Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce displayBlock and deprecate display. #1500

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 display ascending.
sortingBlock := sourceList displayBlock ascending.
sourceList sortingBlock: sortingBlock.
targetList sortingBlock: sortingBlock
]
Expand Down
13 changes: 10 additions & 3 deletions src/Spec2-CommonWidgets/SpFilteringListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ SpFilteringListPresenter >> defaultOutputPort [

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

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

^ self listPresenter displayBlock
]

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

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

^ self listPresenter displayBlock
]

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

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

filteredItems := unfilteredItems select: [ :item |
itemFilterBlock
value: (self display value: item)
value: (self displayBlock 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,6 +60,12 @@ SpFilteringSelectableListPresenter >> display: aBlock [
listPresenter columns: self listColumns
]

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

^ displayBlock
]

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

Expand Down
12 changes: 10 additions & 2 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,11 +97,19 @@ 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 display cull: anItem model cull: anItem
^ self displayBlock cull: anItem model cull: anItem
]

{ #category : 'api' }
Expand Down
8 changes: 7 additions & 1 deletion 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,6 +53,12 @@ SpDropListTableColumn >> display: aBlock [
display := aBlock
]

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

^ display
]

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

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

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

^ 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.

]

{ #category : 'api' }
Expand All @@ -74,6 +75,13 @@ 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: 8 additions & 1 deletion 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,6 +88,13 @@ 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: 10 additions & 2 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 display value: date.
dateString := self displayBlock 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,6 +95,14 @@ 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
Loading