Skip to content

Commit

Permalink
renamed applier as selecter in ToSelecterCommandApplication and ToSel…
Browse files Browse the repository at this point in the history
…ecterCommandApplicationRequest
  • Loading branch information
plantec committed Oct 23, 2024
1 parent 0ad43ad commit a4bd37f
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 61 deletions.
42 changes: 16 additions & 26 deletions src/Toplo-Widget-List/ToCommandApplicationTask.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,32 @@ Class {
#name : #ToCommandApplicationTask,
#superclass : #BlTask,
#instVars : [
'applier',
'commandQueue',
'finishedAction',
'element',
'operator',
'posponedRequestTask'
'posponedRequestTask',
'selecter'
],
#category : #'Toplo-Widget-List-Command-Support'
}

{ #category : #accessing }
ToCommandApplicationTask >> applier: anObject [

applier := anObject
]

{ #category : #'api - running' }
ToCommandApplicationTask >> applyAll [

element ifNil: [ ^ self ].
self element ifNil: [ ^ self ].
self canApplyCommands ifFalse: [
posponedRequestTask ifNotNil: [ ^ self ].
posponedRequestTask := BlTaskAction new.
posponedRequestTask action: [
"applier dispatchEvent: ToCommandApplicationTaskActivationEvent new"
self privateApplyAll ].
element enqueueTask: posponedRequestTask.
posponedRequestTask action: [ self privateApplyAll ].
self element enqueueTask: posponedRequestTask.
^ self ].

self privateApplyAll
self privateApplyAll
]

{ #category : #'api - running' }
ToCommandApplicationTask >> canApplyCommands [

^ element notNil and: [ element isAttachedToSceneGraph ]
^ self element notNil and: [ self element isAttachedToSceneGraph ]
]

{ #category : #initialization }
Expand All @@ -47,9 +37,9 @@ ToCommandApplicationTask >> commandQueue: aQueue [
]

{ #category : #accessing }
ToCommandApplicationTask >> element: anElement [
ToCommandApplicationTask >> element [

element := anElement
^ selecter element
]

{ #category : #accessing }
Expand All @@ -58,18 +48,12 @@ ToCommandApplicationTask >> finishedAction: aValuable [
finishedAction := aValuable
]

{ #category : #accessing }
ToCommandApplicationTask >> operator: anOperator [

operator := anOperator
]

{ #category : #'api - running' }
ToCommandApplicationTask >> privateApplyAll [

| nextInQueue |
[ (nextInQueue := commandQueue nextOrNil) isNotNil ] whileTrue: [
applier applyCommand: nextInQueue ]
selecter applyCommand: nextInQueue ]
]

{ #category : #'api - running' }
Expand All @@ -78,3 +62,9 @@ ToCommandApplicationTask >> run [
self applyAll.
finishedAction value.
]

{ #category : #accessing }
ToCommandApplicationTask >> selecter: aSelecter [

selecter := aSelecter
]
4 changes: 2 additions & 2 deletions src/Toplo-Widget-List/ToInfiniteDataSource.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ ToInfiniteDataSource >> notifyItemsSievedWith: aSieve [
]

{ #category : #'event firing' }
ToInfiniteDataSource >> notifySelecterCommandApplicationRequest: aCommand from: anApplier [
ToInfiniteDataSource >> notifySelecterCommandApplicationRequest: aCommand from: aSelecter [
"Notify any registered observers that a selecter request the application of a command.
This is not a structural change event"

self notifyWithEvent: (ToSelecterCommandApplicationRequest new
applier: anApplier;
selecter: aSelecter;
command: aCommand;
yourself)
]
Expand Down
4 changes: 2 additions & 2 deletions src/Toplo-Widget-List/ToInfiniteDataSourceManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ ToInfiniteDataSourceManager >> onItemsSieved: aPositionStart itemCount: anItemCo
]

{ #category : #'data source updates' }
ToInfiniteDataSourceManager >> onSelecterCommand: aCommand appliedBy: anApplier [
ToInfiniteDataSourceManager >> onSelecterCommand: aCommand appliedBy: aSelecter [
"Return true if pending commands should be processed,
otherwise false"

"Register add command"

finalStepCommands add: (ToSelecterCommandApplication new
applier: anApplier;
selecter: aSelecter;
command: aCommand;
yourself).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ToInfiniteDataSourceObserver >> selecterCommandApplicationRequest: anEvent [
self assertNotInLayoutOrScroll.

infiniteElement dataSourceManager
onSelecterCommand: anEvent command appliedBy: anEvent applier.
onSelecterCommand: anEvent command appliedBy: anEvent selecter.

self triggerUpdateProcessor.
infiniteElement listElement dispatchEvent: anEvent copy
Expand Down
6 changes: 3 additions & 3 deletions src/Toplo-Widget-List/ToInnerBarDataSourceObserver.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ ToInnerBarDataSourceObserver >> initializeWith: anInnerLinearBarElement [
{ #category : #'event handling' }
ToInnerBarDataSourceObserver >> selecterCommandApplicationRequest: aCommandApplicationRequest [

| command applier |
| command selecter |
command := aCommandApplicationRequest command.
applier := aCommandApplicationRequest applier.
applier applyCommand: command
selecter := aCommandApplicationRequest selecter.
selecter applyCommand: command
]
4 changes: 1 addition & 3 deletions src/Toplo-Widget-List/ToQueueBasedCommandApplier.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ ToQueueBasedCommandApplier >> onInstalledIn: aSelecter [
super onInstalledIn: aSelecter.
commandQueue := ToCommandQueue new.
applicationTask := ToCommandApplicationTask new
operator: aSelecter operator;
applier: aSelecter;
selecter: aSelecter;
commandQueue: commandQueue;
element: element;
finishedAction: [ queued := false ];
yourself.
queued := false
Expand Down
30 changes: 15 additions & 15 deletions src/Toplo-Widget-List/ToSelecterCommandApplication.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,12 @@ Class {
#name : #ToSelecterCommandApplication,
#superclass : #BlInfiniteDataSourceCommand,
#instVars : [
'applier',
'command'
'command',
'selecter'
],
#category : #'Toplo-Widget-List-InnerInfinite'
}

{ #category : #accessing }
ToSelecterCommandApplication >> applier [

^ applier
]

{ #category : #accessing }
ToSelecterCommandApplication >> applier: aCommandApplier [

applier := aCommandApplier
]

{ #category : #commands }
ToSelecterCommandApplication >> applyOnPosition: aPosition [
"When the position of an ElementHolder is required.
Expand Down Expand Up @@ -49,5 +37,17 @@ ToSelecterCommandApplication >> dispatchToLayout: aLayout [
{ #category : #commands }
ToSelecterCommandApplication >> offsetPositionsIn: anInfiniteElement [

applier applyCommand: command
selecter applyCommand: command
]

{ #category : #accessing }
ToSelecterCommandApplication >> selecter [

^ selecter
]

{ #category : #accessing }
ToSelecterCommandApplication >> selecter: aSelecter [

selecter := aSelecter
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,33 @@ Class {
#superclass : #BlInfiniteDataSourceRangeChanged,
#instVars : [
'command',
'applier'
'selecter'
],
#category : #'Toplo-Widget-List-InnerInfinite'
}

{ #category : #accessing }
ToSelecterCommandApplicationRequest >> applier [
ToSelecterCommandApplicationRequest >> command [

^ applier
^ command
]

{ #category : #accessing }
ToSelecterCommandApplicationRequest >> applier: anApplier [
ToSelecterCommandApplicationRequest >> command: aCommand [

applier := anApplier
command := aCommand
]

{ #category : #accessing }
ToSelecterCommandApplicationRequest >> command [
ToSelecterCommandApplicationRequest >> selecter [

^ command
^ selecter
]

{ #category : #accessing }
ToSelecterCommandApplicationRequest >> command: aCommand [
ToSelecterCommandApplicationRequest >> selecter: aSelecter [

command := aCommand
selecter := aSelecter
]

{ #category : #sending }
Expand Down

0 comments on commit a4bd37f

Please sign in to comment.