diff --git a/.smalltalk.ston b/.smalltalk.ston index 8f38e8e..4905f3d 100644 --- a/.smalltalk.ston +++ b/.smalltalk.ston @@ -5,8 +5,5 @@ SmalltalkCISpec { #directory : 'src', #platforms : [ #pharo ] } - ], - #testing : { - #packages : [ 'Toplo-Serialization.*' ] - } + ] } diff --git a/src/BaselineOfToploSerialization/BaselineOfToploSerialization.class.st b/src/BaselineOfToploSerialization/BaselineOfToploSerialization.class.st index 6dcab74..2a03308 100644 --- a/src/BaselineOfToploSerialization/BaselineOfToploSerialization.class.st +++ b/src/BaselineOfToploSerialization/BaselineOfToploSerialization.class.st @@ -12,24 +12,29 @@ BaselineOfToploSerialization >> baseline: spec [ self dependency: spec. "project packages" + self dependency: spec. + + "project packages" + spec package: 'Toplo-Serialization-STON'. + spec package: 'Toplo-Serialization-Stash'. + spec package: 'Toplo-Serialization' with: [ + spec requires: + #( 'Toplo' 'BlocSerialization' 'Toplo-Serialization-STON' + 'Toplo-Serialization-Stash' ) ]. spec - package: 'Toplo-Serialization' - ] + package: 'Toplo-Serialization-Tests' + with: [ spec requires: #( 'Toplo-Serialization' ) ] ] ] { #category : #baselines } BaselineOfToploSerialization >> dependency: spec [ - spec - baseline: 'Ston' - with: [ spec repository: 'github://svenvc/ston/repository' ]. - spec baseline: #BlocSerialization with: [ spec repository: 'github://OpenSmock/Bloc-Serialization:main/src' ]. - spec baseline: 'Toplo' with: [ spec repository: 'github://pharo-graphics/Toplo:master/src' ]. - - + spec + baseline: 'Toplo' + with: [ spec repository: 'github://pharo-graphics/Toplo:dev/src' ] ] diff --git a/src/Toplo-Serialization-STON/ToButton.extension.st b/src/Toplo-Serialization-STON/ToButton.extension.st new file mode 100644 index 0000000..ab49373 --- /dev/null +++ b/src/Toplo-Serialization-STON/ToButton.extension.st @@ -0,0 +1,40 @@ +Extension { #name : #ToButton } + +{ #category : #'*Toplo-Serialization-STON' } +ToButton >> stonPostReferenceResolution [ + + super stonPostReferenceResolution. + + "LabeledIcon" + self userData at: #stonLabeledIcon ifPresent: [ :anElement | + (self class slotNamed: #labeledIcon) write: anElement to: self. + self addChild: anElement. + self userData removeKey: #stonLabeledIcon ]. + + "Checkable" + self userData at: #stonIsCheckable ifAbsent: [ ^ self ]. + self beCheckable. + self userData at: #stonChecked ifPresent: [ :aCheckValue | + self checked: aCheckValue. + self userData removeKey: #stonChecked ]. + self userData at: #stonGroup ifPresent: [ :aGroup | + aGroup register: self. + self userData removeKey: #stonGroup ] +] + +{ #category : #'*Toplo-Serialization-STON' } +ToButton >> stonUserDataOn: aIdentityDictionary [ + + super stonUserDataOn: aIdentityDictionary. + + "LabeledIcon" + (self class usesTrait: TToElementWithLabeledIcon) ifTrue: [ + aIdentityDictionary at: #stonLabeledIcon put: self labeledIcon ]. + + "Checkable" + self isCheckable ifFalse: [ ^ self ]. + aIdentityDictionary at: #stonIsCheckable put: self isCheckable. + aIdentityDictionary at: #stonChecked put: self isChecked. + self group ifNotNil: [ + aIdentityDictionary at: #stonGroup put: self group ] +] diff --git a/src/Toplo-Serialization/ToCheckableGroup.extension.st b/src/Toplo-Serialization-STON/ToCheckableGroup.extension.st similarity index 79% rename from src/Toplo-Serialization/ToCheckableGroup.extension.st rename to src/Toplo-Serialization-STON/ToCheckableGroup.extension.st index c50aaeb..25d64e7 100644 --- a/src/Toplo-Serialization/ToCheckableGroup.extension.st +++ b/src/Toplo-Serialization-STON/ToCheckableGroup.extension.st @@ -1,13 +1,13 @@ Extension { #name : #ToCheckableGroup } -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToCheckableGroup >> fromSton: stonReader [ stonReader parseMapDo: [ :key :value | key = #checkingStrategy ifTrue: [ self checkingStrategy: value ] ] ] -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToCheckableGroup >> stonOn: stonWriter [ stonWriter writeObject: self streamMap: [ :dictionary | @@ -15,7 +15,7 @@ ToCheckableGroup >> stonOn: stonWriter [ at: #checkingStrategy put: self checkingStrategy ] ] -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToCheckableGroup >> stonProcessSubObjects: block [ self diff --git a/src/Toplo-Serialization/ToCheckbox.extension.st b/src/Toplo-Serialization-STON/ToCheckbox.extension.st similarity index 72% rename from src/Toplo-Serialization/ToCheckbox.extension.st rename to src/Toplo-Serialization-STON/ToCheckbox.extension.st index 814a0e8..af9e30f 100644 --- a/src/Toplo-Serialization/ToCheckbox.extension.st +++ b/src/Toplo-Serialization-STON/ToCheckbox.extension.st @@ -1,6 +1,6 @@ Extension { #name : #ToCheckbox } -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToCheckbox >> stonPostReferenceResolution [ super stonPostReferenceResolution. @@ -8,14 +8,15 @@ ToCheckbox >> stonPostReferenceResolution [ self checked: aCheckValue. self userData removeKey: #stonChecked ]. self userData at: #stonGroup ifPresent: [ :aGroup | - aGroup add: self. + aGroup register: self. self userData removeKey: #stonGroup ] ] -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToCheckbox >> stonUserDataOn: aIdentityDictionary [ super stonUserDataOn: aIdentityDictionary. aIdentityDictionary at: #stonChecked put: self checked. - self group ifNotNil: [ aIdentityDictionary at: #stonGroup put: self group. ] + self group ifNotNil: [ + aIdentityDictionary at: #stonGroup put: self group ] ] diff --git a/src/Toplo-Serialization-STON/ToElement.extension.st b/src/Toplo-Serialization-STON/ToElement.extension.st new file mode 100644 index 0000000..559982c --- /dev/null +++ b/src/Toplo-Serialization-STON/ToElement.extension.st @@ -0,0 +1,34 @@ +Extension { #name : #ToElement } + +{ #category : #'*Toplo-Serialization-STON' } +ToElement >> stonPostReferenceResolution [ + + super stonPostReferenceResolution. + self userData at: #tooltipContent ifPresent: [ :anElement | + self tooltipContent: anElement. + self userData removeKey: #tooltipContent ]. +] + +{ #category : #'*Toplo-Serialization-STON' } +ToElement >> stonUserDataOn: aIdentityDictionary [ + + super stonUserDataOn: aIdentityDictionary. + "TToEnableable" + self userData + at: #enabled + ifPresent: [ :id | aIdentityDictionary at: #enabled put: id ]. + + "TToElementWithTooltip" + self hasTooltip ifTrue: [ + aIdentityDictionary + at: #tooltipContent + put: (self rawTooltipWindowManager builder asContext tempAt: 3). + self userData at: #tooltipPopupDelay ifPresent: [ :aDuration | + aIdentityDictionary at: #tooltipPopupDelay put: aDuration ]. + self userData + at: #closeTooltipWindowOnMouseLeave + ifPresent: [ :aBoolean | + aIdentityDictionary + at: #closeTooltipWindowOnMouseLeave + put: aBoolean ] ] +] diff --git a/src/Toplo-Serialization/ToImage.extension.st b/src/Toplo-Serialization-STON/ToImage.extension.st similarity index 82% rename from src/Toplo-Serialization/ToImage.extension.st rename to src/Toplo-Serialization-STON/ToImage.extension.st index 243d3b6..9267d32 100644 --- a/src/Toplo-Serialization/ToImage.extension.st +++ b/src/Toplo-Serialization-STON/ToImage.extension.st @@ -1,6 +1,6 @@ Extension { #name : #ToImage } -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToImage >> stonPostReferenceResolution [ super stonPostReferenceResolution. @@ -9,7 +9,7 @@ ToImage >> stonPostReferenceResolution [ self userData removeKey: #stonInnerImage ] ] -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToImage >> stonUserDataOn: aIdentityDictionary [ super stonUserDataOn: aIdentityDictionary. diff --git a/src/Toplo-Serialization/ToLabel.extension.st b/src/Toplo-Serialization-STON/ToLabel.extension.st similarity index 81% rename from src/Toplo-Serialization/ToLabel.extension.st rename to src/Toplo-Serialization-STON/ToLabel.extension.st index edb1ead..27bc8e0 100644 --- a/src/Toplo-Serialization/ToLabel.extension.st +++ b/src/Toplo-Serialization-STON/ToLabel.extension.st @@ -1,6 +1,6 @@ Extension { #name : #ToLabel } -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToLabel >> stonPostReferenceResolution [ super stonPostReferenceResolution. @@ -9,7 +9,7 @@ ToLabel >> stonPostReferenceResolution [ self userData removeKey: #stonToLabelText ] ] -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToLabel >> stonUserDataOn: aIdentityDictionary [ super stonUserDataOn: aIdentityDictionary. diff --git a/src/Toplo-Serialization/ToLabeledIcon.extension.st b/src/Toplo-Serialization-STON/ToLabeledIcon.extension.st similarity index 86% rename from src/Toplo-Serialization/ToLabeledIcon.extension.st rename to src/Toplo-Serialization-STON/ToLabeledIcon.extension.st index 611a663..2094127 100644 --- a/src/Toplo-Serialization/ToLabeledIcon.extension.st +++ b/src/Toplo-Serialization-STON/ToLabeledIcon.extension.st @@ -1,6 +1,6 @@ Extension { #name : #ToLabeledIcon } -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToLabeledIcon >> stonPostReferenceResolution [ super stonPostReferenceResolution. @@ -12,7 +12,7 @@ ToLabeledIcon >> stonPostReferenceResolution [ self userData removeKey: #stonToImage ] ] -{ #category : #'*Toplo-Serialization' } +{ #category : #'*Toplo-Serialization-STON' } ToLabeledIcon >> stonUserDataOn: aIdentityDictionary [ super stonUserDataOn: aIdentityDictionary. diff --git a/src/Toplo-Serialization-STON/package.st b/src/Toplo-Serialization-STON/package.st new file mode 100644 index 0000000..08c03fe --- /dev/null +++ b/src/Toplo-Serialization-STON/package.st @@ -0,0 +1 @@ +Package { #name : #'Toplo-Serialization-STON' } diff --git a/src/Toplo-Serialization-Stash/BlElement.extension.st b/src/Toplo-Serialization-Stash/BlElement.extension.st new file mode 100644 index 0000000..30afb42 --- /dev/null +++ b/src/Toplo-Serialization-Stash/BlElement.extension.st @@ -0,0 +1,30 @@ +Extension { #name : #BlElement } + +{ #category : #'*Toplo-Serialization-Stash' } +BlElement >> allSetterAndGettersForMyStashAllStamps [ + + + self allStamps isEmpty ifTrue: [ ^ { } ]. + ^ self toStyleStore stampIndex allProperties collect: [ :assoc | | setter getter | + setter := [ :element | 'addStamp: <1p> withValue:' expandMacrosWith: assoc value name ]. + getter := [ :element | assoc value value ]. + setter -> getter + ] + + +] + +{ #category : #'*Toplo-Serialization-Stash' } +BlElement >> allSetterAndGettersForMyStashAllTokens [ + + + self ensuredToStyleStore. + self toStyleStore tokenPropertyIndex isEmpty ifTrue: [ ^ { } ]. + ^ self toStyleStore tokenPropertyIndex allProperties collect: [ :assoc | | setter getter | + setter := [ :element | 'addTokenNamed: <1p> withValue:' expandMacrosWith: assoc value name ]. + getter := [ :element | assoc value value ]. + setter -> getter + ] + + +] diff --git a/src/Toplo-Serialization-Stash/TToCheckable.extension.st b/src/Toplo-Serialization-Stash/TToCheckable.extension.st new file mode 100644 index 0000000..2df4b58 --- /dev/null +++ b/src/Toplo-Serialization-Stash/TToCheckable.extension.st @@ -0,0 +1,12 @@ +Extension { #name : #TToCheckable } + +{ #category : #'*Toplo-Serialization-Stash' } +TToCheckable >> allSetterAndGettersOfTraitForMyStash: aToElement [ + + | settersAndGetters | + self isCheckable ifFalse: [ ^ { } ]. + settersAndGetters := OrderedCollection new. + settersAndGetters add: #checked. + settersAndGetters add: #group. + ^ settersAndGetters +] diff --git a/src/Toplo-Serialization-Stash/TToElementWithLabeledIcon.extension.st b/src/Toplo-Serialization-Stash/TToElementWithLabeledIcon.extension.st new file mode 100644 index 0000000..9f66a7a --- /dev/null +++ b/src/Toplo-Serialization-Stash/TToElementWithLabeledIcon.extension.st @@ -0,0 +1,25 @@ +Extension { #name : #TToElementWithLabeledIcon } + +{ #category : #'*Toplo-Serialization-Stash' } +TToElementWithLabeledIcon >> allSetterAndGettersOfTraitForMyStash: aToElement [ + + | settersAndGetters | + settersAndGetters := OrderedCollection new. + aToElement isStartToEnd ifTrue: [ settersAndGetters add: (#beStartToEnd -> nil) onlySetOnStash ]. + aToElement isEndToStart ifTrue: [ settersAndGetters add: (#beEndToStart -> nil) onlySetOnStash ]. + + aToElement isVertical ifTrue: [ settersAndGetters add: (#isVertical -> nil) onlySetOnStash ]. + aToElement isHorizontal ifTrue: [ settersAndGetters add: (#isHorizontal -> nil) onlySetOnStash ]. + + settersAndGetters add: #endAlignment. + settersAndGetters add: #endElement. + settersAndGetters add: #endInterspace. + settersAndGetters add: #flexible. + settersAndGetters add: #icon. + settersAndGetters add: #iconContainerHeight. + settersAndGetters add: #iconContainerWidth. + settersAndGetters add: #label. + settersAndGetters add: #startAlignment. + settersAndGetters add: #startInterspace. + ^ settersAndGetters +] diff --git a/src/Toplo-Serialization-Stash/TToElementWithTooltip.extension.st b/src/Toplo-Serialization-Stash/TToElementWithTooltip.extension.st new file mode 100644 index 0000000..e9b36c7 --- /dev/null +++ b/src/Toplo-Serialization-Stash/TToElementWithTooltip.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #TToElementWithTooltip } + +{ #category : #'*Toplo-Serialization-Stash' } +TToElementWithTooltip >> allSetterAndGettersOfTraitForMyStash: aToElement [ + + self hasTooltip ifFalse: [ ^ { } ]. + ^ { #tooltipBuilder. #closeTooltipWindowOnMouseLeave . #tooltipPopupDelay } +] diff --git a/src/Toplo-Serialization-Stash/TToEnableable.extension.st b/src/Toplo-Serialization-Stash/TToEnableable.extension.st new file mode 100644 index 0000000..db1ccc9 --- /dev/null +++ b/src/Toplo-Serialization-Stash/TToEnableable.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #TToEnableable } + +{ #category : #'*Toplo-Serialization-Stash' } +TToEnableable >> allSetterAndGettersOfTraitForMyStash: aToElement [ + + aToElement isEnabled ifTrue: [ ^ { } ]. + ^ { #enabled: -> #isEnabled } +] diff --git a/src/Toplo-Serialization-Stash/ToButton.extension.st b/src/Toplo-Serialization-Stash/ToButton.extension.st new file mode 100644 index 0000000..3ecfe1e --- /dev/null +++ b/src/Toplo-Serialization-Stash/ToButton.extension.st @@ -0,0 +1,9 @@ +Extension { #name : #ToButton } + +{ #category : #'*Toplo-Serialization-Stash' } +ToButton >> stashToButtonCheckable [ + + + self isCheckable ifFalse: [ ^ { } ]. + ^ { (#beCheckable -> self) onlySetOnStash } +] diff --git a/src/Toplo-Serialization-Stash/ToCheckableGroup.extension.st b/src/Toplo-Serialization-Stash/ToCheckableGroup.extension.st new file mode 100644 index 0000000..41749ff --- /dev/null +++ b/src/Toplo-Serialization-Stash/ToCheckableGroup.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #ToCheckableGroup } + +{ #category : #'*Toplo-Serialization-Stash' } +ToCheckableGroup >> stashAccessorsForCheckableGroup [ + + + ^ { #registerAll: -> #registeredCheckables } +] diff --git a/src/Toplo-Serialization-Stash/ToImage.extension.st b/src/Toplo-Serialization-Stash/ToImage.extension.st new file mode 100644 index 0000000..4c00232 --- /dev/null +++ b/src/Toplo-Serialization-Stash/ToImage.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #ToImage } + +{ #category : #'*Toplo-Serialization-Stash' } +ToImage >> stashAccessorsForInnerImage [ + + + ^ { #innerImage } +] diff --git a/src/Toplo-Serialization-Stash/ToLabel.extension.st b/src/Toplo-Serialization-Stash/ToLabel.extension.st new file mode 100644 index 0000000..6d7abbf --- /dev/null +++ b/src/Toplo-Serialization-Stash/ToLabel.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #ToLabel } + +{ #category : #'*Toplo-Serialization-Stash' } +ToLabel >> stashAccessorsForText [ + + + ^ { #text } +] diff --git a/src/Toplo-Serialization-Stash/ToObservableCollection.extension.st b/src/Toplo-Serialization-Stash/ToObservableCollection.extension.st new file mode 100644 index 0000000..7e1c023 --- /dev/null +++ b/src/Toplo-Serialization-Stash/ToObservableCollection.extension.st @@ -0,0 +1,10 @@ +Extension { #name : #ToObservableCollection } + +{ #category : #'*Toplo-Serialization-Stash' } +ToObservableCollection >> asStashObject [ + + ^ StashCollection new + object: collection; + classType: collection class; + yourself +] diff --git a/src/Toplo-Serialization-Stash/package.st b/src/Toplo-Serialization-Stash/package.st new file mode 100644 index 0000000..bbf378b --- /dev/null +++ b/src/Toplo-Serialization-Stash/package.st @@ -0,0 +1 @@ +Package { #name : #'Toplo-Serialization-Stash' } diff --git a/src/Toplo-Serialization/ToElementWithLeafForTesting.class.st b/src/Toplo-Serialization-Tests/ToElementWithLeafForTesting.class.st similarity index 61% rename from src/Toplo-Serialization/ToElementWithLeafForTesting.class.st rename to src/Toplo-Serialization-Tests/ToElementWithLeafForTesting.class.st index 5298bf3..7aea649 100644 --- a/src/Toplo-Serialization/ToElementWithLeafForTesting.class.st +++ b/src/Toplo-Serialization-Tests/ToElementWithLeafForTesting.class.st @@ -1,5 +1,5 @@ Class { #name : #ToElementWithLeafForTesting, #superclass : #ToElement, - #category : #'Toplo-Serialization-cases-test' + #category : #'Toplo-Serialization-Tests' } diff --git a/src/Toplo-Serialization/ToSerializerTest.class.st b/src/Toplo-Serialization-Tests/ToSerializerTest.class.st similarity index 87% rename from src/Toplo-Serialization/ToSerializerTest.class.st rename to src/Toplo-Serialization-Tests/ToSerializerTest.class.st index ed5c15f..bbefa76 100644 --- a/src/Toplo-Serialization/ToSerializerTest.class.st +++ b/src/Toplo-Serialization-Tests/ToSerializerTest.class.st @@ -1,7 +1,7 @@ Class { #name : #ToSerializerTest, #superclass : #BlocSerializationTests, - #category : #'Toplo-Serialization-cases-test' + #category : #'Toplo-Serialization-Tests' } { #category : #tests } @@ -191,6 +191,41 @@ ToSerializerTest >> testToButton4 [ equals: nil ] ] +{ #category : #tests } +ToSerializerTest >> testToButton5 [ + + | origin | + origin := ToButton new. + + self test: origin on: [ :element | + self deny: element isCheckable ] +] + +{ #category : #tests } +ToSerializerTest >> testToButton6 [ + + | origin | + origin := ToButton new + beCheckable; + yourself. + + self test: origin on: [ :element | self assert: element isCheckable. + self deny: element isChecked ] +] + +{ #category : #tests } +ToSerializerTest >> testToButton7 [ + + | origin | + origin := ToButton new + beCheckable; + check; + yourself. + + self test: origin on: [ :element | self assert: element isCheckable. + self assert: element isChecked ] +] + { #category : #tests } ToSerializerTest >> testToCheckbox1 [ @@ -260,17 +295,17 @@ ToSerializerTest >> testToCheckbox4 [ button1 := ToCheckbox new id: #button1; labelText: 'button1'; - addToGroup: group; + registerInGroup: group; yourself. button2 := ToCheckbox new id: #button2; labelText: 'button2'; - addToGroup: group; + registerInGroup: group; yourself. button3 := ToCheckbox new id: #button3; labelText: 'button3'; - addToGroup: group; + registerInGroup: group; yourself. pane addChildren: { button1. @@ -294,13 +329,17 @@ ToSerializerTest >> testToCheckbox4 [ assert: (element childAt: 2) group equals: (element childAt: 3) group. self - assert: (element childAt: 1) group buttons size equals: 3. - self - assert: ((element childAt: 1) group buttons includes: (element childAt: 1)). - self - assert: ((element childAt: 1) group buttons includes: (element childAt: 2)). - self - assert: ((element childAt: 1) group buttons includes: (element childAt: 3)). ] + assert: (element childAt: 1) group registeredCheckables size + equals: 3. + self assert: + ((element childAt: 1) group registeredCheckables includes: + (element childAt: 1)). + self assert: + ((element childAt: 1) group registeredCheckables includes: + (element childAt: 2)). + self assert: + ((element childAt: 1) group registeredCheckables includes: + (element childAt: 3)) ] ] { #category : #tests } @@ -344,39 +383,6 @@ ToSerializerTest >> testTooltip1 [ { #category : #tests } ToSerializerTest >> testTooltip2 [ - | origin tooltip | - tooltip := BlElement new id: #tooltip; yourself. - origin := ToElement new tooltipContent: tooltip; yourself. - - self - test: origin - on: [ :element | self assert: element hasTooltip. - element newTooltipWindowEvent: nil. - self assert: element hasOpenedTooltip. - self assert: ((element currentTooltipWindow childAt: 1 ) childAt: 1) id equals: #tooltip - ] -] - -{ #category : #tests } -ToSerializerTest >> testTooltip3 [ - - | origin | - origin := ToElement new - tooltipText: 'hello tooltip'; - yourself. - - self test: origin on: [ :element | - self assert: element hasTooltip. - element newTooltipWindowEvent: nil. - self assert: element hasOpenedTooltip. - self - assert: ((element currentTooltipWindow childAt: 1) childAt: 1) text asString - equals: 'hello tooltip' ] -] - -{ #category : #tests } -ToSerializerTest >> testTooltip4 [ - | origin | origin := ToElement new tooltipText: 'hello tooltip'; @@ -389,7 +395,7 @@ ToSerializerTest >> testTooltip4 [ ] { #category : #tests } -ToSerializerTest >> testTooltip5 [ +ToSerializerTest >> testTooltip3 [ | origin | origin := ToElement new diff --git a/src/Toplo-Serialization-Tests/package.st b/src/Toplo-Serialization-Tests/package.st new file mode 100644 index 0000000..e602d51 --- /dev/null +++ b/src/Toplo-Serialization-Tests/package.st @@ -0,0 +1 @@ +Package { #name : #'Toplo-Serialization-Tests' } diff --git a/src/Toplo-Serialization/ToButton.extension.st b/src/Toplo-Serialization/ToButton.extension.st deleted file mode 100644 index fa51548..0000000 --- a/src/Toplo-Serialization/ToButton.extension.st +++ /dev/null @@ -1,21 +0,0 @@ -Extension { #name : #ToButton } - -{ #category : #'*Toplo-Serialization' } -ToButton >> stonPostReferenceResolution [ - - super stonPostReferenceResolution. - self userData at: #stonLabeledIcon ifPresent: [ :anElement | - (self class slotNamed: #labeledIcon) write: anElement to: self. - self addChild: anElement. - self userData removeKey: #stonLabeledIcon ] -] - -{ #category : #'*Toplo-Serialization' } -ToButton >> stonUserDataOn: aIdentityDictionary [ - - super stonUserDataOn: aIdentityDictionary. - - "LabeledIcon" - (self class usesTrait: TToElementWithLabeledIcon) ifTrue: [ - aIdentityDictionary at: #stonLabeledIcon put: self labeledIcon ] -] diff --git a/src/Toplo-Serialization/ToElement.extension.st b/src/Toplo-Serialization/ToElement.extension.st index cd6f056..ce4ddb4 100644 --- a/src/Toplo-Serialization/ToElement.extension.st +++ b/src/Toplo-Serialization/ToElement.extension.st @@ -6,36 +6,3 @@ ToElement >> shouldSerializedChildren [ ^ (self class == ToElement) ] - -{ #category : #'*Toplo-Serialization' } -ToElement >> stonPostReferenceResolution [ - - super stonPostReferenceResolution. - self userData at: #tooltipContent ifPresent: [ :anElement | - self tooltipContent: anElement. - self userData removeKey: #tooltipContent ]. -] - -{ #category : #'*Toplo-Serialization' } -ToElement >> stonUserDataOn: aIdentityDictionary [ - - super stonUserDataOn: aIdentityDictionary. - "TToEnableable" - self userData - at: #enabled - ifPresent: [ :id | aIdentityDictionary at: #enabled put: id ]. - - "TToElementWithTooltip" - self hasTooltip ifTrue: [ - aIdentityDictionary - at: #tooltipContent - put: (self rawTooltipWindowManager builder asContext tempAt: 3). - self userData at: #tooltipPopupDelay ifPresent: [ :aDuration | - aIdentityDictionary at: #tooltipPopupDelay put: aDuration ]. - self userData - at: #closeTooltipWindowOnMouseLeave - ifPresent: [ :aBoolean | - aIdentityDictionary - at: #closeTooltipWindowOnMouseLeave - put: aBoolean ] ] -]