Skip to content

Commit

Permalink
Merge pull request #941 from AlexisCnockaert/Pharo13
Browse files Browse the repository at this point in the history
Branch: Pharo13,  renamed it to presenter and cleaned the class
  • Loading branch information
jecisc authored Jan 17, 2025
2 parents 3e49bbf + fd39634 commit d648ad3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Extension { #name : 'ASTProgramNode' }
Extension { #name : 'OCProgramNode' }

{ #category : '*NewTools-Debugger-Extensions' }
ASTProgramNode >> enableHalts: aBoolean [
OCProgramNode >> enableHalts: aBoolean [
^self propertyAt: #enabledForHaltOrBreakpoint put: aBoolean
]

{ #category : '*NewTools-Debugger-Extensions' }
ASTProgramNode >> enabledForHaltOrBreakpoint [
OCProgramNode >> enabledForHaltOrBreakpoint [
^self propertyAt: #enabledForHaltOrBreakpoint ifAbsent: [ true ]
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Class {
#name : 'SpClosedWindowList',
#name : 'SpClosedWindowListPresenter',
#superclass : 'SpPresenter',
#instVars : [
'title',
Expand All @@ -15,12 +15,12 @@ Class {
}

{ #category : 'layout' }
SpClosedWindowList class >> defaultLayout [
SpClosedWindowListPresenter class >> defaultLayout [
^ self layoutWithOrdering
]

{ #category : 'as yet unclassified' }
SpClosedWindowList class >> exampleClosedWindowsList [
SpClosedWindowListPresenter class >> exampleClosedWindowsList [

<sampleInstance>
| presenter |
Expand All @@ -36,7 +36,7 @@ SpClosedWindowList class >> exampleClosedWindowsList [
]

{ #category : 'layout' }
SpClosedWindowList class >> layoutWithOrdering [
SpClosedWindowListPresenter class >> layoutWithOrdering [

| listLayout |
listLayout := SpBoxLayout newLeftToRight
Expand All @@ -54,7 +54,7 @@ SpClosedWindowList class >> layoutWithOrdering [
]

{ #category : 'initialization' }
SpClosedWindowList >> connectPresenters [
SpClosedWindowListPresenter >> connectPresenters [

super connectPresenters.

Expand All @@ -68,13 +68,13 @@ SpClosedWindowList >> connectPresenters [
]

{ #category : 'api' }
SpClosedWindowList >> display: aBlock [
SpClosedWindowListPresenter >> display: aBlock [

list display: aBlock
]

{ #category : 'initialization' }
SpClosedWindowList >> initialize [
SpClosedWindowListPresenter >> initialize [

super initialize.

Expand All @@ -92,17 +92,7 @@ SpClosedWindowList >> initialize [
]

{ #category : 'initialization' }
SpClosedWindowList >> initializeDialogWindow: aWindow [

aWindow addDefaultButton: 'Ok' do: [ :presenter |
self performOkAction.
presenter close ].


]

{ #category : 'initialization' }
SpClosedWindowList >> initializePresenters [
SpClosedWindowListPresenter >> initializePresenters [

label := self newLabel.
list := self newList.
Expand All @@ -121,33 +111,33 @@ SpClosedWindowList >> initializePresenters [
]

{ #category : 'initialization' }
SpClosedWindowList >> initializeWindow: aWindowPresenter [
SpClosedWindowListPresenter >> initializeWindow: aWindowPresenter [
aWindowPresenter title: self title;
initialExtent: 310@185.
]

{ #category : 'accessing' }
SpClosedWindowList >> items [
SpClosedWindowListPresenter >> items [
^ list model items
]

{ #category : 'private' }
SpClosedWindowList >> items: anItemList [
SpClosedWindowListPresenter >> items: anItemList [
list items: anItemList.
]

{ #category : 'accessing' }
SpClosedWindowList >> label: aString [
SpClosedWindowListPresenter >> label: aString [
label label: aString
]

{ #category : 'accessing' }
SpClosedWindowList >> list [
SpClosedWindowListPresenter >> list [
^ list
]

{ #category : 'initialization' }
SpClosedWindowList >> newList [
SpClosedWindowListPresenter >> newList [
"Default list collection is an Array.
As this presenter aims to add / remove items from the list, we need a growable collection"
^ super newList
Expand All @@ -156,63 +146,63 @@ SpClosedWindowList >> newList [
]

{ #category : 'api' }
SpClosedWindowList >> refresh [
SpClosedWindowListPresenter >> refresh [

self items: self items.
self resetSelection
]

{ #category : 'accessing' }
SpClosedWindowList >> removeButton [
SpClosedWindowListPresenter >> removeButton [
^ removeButton
]

{ #category : 'api' }
SpClosedWindowList >> removeItem: anObject [
SpClosedWindowListPresenter >> removeItem: anObject [

self items remove: anObject.
"self resetSelection "
]

{ #category : 'api' }
SpClosedWindowList >> removeItemBlock: aBlock [
SpClosedWindowListPresenter >> removeItemBlock: aBlock [
removeItemBlock := aBlock.
]

{ #category : 'api' }
SpClosedWindowList >> resetSelection [
SpClosedWindowListPresenter >> resetSelection [
list selection basicSelectIndex: 1.


]

{ #category : 'api' }
SpClosedWindowList >> selectedItem [
SpClosedWindowListPresenter >> selectedItem [
^ list selection selectedItem
]

{ #category : 'accessing' }
SpClosedWindowList >> title [
SpClosedWindowListPresenter >> title [
^ title
]

{ #category : 'accessing' }
SpClosedWindowList >> title: aTitle [
SpClosedWindowListPresenter >> title: aTitle [
title := aTitle
]

{ #category : 'accessing' }
SpClosedWindowList >> unhideButton [
SpClosedWindowListPresenter >> unhideButton [
^ unhideButton
]

{ #category : 'api' }
SpClosedWindowList >> unhideItemBlock: aBlock [
SpClosedWindowListPresenter >> unhideItemBlock: aBlock [
unhideItemBlock := aBlock.
]

{ #category : 'api' }
SpClosedWindowList >> whenSelectionChangedDo: aBlock [
SpClosedWindowListPresenter >> whenSelectionChangedDo: aBlock [

list whenSelectionChangedDo: aBlock
]

0 comments on commit d648ad3

Please sign in to comment.