Skip to content

Commit

Permalink
Merge pull request #23 from adri09070/reworking-main-ui
Browse files Browse the repository at this point in the history
Reworking main UI
  • Loading branch information
StevenCostiou authored Aug 3, 2023
2 parents 2d6c429 + d676a34 commit fb88f9f
Show file tree
Hide file tree
Showing 7 changed files with 377 additions and 46 deletions.
20 changes: 19 additions & 1 deletion src/BaselineOfChest/BaselineOfChest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ BaselineOfChest >> baseline: spec [

<baseline>
spec for: #common do: [
spec postLoadDoIt: #postload:package:.

spec
package: 'Chest';
package: 'Chest-Tests';
Expand All @@ -17,5 +19,21 @@ BaselineOfChest >> baseline: spec [

spec
group: 'default'
with: #( 'Chest' 'Chest-Commands' 'Chest-Tests' 'Chest-Commands-Tests' )
with:
#( 'Chest' 'Chest-Commands' 'Chest-Tests' 'Chest-Commands-Tests' )
]

{ #category : #baselines }
BaselineOfChest >> createChestExamples [

Chest at: 'fortyTwo' put: 42.
(Chest newNamed: 'ExampleChest')
at: 'tata'
put: 'someExampleStringCalledTata'
]

{ #category : #baselines }
BaselineOfChest >> postload: loader package: packageSpec [

self createChestExamples
]
35 changes: 35 additions & 0 deletions src/Chest-Commands/ChestAddNewItemCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Class {
#name : #ChestAddNewItemCommand,
#superclass : #ChestCommand,
#category : #'Chest-Commands'
}

{ #category : #default }
ChestAddNewItemCommand class >> defaultDescription [

^ 'Request an expression whose result will be stored inside the selected chest'
]

{ #category : #default }
ChestAddNewItemCommand class >> defaultIconName [

^ #add
]

{ #category : #default }
ChestAddNewItemCommand class >> defaultName [

^ 'Add item'
]

{ #category : #testing }
ChestAddNewItemCommand >> canBeExecuted [

^ context selectedChest isNotNil
]

{ #category : #executing }
ChestAddNewItemCommand >> execute [

^ context requestExpressionToStoreInChest
]
18 changes: 10 additions & 8 deletions src/Chest-Commands/ChestCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,39 @@ ChestCommand class >> chestLoadItemCommandClasses [
{ #category : #'accessing - commands classes' }
ChestCommand class >> chestTableContentMenuCommandClasses [

^ {
^ {
ChestRenameItemCommand.
ChestInspectItemCommand.
ChestAddNewItemCommand.
ChestRemoveItemCommand.
ChestRemoveAllItemsInChestCommand }
]

{ #category : #'accessing - commands classes' }
ChestCommand class >> chestTableContentToolbarCommandClasses [

^ {
ChestRemoveItemCommand.
ChestRemoveAllItemsInChestCommand }
^ {
ChestAddNewItemCommand.
ChestRemoveItemCommand }
]

{ #category : #'accessing - commands classes' }
ChestCommand class >> chestTableMenuCommandClasses [

^ {
^ {
ChestRenameChestCommand.
ChestInspectChestCommand.
ChestAddNewChestCommand.
ChestRemoveChestCommand.
ChestRemoveAllChestsCommand }
]

{ #category : #'accessing - commands classes' }
ChestCommand class >> chestTableToolbarCommandClasses [

^ {
^ {
ChestAddNewChestCommand.
ChestRemoveChestCommand.
ChestRemoveAllChestsCommand }
ChestRemoveChestCommand }
]

{ #category : #'accessing - commands classes' }
Expand Down
41 changes: 41 additions & 0 deletions src/Chest-Commands/ChestInspectChestCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Class {
#name : #ChestInspectChestCommand,
#superclass : #ChestCommand,
#category : #'Chest-Commands'
}

{ #category : #default }
ChestInspectChestCommand class >> defaultDescription [

^ 'Inspect the chest'
]

{ #category : #default }
ChestInspectChestCommand class >> defaultIconName [

^ #glamorousInspect
]

{ #category : #default }
ChestInspectChestCommand class >> defaultName [

^ 'Inspect chest'
]

{ #category : #default }
ChestInspectChestCommand class >> defaultShortcutKey [

^ $i meta
]

{ #category : #testing }
ChestInspectChestCommand >> canBeExecuted [

^ context selectedChest isNotNil
]

{ #category : #executing }
ChestInspectChestCommand >> execute [

context selectedChest inspect
]
6 changes: 6 additions & 0 deletions src/Chest-Commands/ChestInspectItemCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ ChestInspectItemCommand class >> defaultDescription [
^ 'Inspect the object'
]

{ #category : #default }
ChestInspectItemCommand class >> defaultIconName [

^ #glamorousInspect
]

{ #category : #default }
ChestInspectItemCommand class >> defaultName [

Expand Down
Loading

0 comments on commit fb88f9f

Please sign in to comment.