diff --git a/src/BaselineOfChest/BaselineOfChest.class.st b/src/BaselineOfChest/BaselineOfChest.class.st index 0ae597c..bec054a 100644 --- a/src/BaselineOfChest/BaselineOfChest.class.st +++ b/src/BaselineOfChest/BaselineOfChest.class.st @@ -1,21 +1,23 @@ Class { - #name : #BaselineOfChest, - #superclass : #BaselineOf, - #category : #BaselineOfChest + #name : 'BaselineOfChest', + #superclass : 'BaselineOf', + #category : 'BaselineOfChest', + #package : 'BaselineOfChest' } -{ #category : #baselines } +{ #category : 'baselines' } BaselineOfChest >> baseline: spec [ spec for: #common do: [ spec postLoadDoIt: #postload:package:. - + spec package: 'Chest'; - package: 'Chest-Tests'; - package: 'Chest-Commands'; - package: 'Chest-Commands-Tests' ]. + package: 'Chest-Tests' with: [ spec requires: #( 'Chest' ) ]; + package: 'Chest-Commands' with: [ spec requires: #( 'Chest' ) ]; + package: 'Chest-Commands-Tests' + with: [ spec requires: #( 'Chest-Commands' ) ] ]. spec group: 'default' @@ -23,16 +25,18 @@ BaselineOfChest >> baseline: spec [ #( 'Chest' 'Chest-Commands' 'Chest-Tests' 'Chest-Commands-Tests' ) ] -{ #category : #baselines } +{ #category : 'baselines' } BaselineOfChest >> createChestExamples [ - Chest at: 'fortyTwo' put: 42. - (Chest newNamed: 'ExampleChest') + | chestClass | + chestClass := self class environment at: #Chest ifAbsent: [ ^ self ]. + chestClass at: 'fortyTwo' put: 42. + (chestClass newNamed: 'ExampleChest') at: 'tata' put: 'someExampleStringCalledTata' ] -{ #category : #baselines } +{ #category : 'baselines' } BaselineOfChest >> postload: loader package: packageSpec [ self createChestExamples diff --git a/src/BaselineOfChest/package.st b/src/BaselineOfChest/package.st index f029294..507e83b 100644 --- a/src/BaselineOfChest/package.st +++ b/src/BaselineOfChest/package.st @@ -1 +1 @@ -Package { #name : #BaselineOfChest } +Package { #name : 'BaselineOfChest' } diff --git a/src/Chest-Commands/ChestLoadObjectIntoCodeCommand.class.st b/src/Chest-Commands/ChestLoadObjectIntoCodeCommand.class.st index ae59248..4c70528 100644 --- a/src/Chest-Commands/ChestLoadObjectIntoCodeCommand.class.st +++ b/src/Chest-Commands/ChestLoadObjectIntoCodeCommand.class.st @@ -87,12 +87,12 @@ ChestLoadObjectIntoCodeCommand >> isVisibleForContext: aCodePresenter [ { #category : 'execution' } ChestLoadObjectIntoCodeCommand >> loadAssocIntoContext: assoc [ - (context interactionModel hasBindingOf: assoc key) - ifTrue: [ + (context interactionModel hasBindingOf: assoc variableName) + ifTrue: [ self - warnUserWhenDeletingBindingWithKey: assoc key + warnUserWhenDeletingBindingWithKey: assoc variableName withNewValue: assoc value ] - ifFalse: [ + ifFalse: [ self loadIntoContextObject: assoc value named: assoc variableName ] ] diff --git a/src/Chest/ChestPresenter.class.st b/src/Chest/ChestPresenter.class.st index 730f46a..c3e4fac 100644 --- a/src/Chest/ChestPresenter.class.st +++ b/src/Chest/ChestPresenter.class.st @@ -205,7 +205,7 @@ ChestPresenter >> chestsTableToolbar [ { #category : 'binding' } ChestPresenter >> collectBindingsFromAllChests [ - ^ chestsTable items flatCollect: [ :each | + ^ Chest allChests collect: [ :each | self collectBindingsFromChest: each ] ] diff --git a/src/Chest/ChestTableWithContentPresenter.class.st b/src/Chest/ChestTableWithContentPresenter.class.st index f6f1079..d7dfe4a 100644 --- a/src/Chest/ChestTableWithContentPresenter.class.st +++ b/src/Chest/ChestTableWithContentPresenter.class.st @@ -796,14 +796,15 @@ ChestTableWithContentPresenter >> removeAllChests [ { #category : 'removing' } ChestTableWithContentPresenter >> removeAllItemsFromSelectedChest [ - | items | + | items chest | self flag: 'to do with polymorphism'. items := activePresenter == chestWithContentTreeTable - ifTrue: [ + ifTrue: [ chestWithContentTreeTable childrenFor: self selectedChest ] ifFalse: [ chestContentsTable items ]. - items do: [ :assoc | self selectedChest remove: assoc value ] + chest := self selectedChest. + items do: [ :assoc | chest remove: assoc value ] ] { #category : 'removing' } @@ -917,11 +918,16 @@ ChestTableWithContentPresenter >> selectedChest [ self flag: 'to do with polymorphism'. - (activePresenter isNotNil and: [ - activePresenter == chestWithContentTreeTable ]) ifTrue: [ + (activePresenter isNotNil and: [ + activePresenter == chestWithContentTreeTable ]) ifTrue: [ ^ chestWithContentTreeTable selectedItem isChest ifTrue: [ chestWithContentTreeTable selectedItem ] - ifFalse: [ nil ] ]. + ifFalse: [ + chestWithContentTreeTable roots + detect: [ :root | + (chestWithContentTreeTable childrenFor: root) + identityIncludes: chestWithContentTreeTable selectedItem ] + ifNone: [ nil ] ] ]. ^ chestsTable selection selectedItem ]