Skip to content

Commit

Permalink
Merge branch 'master' into 27-In-the-Chest-tree-table-view-as-a-debug…
Browse files Browse the repository at this point in the history
…ger-extension-Remove-item-context-menu-entry-raises-an-exception-remove-was-sent-to-nil
  • Loading branch information
adri09070 authored May 3, 2024
2 parents e195dc1 + 029ce79 commit d99d156
Show file tree
Hide file tree
Showing 24 changed files with 545 additions and 113 deletions.
8 changes: 1 addition & 7 deletions src/Chest-Commands/ChestCopyObjectCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,5 @@ ChestCopyObjectCommand class >> defaultName [
{ #category : 'executing' }
ChestCopyObjectCommand >> execute [

self evaluateSelectionAndDo: [ :result |
[ ClipboardChest at: ClipboardChest clipboardEntryName put: result ]
on: ChestKeyAlreadyInUseError
do: [
ClipboardChest removeObjectNamed:
ClipboardChest clipboardEntryName.
ClipboardChest at: ClipboardChest clipboardEntryName put: result ] ]
self evaluateSelectionAndDo: [ :result | ClipboardChest add: result ]
]
15 changes: 14 additions & 1 deletion src/Chest-Commands/ChestPasteLastObjectLoadCodeCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,20 @@ ChestPasteLastObjectLoadCodeCommand class >> forSpecContext: aContext [
^ self
forSpecContext: aContext
withChestName: ClipboardChest defaultInstance name
withObjectName: ClipboardChest clipboardEntryName
withObjectName: nil
]

{ #category : 'executing' }
ChestPasteLastObjectLoadCodeCommand >> buildInjectedCode [

objectName := ClipboardChest lastClipboardKeys last.
^ super buildInjectedCode
]

{ #category : 'testing' }
ChestPasteLastObjectLoadCodeCommand >> canBeExecuted [

^ ClipboardChest lastClipboardKeys notEmpty
]

{ #category : 'accessing' }
Expand Down
31 changes: 16 additions & 15 deletions src/Chest-Tests/ChestEventListenerForTest.class.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Class {
#name : #ChestEventListenerForTest,
#superclass : #Object,
#name : 'ChestEventListenerForTest',
#superclass : 'Object',
#instVars : [
'chestRemovedReceived',
'contentOfChestUpdatedReceived',
Expand All @@ -10,67 +10,68 @@ Class {
'newContentsOfUpdatedChest',
'newChest'
],
#category : #'Chest-Tests'
#category : 'Chest-Tests',
#package : 'Chest-Tests'
}

{ #category : #accessing }
{ #category : 'accessing' }
ChestEventListenerForTest >> chestRemovedReceived [
^ chestRemovedReceived
]

{ #category : #accessing }
{ #category : 'accessing' }
ChestEventListenerForTest >> contentOfChestUpdatedReceived [
^ contentOfChestUpdatedReceived
]

{ #category : #initialization }
{ #category : 'initialization' }
ChestEventListenerForTest >> eventChestRemoved: aChestRemovedAnnouncement [
chestRemovedReceived := true.
removedChest := aChestRemovedAnnouncement removedChest
]

{ #category : #initialization }
{ #category : 'initialization' }
ChestEventListenerForTest >> eventContentOfChestUpdated: aChestUpdatedAnnouncement [
contentOfChestUpdatedReceived := true.
updatedChest := aChestUpdatedAnnouncement updatedChest .
newContentsOfUpdatedChest := aChestUpdatedAnnouncement newContent

]

{ #category : #initialization }
{ #category : 'initialization' }
ChestEventListenerForTest >> eventNewChest: aChestCreatedAnnouncement [
newChestReceived := true.
newChest := aChestCreatedAnnouncement createdChest
]

{ #category : #initialization }
{ #category : 'initialization' }
ChestEventListenerForTest >> initialize [
chestRemovedReceived := false.
contentOfChestUpdatedReceived := false.
newChestReceived := false
]

{ #category : #accessing }
{ #category : 'accessing' }
ChestEventListenerForTest >> newChest [
^ newChest
]

{ #category : #accessing }
{ #category : 'accessing' }
ChestEventListenerForTest >> newChestReceived [
^ newChestReceived
]

{ #category : #accessing }
{ #category : 'accessing' }
ChestEventListenerForTest >> newContentsOfUpdatedChest [
^ newContentsOfUpdatedChest
]

{ #category : #accessing }
{ #category : 'accessing' }
ChestEventListenerForTest >> removedChest [
^ removedChest
]

{ #category : #updating }
{ #category : 'updating' }
ChestEventListenerForTest >> subscribeToChestAnnouncer [

Chest announcer weak when: ChestCreated send: #eventNewChest: to: self.
Expand All @@ -80,7 +81,7 @@ ChestEventListenerForTest >> subscribeToChestAnnouncer [

]

{ #category : #accessing }
{ #category : 'accessing' }
ChestEventListenerForTest >> updatedChest [
^ updatedChest
]
Loading

0 comments on commit d99d156

Please sign in to comment.