From f7da81775178bf351329c4605504ea97ce25dbc0 Mon Sep 17 00:00:00 2001 From: SullyMLT Date: Wed, 25 Jun 2025 09:49:05 +0200 Subject: [PATCH 01/10] Adding shortcut manager feature to Pyramid for the moment focus on space only. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List of current active shortcut (default value) : • Save -> ctrl + S • Undo -> ctrl + Z • Redo -> ctrl + Y • Copy -> ctrl + C • Paste -> ctrl + V • Grid visibility switch -> ctrl + G • Select all element -> ctrl + A • Delete selected element -> delete or suppr --- .../PyramidShortcutCopyPaste.class.st | 119 ++++++++++++++++ src/Pyramid-Bloc/PyramidShortcutGrid.class.st | 63 +++++++++ .../PyramidShortcutRemoveElement.class.st | 53 +++++++ src/Pyramid-Bloc/PyramidShortcutSave.class.st | 54 +++++++ .../PyramidShortcutSelectAllElement.class.st | 65 +++++++++ .../PyramidShortcutUndoRedo.class.st | 82 +++++++++++ src/Pyramid-Bloc/PyramidSpacePlugin.class.st | 17 ++- ...PyramidSpaceShortcutManagerPlugin.class.st | 132 ++++++++++++++++++ 8 files changed, 584 insertions(+), 1 deletion(-) create mode 100644 src/Pyramid-Bloc/PyramidShortcutCopyPaste.class.st create mode 100644 src/Pyramid-Bloc/PyramidShortcutGrid.class.st create mode 100644 src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st create mode 100644 src/Pyramid-Bloc/PyramidShortcutSave.class.st create mode 100644 src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st create mode 100644 src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st create mode 100644 src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st diff --git a/src/Pyramid-Bloc/PyramidShortcutCopyPaste.class.st b/src/Pyramid-Bloc/PyramidShortcutCopyPaste.class.st new file mode 100644 index 00000000..e9c10797 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShortcutCopyPaste.class.st @@ -0,0 +1,119 @@ +" +This class is used to create the shortcut for copy and paste -> use the plugin-copy-paste from this package. + +It use the editor to get the collection of selected object from project model in Pyramid space. +" +Class { + #name : #PyramidShortcutCopyPaste, + #superclass : #PyramidSpaceShortcutManagerPlugin, + #instVars : [ + 'copyPastePlugin', + 'shortcutCopy', + 'shortcutPaste', + 'keyCombinationCopy', + 'keyCombinationPaste', + 'elementCollectionSelected' + ], + #category : #'Pyramid-Bloc-plugin-shortcut-manager' +} + +{ #category : #accessing } +PyramidShortcutCopyPaste >> copyPastePlugin: aPlugin [ + + copyPastePlugin := aPlugin +] + +{ #category : #'as yet unclassified' } +PyramidShortcutCopyPaste >> copyPastePluginFromPyramid: aPyramidEditor [ + + | copyPastePluginList | + self elementCollectionSelected: aPyramidEditor. + copyPastePluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidCopyPastePlugin ]. + copyPastePluginList size = 1 + ifFalse: [^ self]. + copyPastePlugin := copyPastePluginList asArray first +] + +{ #category : #testing } +PyramidShortcutCopyPaste >> copySelectedElementInSpace [ + + elementCollectionSelected isEmpty + ifTrue: [ ^ self ]. + elementCollectionSelected size = 1 + ifTrue: [ elementCollectionSelected do: [ :element | copyPastePlugin copyAsStonInClipboard: element ]. ] + ifFalse: [ self inform: 'Can not copy multiple element' ] + + + +] + +{ #category : #accessing } +PyramidShortcutCopyPaste >> defaultKeyCombinationCopy [ + "CTRL + C to activate this shortcut" + keyCombinationCopy := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey C) build) +] + +{ #category : #accessing } +PyramidShortcutCopyPaste >> defaultKeyCombinationPaste [ + "CTRL + V to activate this shortcut" + keyCombinationPaste := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey V) build) +] + +{ #category : #accessing } +PyramidShortcutCopyPaste >> elementCollectionSelected: aPyramidEditor [ + + elementCollectionSelected := (aPyramidEditor projectModel selection) collection. +] + +{ #category : #initialization } +PyramidShortcutCopyPaste >> initialize [ + + self defaultKeyCombinationCopy. + self defaultKeyCombinationPaste. +] + +{ #category : #accessing } +PyramidShortcutCopyPaste >> keyCombinationCopy: aKeyCombination [ + + ^ keyCombinationCopy := aKeyCombination +] + +{ #category : #accessing } +PyramidShortcutCopyPaste >> keyCombinationPaste: aKeyCombination [ + + ^ keyCombinationPaste := aKeyCombination +] + +{ #category : #testing } +PyramidShortcutCopyPaste >> pasteElement [ + + elementCollectionSelected isEmpty + ifTrue: [ copyPastePlugin pasteFromClipboardOnFirstLevelElements ]. + elementCollectionSelected size = 1 + ifTrue: [ elementCollectionSelected do: [ :element | copyPastePlugin pasteFromClipboardOnSelection: element ]. ] + + + +] + +{ #category : #accessing } +PyramidShortcutCopyPaste >> shortcutActionCopy [ + + ^ shortcutCopy := BlShortcutWithAction new + name: 'Pyramid edition shortcut copy'; + combination: keyCombinationCopy; + action: [ :event | copyPastePlugin + ifNil: [ self inform: 'Plugin Copy/Paste is not installed' ] + ifNotNil: [ self copySelectedElementInSpace ] ] +] + +{ #category : #accessing } +PyramidShortcutCopyPaste >> shortcutActionPaste [ + + ^ shortcutPaste := BlShortcutWithAction new + name: 'Pyramid edition shortcut paste'; + combination: keyCombinationPaste; + action: [ :event | copyPastePlugin + ifNil: [ self inform: 'Plugin Copy/Paste is not installed' ] + ifNotNil: [ self pasteElement ] ] +] diff --git a/src/Pyramid-Bloc/PyramidShortcutGrid.class.st b/src/Pyramid-Bloc/PyramidShortcutGrid.class.st new file mode 100644 index 00000000..4059c2a6 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShortcutGrid.class.st @@ -0,0 +1,63 @@ +" +This class define the shortcut to show or hide the grid on the space. + +the grid is define in the plugin-space-extension -> PyramidMainExtension +" +Class { + #name : #PyramidShortcutGrid, + #superclass : #PyramidSpaceShortcutManagerPlugin, + #instVars : [ + 'gridFeature', + 'shortcutGridVisibility', + 'keyCombinationGridVisibility', + 'keyCombinationTest', + 'shortcutTest' + ], + #category : #'Pyramid-Bloc-plugin-shortcut-manager' +} + +{ #category : #accessing } +PyramidShortcutGrid >> defaultKeyCombinationGridVisibility [ + "CTRL + G to activate this shortcut" + keyCombinationGridVisibility := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey G) build) +] + +{ #category : #'as yet unclassified' } +PyramidShortcutGrid >> gridFeatureFromSpacePlugin: aPyramidEditor [ + + | spacePlugin spacePluginSet listOfSpaceExtension pyramidMainExtensionSet | + + spacePluginSet := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidSpacePlugin ]. + spacePluginSet size = 1 + ifFalse: [^ self]. + spacePlugin := spacePluginSet asArray first. + + listOfSpaceExtension := spacePlugin builder extensions. + + pyramidMainExtensionSet := listOfSpaceExtension select: [ :extensions | extensions isKindOf: PyramidMainExtension ]. + pyramidMainExtensionSet size = 1 + ifFalse: [^ self]. + gridFeature := pyramidMainExtensionSet asArray first + +] + +{ #category : #initialization } +PyramidShortcutGrid >> initialize [ + + self defaultKeyCombinationGridVisibility. +] + +{ #category : #accessing } +PyramidShortcutGrid >> keyCombinationGridVisibility: aKeyCombination [ + + keyCombinationGridVisibility := aKeyCombination +] + +{ #category : #accessing } +PyramidShortcutGrid >> shortcutActionGridVisibility [ + + ^ shortcutGridVisibility := BlShortcutWithAction new + name: 'Pyramid edition shortcut grid visibility'; + combination: keyCombinationGridVisibility; + action: [ :event | gridFeature workplacePropertiesView visibilityButton toggleState ]. +] diff --git a/src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st b/src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st new file mode 100644 index 00000000..b2886ea4 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st @@ -0,0 +1,53 @@ +" +This class define the shortcut to delete a selected element in the space. + +it use the plugin-navigation in this package. +" +Class { + #name : #PyramidShortcutRemoveElement, + #superclass : #PyramidSpaceShortcutManagerPlugin, + #instVars : [ + 'navigationPlugin', + 'shortcutActionRemoveElement', + 'keyCombinationRemoveElement' + ], + #category : #'Pyramid-Bloc-plugin-shortcut-manager' +} + +{ #category : #accessing } +PyramidShortcutRemoveElement >> defaultKeyCombinationRemoveElement [ + "suppr / del to activate this shortcut" + keyCombinationRemoveElement := ((BlKeyCombination builder key: KeyboardKey delete) build) +] + +{ #category : #initialization } +PyramidShortcutRemoveElement >> initialize [ + + self defaultKeyCombinationRemoveElement +] + +{ #category : #accessing } +PyramidShortcutRemoveElement >> keyCombinationRemoveElement: aKeyCombination [ + + keyCombinationRemoveElement := aKeyCombination +] + +{ #category : #removing } +PyramidShortcutRemoveElement >> navigationPluginForRemoveElementFromPyramid: aPyramidEditor [ + + | removeElementPluginList | + removeElementPluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidNavigationPlugin ]. + removeElementPluginList size = 1 + ifFalse: [^ self]. + navigationPlugin := removeElementPluginList asArray first +] + +{ #category : #accessing } +PyramidShortcutRemoveElement >> shortcutActionRemoveElement [ + + ^ shortcutActionRemoveElement := BlShortcutWithAction new + name: 'Pyramid edition shortcut remove selected element'; + combination: keyCombinationRemoveElement; + action: [ :event | navigationPlugin ifNil: [ self inform: 'Plugin navigation is not installed' ] + ifNotNil: [ navigationPlugin removeSelectedElements ] ] +] diff --git a/src/Pyramid-Bloc/PyramidShortcutSave.class.st b/src/Pyramid-Bloc/PyramidShortcutSave.class.st new file mode 100644 index 00000000..f29b0372 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShortcutSave.class.st @@ -0,0 +1,54 @@ +" +This class used to create shortcut for saving in Pyramid space. + +Used the plugin-save in this package. +" +Class { + #name : #PyramidShortcutSave, + #superclass : #PyramidSpaceShortcutManagerPlugin, + #instVars : [ + 'savePlugin', + 'shortcutSave', + 'keyCombinationSave' + ], + #category : #'Pyramid-Bloc-plugin-shortcut-manager' +} + +{ #category : #accessing } +PyramidShortcutSave >> defaultKeyCombinationSave [ + "CTRL + S to activate this shortcut" + keyCombinationSave := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey S) build) +] + +{ #category : #initialization } +PyramidShortcutSave >> initialize [ + + self defaultKeyCombinationSave +] + +{ #category : #accessing } +PyramidShortcutSave >> keyCombinationSave: aKeyCombination [ + + ^ keyCombinationSave := aKeyCombination +] + +{ #category : #'as yet unclassified' } +PyramidShortcutSave >> savePluginFromPyramid: aPyramidEditor [ + + | savePluginList | + savePluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidSavePlugin ]. + savePluginList size = 1 + ifFalse: [^ self]. + savePlugin := savePluginList asArray first +] + +{ #category : #accessing } +PyramidShortcutSave >> shortcutActionSave [ + + ^ shortcutSave := BlShortcutWithAction new + name: 'Pyramid edition shortcut save'; + combination: keyCombinationSave; + action: [ :event | savePlugin + ifNil: [ self inform: 'Plugin save is not installed' ] + ifNotNil: [ savePlugin saveAction ] ] +] diff --git a/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st b/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st new file mode 100644 index 00000000..2fb1edfd --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st @@ -0,0 +1,65 @@ +" +This class used to create shortcut for select all element or all children from one selected element in Pyramid space. +" +Class { + #name : #PyramidShortcutSelectAllElement, + #superclass : #PyramidSpaceShortcutManagerPlugin, + #instVars : [ + 'keyCombinationSelectAll', + 'shortcutSelectAll', + 'projectModel' + ], + #category : #'Pyramid-Bloc-plugin-shortcut-manager' +} + +{ #category : #'as yet unclassified' } +PyramidShortcutSelectAllElement >> defaultKeyCombinationSelectAll [ + "CTRL + A to activate this shortcut" + keyCombinationSelectAll := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey A) build) +] + +{ #category : #initialization } +PyramidShortcutSelectAllElement >> initialize [ + + self defaultKeyCombinationSelectAll +] + +{ #category : #'as yet unclassified' } +PyramidShortcutSelectAllElement >> projectModelFromPyramid: aPyramidEditor [ + + projectModel := aPyramidEditor projectModel. +] + +{ #category : #'as yet unclassified' } +PyramidShortcutSelectAllElement >> selectAll [ + + projectModel selection asArray isEmpty + ifTrue: [ self selectAllElementInSpace ]. + projectModel selection asArray size = 1 + ifTrue: [ self selectAllChildrenOfSelectedElement ]. +] + +{ #category : #'as yet unclassified' } +PyramidShortcutSelectAllElement >> selectAllChildrenOfSelectedElement [ + + (projectModel selection collection asArray first) children isEmpty + ifTrue: [ self inform: 'No children to select in the selected element' ] + ifFalse: [ projectModel setSelection: (projectModel selection collection asArray first) children ] + +] + +{ #category : #'as yet unclassified' } +PyramidShortcutSelectAllElement >> selectAllElementInSpace [ + + projectModel setSelection: projectModel firstLevelElements collection +] + +{ #category : #accessing } +PyramidShortcutSelectAllElement >> shortcutActionSelectAll [ + + ^ shortcutSelectAll := BlShortcutWithAction new + name: 'Pyramid edition shortcut to select all element in space'; + combination: keyCombinationSelectAll; + action: [ :event | projectModel ifNil: [ self inform: 'problem with the project model' ] + ifNotNil: [ self selectAll ] ] +] diff --git a/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st b/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st new file mode 100644 index 00000000..4944c510 --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st @@ -0,0 +1,82 @@ +" +Class use to create the shortcut undo / redo. + +Use the history feature from the package Pyramid. +" +Class { + #name : #PyramidShortcutUndoRedo, + #superclass : #PyramidSpaceShortcutManagerPlugin, + #instVars : [ + 'historyPlugin', + 'shortcutUndo', + 'keyCombinationUndo', + 'shortcutRedo', + 'keyCombinationRedo' + ], + #category : #'Pyramid-Bloc-plugin-shortcut-manager' +} + +{ #category : #accessing } +PyramidShortcutUndoRedo >> defaultKeyCombinationRedo [ + "CTRL + Y to activate this shortcut" + keyCombinationRedo := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey Y) build) +] + +{ #category : #accessing } +PyramidShortcutUndoRedo >> defaultKeyCombinationUndo [ + "CTRL + Z to activate this shortcut" + keyCombinationUndo := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey Z) build) +] + +{ #category : #'as yet unclassified' } +PyramidShortcutUndoRedo >> historyPluginFromPyramid: aPyramidEditor [ + + | historyPluginList | + historyPluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidHistoryPlugin ]. + historyPluginList size = 1 + ifFalse: [^ self]. + historyPlugin := historyPluginList asArray first. +] + +{ #category : #initialization } +PyramidShortcutUndoRedo >> initialize [ + + self defaultKeyCombinationRedo. + self defaultKeyCombinationUndo. +] + +{ #category : #accessing } +PyramidShortcutUndoRedo >> keyCombinationRedo: aNewKeyCombination [ + + ^ keyCombinationRedo := aNewKeyCombination +] + +{ #category : #accessing } +PyramidShortcutUndoRedo >> keyCombinationUndo: aNewKeyCombination [ + + ^ keyCombinationUndo := aNewKeyCombination +] + +{ #category : #accessing } +PyramidShortcutUndoRedo >> shortcutActionRedo [ + + ^ shortcutRedo := BlShortcutWithAction new + name: 'Pyramid edition shortcut redo'; + combination: keyCombinationRedo; + action: [ :event | historyPlugin + ifNil: [ self inform: 'Plugin undo/redo is not installed' ] + ifNotNil: [ historyPlugin history redo. + historyPlugin projectModel informElementsChanged ] ] +] + +{ #category : #accessing } +PyramidShortcutUndoRedo >> shortcutActionUndo [ + + ^ shortcutUndo := BlShortcutWithAction new + name: 'Pyramid edition shortcut undo'; + combination: keyCombinationUndo; + action: [ :event | historyPlugin + ifNil: [ self inform: 'Plugin undo/redo is not installed' ] + ifNotNil: [ historyPlugin history undo. + historyPlugin projectModel informElementsChanged ] ] +] diff --git a/src/Pyramid-Bloc/PyramidSpacePlugin.class.st b/src/Pyramid-Bloc/PyramidSpacePlugin.class.st index e9459d12..744c2bb5 100644 --- a/src/Pyramid-Bloc/PyramidSpacePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSpacePlugin.class.st @@ -6,7 +6,8 @@ Class { #instVars : [ 'builder', 'morphicPresenter', - 'resetSpaceButton' + 'resetSpaceButton', + 'resetBloc' ], #category : #'Pyramid-Bloc-plugin-space' } @@ -37,6 +38,7 @@ PyramidSpacePlugin >> connectOn: aPyramidEditor [ { #category : #initialization } PyramidSpacePlugin >> initialize [ + resetBloc := [ :aSpace | ]. builder := PyramidSpaceBuilder defaultEditorBuilder. morphicPresenter := SpMorphPresenter new. resetSpaceButton := SpButtonPresenter new @@ -74,12 +76,25 @@ PyramidSpacePlugin >> morphicPresenter [ ^ morphicPresenter ] +{ #category : #accessing } +PyramidSpacePlugin >> resetBloc [ + + ^ resetBloc +] + +{ #category : #accessing } +PyramidSpacePlugin >> resetBloc: aBlock [ + + resetBloc := aBlock +] + { #category : #initialization } PyramidSpacePlugin >> resetSpace [ | space | space := self builder build. self makePresenterWithBlSpace: space. + resetBloc value: space. space show ] diff --git a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st new file mode 100644 index 00000000..9ced52ef --- /dev/null +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st @@ -0,0 +1,132 @@ +" +This class is use to add shortcut to the space in pyramid to use feature, you can check the PyramidShortcutUndoRedo as exemple. + +Shortcut only works when the space of Pyramid have the focus. + +List of current active shortcut (default value) : +- Save -> ctrl + S +- Undo -> ctrl + Z +- Redo -> ctrl + Y +- Copy -> ctrl + C +- Paste -> ctrl + V +- Grid visibility switch -> ctrl + G +- Select all element -> ctrl + A +- Delete selected element -> delete or suppr +" +Class { + #name : #PyramidSpaceShortcutManagerPlugin, + #superclass : #Object, + #traits : 'TPyramidPlugin', + #classTraits : 'TPyramidPlugin classTrait', + #instVars : [ + 'shortcutCollection', + 'shortcutUndoRedo', + 'shortcutCopyPaste', + 'shortcutSaveAction', + 'shortcutGrid', + 'shortcutRemoveElement', + 'shortcutSelectAllElement' + ], + #category : #'Pyramid-Bloc-plugin-shortcut-manager' +} + +{ #category : #adding } +PyramidSpaceShortcutManagerPlugin >> addAllShortcutInCollection [ + "Default values of the different shortcut" + + "Shortcut Undo (ctrl + Z) / Redo (ctrl + Y) " + shortcutCollection add: shortcutUndoRedo shortcutActionUndo. + shortcutCollection add: shortcutUndoRedo shortcutActionRedo. + + "Shortcut Copy (ctrl + C) / Paste (ctrl + V)" + shortcutCollection add: shortcutCopyPaste shortcutActionCopy. + shortcutCollection add: shortcutCopyPaste shortcutActionPaste. + + "Shortcut Save (ctrl + S)" + shortcutCollection add: shortcutSaveAction shortcutActionSave. + + "Shortcut grid" + "Grid visibility (ctrl + G)" + shortcutCollection add: shortcutGrid shortcutActionGridVisibility. + + "Shortcut Remove Element (suppr / del)" + shortcutCollection add: shortcutRemoveElement shortcutActionRemoveElement. + + "Shortcut Select all element in space (ctrl + A)" + shortcutCollection add: shortcutSelectAllElement shortcutActionSelectAll. + + "New shortcut to add under this comment, keep the same patern as before" + +] + +{ #category : #accessing } +PyramidSpaceShortcutManagerPlugin >> addAllShortcutInSpace: aSpace [ + + self addAllShortcutInCollection. + shortcutCollection do: [ :shortcut | aSpace root addShortcut: shortcut ]. + + +] + +{ #category : #connecting } +PyramidSpaceShortcutManagerPlugin >> connectOn: aPyramidEditor [ + + | spacePlugin spacePluginSet | + + "Get the space plugin to adding shortcut" + spacePluginSet := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidSpacePlugin ]. + spacePluginSet size = 1 + ifFalse: [self inform: 'Space plugin is not installed -> impossible to install shortcut to the space'. + ^ self]. + spacePlugin := spacePluginSet asArray first. + + "Get History plugin for Undo / Redo shortcut" + shortcutUndoRedo historyPluginFromPyramid: aPyramidEditor. + + "Get Copy Paste plugin" + shortcutCopyPaste copyPastePluginFromPyramid: aPyramidEditor. + + "Get Save plugin" + shortcutSaveAction savePluginFromPyramid: aPyramidEditor. + + "Get space MainExtension" + shortcutGrid gridFeatureFromSpacePlugin: aPyramidEditor. + + "Get Navigation Plugin for shortcut remove element" + shortcutRemoveElement navigationPluginForRemoveElementFromPyramid: aPyramidEditor. + + shortcutSelectAllElement projectModelFromPyramid: aPyramidEditor. + + "Adding shortcut to Pyramid" + spacePlugin resetBloc: [ :aSpace | self refreshAllShortcutInSpace: aSpace ]. + spacePlugin resetSpace. +] + +{ #category : #initialization } +PyramidSpaceShortcutManagerPlugin >> initialize [ + + shortcutCollection := OrderedCollection new. + + shortcutUndoRedo := PyramidShortcutUndoRedo new. + shortcutCopyPaste := PyramidShortcutCopyPaste new. + shortcutSaveAction := PyramidShortcutSave new. + shortcutGrid := PyramidShortcutGrid new. + shortcutRemoveElement := PyramidShortcutRemoveElement new. + shortcutSelectAllElement := PyramidShortcutSelectAllElement new. +] + +{ #category : #'as yet unclassified' } +PyramidSpaceShortcutManagerPlugin >> refreshAllShortcutInSpace: aSpace [ + + self removeAllShortcutInSpace: aSpace. + self addAllShortcutInSpace: aSpace. + + +] + +{ #category : #removing } +PyramidSpaceShortcutManagerPlugin >> removeAllShortcutInSpace: aSpace [ + + shortcutCollection do: [ :shortcut | aSpace root removeShortcut: shortcut ]. + shortcutCollection removeAll. +] From fb1426bb19cccad06d0b6b5cff4c1eb149e372df Mon Sep 17 00:00:00 2001 From: Sully Millet <119430426+SullyMLT@users.noreply.github.com> Date: Mon, 30 Jun 2025 12:04:00 +0200 Subject: [PATCH 02/10] Update .smalltalk.ston --- .smalltalk.ston | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.smalltalk.ston b/.smalltalk.ston index b061e401..69bf48aa 100644 --- a/.smalltalk.ston +++ b/.smalltalk.ston @@ -6,6 +6,9 @@ SmalltalkCISpec { SCIMetacelloLoadSpec { #baseline : 'Pyramid', #directory : 'src', + #onConflict : #useLoaded, + #onUpgrade : #useLoaded, + #onWarningLog : true, #platforms : [ #pharo ] } ], From 218e49fcde15e8508e6dd08068e39d1c6d7cf14c Mon Sep 17 00:00:00 2001 From: Sully Millet <119430426+SullyMLT@users.noreply.github.com> Date: Mon, 30 Jun 2025 12:22:24 +0200 Subject: [PATCH 03/10] Update README.md --- README.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1c605b3f..13d3fa87 100644 --- a/README.md +++ b/README.md @@ -36,20 +36,32 @@ To install a version of Pyramid, use one of the following scripts inside a playg ### Latest development version ```st -Metacello new +[[ + Metacello new baseline: 'Pyramid'; - repository: 'github://OpenSmock/Pyramid:main/src'; - load + repository: 'github://OpenSmock/Pyramid:stage-dev-shortcuts/src'; + onConflict: [ :ex :loaded :incoming | ex useLoaded ]; + onUpgrade: [ :ex :loaded :incoming | ex useLoaded ]; + ignoreImage; + load. + ] on: MCMergeOrLoadWarning do: [ :warning | warning load ] +] on: Warning do: [ :w | w resume ]. ``` Only with Bloc (without Toplo features): ```st -Metacello new +[[ + Metacello new baseline: 'Pyramid'; - repository: 'github://OpenSmock/Pyramid:main/src'; - load: 'BlocUI'; - load + repository: 'github://OpenSmock/Pyramid:stage-dev-shortcuts/src'; + onConflict: [ :ex :loaded :incoming | ex useLoaded ]; + onUpgrade: [ :ex :loaded :incoming | ex useLoaded ]; + ignoreImage; + load: 'BlocUI'; + load. + ] on: MCMergeOrLoadWarning do: [ :warning | warning load ] +] on: Warning do: [ :w | w resume ]. ``` ### Release version From fa360b4aac6ed051a3ac466807cbc7d6f23d04a9 Mon Sep 17 00:00:00 2001 From: SullyMLT Date: Mon, 30 Jun 2025 15:06:06 +0200 Subject: [PATCH 04/10] Adding Cut to the actual shortcut, PyramidShortcutCopyPaste rename into PyramidShortcutCopyPasteCut --- ...t => PyramidShortcutCopyPasteCut.class.st} | 79 +++++++++++++------ ...PyramidSpaceShortcutManagerPlugin.class.st | 20 ++--- 2 files changed, 68 insertions(+), 31 deletions(-) rename src/Pyramid-Bloc/{PyramidShortcutCopyPaste.class.st => PyramidShortcutCopyPasteCut.class.st} (55%) diff --git a/src/Pyramid-Bloc/PyramidShortcutCopyPaste.class.st b/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st similarity index 55% rename from src/Pyramid-Bloc/PyramidShortcutCopyPaste.class.st rename to src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st index e9c10797..5da1f287 100644 --- a/src/Pyramid-Bloc/PyramidShortcutCopyPaste.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st @@ -4,43 +4,53 @@ This class is used to create the shortcut for copy and paste -> use the plugin-c It use the editor to get the collection of selected object from project model in Pyramid space. " Class { - #name : #PyramidShortcutCopyPaste, + #name : #PyramidShortcutCopyPasteCut, #superclass : #PyramidSpaceShortcutManagerPlugin, #instVars : [ 'copyPastePlugin', + 'navigationPlugin', 'shortcutCopy', 'shortcutPaste', 'keyCombinationCopy', 'keyCombinationPaste', - 'elementCollectionSelected' + 'elementCollectionSelected', + 'keyCombinationCut', + 'shortcutCut' ], #category : #'Pyramid-Bloc-plugin-shortcut-manager' } -{ #category : #accessing } -PyramidShortcutCopyPaste >> copyPastePlugin: aPlugin [ - - copyPastePlugin := aPlugin -] - { #category : #'as yet unclassified' } -PyramidShortcutCopyPaste >> copyPastePluginFromPyramid: aPyramidEditor [ +PyramidShortcutCopyPasteCut >> copyPasteCutPluginFromPyramid: aPyramidEditor [ - | copyPastePluginList | + | copyPastePluginList navigationPluginList | + "get copyPastePlugin" self elementCollectionSelected: aPyramidEditor. copyPastePluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidCopyPastePlugin ]. copyPastePluginList size = 1 ifFalse: [^ self]. - copyPastePlugin := copyPastePluginList asArray first + copyPastePlugin := copyPastePluginList asArray first. + + "Get navigationPlugin" + navigationPluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidNavigationPlugin ]. + navigationPluginList size = 1 + ifFalse: [^ self]. + navigationPlugin := navigationPluginList asArray first +] + +{ #category : #accessing } +PyramidShortcutCopyPasteCut >> copyPastePlugin: aPlugin [ + + copyPastePlugin := aPlugin ] { #category : #testing } -PyramidShortcutCopyPaste >> copySelectedElementInSpace [ +PyramidShortcutCopyPasteCut >> copySelectedElementInSpace [ elementCollectionSelected isEmpty ifTrue: [ ^ self ]. elementCollectionSelected size = 1 - ifTrue: [ elementCollectionSelected do: [ :element | copyPastePlugin copyAsStonInClipboard: element ]. ] + ifTrue: [ elementCollectionSelected do: [ :element | copyPastePlugin copyAsStonInClipboard: element ]. ^ 1 ] ifFalse: [ self inform: 'Can not copy multiple element' ] @@ -48,44 +58,57 @@ PyramidShortcutCopyPaste >> copySelectedElementInSpace [ ] { #category : #accessing } -PyramidShortcutCopyPaste >> defaultKeyCombinationCopy [ +PyramidShortcutCopyPasteCut >> defaultKeyCombinationCopy [ "CTRL + C to activate this shortcut" keyCombinationCopy := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey C) build) ] { #category : #accessing } -PyramidShortcutCopyPaste >> defaultKeyCombinationPaste [ +PyramidShortcutCopyPasteCut >> defaultKeyCombinationCut [ + "CTRL + X to activate this shortcut" + keyCombinationCut := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey X) build) +] + +{ #category : #accessing } +PyramidShortcutCopyPasteCut >> defaultKeyCombinationPaste [ "CTRL + V to activate this shortcut" keyCombinationPaste := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey V) build) ] { #category : #accessing } -PyramidShortcutCopyPaste >> elementCollectionSelected: aPyramidEditor [ +PyramidShortcutCopyPasteCut >> elementCollectionSelected: aPyramidEditor [ elementCollectionSelected := (aPyramidEditor projectModel selection) collection. ] { #category : #initialization } -PyramidShortcutCopyPaste >> initialize [ +PyramidShortcutCopyPasteCut >> initialize [ self defaultKeyCombinationCopy. self defaultKeyCombinationPaste. + self defaultKeyCombinationCut. ] { #category : #accessing } -PyramidShortcutCopyPaste >> keyCombinationCopy: aKeyCombination [ +PyramidShortcutCopyPasteCut >> keyCombinationCopy: aKeyCombination [ ^ keyCombinationCopy := aKeyCombination ] { #category : #accessing } -PyramidShortcutCopyPaste >> keyCombinationPaste: aKeyCombination [ +PyramidShortcutCopyPasteCut >> keyCombinationCut: aKeyCombination [ + + ^ keyCombinationCut := aKeyCombination +] + +{ #category : #accessing } +PyramidShortcutCopyPasteCut >> keyCombinationPaste: aKeyCombination [ ^ keyCombinationPaste := aKeyCombination ] { #category : #testing } -PyramidShortcutCopyPaste >> pasteElement [ +PyramidShortcutCopyPasteCut >> pasteElement [ elementCollectionSelected isEmpty ifTrue: [ copyPastePlugin pasteFromClipboardOnFirstLevelElements ]. @@ -97,7 +120,7 @@ PyramidShortcutCopyPaste >> pasteElement [ ] { #category : #accessing } -PyramidShortcutCopyPaste >> shortcutActionCopy [ +PyramidShortcutCopyPasteCut >> shortcutActionCopy [ ^ shortcutCopy := BlShortcutWithAction new name: 'Pyramid edition shortcut copy'; @@ -108,7 +131,19 @@ PyramidShortcutCopyPaste >> shortcutActionCopy [ ] { #category : #accessing } -PyramidShortcutCopyPaste >> shortcutActionPaste [ +PyramidShortcutCopyPasteCut >> shortcutActionCut [ + + ^ shortcutCut := BlShortcutWithAction new + name: 'Pyramid edition shortcut paste'; + combination: keyCombinationCut; + action: [ :event | copyPastePlugin + ifNil: [ self inform: 'Plugin Copy/Paste is not installed' ] + ifNotNil: [ self copySelectedElementInSpace = 1 + ifTrue: [ navigationPlugin removeSelectedElements ] ] ] +] + +{ #category : #accessing } +PyramidShortcutCopyPasteCut >> shortcutActionPaste [ ^ shortcutPaste := BlShortcutWithAction new name: 'Pyramid edition shortcut paste'; diff --git a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st index 9ced52ef..793c7000 100644 --- a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st @@ -4,13 +4,14 @@ This class is use to add shortcut to the space in pyramid to use feature, you ca Shortcut only works when the space of Pyramid have the focus. List of current active shortcut (default value) : -- Save -> ctrl + S -- Undo -> ctrl + Z -- Redo -> ctrl + Y -- Copy -> ctrl + C -- Paste -> ctrl + V -- Grid visibility switch -> ctrl + G -- Select all element -> ctrl + A +- Save -> ctrl left + S +- Undo -> ctrl left + Z +- Redo -> ctrl left + Y +- Copy -> ctrl left + C +- Paste -> ctrl left + V +- Cut -> ctrl left + X +- Grid visibility switch -> ctrl left + G +- Select all element -> ctrl left + A - Delete selected element -> delete or suppr " Class { @@ -41,6 +42,7 @@ PyramidSpaceShortcutManagerPlugin >> addAllShortcutInCollection [ "Shortcut Copy (ctrl + C) / Paste (ctrl + V)" shortcutCollection add: shortcutCopyPaste shortcutActionCopy. shortcutCollection add: shortcutCopyPaste shortcutActionPaste. + shortcutCollection add: shortcutCopyPaste shortcutActionCut. "Shortcut Save (ctrl + S)" shortcutCollection add: shortcutSaveAction shortcutActionSave. @@ -84,7 +86,7 @@ PyramidSpaceShortcutManagerPlugin >> connectOn: aPyramidEditor [ shortcutUndoRedo historyPluginFromPyramid: aPyramidEditor. "Get Copy Paste plugin" - shortcutCopyPaste copyPastePluginFromPyramid: aPyramidEditor. + shortcutCopyPaste copyPasteCutPluginFromPyramid: aPyramidEditor. "Get Save plugin" shortcutSaveAction savePluginFromPyramid: aPyramidEditor. @@ -108,7 +110,7 @@ PyramidSpaceShortcutManagerPlugin >> initialize [ shortcutCollection := OrderedCollection new. shortcutUndoRedo := PyramidShortcutUndoRedo new. - shortcutCopyPaste := PyramidShortcutCopyPaste new. + shortcutCopyPaste := PyramidShortcutCopyPasteCut new. shortcutSaveAction := PyramidShortcutSave new. shortcutGrid := PyramidShortcutGrid new. shortcutRemoveElement := PyramidShortcutRemoveElement new. From a6777b1a49b5f53d7bf5a234b33ffd960fad0149 Mon Sep 17 00:00:00 2001 From: SullyMLT Date: Mon, 30 Jun 2025 15:36:37 +0200 Subject: [PATCH 05/10] Adding Inspect selected element to actual shortcut -> PyramidShortcutInspectSelectedElement, Key combination ctrl left + i --- ...midShortcutInspectSelectedElement.class.st | 45 +++++++++++++++++++ ...PyramidSpaceShortcutManagerPlugin.class.st | 11 ++++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st diff --git a/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st b/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st new file mode 100644 index 00000000..5a54513a --- /dev/null +++ b/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st @@ -0,0 +1,45 @@ +Class { + #name : #PyramidShortcutInspectSelectedElement, + #superclass : #PyramidSpaceShortcutManagerPlugin, + #instVars : [ + 'projectModel', + 'keyCombinationInspect', + 'shortcutInspect' + ], + #category : #'Pyramid-Bloc-plugin-shortcut-manager' +} + +{ #category : #'as yet unclassified' } +PyramidShortcutInspectSelectedElement >> defaultKeyCombinationInspect [ + "CTRL + S to activate this shortcut" + keyCombinationInspect := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey I) build) +] + +{ #category : #initialization } +PyramidShortcutInspectSelectedElement >> initialize [ + + self defaultKeyCombinationInspect. +] + +{ #category : #accessing } +PyramidShortcutInspectSelectedElement >> keyCombinationInspect: aKeyCombination [ + + ^ keyCombinationInspect := aKeyCombination +] + +{ #category : #'as yet unclassified' } +PyramidShortcutInspectSelectedElement >> projectModelFromPyramid: aPyramidEditor [ + + projectModel := aPyramidEditor projectModel +] + +{ #category : #'as yet unclassified' } +PyramidShortcutInspectSelectedElement >> shortcutActionInspect [ + + ^ shortcutInspect := BlShortcutWithAction new + name: 'Pyramid edition shortcut save'; + combination: keyCombinationInspect; + action: [ :event | projectModel selection size = 1 + ifTrue: [ (projectModel selection first) inspect ] + ifFalse: [ self inform: 'Cannot inspect zero or multiple selected element' ] ] +] diff --git a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st index 793c7000..fe74f16d 100644 --- a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st @@ -13,6 +13,7 @@ List of current active shortcut (default value) : - Grid visibility switch -> ctrl left + G - Select all element -> ctrl left + A - Delete selected element -> delete or suppr +- Inspect one selected element -> ctrl left + I " Class { #name : #PyramidSpaceShortcutManagerPlugin, @@ -26,7 +27,8 @@ Class { 'shortcutSaveAction', 'shortcutGrid', 'shortcutRemoveElement', - 'shortcutSelectAllElement' + 'shortcutSelectAllElement', + 'shortcutInspectSelectedElement' ], #category : #'Pyramid-Bloc-plugin-shortcut-manager' } @@ -57,6 +59,9 @@ PyramidSpaceShortcutManagerPlugin >> addAllShortcutInCollection [ "Shortcut Select all element in space (ctrl + A)" shortcutCollection add: shortcutSelectAllElement shortcutActionSelectAll. + "Shortcut inspect selected element (ctrl + I)" + shortcutCollection add: shortcutInspectSelectedElement shortcutActionInspect. + "New shortcut to add under this comment, keep the same patern as before" ] @@ -99,6 +104,9 @@ PyramidSpaceShortcutManagerPlugin >> connectOn: aPyramidEditor [ shortcutSelectAllElement projectModelFromPyramid: aPyramidEditor. + "Get projectModelFromPyramid for Inspect selected element" + shortcutInspectSelectedElement projectModelFromPyramid: aPyramidEditor. + "Adding shortcut to Pyramid" spacePlugin resetBloc: [ :aSpace | self refreshAllShortcutInSpace: aSpace ]. spacePlugin resetSpace. @@ -115,6 +123,7 @@ PyramidSpaceShortcutManagerPlugin >> initialize [ shortcutGrid := PyramidShortcutGrid new. shortcutRemoveElement := PyramidShortcutRemoveElement new. shortcutSelectAllElement := PyramidShortcutSelectAllElement new. + shortcutInspectSelectedElement := PyramidShortcutInspectSelectedElement new. ] { #category : #'as yet unclassified' } From 8842c304867da580837af7a568ab1bf2e4998e3d Mon Sep 17 00:00:00 2001 From: SullyMLT Date: Mon, 30 Jun 2025 16:40:13 +0200 Subject: [PATCH 06/10] Editing shortcut from ctrl left to ctrlRight or ctrlLeft or cmd --- .../PyramidShortcutCopyPasteCut.class.st | 6 +++--- src/Pyramid-Bloc/PyramidShortcutGrid.class.st | 2 +- ...amidShortcutInspectSelectedElement.class.st | 2 +- src/Pyramid-Bloc/PyramidShortcutSave.class.st | 2 +- .../PyramidShortcutSelectAllElement.class.st | 2 +- .../PyramidShortcutUndoRedo.class.st | 4 ++-- .../PyramidSpaceShortcutManagerPlugin.class.st | 18 +++++++++--------- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st b/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st index 5da1f287..ea76c2e2 100644 --- a/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st @@ -60,19 +60,19 @@ PyramidShortcutCopyPasteCut >> copySelectedElementInSpace [ { #category : #accessing } PyramidShortcutCopyPasteCut >> defaultKeyCombinationCopy [ "CTRL + C to activate this shortcut" - keyCombinationCopy := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey C) build) + keyCombinationCopy := ((BlKeyCombination builder primary key: KeyboardKey C) build) ] { #category : #accessing } PyramidShortcutCopyPasteCut >> defaultKeyCombinationCut [ "CTRL + X to activate this shortcut" - keyCombinationCut := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey X) build) + keyCombinationCut := ((BlKeyCombination builder primary key: KeyboardKey X) build) ] { #category : #accessing } PyramidShortcutCopyPasteCut >> defaultKeyCombinationPaste [ "CTRL + V to activate this shortcut" - keyCombinationPaste := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey V) build) + keyCombinationPaste := ((BlKeyCombination builder primary key: KeyboardKey V) build) ] { #category : #accessing } diff --git a/src/Pyramid-Bloc/PyramidShortcutGrid.class.st b/src/Pyramid-Bloc/PyramidShortcutGrid.class.st index 4059c2a6..c4f2be40 100644 --- a/src/Pyramid-Bloc/PyramidShortcutGrid.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutGrid.class.st @@ -19,7 +19,7 @@ Class { { #category : #accessing } PyramidShortcutGrid >> defaultKeyCombinationGridVisibility [ "CTRL + G to activate this shortcut" - keyCombinationGridVisibility := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey G) build) + keyCombinationGridVisibility := ((BlKeyCombination builder primary key: KeyboardKey G) build) ] { #category : #'as yet unclassified' } diff --git a/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st b/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st index 5a54513a..581e3d36 100644 --- a/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st @@ -12,7 +12,7 @@ Class { { #category : #'as yet unclassified' } PyramidShortcutInspectSelectedElement >> defaultKeyCombinationInspect [ "CTRL + S to activate this shortcut" - keyCombinationInspect := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey I) build) + keyCombinationInspect := ((BlKeyCombination builder primary key: KeyboardKey I) build) ] { #category : #initialization } diff --git a/src/Pyramid-Bloc/PyramidShortcutSave.class.st b/src/Pyramid-Bloc/PyramidShortcutSave.class.st index f29b0372..a1b1f0bc 100644 --- a/src/Pyramid-Bloc/PyramidShortcutSave.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutSave.class.st @@ -17,7 +17,7 @@ Class { { #category : #accessing } PyramidShortcutSave >> defaultKeyCombinationSave [ "CTRL + S to activate this shortcut" - keyCombinationSave := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey S) build) + keyCombinationSave := ((BlKeyCombination builder primary key: KeyboardKey S) build) ] { #category : #initialization } diff --git a/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st b/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st index 2fb1edfd..61ec1f5b 100644 --- a/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st @@ -15,7 +15,7 @@ Class { { #category : #'as yet unclassified' } PyramidShortcutSelectAllElement >> defaultKeyCombinationSelectAll [ "CTRL + A to activate this shortcut" - keyCombinationSelectAll := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey A) build) + keyCombinationSelectAll := ((BlKeyCombination builder primary key: KeyboardKey A) build) ] { #category : #initialization } diff --git a/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st b/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st index 4944c510..29946a80 100644 --- a/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st @@ -19,13 +19,13 @@ Class { { #category : #accessing } PyramidShortcutUndoRedo >> defaultKeyCombinationRedo [ "CTRL + Y to activate this shortcut" - keyCombinationRedo := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey Y) build) + keyCombinationRedo := ((BlKeyCombination builder primary key: KeyboardKey Y) build) ] { #category : #accessing } PyramidShortcutUndoRedo >> defaultKeyCombinationUndo [ "CTRL + Z to activate this shortcut" - keyCombinationUndo := ((BlKeyCombination builder key: KeyboardKey controlLeft; key: KeyboardKey Z) build) + keyCombinationUndo := ((BlKeyCombination builder primary key: KeyboardKey Z) build) ] { #category : #'as yet unclassified' } diff --git a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st index fe74f16d..956e8e40 100644 --- a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st @@ -4,16 +4,16 @@ This class is use to add shortcut to the space in pyramid to use feature, you ca Shortcut only works when the space of Pyramid have the focus. List of current active shortcut (default value) : -- Save -> ctrl left + S -- Undo -> ctrl left + Z -- Redo -> ctrl left + Y -- Copy -> ctrl left + C -- Paste -> ctrl left + V -- Cut -> ctrl left + X -- Grid visibility switch -> ctrl left + G -- Select all element -> ctrl left + A +- Save -> ctrl + S +- Undo -> ctrl + Z +- Redo -> ctrl + Y +- Copy -> ctrl + C +- Paste -> ctrl + V +- Cut -> ctrl + X +- Grid visibility switch -> ctrl + G +- Select all element -> ctrl + A - Delete selected element -> delete or suppr -- Inspect one selected element -> ctrl left + I +- Inspect one selected element -> ctrl + I " Class { #name : #PyramidSpaceShortcutManagerPlugin, From 2d6bc7a17711eef68d7f7836f714eed29aa1fea1 Mon Sep 17 00:00:00 2001 From: SullyMLT Date: Mon, 30 Jun 2025 17:09:20 +0200 Subject: [PATCH 07/10] Move message into protocole and rename resetBloc -> resetShortcutBlock --- .../PyramidShortcutCopyPasteCut.class.st | 6 +++--- src/Pyramid-Bloc/PyramidShortcutGrid.class.st | 2 +- .../PyramidShortcutInspectSelectedElement.class.st | 6 +++--- src/Pyramid-Bloc/PyramidShortcutSave.class.st | 2 +- .../PyramidShortcutSelectAllElement.class.st | 10 +++++----- src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st | 2 +- src/Pyramid-Bloc/PyramidSpacePlugin.class.st | 14 +++++++------- .../PyramidSpaceShortcutManagerPlugin.class.st | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st b/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st index ea76c2e2..71178e8b 100644 --- a/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st @@ -20,7 +20,7 @@ Class { #category : #'Pyramid-Bloc-plugin-shortcut-manager' } -{ #category : #'as yet unclassified' } +{ #category : #'accessing - classes' } PyramidShortcutCopyPasteCut >> copyPasteCutPluginFromPyramid: aPyramidEditor [ | copyPastePluginList navigationPluginList | @@ -44,7 +44,7 @@ PyramidShortcutCopyPasteCut >> copyPastePlugin: aPlugin [ copyPastePlugin := aPlugin ] -{ #category : #testing } +{ #category : #action } PyramidShortcutCopyPasteCut >> copySelectedElementInSpace [ elementCollectionSelected isEmpty @@ -107,7 +107,7 @@ PyramidShortcutCopyPasteCut >> keyCombinationPaste: aKeyCombination [ ^ keyCombinationPaste := aKeyCombination ] -{ #category : #testing } +{ #category : #action } PyramidShortcutCopyPasteCut >> pasteElement [ elementCollectionSelected isEmpty diff --git a/src/Pyramid-Bloc/PyramidShortcutGrid.class.st b/src/Pyramid-Bloc/PyramidShortcutGrid.class.st index c4f2be40..bd7e30af 100644 --- a/src/Pyramid-Bloc/PyramidShortcutGrid.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutGrid.class.st @@ -22,7 +22,7 @@ PyramidShortcutGrid >> defaultKeyCombinationGridVisibility [ keyCombinationGridVisibility := ((BlKeyCombination builder primary key: KeyboardKey G) build) ] -{ #category : #'as yet unclassified' } +{ #category : #'accessing - classes' } PyramidShortcutGrid >> gridFeatureFromSpacePlugin: aPyramidEditor [ | spacePlugin spacePluginSet listOfSpaceExtension pyramidMainExtensionSet | diff --git a/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st b/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st index 581e3d36..8556fbe7 100644 --- a/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st @@ -9,7 +9,7 @@ Class { #category : #'Pyramid-Bloc-plugin-shortcut-manager' } -{ #category : #'as yet unclassified' } +{ #category : #accessing } PyramidShortcutInspectSelectedElement >> defaultKeyCombinationInspect [ "CTRL + S to activate this shortcut" keyCombinationInspect := ((BlKeyCombination builder primary key: KeyboardKey I) build) @@ -27,13 +27,13 @@ PyramidShortcutInspectSelectedElement >> keyCombinationInspect: aKeyCombination ^ keyCombinationInspect := aKeyCombination ] -{ #category : #'as yet unclassified' } +{ #category : #'accessing - classes' } PyramidShortcutInspectSelectedElement >> projectModelFromPyramid: aPyramidEditor [ projectModel := aPyramidEditor projectModel ] -{ #category : #'as yet unclassified' } +{ #category : #accessing } PyramidShortcutInspectSelectedElement >> shortcutActionInspect [ ^ shortcutInspect := BlShortcutWithAction new diff --git a/src/Pyramid-Bloc/PyramidShortcutSave.class.st b/src/Pyramid-Bloc/PyramidShortcutSave.class.st index a1b1f0bc..ef2b7550 100644 --- a/src/Pyramid-Bloc/PyramidShortcutSave.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutSave.class.st @@ -32,7 +32,7 @@ PyramidShortcutSave >> keyCombinationSave: aKeyCombination [ ^ keyCombinationSave := aKeyCombination ] -{ #category : #'as yet unclassified' } +{ #category : #'accessing - classes' } PyramidShortcutSave >> savePluginFromPyramid: aPyramidEditor [ | savePluginList | diff --git a/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st b/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st index 61ec1f5b..ce5f25e7 100644 --- a/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st @@ -12,7 +12,7 @@ Class { #category : #'Pyramid-Bloc-plugin-shortcut-manager' } -{ #category : #'as yet unclassified' } +{ #category : #accessing } PyramidShortcutSelectAllElement >> defaultKeyCombinationSelectAll [ "CTRL + A to activate this shortcut" keyCombinationSelectAll := ((BlKeyCombination builder primary key: KeyboardKey A) build) @@ -24,13 +24,13 @@ PyramidShortcutSelectAllElement >> initialize [ self defaultKeyCombinationSelectAll ] -{ #category : #'as yet unclassified' } +{ #category : #'accessing - classes' } PyramidShortcutSelectAllElement >> projectModelFromPyramid: aPyramidEditor [ projectModel := aPyramidEditor projectModel. ] -{ #category : #'as yet unclassified' } +{ #category : #action } PyramidShortcutSelectAllElement >> selectAll [ projectModel selection asArray isEmpty @@ -39,7 +39,7 @@ PyramidShortcutSelectAllElement >> selectAll [ ifTrue: [ self selectAllChildrenOfSelectedElement ]. ] -{ #category : #'as yet unclassified' } +{ #category : #action } PyramidShortcutSelectAllElement >> selectAllChildrenOfSelectedElement [ (projectModel selection collection asArray first) children isEmpty @@ -48,7 +48,7 @@ PyramidShortcutSelectAllElement >> selectAllChildrenOfSelectedElement [ ] -{ #category : #'as yet unclassified' } +{ #category : #action } PyramidShortcutSelectAllElement >> selectAllElementInSpace [ projectModel setSelection: projectModel firstLevelElements collection diff --git a/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st b/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st index 29946a80..fee2dc02 100644 --- a/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st @@ -28,7 +28,7 @@ PyramidShortcutUndoRedo >> defaultKeyCombinationUndo [ keyCombinationUndo := ((BlKeyCombination builder primary key: KeyboardKey Z) build) ] -{ #category : #'as yet unclassified' } +{ #category : #'accessing - classes' } PyramidShortcutUndoRedo >> historyPluginFromPyramid: aPyramidEditor [ | historyPluginList | diff --git a/src/Pyramid-Bloc/PyramidSpacePlugin.class.st b/src/Pyramid-Bloc/PyramidSpacePlugin.class.st index 744c2bb5..df836934 100644 --- a/src/Pyramid-Bloc/PyramidSpacePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSpacePlugin.class.st @@ -7,7 +7,7 @@ Class { 'builder', 'morphicPresenter', 'resetSpaceButton', - 'resetBloc' + 'resetShortcutBlock' ], #category : #'Pyramid-Bloc-plugin-space' } @@ -38,7 +38,7 @@ PyramidSpacePlugin >> connectOn: aPyramidEditor [ { #category : #initialization } PyramidSpacePlugin >> initialize [ - resetBloc := [ :aSpace | ]. + resetShortcutBlock := [ :aSpace | ]. builder := PyramidSpaceBuilder defaultEditorBuilder. morphicPresenter := SpMorphPresenter new. resetSpaceButton := SpButtonPresenter new @@ -77,15 +77,15 @@ PyramidSpacePlugin >> morphicPresenter [ ] { #category : #accessing } -PyramidSpacePlugin >> resetBloc [ +PyramidSpacePlugin >> resetShortcutBlock [ - ^ resetBloc + ^ resetShortcutBlock ] { #category : #accessing } -PyramidSpacePlugin >> resetBloc: aBlock [ +PyramidSpacePlugin >> resetShortcutBlock: aBlock [ - resetBloc := aBlock + resetShortcutBlock := aBlock ] { #category : #initialization } @@ -94,7 +94,7 @@ PyramidSpacePlugin >> resetSpace [ | space | space := self builder build. self makePresenterWithBlSpace: space. - resetBloc value: space. + resetShortcutBlock value: space. space show ] diff --git a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st index 956e8e40..0681337b 100644 --- a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st @@ -108,7 +108,7 @@ PyramidSpaceShortcutManagerPlugin >> connectOn: aPyramidEditor [ shortcutInspectSelectedElement projectModelFromPyramid: aPyramidEditor. "Adding shortcut to Pyramid" - spacePlugin resetBloc: [ :aSpace | self refreshAllShortcutInSpace: aSpace ]. + spacePlugin resetShortcutBlock: [ :aSpace | self refreshAllShortcutInSpace: aSpace ]. spacePlugin resetSpace. ] @@ -126,7 +126,7 @@ PyramidSpaceShortcutManagerPlugin >> initialize [ shortcutInspectSelectedElement := PyramidShortcutInspectSelectedElement new. ] -{ #category : #'as yet unclassified' } +{ #category : #action } PyramidSpaceShortcutManagerPlugin >> refreshAllShortcutInSpace: aSpace [ self removeAllShortcutInSpace: aSpace. From 61da39a8587f8315f7deb57b2eb27fc7b3bd45b0 Mon Sep 17 00:00:00 2001 From: SullyMLT Date: Mon, 30 Jun 2025 17:11:18 +0200 Subject: [PATCH 08/10] Rename message and move into the right protocol --- src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st | 4 ++-- src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st b/src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st index b2886ea4..907b1277 100644 --- a/src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st @@ -32,8 +32,8 @@ PyramidShortcutRemoveElement >> keyCombinationRemoveElement: aKeyCombination [ keyCombinationRemoveElement := aKeyCombination ] -{ #category : #removing } -PyramidShortcutRemoveElement >> navigationPluginForRemoveElementFromPyramid: aPyramidEditor [ +{ #category : #'accessing - classes' } +PyramidShortcutRemoveElement >> navigationPluginFromPyramid: aPyramidEditor [ | removeElementPluginList | removeElementPluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidNavigationPlugin ]. diff --git a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st index 0681337b..8bac3f6b 100644 --- a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st @@ -100,7 +100,7 @@ PyramidSpaceShortcutManagerPlugin >> connectOn: aPyramidEditor [ shortcutGrid gridFeatureFromSpacePlugin: aPyramidEditor. "Get Navigation Plugin for shortcut remove element" - shortcutRemoveElement navigationPluginForRemoveElementFromPyramid: aPyramidEditor. + shortcutRemoveElement navigationPluginFromPyramid: aPyramidEditor. shortcutSelectAllElement projectModelFromPyramid: aPyramidEditor. From 970b5f04d1c08e281f699aadaf24823d4fa875fe Mon Sep 17 00:00:00 2001 From: SullyMLT Date: Tue, 1 Jul 2025 09:40:25 +0200 Subject: [PATCH 09/10] Edit some code to replace iteration on array to array first --- src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st b/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st index 71178e8b..7e5b618d 100644 --- a/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st +++ b/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st @@ -50,7 +50,7 @@ PyramidShortcutCopyPasteCut >> copySelectedElementInSpace [ elementCollectionSelected isEmpty ifTrue: [ ^ self ]. elementCollectionSelected size = 1 - ifTrue: [ elementCollectionSelected do: [ :element | copyPastePlugin copyAsStonInClipboard: element ]. ^ 1 ] + ifTrue: [ copyPastePlugin copyAsStonInClipboard: (elementCollectionSelected first). ^ 1 ] ifFalse: [ self inform: 'Can not copy multiple element' ] @@ -113,7 +113,7 @@ PyramidShortcutCopyPasteCut >> pasteElement [ elementCollectionSelected isEmpty ifTrue: [ copyPastePlugin pasteFromClipboardOnFirstLevelElements ]. elementCollectionSelected size = 1 - ifTrue: [ elementCollectionSelected do: [ :element | copyPastePlugin pasteFromClipboardOnSelection: element ]. ] + ifTrue: [ copyPastePlugin pasteFromClipboardOnSelection: (elementCollectionSelected first) ] @@ -134,7 +134,7 @@ PyramidShortcutCopyPasteCut >> shortcutActionCopy [ PyramidShortcutCopyPasteCut >> shortcutActionCut [ ^ shortcutCut := BlShortcutWithAction new - name: 'Pyramid edition shortcut paste'; + name: 'Pyramid edition shortcut cut'; combination: keyCombinationCut; action: [ :event | copyPastePlugin ifNil: [ self inform: 'Plugin Copy/Paste is not installed' ] From 0a555b84f4df008bc42c4c3192c5bbce0b6c682f Mon Sep 17 00:00:00 2001 From: SullyMLT Date: Thu, 3 Jul 2025 10:25:57 +0200 Subject: [PATCH 10/10] Rename all class link to the space shortcut and change the way of getting the plugin for each shortcut --- ...PyramidSpaceShortcutCopyPasteCut.class.st} | 49 ++++++++----------- ...s.st => PyramidSpaceShortcutGrid.class.st} | 19 +++---- ...ceShortcutInspectSelectedElement.class.st} | 12 ++--- ...PyramidSpaceShortcutManagerPlugin.class.st | 14 +++--- ...yramidSpaceShortcutRemoveElement.class.st} | 18 +++---- ...s.st => PyramidSpaceShortcutSave.class.st} | 18 +++---- ...midSpaceShortcutSelectAllElement.class.st} | 16 +++--- ... => PyramidSpaceShortcutUndoRedo.class.st} | 24 ++++----- 8 files changed, 74 insertions(+), 96 deletions(-) rename src/Pyramid-Bloc/{PyramidShortcutCopyPasteCut.class.st => PyramidSpaceShortcutCopyPasteCut.class.st} (70%) rename src/Pyramid-Bloc/{PyramidShortcutGrid.class.st => PyramidSpaceShortcutGrid.class.st} (69%) rename src/Pyramid-Bloc/{PyramidShortcutInspectSelectedElement.class.st => PyramidSpaceShortcutInspectSelectedElement.class.st} (69%) rename src/Pyramid-Bloc/{PyramidShortcutRemoveElement.class.st => PyramidSpaceShortcutRemoveElement.class.st} (64%) rename src/Pyramid-Bloc/{PyramidShortcutSave.class.st => PyramidSpaceShortcutSave.class.st} (66%) rename src/Pyramid-Bloc/{PyramidShortcutSelectAllElement.class.st => PyramidSpaceShortcutSelectAllElement.class.st} (75%) rename src/Pyramid-Bloc/{PyramidShortcutUndoRedo.class.st => PyramidSpaceShortcutUndoRedo.class.st} (71%) diff --git a/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutCopyPasteCut.class.st similarity index 70% rename from src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st rename to src/Pyramid-Bloc/PyramidSpaceShortcutCopyPasteCut.class.st index 7e5b618d..5ecf5122 100644 --- a/src/Pyramid-Bloc/PyramidShortcutCopyPasteCut.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutCopyPasteCut.class.st @@ -4,7 +4,7 @@ This class is used to create the shortcut for copy and paste -> use the plugin-c It use the editor to get the collection of selected object from project model in Pyramid space. " Class { - #name : #PyramidShortcutCopyPasteCut, + #name : #PyramidSpaceShortcutCopyPasteCut, #superclass : #PyramidSpaceShortcutManagerPlugin, #instVars : [ 'copyPastePlugin', @@ -21,31 +21,24 @@ Class { } { #category : #'accessing - classes' } -PyramidShortcutCopyPasteCut >> copyPasteCutPluginFromPyramid: aPyramidEditor [ - - | copyPastePluginList navigationPluginList | - "get copyPastePlugin" - self elementCollectionSelected: aPyramidEditor. - copyPastePluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidCopyPastePlugin ]. - copyPastePluginList size = 1 - ifFalse: [^ self]. - copyPastePlugin := copyPastePluginList asArray first. +PyramidSpaceShortcutCopyPasteCut >> copyPasteCutPluginFromPyramid: aPyramidEditor [ + "Connect selection array" + self elementCollectionSelected: aPyramidEditor. + "get copyPastePlugin" + copyPastePlugin := aPyramidEditor findPlugin: PyramidCopyPastePlugin. "Get navigationPlugin" - navigationPluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidNavigationPlugin ]. - navigationPluginList size = 1 - ifFalse: [^ self]. - navigationPlugin := navigationPluginList asArray first + navigationPlugin := aPyramidEditor findPlugin: PyramidNavigationPlugin. ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> copyPastePlugin: aPlugin [ +PyramidSpaceShortcutCopyPasteCut >> copyPastePlugin: aPlugin [ copyPastePlugin := aPlugin ] { #category : #action } -PyramidShortcutCopyPasteCut >> copySelectedElementInSpace [ +PyramidSpaceShortcutCopyPasteCut >> copySelectedElementInSpace [ elementCollectionSelected isEmpty ifTrue: [ ^ self ]. @@ -58,31 +51,31 @@ PyramidShortcutCopyPasteCut >> copySelectedElementInSpace [ ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> defaultKeyCombinationCopy [ +PyramidSpaceShortcutCopyPasteCut >> defaultKeyCombinationCopy [ "CTRL + C to activate this shortcut" keyCombinationCopy := ((BlKeyCombination builder primary key: KeyboardKey C) build) ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> defaultKeyCombinationCut [ +PyramidSpaceShortcutCopyPasteCut >> defaultKeyCombinationCut [ "CTRL + X to activate this shortcut" keyCombinationCut := ((BlKeyCombination builder primary key: KeyboardKey X) build) ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> defaultKeyCombinationPaste [ +PyramidSpaceShortcutCopyPasteCut >> defaultKeyCombinationPaste [ "CTRL + V to activate this shortcut" keyCombinationPaste := ((BlKeyCombination builder primary key: KeyboardKey V) build) ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> elementCollectionSelected: aPyramidEditor [ +PyramidSpaceShortcutCopyPasteCut >> elementCollectionSelected: aPyramidEditor [ elementCollectionSelected := (aPyramidEditor projectModel selection) collection. ] { #category : #initialization } -PyramidShortcutCopyPasteCut >> initialize [ +PyramidSpaceShortcutCopyPasteCut >> initialize [ self defaultKeyCombinationCopy. self defaultKeyCombinationPaste. @@ -90,25 +83,25 @@ PyramidShortcutCopyPasteCut >> initialize [ ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> keyCombinationCopy: aKeyCombination [ +PyramidSpaceShortcutCopyPasteCut >> keyCombinationCopy: aKeyCombination [ ^ keyCombinationCopy := aKeyCombination ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> keyCombinationCut: aKeyCombination [ +PyramidSpaceShortcutCopyPasteCut >> keyCombinationCut: aKeyCombination [ ^ keyCombinationCut := aKeyCombination ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> keyCombinationPaste: aKeyCombination [ +PyramidSpaceShortcutCopyPasteCut >> keyCombinationPaste: aKeyCombination [ ^ keyCombinationPaste := aKeyCombination ] { #category : #action } -PyramidShortcutCopyPasteCut >> pasteElement [ +PyramidSpaceShortcutCopyPasteCut >> pasteElement [ elementCollectionSelected isEmpty ifTrue: [ copyPastePlugin pasteFromClipboardOnFirstLevelElements ]. @@ -120,7 +113,7 @@ PyramidShortcutCopyPasteCut >> pasteElement [ ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> shortcutActionCopy [ +PyramidSpaceShortcutCopyPasteCut >> shortcutActionCopy [ ^ shortcutCopy := BlShortcutWithAction new name: 'Pyramid edition shortcut copy'; @@ -131,7 +124,7 @@ PyramidShortcutCopyPasteCut >> shortcutActionCopy [ ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> shortcutActionCut [ +PyramidSpaceShortcutCopyPasteCut >> shortcutActionCut [ ^ shortcutCut := BlShortcutWithAction new name: 'Pyramid edition shortcut cut'; @@ -143,7 +136,7 @@ PyramidShortcutCopyPasteCut >> shortcutActionCut [ ] { #category : #accessing } -PyramidShortcutCopyPasteCut >> shortcutActionPaste [ +PyramidSpaceShortcutCopyPasteCut >> shortcutActionPaste [ ^ shortcutPaste := BlShortcutWithAction new name: 'Pyramid edition shortcut paste'; diff --git a/src/Pyramid-Bloc/PyramidShortcutGrid.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutGrid.class.st similarity index 69% rename from src/Pyramid-Bloc/PyramidShortcutGrid.class.st rename to src/Pyramid-Bloc/PyramidSpaceShortcutGrid.class.st index bd7e30af..8acf0ca1 100644 --- a/src/Pyramid-Bloc/PyramidShortcutGrid.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutGrid.class.st @@ -4,7 +4,7 @@ This class define the shortcut to show or hide the grid on the space. the grid is define in the plugin-space-extension -> PyramidMainExtension " Class { - #name : #PyramidShortcutGrid, + #name : #PyramidSpaceShortcutGrid, #superclass : #PyramidSpaceShortcutManagerPlugin, #instVars : [ 'gridFeature', @@ -17,20 +17,17 @@ Class { } { #category : #accessing } -PyramidShortcutGrid >> defaultKeyCombinationGridVisibility [ +PyramidSpaceShortcutGrid >> defaultKeyCombinationGridVisibility [ "CTRL + G to activate this shortcut" keyCombinationGridVisibility := ((BlKeyCombination builder primary key: KeyboardKey G) build) ] { #category : #'accessing - classes' } -PyramidShortcutGrid >> gridFeatureFromSpacePlugin: aPyramidEditor [ +PyramidSpaceShortcutGrid >> gridFeatureFromSpacePlugin: aPyramidEditor [ - | spacePlugin spacePluginSet listOfSpaceExtension pyramidMainExtensionSet | + | spacePlugin listOfSpaceExtension pyramidMainExtensionSet | - spacePluginSet := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidSpacePlugin ]. - spacePluginSet size = 1 - ifFalse: [^ self]. - spacePlugin := spacePluginSet asArray first. + spacePlugin := aPyramidEditor findPlugin: PyramidSpacePlugin. listOfSpaceExtension := spacePlugin builder extensions. @@ -42,19 +39,19 @@ PyramidShortcutGrid >> gridFeatureFromSpacePlugin: aPyramidEditor [ ] { #category : #initialization } -PyramidShortcutGrid >> initialize [ +PyramidSpaceShortcutGrid >> initialize [ self defaultKeyCombinationGridVisibility. ] { #category : #accessing } -PyramidShortcutGrid >> keyCombinationGridVisibility: aKeyCombination [ +PyramidSpaceShortcutGrid >> keyCombinationGridVisibility: aKeyCombination [ keyCombinationGridVisibility := aKeyCombination ] { #category : #accessing } -PyramidShortcutGrid >> shortcutActionGridVisibility [ +PyramidSpaceShortcutGrid >> shortcutActionGridVisibility [ ^ shortcutGridVisibility := BlShortcutWithAction new name: 'Pyramid edition shortcut grid visibility'; diff --git a/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutInspectSelectedElement.class.st similarity index 69% rename from src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st rename to src/Pyramid-Bloc/PyramidSpaceShortcutInspectSelectedElement.class.st index 8556fbe7..5a317ecf 100644 --- a/src/Pyramid-Bloc/PyramidShortcutInspectSelectedElement.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutInspectSelectedElement.class.st @@ -1,5 +1,5 @@ Class { - #name : #PyramidShortcutInspectSelectedElement, + #name : #PyramidSpaceShortcutInspectSelectedElement, #superclass : #PyramidSpaceShortcutManagerPlugin, #instVars : [ 'projectModel', @@ -10,31 +10,31 @@ Class { } { #category : #accessing } -PyramidShortcutInspectSelectedElement >> defaultKeyCombinationInspect [ +PyramidSpaceShortcutInspectSelectedElement >> defaultKeyCombinationInspect [ "CTRL + S to activate this shortcut" keyCombinationInspect := ((BlKeyCombination builder primary key: KeyboardKey I) build) ] { #category : #initialization } -PyramidShortcutInspectSelectedElement >> initialize [ +PyramidSpaceShortcutInspectSelectedElement >> initialize [ self defaultKeyCombinationInspect. ] { #category : #accessing } -PyramidShortcutInspectSelectedElement >> keyCombinationInspect: aKeyCombination [ +PyramidSpaceShortcutInspectSelectedElement >> keyCombinationInspect: aKeyCombination [ ^ keyCombinationInspect := aKeyCombination ] { #category : #'accessing - classes' } -PyramidShortcutInspectSelectedElement >> projectModelFromPyramid: aPyramidEditor [ +PyramidSpaceShortcutInspectSelectedElement >> projectModelFromPyramid: aPyramidEditor [ projectModel := aPyramidEditor projectModel ] { #category : #accessing } -PyramidShortcutInspectSelectedElement >> shortcutActionInspect [ +PyramidSpaceShortcutInspectSelectedElement >> shortcutActionInspect [ ^ shortcutInspect := BlShortcutWithAction new name: 'Pyramid edition shortcut save'; diff --git a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st index 8bac3f6b..b4c5abbe 100644 --- a/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutManagerPlugin.class.st @@ -117,13 +117,13 @@ PyramidSpaceShortcutManagerPlugin >> initialize [ shortcutCollection := OrderedCollection new. - shortcutUndoRedo := PyramidShortcutUndoRedo new. - shortcutCopyPaste := PyramidShortcutCopyPasteCut new. - shortcutSaveAction := PyramidShortcutSave new. - shortcutGrid := PyramidShortcutGrid new. - shortcutRemoveElement := PyramidShortcutRemoveElement new. - shortcutSelectAllElement := PyramidShortcutSelectAllElement new. - shortcutInspectSelectedElement := PyramidShortcutInspectSelectedElement new. + shortcutUndoRedo := PyramidSpaceShortcutUndoRedo new. + shortcutCopyPaste := PyramidSpaceShortcutCopyPasteCut new. + shortcutSaveAction := PyramidSpaceShortcutSave new. + shortcutGrid := PyramidSpaceShortcutGrid new. + shortcutRemoveElement := PyramidSpaceShortcutRemoveElement new. + shortcutSelectAllElement := PyramidSpaceShortcutSelectAllElement new. + shortcutInspectSelectedElement := PyramidSpaceShortcutInspectSelectedElement new. ] { #category : #action } diff --git a/src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutRemoveElement.class.st similarity index 64% rename from src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st rename to src/Pyramid-Bloc/PyramidSpaceShortcutRemoveElement.class.st index 907b1277..e90b4a44 100644 --- a/src/Pyramid-Bloc/PyramidShortcutRemoveElement.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutRemoveElement.class.st @@ -4,7 +4,7 @@ This class define the shortcut to delete a selected element in the space. it use the plugin-navigation in this package. " Class { - #name : #PyramidShortcutRemoveElement, + #name : #PyramidSpaceShortcutRemoveElement, #superclass : #PyramidSpaceShortcutManagerPlugin, #instVars : [ 'navigationPlugin', @@ -15,35 +15,31 @@ Class { } { #category : #accessing } -PyramidShortcutRemoveElement >> defaultKeyCombinationRemoveElement [ +PyramidSpaceShortcutRemoveElement >> defaultKeyCombinationRemoveElement [ "suppr / del to activate this shortcut" keyCombinationRemoveElement := ((BlKeyCombination builder key: KeyboardKey delete) build) ] { #category : #initialization } -PyramidShortcutRemoveElement >> initialize [ +PyramidSpaceShortcutRemoveElement >> initialize [ self defaultKeyCombinationRemoveElement ] { #category : #accessing } -PyramidShortcutRemoveElement >> keyCombinationRemoveElement: aKeyCombination [ +PyramidSpaceShortcutRemoveElement >> keyCombinationRemoveElement: aKeyCombination [ keyCombinationRemoveElement := aKeyCombination ] { #category : #'accessing - classes' } -PyramidShortcutRemoveElement >> navigationPluginFromPyramid: aPyramidEditor [ +PyramidSpaceShortcutRemoveElement >> navigationPluginFromPyramid: aPyramidEditor [ - | removeElementPluginList | - removeElementPluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidNavigationPlugin ]. - removeElementPluginList size = 1 - ifFalse: [^ self]. - navigationPlugin := removeElementPluginList asArray first + navigationPlugin := aPyramidEditor findPlugin: PyramidNavigationPlugin. ] { #category : #accessing } -PyramidShortcutRemoveElement >> shortcutActionRemoveElement [ +PyramidSpaceShortcutRemoveElement >> shortcutActionRemoveElement [ ^ shortcutActionRemoveElement := BlShortcutWithAction new name: 'Pyramid edition shortcut remove selected element'; diff --git a/src/Pyramid-Bloc/PyramidShortcutSave.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutSave.class.st similarity index 66% rename from src/Pyramid-Bloc/PyramidShortcutSave.class.st rename to src/Pyramid-Bloc/PyramidSpaceShortcutSave.class.st index ef2b7550..5ab40a75 100644 --- a/src/Pyramid-Bloc/PyramidShortcutSave.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutSave.class.st @@ -4,7 +4,7 @@ This class used to create shortcut for saving in Pyramid space. Used the plugin-save in this package. " Class { - #name : #PyramidShortcutSave, + #name : #PyramidSpaceShortcutSave, #superclass : #PyramidSpaceShortcutManagerPlugin, #instVars : [ 'savePlugin', @@ -15,35 +15,31 @@ Class { } { #category : #accessing } -PyramidShortcutSave >> defaultKeyCombinationSave [ +PyramidSpaceShortcutSave >> defaultKeyCombinationSave [ "CTRL + S to activate this shortcut" keyCombinationSave := ((BlKeyCombination builder primary key: KeyboardKey S) build) ] { #category : #initialization } -PyramidShortcutSave >> initialize [ +PyramidSpaceShortcutSave >> initialize [ self defaultKeyCombinationSave ] { #category : #accessing } -PyramidShortcutSave >> keyCombinationSave: aKeyCombination [ +PyramidSpaceShortcutSave >> keyCombinationSave: aKeyCombination [ ^ keyCombinationSave := aKeyCombination ] { #category : #'accessing - classes' } -PyramidShortcutSave >> savePluginFromPyramid: aPyramidEditor [ +PyramidSpaceShortcutSave >> savePluginFromPyramid: aPyramidEditor [ - | savePluginList | - savePluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidSavePlugin ]. - savePluginList size = 1 - ifFalse: [^ self]. - savePlugin := savePluginList asArray first + savePlugin := aPyramidEditor findPlugin: PyramidSavePlugin. ] { #category : #accessing } -PyramidShortcutSave >> shortcutActionSave [ +PyramidSpaceShortcutSave >> shortcutActionSave [ ^ shortcutSave := BlShortcutWithAction new name: 'Pyramid edition shortcut save'; diff --git a/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutSelectAllElement.class.st similarity index 75% rename from src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st rename to src/Pyramid-Bloc/PyramidSpaceShortcutSelectAllElement.class.st index ce5f25e7..359da9c2 100644 --- a/src/Pyramid-Bloc/PyramidShortcutSelectAllElement.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutSelectAllElement.class.st @@ -2,7 +2,7 @@ This class used to create shortcut for select all element or all children from one selected element in Pyramid space. " Class { - #name : #PyramidShortcutSelectAllElement, + #name : #PyramidSpaceShortcutSelectAllElement, #superclass : #PyramidSpaceShortcutManagerPlugin, #instVars : [ 'keyCombinationSelectAll', @@ -13,25 +13,25 @@ Class { } { #category : #accessing } -PyramidShortcutSelectAllElement >> defaultKeyCombinationSelectAll [ +PyramidSpaceShortcutSelectAllElement >> defaultKeyCombinationSelectAll [ "CTRL + A to activate this shortcut" keyCombinationSelectAll := ((BlKeyCombination builder primary key: KeyboardKey A) build) ] { #category : #initialization } -PyramidShortcutSelectAllElement >> initialize [ +PyramidSpaceShortcutSelectAllElement >> initialize [ self defaultKeyCombinationSelectAll ] { #category : #'accessing - classes' } -PyramidShortcutSelectAllElement >> projectModelFromPyramid: aPyramidEditor [ +PyramidSpaceShortcutSelectAllElement >> projectModelFromPyramid: aPyramidEditor [ projectModel := aPyramidEditor projectModel. ] { #category : #action } -PyramidShortcutSelectAllElement >> selectAll [ +PyramidSpaceShortcutSelectAllElement >> selectAll [ projectModel selection asArray isEmpty ifTrue: [ self selectAllElementInSpace ]. @@ -40,7 +40,7 @@ PyramidShortcutSelectAllElement >> selectAll [ ] { #category : #action } -PyramidShortcutSelectAllElement >> selectAllChildrenOfSelectedElement [ +PyramidSpaceShortcutSelectAllElement >> selectAllChildrenOfSelectedElement [ (projectModel selection collection asArray first) children isEmpty ifTrue: [ self inform: 'No children to select in the selected element' ] @@ -49,13 +49,13 @@ PyramidShortcutSelectAllElement >> selectAllChildrenOfSelectedElement [ ] { #category : #action } -PyramidShortcutSelectAllElement >> selectAllElementInSpace [ +PyramidSpaceShortcutSelectAllElement >> selectAllElementInSpace [ projectModel setSelection: projectModel firstLevelElements collection ] { #category : #accessing } -PyramidShortcutSelectAllElement >> shortcutActionSelectAll [ +PyramidSpaceShortcutSelectAllElement >> shortcutActionSelectAll [ ^ shortcutSelectAll := BlShortcutWithAction new name: 'Pyramid edition shortcut to select all element in space'; diff --git a/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st b/src/Pyramid-Bloc/PyramidSpaceShortcutUndoRedo.class.st similarity index 71% rename from src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st rename to src/Pyramid-Bloc/PyramidSpaceShortcutUndoRedo.class.st index fee2dc02..bd6c39e3 100644 --- a/src/Pyramid-Bloc/PyramidShortcutUndoRedo.class.st +++ b/src/Pyramid-Bloc/PyramidSpaceShortcutUndoRedo.class.st @@ -4,7 +4,7 @@ Class use to create the shortcut undo / redo. Use the history feature from the package Pyramid. " Class { - #name : #PyramidShortcutUndoRedo, + #name : #PyramidSpaceShortcutUndoRedo, #superclass : #PyramidSpaceShortcutManagerPlugin, #instVars : [ 'historyPlugin', @@ -17,48 +17,44 @@ Class { } { #category : #accessing } -PyramidShortcutUndoRedo >> defaultKeyCombinationRedo [ +PyramidSpaceShortcutUndoRedo >> defaultKeyCombinationRedo [ "CTRL + Y to activate this shortcut" keyCombinationRedo := ((BlKeyCombination builder primary key: KeyboardKey Y) build) ] { #category : #accessing } -PyramidShortcutUndoRedo >> defaultKeyCombinationUndo [ +PyramidSpaceShortcutUndoRedo >> defaultKeyCombinationUndo [ "CTRL + Z to activate this shortcut" keyCombinationUndo := ((BlKeyCombination builder primary key: KeyboardKey Z) build) ] { #category : #'accessing - classes' } -PyramidShortcutUndoRedo >> historyPluginFromPyramid: aPyramidEditor [ +PyramidSpaceShortcutUndoRedo >> historyPluginFromPyramid: aPyramidEditor [ - | historyPluginList | - historyPluginList := aPyramidEditor plugins select: [ :plugin | plugin isKindOf: PyramidHistoryPlugin ]. - historyPluginList size = 1 - ifFalse: [^ self]. - historyPlugin := historyPluginList asArray first. + historyPlugin := aPyramidEditor findPlugin: PyramidHistoryPlugin. ] { #category : #initialization } -PyramidShortcutUndoRedo >> initialize [ +PyramidSpaceShortcutUndoRedo >> initialize [ self defaultKeyCombinationRedo. self defaultKeyCombinationUndo. ] { #category : #accessing } -PyramidShortcutUndoRedo >> keyCombinationRedo: aNewKeyCombination [ +PyramidSpaceShortcutUndoRedo >> keyCombinationRedo: aNewKeyCombination [ ^ keyCombinationRedo := aNewKeyCombination ] { #category : #accessing } -PyramidShortcutUndoRedo >> keyCombinationUndo: aNewKeyCombination [ +PyramidSpaceShortcutUndoRedo >> keyCombinationUndo: aNewKeyCombination [ ^ keyCombinationUndo := aNewKeyCombination ] { #category : #accessing } -PyramidShortcutUndoRedo >> shortcutActionRedo [ +PyramidSpaceShortcutUndoRedo >> shortcutActionRedo [ ^ shortcutRedo := BlShortcutWithAction new name: 'Pyramid edition shortcut redo'; @@ -70,7 +66,7 @@ PyramidShortcutUndoRedo >> shortcutActionRedo [ ] { #category : #accessing } -PyramidShortcutUndoRedo >> shortcutActionUndo [ +PyramidSpaceShortcutUndoRedo >> shortcutActionUndo [ ^ shortcutUndo := BlShortcutWithAction new name: 'Pyramid edition shortcut undo';