Skip to content

Commit

Permalink
Merge pull request #1504 from pharo-spec/revert-1500-1499-display---d…
Browse files Browse the repository at this point in the history
…isplayBlock

Revert "introduce displayBlock and deprecate display."
  • Loading branch information
guillep authored Jan 12, 2024
2 parents 94061a8 + ec0056e commit 35bb072
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 65 deletions.
2 changes: 1 addition & 1 deletion src/Spec2-CommonWidgets/SpChooserPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ SpChooserPresenter >> initializePresenters [
SpChooserPresenter >> initializeSortingBlocks [

| sortingBlock |
sortingBlock := sourceList displayBlock ascending.
sortingBlock := sourceList display ascending.
sourceList sortingBlock: sortingBlock.
targetList sortingBlock: sortingBlock
]
Expand Down
13 changes: 3 additions & 10 deletions src/Spec2-CommonWidgets/SpFilteringListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ SpFilteringListPresenter >> defaultOutputPort [

{ #category : 'api' }
SpFilteringListPresenter >> display [
self deprecated: 'Please use displayBlock' transformWith: '`aRec display' -> '`aRec displayBlock'.

^ self listPresenter displayBlock

^ self listPresenter display
]

{ #category : 'api' }
Expand All @@ -90,12 +89,6 @@ SpFilteringListPresenter >> display: aBlock [
self listPresenter display: aBlock
]

{ #category : 'api' }
SpFilteringListPresenter >> displayBlock [

^ self listPresenter displayBlock
]

{ #category : 'api' }
SpFilteringListPresenter >> displayIcon: aBlock [

Expand All @@ -118,7 +111,7 @@ SpFilteringListPresenter >> filterListItems: pattern [

filteredItems := unfilteredItems select: [ :item |
itemFilterBlock
value: (self displayBlock value: item)
value: (self display value: item)
value: pattern ].

listPresenter items: filteredItems
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ SpFilteringSelectableListPresenter >> deactivateItem: anObject [

{ #category : 'api' }
SpFilteringSelectableListPresenter >> display [
self deprecated: 'Please use displayBlock' transformWith: '`aRec display' -> '`aRec displayBlock' .

^ displayBlock
]

Expand All @@ -60,12 +60,6 @@ SpFilteringSelectableListPresenter >> display: aBlock [
listPresenter columns: self listColumns
]

{ #category : 'api' }
SpFilteringSelectableListPresenter >> displayBlock [

^ displayBlock
]

{ #category : 'api' }
SpFilteringSelectableListPresenter >> displayIcon: aBlock [

Expand Down
12 changes: 2 additions & 10 deletions src/Spec2-Core/SpDropListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ SpDropListPresenter >> disableSelectionDuring: aBlock [
SpDropListPresenter >> display [
"Answer the formatting block to transform how the elements will be displayed.
See also `SpDropListPresenter>>#display:`"
self deprecated: 'Please use displayBlock' transformWith: '`aRec display' -> '`aRec displayBlock'.

^ displayBlock
]

Expand All @@ -97,19 +97,11 @@ SpDropListPresenter >> display: aBlock [

]

{ #category : 'api' }
SpDropListPresenter >> displayBlock [
"Answer the formatting block to transform how the elements will be displayed.
See also `SpDropListPresenter>>#display:`"

^ displayBlock
]

{ #category : 'private' }
SpDropListPresenter >> displayForItem: anItem [
"The order of the arguments may look weird, but then it seems more natural while using the widget"

^ self displayBlock cull: anItem model cull: anItem
^ self display cull: anItem model cull: anItem
]

{ #category : 'api' }
Expand Down
8 changes: 1 addition & 7 deletions src/Spec2-Core/SpDropListTableColumn.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SpDropListTableColumn >> acceptColumnVisitor: aBuilder [

{ #category : 'accessing' }
SpDropListTableColumn >> display [
self deprecated: 'Please use displayBlock' transformWith: '`aRec display' -> '`aRec displayBlock'.

^ display
]

Expand All @@ -53,12 +53,6 @@ SpDropListTableColumn >> display: aBlock [
display := aBlock
]

{ #category : 'accessing' }
SpDropListTableColumn >> displayBlock [

^ display
]

{ #category : 'initialization' }
SpDropListTableColumn >> initialize [

Expand Down
16 changes: 4 additions & 12 deletions src/Spec2-Core/SpListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ SpListPresenter >> clickOnSelectedItem [

{ #category : 'api' }
SpListPresenter >> display [
"Answer the display block that will transform the objects from `SpAbstractListPresenter>>#model` into a displayable string."

self deprecated: 'Please use displayBlock' transformWith: '`aRec display' -> '`aRec displayBlock'.
^ self displayBlock.

"Answer the display block that will transform the objects from `SpAbstractListPresenter>>#model` into a
displayable string."

^ display
]

{ #category : 'api' }
Expand All @@ -75,13 +74,6 @@ SpListPresenter >> display: aBlock [
display := aBlock
]

{ #category : 'api' }
SpListPresenter >> displayBlock [
"Answer the display block that will transform the objects from `SpAbstractListPresenter>>#model` into a displayable string."

^ display
]

{ #category : 'api' }
SpListPresenter >> displayIcon [
"Return the block used to return an icon that will be displayed in the list"
Expand Down
9 changes: 1 addition & 8 deletions src/Spec2-Core/SpTreePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ SpTreePresenter >> beResizable [
{ #category : 'api' }
SpTreePresenter >> display [
"Answer the display block that will transform the model nodes into a displayable string."
self deprecated: 'Please use displayBlock' transformWith: '`aRec display' -> '`aRec displayBlock'.

^ displayBlock
]

Expand All @@ -88,13 +88,6 @@ SpTreePresenter >> display: aBlock [
displayBlock := aBlock
]

{ #category : 'api' }
SpTreePresenter >> displayBlock [
"Answer the display block that will transform the model nodes into a displayable string."

^ displayBlock
]

{ #category : 'api' }
SpTreePresenter >> displayIcon [
"Return the block used to return an icon that will be displayed in the tree"
Expand Down
12 changes: 2 additions & 10 deletions src/Spec2-Morphic/SpDatePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SpDatePresenter >> date: aDate [

| dateString |
date := aDate.
dateString := self displayBlock value: date.
dateString := self display value: date.
self dateModel text: dateString.
]

Expand All @@ -84,7 +84,7 @@ SpDatePresenter >> defaultDate [
SpDatePresenter >> display [
"Return the one argument block used to wrap your domain specific items.
The block should return something that can be displayed in a list - like a String or a Text"
self deprecated: 'Please use displayBlock' transformWith: '`aRec display' -> '`aRec displayBlock'.

^ displayBlock
]

Expand All @@ -95,14 +95,6 @@ SpDatePresenter >> display: aBlock [
displayBlock := aBlock
]

{ #category : 'api' }
SpDatePresenter >> displayBlock [
"Return the one argument block used to wrap your domain specific items.
The block should return something that can be displayed in a list - like a String or a Text"

^ displayBlock
]

{ #category : 'private' }
SpDatePresenter >> iconMorph [

Expand Down

3 comments on commit 35bb072

@Ducasse
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the impression that the revert did not work because I cannot get a debugger in P12.

@Ducasse
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we need to relaunch the build of Pharo?

@Ducasse
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I integrated a refactoring enh the image does not show the old version anymore so we are safe and this revert passed.

Please sign in to comment.