diff --git a/src/Toplo-Examples/ToListSelectionHistoryExampleEventHandler.class.st b/src/Toplo-Examples/ToListSelectionHistoryExampleEventHandler.class.st index c46a7e12..4495c73a 100644 --- a/src/Toplo-Examples/ToListSelectionHistoryExampleEventHandler.class.st +++ b/src/Toplo-Examples/ToListSelectionHistoryExampleEventHandler.class.st @@ -62,7 +62,7 @@ ToListSelectionHistoryExampleEventHandler >> listSelectionCommandAppliedEvent: a currentTarget := aCommandAppliedEvent currentTarget. " check that the command is applied on the primary selection model " - aCommandAppliedEvent selectionModel = currentTarget selectionModel + aCommandAppliedEvent selectionModel == currentTarget selectionModel ifFalse: [ ^ self ]. aCommandAppliedEvent command applyWithOperator: self. currentTarget := nil diff --git a/src/Toplo-Examples/ToListSelectionTraceExampleEventHandler.class.st b/src/Toplo-Examples/ToListSelectionTraceExampleEventHandler.class.st index 2289f00e..9152c93a 100644 --- a/src/Toplo-Examples/ToListSelectionTraceExampleEventHandler.class.st +++ b/src/Toplo-Examples/ToListSelectionTraceExampleEventHandler.class.st @@ -49,7 +49,7 @@ ToListSelectionTraceExampleEventHandler >> listSelectionCommandAppliedEvent: aCo currentTarget := aCommandAppliedEvent currentTarget. " check that the command is applied on the primary selection model " - aCommandAppliedEvent selectionModel = currentTarget selectionModel + aCommandAppliedEvent selectionModel == currentTarget selectionModel ifFalse: [ ^ self ]. traceSelectionModel := currentTarget userData at: #traceSelectionModel. diff --git a/src/Toplo-Examples/ToSandBox.class.st b/src/Toplo-Examples/ToSandBox.class.st index af591d83..1a3c8671 100644 --- a/src/Toplo-Examples/ToSandBox.class.st +++ b/src/Toplo-Examples/ToSandBox.class.st @@ -1395,7 +1395,6 @@ ToSandBox class >> example_ListWithEditableAndContextMenu [ | l | l := self listWithEditableAndContextMenu. - l inspect. l openInInnerWindow ] @@ -3867,6 +3866,16 @@ ToSandBox class >> example_selectWithEditingMultiSelectionWithAllClassNames [ | select innerWindow space | select := self selectWithEditingMultiSelection. select filtrable: true. + select placeholderText: ('Choose a class' asRopedText + foreground: Color lightGray; + yourself). + select popupListElement placeholderBuilder: [ :placeholder :e | + placeholder layout alignCenter. + placeholder addChild: + (ToAttributedLabel text: ('No Data' asRopedText + fontSize: 24; + foreground: Color lightGray; + yourself)) ]. innerWindow := ToInnerWindow new. select popupWindowManager anchorRoot: innerWindow root. @@ -5432,19 +5441,6 @@ ToSandBox class >> listWithEditableAndContextMenu [ disabledMode changeSelectionOptionWith: option. unselectableMode := l unselectableSelectionMode. - l - addEventHandlerOn: unselectableMode selectionChangedEventClass - do: [ :event | - | target | - target := event currentTarget. - event selectionOption - updateSelectionIn: target - withSelectionModel: target selecter selectionModel. - target selecter deselectIndexes: event touchedIndexes. - target secondarySelecter deselectAll. - event touchedIntervals do: [ :int | - target dataSource notifyItemsChanged: int ] ]. - option := ToListSelectionOption new. option grouped: false. option beneath: false. diff --git a/src/Toplo-Widget-List-Tests/ToSelecterEventTargetStub.class.st b/src/Toplo-Widget-List-Tests/ToSelecterEventTargetStub.class.st index 09c8a70f..331ce35d 100644 --- a/src/Toplo-Widget-List-Tests/ToSelecterEventTargetStub.class.st +++ b/src/Toplo-Widget-List-Tests/ToSelecterEventTargetStub.class.st @@ -16,10 +16,6 @@ ToSelecterEventTargetStub >> itemCount [ ^ 100 ] -{ #category : #'event firing' } -ToSelecterEventTargetStub >> notifyPrimarySelectionDirty [ -] - { #category : #accessing } ToSelecterEventTargetStub >> scrollIndex [ @@ -51,3 +47,7 @@ ToSelecterEventTargetStub >> selectionModel: aSelectionModel [ on: self; yourself ] + +{ #category : #'event firing' } +ToSelecterEventTargetStub >> updateAllSelections [ +] diff --git a/src/Toplo-Widget-List/TToListElementWithDecoration.trait.st b/src/Toplo-Widget-List/TToListElementWithDecoration.trait.st index e13ba40f..191921d0 100644 --- a/src/Toplo-Widget-List/TToListElementWithDecoration.trait.st +++ b/src/Toplo-Widget-List/TToListElementWithDecoration.trait.st @@ -10,9 +10,9 @@ TToListElementWithDecoration >> withDecoration: aDecorationClass [ ] { #category : #'t - infinite accessing' } -TToListElementWithDecoration >> withRowNumbers [ +TToListElementWithDecoration >> withRowNumbers [ self next withRowNumbers. - self notifyPrimarySelectionDirty. + self updateAllSelections. self requestLayout ] diff --git a/src/Toplo-Widget-List/ToAbstractListElement.class.st b/src/Toplo-Widget-List/ToAbstractListElement.class.st index 79f03326..5920295c 100644 --- a/src/Toplo-Widget-List/ToAbstractListElement.class.st +++ b/src/Toplo-Widget-List/ToAbstractListElement.class.st @@ -344,39 +344,34 @@ ToAbstractListElement >> nodeUnbuilder: aValuable [ nodeManager nodeUnbuilder: aValuable ] -{ #category : #'event firing' } +{ #category : #notifications } ToAbstractListElement >> notifyDataSourceChanged [ self dataSource notifyChanged ] -{ #category : #'event firing' } +{ #category : #notifications } ToAbstractListElement >> notifyDataSourceItemChanged: aDataSourceEvent [ - | request | - request := ToListDataSourceItemChangeRequestEvent new - dataSourceEvent: aDataSourceEvent; - requestedAction: [ self dispatchEvent: aDataSourceEvent ]; - yourself. - self dispatchAuthorisationRequest: request + self dispatchEvent: aDataSourceEvent ] -{ #category : #'event firing' } +{ #category : #notifications } ToAbstractListElement >> notifyDataSourceItemsFiltered: aDataSourceEvent [ self dispatchEvent: aDataSourceEvent ] -{ #category : #'event firing' } +{ #category : #notifications } ToAbstractListElement >> notifyPrimarySelectionDirty [ - self dispatchEvent: (ToListPrimarySelectionDirtyEvent new - selectionOption: self selectionOption; - selectionModel: self selectionModel; - itemCount: self itemCount; - yourself) + self + deprecated: 'use #updateAllSelections instead' + transformWith: + '`@rcvr notifyPrimarySelectionDirty' -> '`@rcvr updateAllSelections'. + self updateAllSelections ] { #category : #'private - commands' } @@ -540,6 +535,16 @@ ToAbstractListElement >> unselectableSelectionModel [ ^ self selectionModel unselectableSelectionModel ] +{ #category : #'selection updating' } +ToAbstractListElement >> updateAllSelections [ + + self selectionModes do: [ :mode | + mode selectionOption ifNotNil: [ :option | + option + updateSelectionIn: self + withSelectionModel: mode selectionModel ] ] +] + { #category : #accessing } ToAbstractListElement >> withoutNodeBuilder [ diff --git a/src/Toplo-Widget-List/ToCommandApplicationTaskActivationEvent.class.st b/src/Toplo-Widget-List/ToCommandApplicationTaskActivationEvent.class.st deleted file mode 100644 index 4f33acfc..00000000 --- a/src/Toplo-Widget-List/ToCommandApplicationTaskActivationEvent.class.st +++ /dev/null @@ -1,11 +0,0 @@ -Class { - #name : #ToCommandApplicationTaskActivationEvent, - #superclass : #BlEvent, - #category : #'Toplo-Widget-List-Command-Support' -} - -{ #category : #sending } -ToCommandApplicationTaskActivationEvent >> sendTo: anObject [ - - anObject elementCommandApplicationTaskActivationEvent: self -] diff --git a/src/Toplo-Widget-List/ToCommandApplier.class.st b/src/Toplo-Widget-List/ToCommandApplier.class.st index 25c2c865..bc453692 100644 --- a/src/Toplo-Widget-List/ToCommandApplier.class.st +++ b/src/Toplo-Widget-List/ToCommandApplier.class.st @@ -1,6 +1,6 @@ Class { #name : #ToCommandApplier, - #superclass : #BlCustomEventHandler, + #superclass : #Object, #instVars : [ 'element' ], @@ -19,8 +19,12 @@ ToCommandApplier >> element: anElement [ element := anElement ] -{ #category : #'api - accessing' } -ToCommandApplier >> eventsToHandle [ +{ #category : #'api - hooks' } +ToCommandApplier >> onInstalledIn: aSelecter [ + +] + +{ #category : #'api - hooks' } +ToCommandApplier >> onUninstalledIn: aSelecter [ - ^ { } ] diff --git a/src/Toplo-Widget-List/ToListDataSourceItemChangeRequestEvent.class.st b/src/Toplo-Widget-List/ToListDataSourceItemChangeRequestEvent.class.st deleted file mode 100644 index 47dc4d61..00000000 --- a/src/Toplo-Widget-List/ToListDataSourceItemChangeRequestEvent.class.st +++ /dev/null @@ -1,26 +0,0 @@ -Class { - #name : #ToListDataSourceItemChangeRequestEvent, - #superclass : #ToAuthorisationRequestEvent, - #instVars : [ - 'dataSourceEvent' - ], - #category : #'Toplo-Widget-List-Selection-Events' -} - -{ #category : #accessing } -ToListDataSourceItemChangeRequestEvent >> dataSourceEvent [ - - ^ dataSourceEvent -] - -{ #category : #accessing } -ToListDataSourceItemChangeRequestEvent >> dataSourceEvent: anObject [ - - dataSourceEvent := anObject -] - -{ #category : #sending } -ToListDataSourceItemChangeRequestEvent >> sendTo: anObject [ - - anObject listDataSourceItemsChangeRequestEvent: self -] diff --git a/src/Toplo-Widget-List/ToListElement.class.st b/src/Toplo-Widget-List/ToListElement.class.st index 31e0198e..7ddca40f 100644 --- a/src/Toplo-Widget-List/ToListElement.class.st +++ b/src/Toplo-Widget-List/ToListElement.class.st @@ -27,7 +27,7 @@ ToListElement >> defaultNodeManagerClass [ { #category : #'private - invalidation' } ToListElement >> invalidateItemDecorations [ - self notifyPrimarySelectionDirty + self updateAllSelections ] { #category : #skin } diff --git a/src/Toplo-Widget-List/ToListElementEventHandler.class.st b/src/Toplo-Widget-List/ToListElementEventHandler.class.st index 7490eaa9..9ccd12d5 100644 --- a/src/Toplo-Widget-List/ToListElementEventHandler.class.st +++ b/src/Toplo-Widget-List/ToListElementEventHandler.class.st @@ -189,7 +189,7 @@ ToListElementEventHandler >> listDataSourceItemsRemovedEvent: anEvent [ | target | target := anEvent currentTarget. - " update the secondary selection because it can be on the removed nodes " + " update the secondary selection because it can be on the removed nodes " target secondarySelecter deselectIndex: anEvent position to: anEvent position + anEvent itemCount - 1. @@ -197,17 +197,17 @@ ToListElementEventHandler >> listDataSourceItemsRemovedEvent: anEvent [ If done by the selecter, the model update is postponed, the consequence can be that the skin can be updated whereas the selection model is not up-to-date leading to a baddly SelectedSkinEvent sent" - target selectionModel withAllSubModelsDo: [ :sm | sm deselectIndex: anEvent position to: anEvent position + anEvent itemCount - 1 ]. " since the delection model as been updated, one have to force the renewal of selection elements " - target notifyPrimarySelectionDirty. target selecter shiftSelection: anEvent itemCount negated - from: anEvent position + from: anEvent position. + + target updateAllSelections ] { #category : #'infinite event handling' } diff --git a/src/Toplo-Widget-List/ToListElementSieve.class.st b/src/Toplo-Widget-List/ToListElementSieve.class.st index 5b68d379..bdb60596 100644 --- a/src/Toplo-Widget-List/ToListElementSieve.class.st +++ b/src/Toplo-Widget-List/ToListElementSieve.class.st @@ -54,10 +54,6 @@ ToListElementSieve >> isInstalled [ ^ originalData notNil ] -{ #category : #'event firing' } -ToListElementSieve >> notifyPrimarySelectionDirty [ -] - { #category : #'api - hooks' } ToListElementSieve >> onInstalledIn: aListElement [ " install the sieve on the listElement " @@ -161,6 +157,10 @@ ToListElementSieve >> selectionModel [ ^ selectionModel ] +{ #category : #'selection updating' } +ToListElementSieve >> updateAllSelections [ +] + { #category : #private } ToListElementSieve >> updateCurrentData [ diff --git a/src/Toplo-Widget-List/ToListHiddenSelectionMode.class.st b/src/Toplo-Widget-List/ToListHiddenSelectionMode.class.st index d10cae1e..f367264b 100644 --- a/src/Toplo-Widget-List/ToListHiddenSelectionMode.class.st +++ b/src/Toplo-Widget-List/ToListHiddenSelectionMode.class.st @@ -4,6 +4,14 @@ Class { #category : #'Toplo-Widget-List-Selection-Mode' } +{ #category : #'instance creation' } +ToListHiddenSelectionMode >> newSelectionChangedEventHandler [ + + ^ ToListBasicAdditionalSelectionElementEventHandler new + selectionChangedEventClass: self selectionChangedEventClass; + yourself +] + { #category : #'instance creation' } ToListHiddenSelectionMode >> selectionChangedEventClass [ diff --git a/src/Toplo-Widget-List/ToListInnerContainerEventHandler.class.st b/src/Toplo-Widget-List/ToListInnerContainerEventHandler.class.st index 05b77bf1..6bba467f 100644 --- a/src/Toplo-Widget-List/ToListInnerContainerEventHandler.class.st +++ b/src/Toplo-Widget-List/ToListInnerContainerEventHandler.class.st @@ -14,15 +14,15 @@ ToListInnerContainerEventHandler >> boundsHasChangedDuringScrollingEvent: anEven ] { #category : #'infinite event handling' } -ToListInnerContainerEventHandler >> elementAddedToSceneGraphEvent: anEvent [ +ToListInnerContainerEventHandler >> elementAddedToSceneGraphEvent: anEvent [ - "anEvent currentTarget listElement notifyPrimarySelectionDirty" + "anEvent currentTarget listElement updateAllSelections" ] { #category : #'infinite event handling' } ToListInnerContainerEventHandler >> elementPositionChangedEvent: anEvent [ - anEvent currentTarget listElement notifyPrimarySelectionDirty + anEvent currentTarget listElement updateAllSelections ] { #category : #'infinite event handling' } diff --git a/src/Toplo-Widget-List/ToListPrimarySelectionDirtyEvent.class.st b/src/Toplo-Widget-List/ToListPrimarySelectionDirtyEvent.class.st deleted file mode 100644 index 76871b67..00000000 --- a/src/Toplo-Widget-List/ToListPrimarySelectionDirtyEvent.class.st +++ /dev/null @@ -1,52 +0,0 @@ -Class { - #name : #ToListPrimarySelectionDirtyEvent, - #superclass : #ToListElementEvent, - #instVars : [ - 'itemCount', - 'selectionOption', - 'selectionModel' - ], - #category : #'Toplo-Widget-List-Selection-Events' -} - -{ #category : #accessing } -ToListPrimarySelectionDirtyEvent >> itemCount: anInteger [ - - itemCount := anInteger -] - -{ #category : #accessing } -ToListPrimarySelectionDirtyEvent >> selectionModel [ - - ^ selectionModel -] - -{ #category : #accessing } -ToListPrimarySelectionDirtyEvent >> selectionModel: aSelectionModel [ - - selectionModel := aSelectionModel -] - -{ #category : #accessing } -ToListPrimarySelectionDirtyEvent >> selectionOption [ - - ^ selectionOption -] - -{ #category : #accessing } -ToListPrimarySelectionDirtyEvent >> selectionOption: aSelectionElementOption [ - - selectionOption := aSelectionElementOption -] - -{ #category : #sending } -ToListPrimarySelectionDirtyEvent >> sendTo: anObject [ - - anObject listPrimarySelectionDirtyEvent: self -] - -{ #category : #accessing } -ToListPrimarySelectionDirtyEvent >> touchedIndexes [ - - ^ 1 to: itemCount -] diff --git a/src/Toplo-Widget-List/ToListPrimarySelectionElementEventHandler.class.st b/src/Toplo-Widget-List/ToListPrimarySelectionElementEventHandler.class.st index 843837c7..22387cc8 100644 --- a/src/Toplo-Widget-List/ToListPrimarySelectionElementEventHandler.class.st +++ b/src/Toplo-Widget-List/ToListPrimarySelectionElementEventHandler.class.st @@ -12,7 +12,7 @@ ToListPrimarySelectionElementEventHandler >> differUpdateSelectionFrom: anElemen differedUpdateTask ifNotNil: [ ^ self ]. differedUpdateTask := BlTaskAction new action: [ - anElement notifyPrimarySelectionDirty. + anElement updateAllSelections. differedUpdateTask := nil ]. anElement enqueueTask: differedUpdateTask ] @@ -20,9 +20,7 @@ ToListPrimarySelectionElementEventHandler >> differUpdateSelectionFrom: anElemen { #category : #'api - accessing' } ToListPrimarySelectionElementEventHandler >> eventsToHandle [ - ^ super eventsToHandle, { - ToListPrimarySelectionDirtyEvent. - ToListPrimarySelectionChangedEvent } + ^ super eventsToHandle , { ToListPrimarySelectionChangedEvent } ] { #category : #'element handlers' } @@ -30,9 +28,3 @@ ToListPrimarySelectionElementEventHandler >> listPrimarySelectionChangedEvent: a self updateSelectionFromEvent: anEvent ] - -{ #category : #'element handlers' } -ToListPrimarySelectionElementEventHandler >> listPrimarySelectionDirtyEvent: anEvent [ - - self updateSelectionFromEvent: anEvent -] diff --git a/src/Toplo-Widget-List/ToListSelecter.class.st b/src/Toplo-Widget-List/ToListSelecter.class.st index 649f11db..73ac241c 100644 --- a/src/Toplo-Widget-List/ToListSelecter.class.st +++ b/src/Toplo-Widget-List/ToListSelecter.class.st @@ -57,7 +57,8 @@ ToListSelecter >> commandApplied: aCommand [ command: aCommand; requestedAction: [ element dispatchEvent: (selectionChangedEventClass new - command: aCommand; + selectionModel: aCommand selectionModel; + touchedIntervals: aCommand intervals; selectionOption: self selectionOption; yourself) ]; yourself. @@ -269,13 +270,13 @@ ToListSelecter >> onInstalledIn: anElement [ element := anElement. selectionModel on: anElement. commandApplier element: anElement. - self addEventHandler: commandApplier + commandApplier onInstalledIn: self ] { #category : #'api - hooks' } ToListSelecter >> onUninstalledIn: anElement [ - self removeEventHandler: commandApplier. + commandApplier onUninstalledIn: self. commandApplier := nil. element := nil ] @@ -519,5 +520,5 @@ ToListSelecter >> switchIndexSelection: anIndex [ ToListSelecter >> updateSelection [ self selectionModel deselectAll. - element notifyPrimarySelectionDirty + element updateAllSelections ] diff --git a/src/Toplo-Widget-List/ToListSelectionChangedEvent.class.st b/src/Toplo-Widget-List/ToListSelectionChangedEvent.class.st index e9e932d0..456e49b0 100644 --- a/src/Toplo-Widget-List/ToListSelectionChangedEvent.class.st +++ b/src/Toplo-Widget-List/ToListSelectionChangedEvent.class.st @@ -2,34 +2,29 @@ Class { #name : #ToListSelectionChangedEvent, #superclass : #ToListElementEvent, #instVars : [ - 'command', - 'selectionOption' + 'selectionOption', + 'selectionModel', + 'touchedIntervals' ], #category : #'Toplo-Widget-List-Selection-Events' } { #category : #accessing } -ToListSelectionChangedEvent >> command [ - - ^ command -] - -{ #category : #accessing } -ToListSelectionChangedEvent >> command: aCommand [ +ToListSelectionChangedEvent >> selectedIndexes [ - command := aCommand + ^ self selectionModel selectedIndexes ] { #category : #accessing } -ToListSelectionChangedEvent >> selectedIndexes [ +ToListSelectionChangedEvent >> selectionModel [ - ^ self selectionModel selectedIndexes + ^ selectionModel ] { #category : #accessing } -ToListSelectionChangedEvent >> selectionModel [ +ToListSelectionChangedEvent >> selectionModel: aSelectionModel [ - ^ command selectionModel + selectionModel := aSelectionModel ] { #category : #accessing } @@ -45,13 +40,13 @@ ToListSelectionChangedEvent >> selectionOption: aSelectionElementOption [ ] { #category : #accessing } -ToListSelectionChangedEvent >> touchedIndexes [ +ToListSelectionChangedEvent >> touchedIntervals [ - ^ command indexes + ^ touchedIntervals ] { #category : #accessing } -ToListSelectionChangedEvent >> touchedIntervals [ +ToListSelectionChangedEvent >> touchedIntervals: aCollection [ - ^ command intervals + touchedIntervals := aCollection ] diff --git a/src/Toplo-Widget-List/ToListSelectionElementEventHandler.class.st b/src/Toplo-Widget-List/ToListSelectionElementEventHandler.class.st index f5d474fc..e8fd4756 100644 --- a/src/Toplo-Widget-List/ToListSelectionElementEventHandler.class.st +++ b/src/Toplo-Widget-List/ToListSelectionElementEventHandler.class.st @@ -33,9 +33,6 @@ ToListSelectionElementEventHandler >> updateSelectionFromEvent: anEvent [ | target | target := anEvent currentTarget. - anEvent touchedIndexes ifEmpty: [ - self refreshSelectionFromEvent: anEvent. - ^ self ]. target isAttachedToSceneGraph ifFalse: [ self differUpdateSelectionFrom: target. diff --git a/src/Toplo-Widget-List/ToListUnselectableSelectionElementEventHandler.class.st b/src/Toplo-Widget-List/ToListUnselectableSelectionElementEventHandler.class.st index f01d6aa6..6702151c 100644 --- a/src/Toplo-Widget-List/ToListUnselectableSelectionElementEventHandler.class.st +++ b/src/Toplo-Widget-List/ToListUnselectableSelectionElementEventHandler.class.st @@ -13,12 +13,10 @@ ToListUnselectableSelectionElementEventHandler >> eventsToHandle [ { #category : #'element handlers' } ToListUnselectableSelectionElementEventHandler >> listUnselectableSelectionChangedEvent: anEvent [ - | touchedIndexes target | - touchedIndexes := anEvent touchedIndexes. + | target | target := anEvent currentTarget. self updateSelectionFromEvent: anEvent. - target selecter deselectIndexes: touchedIndexes. - target secondarySelecter deselectAll. anEvent touchedIntervals do: [ :int | - target dataSource notifyItemsChanged: int ] + target selecter deselectIndex: int first to: int last ]. + target secondarySelecter deselectAll ] diff --git a/src/Toplo-Widget-List/ToListUnselectableSelectionMode.class.st b/src/Toplo-Widget-List/ToListUnselectableSelectionMode.class.st index f7119c2d..97fd37bb 100644 --- a/src/Toplo-Widget-List/ToListUnselectableSelectionMode.class.st +++ b/src/Toplo-Widget-List/ToListUnselectableSelectionMode.class.st @@ -4,6 +4,12 @@ Class { #category : #'Toplo-Widget-List-Selection-Mode' } +{ #category : #'instance creation' } +ToListUnselectableSelectionMode >> newSelectionChangedEventHandler [ + + ^ ToListUnselectableSelectionElementEventHandler new +] + { #category : #'instance creation' } ToListUnselectableSelectionMode >> selectionChangedEventClass [ diff --git a/src/Toplo-Widget-List/ToQueueBasedCommandApplier.class.st b/src/Toplo-Widget-List/ToQueueBasedCommandApplier.class.st index 0f4923ea..79bc6e38 100644 --- a/src/Toplo-Widget-List/ToQueueBasedCommandApplier.class.st +++ b/src/Toplo-Widget-List/ToQueueBasedCommandApplier.class.st @@ -23,19 +23,6 @@ ToQueueBasedCommandApplier >> command: aCommand addedIn: aSelecter [ element spaceDo: [ :sp | sp requestNextPulse ] ] -{ #category : #'event handling' } -ToQueueBasedCommandApplier >> elementCommandApplicationTaskActivationEvent: aCommandsApplicationRequestEvent [ - - self postApplicationTask -] - -{ #category : #'api - accessing' } -ToQueueBasedCommandApplier >> eventsToHandle [ - - ^ super eventsToHandle , { - ToCommandApplicationTaskActivationEvent } -] - { #category : #initialization } ToQueueBasedCommandApplier >> initialize [ @@ -47,7 +34,6 @@ ToQueueBasedCommandApplier >> initialize [ ToQueueBasedCommandApplier >> onInstalledIn: aSelecter [ super onInstalledIn: aSelecter. - commandQueue := ToCommandQueue new. applicationTask := ToCommandApplicationTask new operator: aSelecter operator; @@ -63,7 +49,6 @@ ToQueueBasedCommandApplier >> onInstalledIn: aSelecter [ ToQueueBasedCommandApplier >> onUninstalledIn: aSelecter [ super onUninstalledIn: aSelecter. - commandQueue := nil. applicationTask := nil. ] diff --git a/src/Toplo-Widget-List/ToSieveEventHandler.class.st b/src/Toplo-Widget-List/ToSieveEventHandler.class.st index f23bb9a0..76145d04 100644 --- a/src/Toplo-Widget-List/ToSieveEventHandler.class.st +++ b/src/Toplo-Widget-List/ToSieveEventHandler.class.st @@ -25,17 +25,13 @@ ToSieveEventHandler >> listPrimarySelectionChangedEvent: anEvent [ " I'm sent when the selecter of my sieve is used directly for a selection operation as an example, to intialize some selected elements programmatically " - | touchedIndexes | anEvent currentTarget pattern ifEmpty: [ - touchedIndexes := anEvent touchedIndexes. - listElement selectionModel copySelectionFrom: sieveSelectionModel ] + listElement selectionModel copySelectionFrom: sieveSelectionModel ] ifNotEmpty: [ - touchedIndexes := OrderedCollection new. listElement dataAccessor withIndexDo: [ :dataItem :localIndex | | originalIndex | originalIndex := originalIndexMap at: dataItem. - touchedIndexes add: originalIndex. sieveSelectionModel transferSelectionFromIndex: originalIndex toIndex: localIndex @@ -46,11 +42,9 @@ ToSieveEventHandler >> listPrimarySelectionChangedEvent: anEvent [ according to the sieve selection" listElement dispatchEvent: (ToSieveSelectionChangedEvent new sieve: anEvent currentTarget; - sourceCommand: anEvent command; - touchedIndexes: touchedIndexes asArray; selectionModel: sieveSelectionModel; yourself). - listElement notifyPrimarySelectionDirty + listElement updateAllSelections ] { #category : #'api - hooks' } diff --git a/src/Toplo-Widget-List/ToSieveSelecter.class.st b/src/Toplo-Widget-List/ToSieveSelecter.class.st index 692f940b..e724c487 100644 --- a/src/Toplo-Widget-List/ToSieveSelecter.class.st +++ b/src/Toplo-Widget-List/ToSieveSelecter.class.st @@ -9,9 +9,3 @@ ToSieveSelecter >> initializeCommandApplier [ commandApplier := ToImmediateCommandApplier new ] - -{ #category : #'event firing' } -ToSieveSelecter >> notifyPrimarySelectionDirty [ - - -] diff --git a/src/Toplo-Widget-List/ToSieveSelectionChangedEvent.class.st b/src/Toplo-Widget-List/ToSieveSelectionChangedEvent.class.st index 71d6f535..00078993 100644 --- a/src/Toplo-Widget-List/ToSieveSelectionChangedEvent.class.st +++ b/src/Toplo-Widget-List/ToSieveSelectionChangedEvent.class.st @@ -3,9 +3,7 @@ Class { #superclass : #BlEvent, #instVars : [ 'sieve', - 'selectionModel', - 'touchedIndexes', - 'sourceCommand' + 'selectionModel' ], #category : #'Toplo-Widget-List-Sieve' } @@ -39,27 +37,3 @@ ToSieveSelectionChangedEvent >> sieve: aSieve [ sieve := aSieve ] - -{ #category : #accessing } -ToSieveSelectionChangedEvent >> sourceCommand [ - - ^ sourceCommand -] - -{ #category : #accessing } -ToSieveSelectionChangedEvent >> sourceCommand: aSelectionCommand [ - - sourceCommand := aSelectionCommand -] - -{ #category : #accessing } -ToSieveSelectionChangedEvent >> touchedIndexes [ - - ^ touchedIndexes -] - -{ #category : #accessing } -ToSieveSelectionChangedEvent >> touchedIndexes: aCollection [ - - touchedIndexes := aCollection -] diff --git a/src/Toplo-Widget-List/ToSievedListElementEventHandler.class.st b/src/Toplo-Widget-List/ToSievedListElementEventHandler.class.st index 497a1c69..6da520a9 100644 --- a/src/Toplo-Widget-List/ToSievedListElementEventHandler.class.st +++ b/src/Toplo-Widget-List/ToSievedListElementEventHandler.class.st @@ -67,7 +67,7 @@ ToSievedListElementEventHandler >> listSelectionCommandAppliedEvent: aPreNotific listElement := aPreNotification currentTarget. listSelModel := listElement selectionModel. " first check if the request is for the primary selection model " - listSelModel = aPreNotification selectionModel ifFalse: [ ^ self ]. + listSelModel == aPreNotification selectionModel ifFalse: [ ^ self ]. " have to do nothing if the list is empty. Else, the selection can be lost in case of single select" listElement dataAccessor ifEmpty: [ ^ self ]. @@ -99,8 +99,6 @@ ToSievedListElementEventHandler >> listSelectionCommandAppliedEvent: aPreNotific according to the sieve selection" listElement dispatchEvent: (ToSieveSelectionChangedEvent new sieve: sieve; - sourceCommand: aPreNotification command; - touchedIndexes: touchedIndexes asArray; selectionModel: sieveSelectionModel; yourself) ] diff --git a/src/Toplo-Widget-Tag/ToTagSkin.class.st b/src/Toplo-Widget-Tag/ToTagSkin.class.st index 5c7a12c8..6c6156e7 100644 --- a/src/Toplo-Widget-Tag/ToTagSkin.class.st +++ b/src/Toplo-Widget-Tag/ToTagSkin.class.st @@ -9,9 +9,7 @@ ToTagSkin >> disabledSkinEvent: anEvent [ super disabledSkinEvent: anEvent. anEvent elementDo: [ :e | - e border: (BlBorder - paint: (e valueOfTokenNamed: #'color-border-disabled') - width: (e valueOfTokenNamed: #'line-width')). + e border: BlBorder empty. e background: (e valueOfTokenNamed: #'color-bg-container-disabled'). e iconDo: [ :ic | ic formColor: (e valueOfTokenNamed: #'color-text-disabled') ].