Skip to content
Permalink
Browse files

Merge pull request #775 from jecisc/Migrate-initializeWidgets-and-ini…

…tializePresenter-to-new-API

Migrate-initializeWidgets-and-initializePresenter-to-new-API
  • Loading branch information...
jecisc committed Sep 12, 2019
2 parents 118d058 + 4580ffb commit dd74217cf643a4a7d80cae17c2bf9ee73f796746
Showing with 312 additions and 312 deletions.
  1. +1 −1 src/Spec2-Backend-Tests/SpDynamicMockPresenter.class.st
  2. +2 −2 src/Spec2-Backend-Tests/SpMockDynamicPresenter.class.st
  3. +2 −2 src/Spec2-Backend-Tests/SpTestPresenterWithThreeRadioButtons.class.st
  4. +1 −1 src/Spec2-Commander2-ContactBook/SpContactBookPresenter.class.st
  5. +1 −1 src/Spec2-Core/SpAbstractWidgetPresenter.class.st
  6. +1 −1 src/Spec2-Core/SpCalendarPresenter.class.st
  7. +1 −1 src/Spec2-Core/SpDatePresenter.class.st
  8. +1 −1 src/Spec2-Core/SpDynamicPresenter.class.st
  9. +24 −24 src/Spec2-Core/SpEditableList.class.st
  10. +1 −1 src/Spec2-Core/SpLabelledContainer.class.st
  11. +2 −2 src/Spec2-Core/SpLabelledDropList.class.st
  12. +2 −2 src/Spec2-Core/SpLabelledList.class.st
  13. +1 −1 src/Spec2-Core/SpLabelledPresenter.class.st
  14. +2 −2 src/Spec2-Core/SpLabelledSliderInput.class.st
  15. +2 −2 src/Spec2-Core/SpLabelledTextInput.class.st
  16. +1 −1 src/Spec2-Core/SpMethodToolbar.class.st
  17. +1 −1 src/Spec2-Core/SpMillerColumnPresenter.class.st
  18. +1 −1 src/Spec2-Core/SpNullMillerPresenter.class.st
  19. +1 −1 src/Spec2-Core/SpNullPresenter.class.st
  20. +1 −1 src/Spec2-Core/SpRGBSliders.class.st
  21. +2 −2 src/Spec2-Core/SpRGBWidget.class.st
  22. +7 −7 src/Spec2-Core/SpSearchableTree.class.st
  23. +12 −12 src/Spec2-Core/SpSelectEntity.class.st
  24. +2 −2 src/Spec2-Core/SpSliderInput.class.st
  25. +14 −14 src/Spec2-Core/SpVersatileDialogPresenter.class.st
  26. +1 −1 src/Spec2-Deprecated/SpAbstractTwoButtons.class.st
  27. +1 −1 src/Spec2-Deprecated/SpDropListButton.class.st
  28. +2 −2 src/Spec2-Deprecated/SpLabelledDropListButton.class.st
  29. +2 −2 src/Spec2-Deprecated/SpLabelledInputTextDropList.class.st
  30. +9 −9 src/Spec2-Deprecated/SpOkCancelToolbar.class.st
  31. +7 −7 src/Spec2-Deprecated/SpOkToolbar.class.st
  32. +10 −10 src/Spec2-Deprecated/SpPickListPresenter.class.st
  33. +2 −2 src/Spec2-Deprecated/SpSearchableList.class.st
  34. +1 −1 src/Spec2-Examples/SpApplicationWithToolbar.class.st
  35. +2 −2 src/Spec2-Examples/SpCheckBoxExample.class.st
  36. +2 −2 src/Spec2-Examples/SpClassMethodBrowser.class.st
  37. +17 −17 src/Spec2-Examples/SpDemo.class.st
  38. +1 −1 src/Spec2-Examples/SpDemoAbstractModalPresenter.class.st
  39. +1 −1 src/Spec2-Examples/SpDemoActionBarPresenter.class.st
  40. +2 −2 src/Spec2-Examples/SpDemoButtonsPresenter.class.st
  41. +1 −1 src/Spec2-Examples/SpDemoCheckboxesPresenter.class.st
  42. +1 −1 src/Spec2-Examples/SpDemoDynamicMemoryGamePresenter.class.st
  43. +1 −1 src/Spec2-Examples/SpDemoFormPresenter.class.st
  44. +1 −1 src/Spec2-Examples/SpDemoImagePresenter.class.st
  45. +1 −1 src/Spec2-Examples/SpDemoLabelledPresenter.class.st
  46. +1 −1 src/Spec2-Examples/SpDemoLinksPresenter.class.st
  47. +19 −19 src/Spec2-Examples/SpDemoListsPresenter.class.st
  48. +1 −1 src/Spec2-Examples/SpDemoModalPresenter.class.st
  49. +8 −8 src/Spec2-Examples/SpDemoNotebookPresenter.class.st
  50. +1 −1 src/Spec2-Examples/SpDemoPage.class.st
  51. +1 −1 src/Spec2-Examples/SpDemoRadioButtonsPresenter.class.st
  52. +7 −7 src/Spec2-Examples/SpDemoStandaloneFormPresenter.class.st
  53. +1 −1 src/Spec2-Examples/SpDemoTablePresenter.class.st
  54. +1 −1 src/Spec2-Examples/SpDemoTextInputPresenter.class.st
  55. +1 −1 src/Spec2-Examples/SpDemoToolBarPresenter.class.st
  56. +1 −1 src/Spec2-Examples/SpDemoTreeTablePresenter.class.st
  57. +1 −1 src/Spec2-Examples/SpDropListExample.class.st
  58. +1 −1 src/Spec2-Examples/SpDynamicWidgetChange.class.st
  59. +1 −1 src/Spec2-Examples/SpGridLayoutExample.class.st
  60. +2 −2 src/Spec2-Examples/SpListSelectionPresenter.class.st
  61. +8 −8 src/Spec2-Examples/SpMethodBrowser.class.st
  62. +7 −7 src/Spec2-Examples/SpOpenOnIntExample.class.st
  63. +1 −1 src/Spec2-Examples/SpOpenOnNilExample.class.st
  64. +9 −9 src/Spec2-Examples/SpOpenOnStringExample.class.st
  65. +1 −1 src/Spec2-Examples/SpPrepareWindowExample.class.st
  66. +6 −6 src/Spec2-Examples/SpProgressBarDemo.class.st
  67. +2 −2 src/Spec2-Examples/SpRadioButtonExample.class.st
  68. +1 −1 src/Spec2-Examples/SpScrollSyncExample.class.st
  69. +7 −7 src/Spec2-Examples/SpTextFieldExample.class.st
  70. +3 −3 src/Spec2-Help/SpTheHeartOfSpec.class.st
  71. +1 −1 src/Spec2-Morphic-Backend-Tests/SpBoxLayoutWithTableForTestPresenter.class.st
  72. +1 −1 src/Spec2-Tests/SpMockMillerPresenter.class.st
  73. +1 −1 src/Spec2-Tests/SpMockPesenterWithoutGetter.class.st
  74. +1 −1 src/Spec2-Tests/SpTestingPresenter.class.st
  75. +1 −1 src/Spec2-Tests/SpTestingPresenterWithAdditionalPresenters.class.st
  76. +1 −1 src/Spec2-Tests/SpTestingPresenterWithModel.class.st
  77. +1 −1 src/Spec2-Tools/AbstractMessageCentricBrowser.class.st
  78. +11 −11 src/Spec2-Tools/ChangeSorterPresenter.class.st
  79. +10 −10 src/Spec2-Tools/DualChangeSorterPresenter.class.st
  80. +10 −10 src/Spec2-Tools/KeymapBrowser.class.st
  81. +10 −10 src/Spec2-Tools/MessageBrowser.class.st
  82. +1 −1 src/Spec2-Tools/MessageList.class.st
  83. +10 −10 src/Spec2-Tools/SpChooseMethodUI.class.st
  84. +8 −8 src/Spec2-Tools/VersionBrowser.class.st
  85. +1 −1 src/Spec2-Tools/WorkingCopyToolBar.class.st
  86. +1 −1 src/Spec2-Transmission/SpTransmissionExample.class.st
@@ -26,7 +26,7 @@ SpDynamicMockPresenter >> dynamicPresenter: anObject [
]

{ #category : #initialization }
SpDynamicMockPresenter >> initializeWidgets [
SpDynamicMockPresenter >> initializePresenters [
dynamicPresenter := self newNullPresenter.
self rebuildDynamicPresenter
]
@@ -31,7 +31,7 @@ SpMockDynamicPresenter class >> openWithRebuildBeforeOpening [
]

{ #category : #initialization }
SpMockDynamicPresenter >> initializePresenter [
SpMockDynamicPresenter >> connectPresenters [
list
whenSelectionChangedDo: [ :sel |
label := self newLabel.
@@ -41,7 +41,7 @@ SpMockDynamicPresenter >> initializePresenter [
]

{ #category : #initialization }
SpMockDynamicPresenter >> initializeWidgets [
SpMockDynamicPresenter >> initializePresenters [
list := self newList.
label := self newLabel.

@@ -20,7 +20,7 @@ SpTestPresenterWithThreeRadioButtons class >> defaultSpec [
]

{ #category : #initialization }
SpTestPresenterWithThreeRadioButtons >> initializePresenter [
SpTestPresenterWithThreeRadioButtons >> connectPresenters [

radio1 state: false.
radio2 state: true.
@@ -29,7 +29,7 @@ SpTestPresenterWithThreeRadioButtons >> initializePresenter [
]

{ #category : #initialization }
SpTestPresenterWithThreeRadioButtons >> initializeWidgets [
SpTestPresenterWithThreeRadioButtons >> initializePresenters [

radio1 := self newRadioButton
label: 'radio1';
@@ -93,7 +93,7 @@ SpContactBookPresenter >> contactBook [
]

{ #category : #initialization }
SpContactBookPresenter >> initializeWidgets [
SpContactBookPresenter >> initializePresenters [
table := self newTable.
table
addColumn: (SpStringTableColumn title: 'Name' evaluated: #name);
@@ -242,7 +242,7 @@ SpAbstractWidgetPresenter >> initialize [
]

{ #category : #initialization }
SpAbstractWidgetPresenter >> initializeWidgets [
SpAbstractWidgetPresenter >> initializePresenters [
"ignore this method since there is no composition in basic widgets"
]

@@ -128,7 +128,7 @@ SpCalendarPresenter >> initialize [
]

{ #category : #initialization }
SpCalendarPresenter >> initializeWidgets [
SpCalendarPresenter >> initializePresenters [
previousMonthButton := self newButton.
previousMonthButton label: '<'.

@@ -134,7 +134,7 @@ SpDatePresenter >> initialize [
]

{ #category : #initialization }
SpDatePresenter >> initializeWidgets [
SpDatePresenter >> initializePresenters [

dateModel := self newTextInput.
chooseDateButton := self newButton.
@@ -43,7 +43,7 @@ SpDynamicPresenter >> doesNotUnderstand: aMessage [
]

{ #category : #initialization }
SpDynamicPresenter >> initializeWidgets [
SpDynamicPresenter >> initializePresenters [
]

{ #category : #'instance creation' }
@@ -77,6 +77,29 @@ SpEditableList >> bottomButton [
^ bottomButton
]

{ #category : #initialization }
SpEditableList >> connectPresenters [
super connectPresenters

addButton action: [ | requirement |
requirement := addItemBlock value.
requirement ifNotNil: [
self list: (self list listItems copyWith: requirement) ] ].

removeButton
action: [ self list: (list listItems copyWithoutIndex: list selectedIndex) ].

topButton
action: [ self moveElementAt: list selectedIndex to: 1 ].
bottomButton
action: [ self moveElementAt: list selectedIndex to: list listItems size ].
upButton
action: [ self moveElementAt: list selectedIndex to: list selectedIndex - 1].
downButton
action: [ self moveElementAt: list selectedIndex to: list selectedIndex + 1].

]

{ #category : #accessing }
SpEditableList >> downButton [
^ downButton
@@ -100,30 +123,7 @@ SpEditableList >> initializeDialogWindow: aWindow [
]

{ #category : #initialization }
SpEditableList >> initializePresenter [
super initializePresenter

addButton action: [ | requirement |
requirement := addItemBlock value.
requirement ifNotNil: [
self list: (self list listItems copyWith: requirement) ] ].

removeButton
action: [ self list: (list listItems copyWithoutIndex: list selectedIndex) ].

topButton
action: [ self moveElementAt: list selectedIndex to: 1 ].
bottomButton
action: [ self moveElementAt: list selectedIndex to: list listItems size ].
upButton
action: [ self moveElementAt: list selectedIndex to: list selectedIndex - 1].
downButton
action: [ self moveElementAt: list selectedIndex to: list selectedIndex + 1].

]

{ #category : #initialization }
SpEditableList >> initializeWidgets [
SpEditableList >> initializePresenters [
list := self newList.
addButton := self newButton.
removeButton := self newButton.
@@ -84,7 +84,7 @@ SpLabelledContainer >> doesNotUnderstand: aMessage [
]

{ #category : #initialization }
SpLabelledContainer >> initializeWidgets [
SpLabelledContainer >> initializePresenters [
label := self instantiate: SpLabelPresenter.
]

@@ -47,8 +47,8 @@ SpLabelledDropList >> emptyList [
]

{ #category : #initialization }
SpLabelledDropList >> initializeWidgets [
super initializeWidgets.
SpLabelledDropList >> initializePresenters [
super initializePresenters.
self content: SpDropListPresenter
]

@@ -37,8 +37,8 @@ SpLabelledList >> displayBlock: aBlock [
]

{ #category : #initialization }
SpLabelledList >> initializeWidgets [
super initializeWidgets.
SpLabelledList >> initializePresenters [
super initializePresenters.
self content: SpListPresenter
]

@@ -65,7 +65,7 @@ SpLabelledPresenter >> descriptionPresenter: anObject [
]

{ #category : #initialization }
SpLabelledPresenter >> initializeWidgets [
SpLabelledPresenter >> initializePresenters [
labelPresenter := self newLabel.
descriptionPresenter := self newNullPresenter. "By default it is null"
]
@@ -35,8 +35,8 @@ SpLabelledSliderInput >> autoAccept: aBoolean [
]

{ #category : #initialization }
SpLabelledSliderInput >> initializeWidgets [
super initializeWidgets.
SpLabelledSliderInput >> initializePresenters [
super initializePresenters.
self content: SpSliderInput
]

@@ -50,8 +50,8 @@ SpLabelledTextInput >> entryCompletion: anEntryCompletion [
]

{ #category : #initialization }
SpLabelledTextInput >> initializeWidgets [
super initializeWidgets.
SpLabelledTextInput >> initializePresenters [
super initializePresenters.
self content: SpTextInputFieldPresenter.
]

@@ -86,7 +86,7 @@ SpMethodToolbar >> initialize [
]

{ #category : #initialization }
SpMethodToolbar >> initializeWidgets [
SpMethodToolbar >> initializePresenters [
browseModel := self newButton.
usersModel := self newButton.
sendersModel := self newButton.
@@ -49,7 +49,7 @@ SpMillerColumnPresenter >> initialize [
]

{ #category : #initialization }
SpMillerColumnPresenter >> initializeWidgets [
SpMillerColumnPresenter >> initializePresenters [

layout := SpBoxLayout newHorizontal
]
@@ -20,7 +20,7 @@ SpNullMillerPresenter class >> defaultSpec [
]

{ #category : #initialization }
SpNullMillerPresenter >> initializeWidgets [
SpNullMillerPresenter >> initializePresenters [

"Do nothing"
]
@@ -16,6 +16,6 @@ SpNullPresenter class >> defaultSpec [
]

{ #category : #initialization }
SpNullPresenter >> initializeWidgets [
SpNullPresenter >> initializePresenters [
"Does nothing. That's the point of null presenter."
]
@@ -48,7 +48,7 @@ SpRGBSliders >> greenSlider [
]

{ #category : #initialization }
SpRGBSliders >> initializeWidgets [
SpRGBSliders >> initializePresenters [
redSlider := self instantiate: SpSliderInput.
greenSlider := self instantiate: SpSliderInput.
blueSlider := self instantiate: SpSliderInput.
@@ -36,12 +36,12 @@ SpRGBWidget >> color [
]

{ #category : #initialization }
SpRGBWidget >> initializePresenter [
SpRGBWidget >> connectPresenters [
sliders whenChangedDo: [ preview image: self makeNewForm ].
]

{ #category : #initialization }
SpRGBWidget >> initializeWidgets [
SpRGBWidget >> initializePresenters [
preview := self instantiate: SpImagePresenter.
sliders := self instantiate: SpRGBSliders.
preview image: (Form extent: 30 @ 30 depth: 32).
@@ -92,6 +92,12 @@ SpSearchableTree >> columns: aCollection [
tree columns: aCollection
]

{ #category : #initialization }
SpSearchableTree >> connectPresenters [
inputField whenTextChangedDo: [ :text | self updateRootFor: text ].
tree whenTreeUpdatedDo: [ inputField text: '' ]
]

{ #category : #'api-compatibility' }
SpSearchableTree >> display [

@@ -158,13 +164,7 @@ SpSearchableTree >> initialize [
]

{ #category : #initialization }
SpSearchableTree >> initializePresenter [
inputField whenTextChangedDo: [ :text | self updateRootFor: text ].
tree whenTreeUpdatedDo: [ inputField text: '' ]
]

{ #category : #initialization }
SpSearchableTree >> initializeWidgets [
SpSearchableTree >> initializePresenters [
tree := self newTree.
inputField := self newTextInput.
button := self newButton.
@@ -32,6 +32,17 @@ SpSelectEntity class >> defaultSpec [
yourself
]

{ #category : #initialization }
SpSelectEntity >> connectPresenters [
selectEntity
action: [ |select|
select := self selectDialog value.
select openDialogWithSpec
okAction: [
self entity: select selectedItem ]]

]

{ #category : #api }
SpSelectEntity >> displaySymbol [
"return the method selector used to get the label of the entity that is for entry completion"
@@ -88,18 +99,7 @@ SpSelectEntity >> initialize [
]

{ #category : #initialization }
SpSelectEntity >> initializePresenter [
selectEntity
action: [ |select|
select := self selectDialog value.
select openDialogWithSpec
okAction: [
self entity: select selectedItem ]]

]

{ #category : #initialization }
SpSelectEntity >> initializeWidgets [
SpSelectEntity >> initializePresenters [
entityText := self newTextInput
placeholder: self placeholder;
autoAccept: true;
@@ -75,7 +75,7 @@ SpSliderInput >> autoAccept: aBoolean [
]

{ #category : #initialization }
SpSliderInput >> initializePresenter [
SpSliderInput >> connectPresenters [
slider
whenValueChangedDo: [ :sliderValue |
| inputValue |
@@ -91,7 +91,7 @@ SpSliderInput >> initializePresenter [
]

{ #category : #initialization }
SpSliderInput >> initializeWidgets [
SpSliderInput >> initializePresenters [
slider := self instantiate: SpSliderPresenter.
input := self instantiate: SpTextInputFieldPresenter.
self focusOrder add: input
@@ -169,6 +169,19 @@ SpVersatileDialogPresenter >> buttons [
^ buttons
]

{ #category : #initialization }
SpVersatileDialogPresenter >> connectPresenters [

super connectPresenters.

moreOptionsButton action: [
moreOptionsVisible := moreOptionsVisible not.
self needRebuild: false.
self buildWithSpec ].


]

{ #category : #accessing }
SpVersatileDialogPresenter >> contentArea [

@@ -237,20 +250,7 @@ SpVersatileDialogPresenter >> initializeDialogWindow: aDialogWindowPresenter [
]

{ #category : #initialization }
SpVersatileDialogPresenter >> initializePresenter [

super initializePresenter.

moreOptionsButton action: [
moreOptionsVisible := moreOptionsVisible not.
self needRebuild: false.
self buildWithSpec ].


]

{ #category : #initialization }
SpVersatileDialogPresenter >> initializeWidgets [
SpVersatileDialogPresenter >> initializePresenters [

moreOptionsText := 'More options' asText.
lessOptionsText := 'Less options' asText.

0 comments on commit dd74217

Please sign in to comment.
You can’t perform that action at this time.