Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .smalltalk.ston
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ SmalltalkCISpec {
SCIMetacelloLoadSpec {
#baseline : 'Pyramid',
#directory : 'src',
#onConflict : #useLoaded,
#onUpgrade : #useLoaded,
#onWarningLog : true,
#platforms : [ #pharo ]
}
],
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion src/Pyramid-Bloc/PyramidSpacePlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Class {
#instVars : [
'builder',
'morphicPresenter',
'resetSpaceButton'
'resetSpaceButton',
'resetShortcutBlock'
],
#category : #'Pyramid-Bloc-plugin-space'
}
Expand Down Expand Up @@ -37,6 +38,7 @@ PyramidSpacePlugin >> connectOn: aPyramidEditor [
{ #category : #initialization }
PyramidSpacePlugin >> initialize [

resetShortcutBlock := [ :aSpace | ].
builder := PyramidSpaceBuilder defaultEditorBuilder.
morphicPresenter := SpMorphPresenter new.
resetSpaceButton := SpButtonPresenter new
Expand Down Expand Up @@ -74,12 +76,25 @@ PyramidSpacePlugin >> morphicPresenter [
^ morphicPresenter
]

{ #category : #accessing }
PyramidSpacePlugin >> resetShortcutBlock [

^ resetShortcutBlock
]

{ #category : #accessing }
PyramidSpacePlugin >> resetShortcutBlock: aBlock [

resetShortcutBlock := aBlock
]

{ #category : #initialization }
PyramidSpacePlugin >> resetSpace [

| space |
space := self builder build.
self makePresenterWithBlSpace: space.
resetShortcutBlock value: space.
space show
]

Expand Down
147 changes: 147 additions & 0 deletions src/Pyramid-Bloc/PyramidSpaceShortcutCopyPasteCut.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
"
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 : #PyramidSpaceShortcutCopyPasteCut,
#superclass : #PyramidSpaceShortcutManagerPlugin,
#instVars : [
'copyPastePlugin',
'navigationPlugin',
'shortcutCopy',
'shortcutPaste',
'keyCombinationCopy',
'keyCombinationPaste',
'elementCollectionSelected',
'keyCombinationCut',
'shortcutCut'
],
#category : #'Pyramid-Bloc-plugin-shortcut-manager'
}

{ #category : #'accessing - classes' }
PyramidSpaceShortcutCopyPasteCut >> copyPasteCutPluginFromPyramid: aPyramidEditor [

"Connect selection array"
self elementCollectionSelected: aPyramidEditor.
"get copyPastePlugin"
copyPastePlugin := aPyramidEditor findPlugin: PyramidCopyPastePlugin.
"Get navigationPlugin"
navigationPlugin := aPyramidEditor findPlugin: PyramidNavigationPlugin.
]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> copyPastePlugin: aPlugin [

copyPastePlugin := aPlugin
]

{ #category : #action }
PyramidSpaceShortcutCopyPasteCut >> copySelectedElementInSpace [

elementCollectionSelected isEmpty
ifTrue: [ ^ self ].
elementCollectionSelected size = 1
ifTrue: [ copyPastePlugin copyAsStonInClipboard: (elementCollectionSelected first). ^ 1 ]
ifFalse: [ self inform: 'Can not copy multiple element' ]



]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> defaultKeyCombinationCopy [
"CTRL + C to activate this shortcut"
keyCombinationCopy := ((BlKeyCombination builder primary key: KeyboardKey C) build)
]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> defaultKeyCombinationCut [
"CTRL + X to activate this shortcut"
keyCombinationCut := ((BlKeyCombination builder primary key: KeyboardKey X) build)
]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> defaultKeyCombinationPaste [
"CTRL + V to activate this shortcut"
keyCombinationPaste := ((BlKeyCombination builder primary key: KeyboardKey V) build)
]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> elementCollectionSelected: aPyramidEditor [

elementCollectionSelected := (aPyramidEditor projectModel selection) collection.
]

{ #category : #initialization }
PyramidSpaceShortcutCopyPasteCut >> initialize [

self defaultKeyCombinationCopy.
self defaultKeyCombinationPaste.
self defaultKeyCombinationCut.
]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> keyCombinationCopy: aKeyCombination [

^ keyCombinationCopy := aKeyCombination
]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> keyCombinationCut: aKeyCombination [

^ keyCombinationCut := aKeyCombination
]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> keyCombinationPaste: aKeyCombination [

^ keyCombinationPaste := aKeyCombination
]

{ #category : #action }
PyramidSpaceShortcutCopyPasteCut >> pasteElement [

elementCollectionSelected isEmpty
ifTrue: [ copyPastePlugin pasteFromClipboardOnFirstLevelElements ].
elementCollectionSelected size = 1
ifTrue: [ copyPastePlugin pasteFromClipboardOnSelection: (elementCollectionSelected first) ]



]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> 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 }
PyramidSpaceShortcutCopyPasteCut >> shortcutActionCut [

^ shortcutCut := BlShortcutWithAction new
name: 'Pyramid edition shortcut cut';
combination: keyCombinationCut;
action: [ :event | copyPastePlugin
ifNil: [ self inform: 'Plugin Copy/Paste is not installed' ]
ifNotNil: [ self copySelectedElementInSpace = 1
ifTrue: [ navigationPlugin removeSelectedElements ] ] ]
]

{ #category : #accessing }
PyramidSpaceShortcutCopyPasteCut >> 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 ] ]
]
60 changes: 60 additions & 0 deletions src/Pyramid-Bloc/PyramidSpaceShortcutGrid.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"
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 : #PyramidSpaceShortcutGrid,
#superclass : #PyramidSpaceShortcutManagerPlugin,
#instVars : [
'gridFeature',
'shortcutGridVisibility',
'keyCombinationGridVisibility',
'keyCombinationTest',
'shortcutTest'
],
#category : #'Pyramid-Bloc-plugin-shortcut-manager'
}

{ #category : #accessing }
PyramidSpaceShortcutGrid >> defaultKeyCombinationGridVisibility [
"CTRL + G to activate this shortcut"
keyCombinationGridVisibility := ((BlKeyCombination builder primary key: KeyboardKey G) build)
]

{ #category : #'accessing - classes' }
PyramidSpaceShortcutGrid >> gridFeatureFromSpacePlugin: aPyramidEditor [

| spacePlugin listOfSpaceExtension pyramidMainExtensionSet |

spacePlugin := aPyramidEditor findPlugin: PyramidSpacePlugin.

listOfSpaceExtension := spacePlugin builder extensions.

pyramidMainExtensionSet := listOfSpaceExtension select: [ :extensions | extensions isKindOf: PyramidMainExtension ].
pyramidMainExtensionSet size = 1
ifFalse: [^ self].
gridFeature := pyramidMainExtensionSet asArray first

]

{ #category : #initialization }
PyramidSpaceShortcutGrid >> initialize [

self defaultKeyCombinationGridVisibility.
]

{ #category : #accessing }
PyramidSpaceShortcutGrid >> keyCombinationGridVisibility: aKeyCombination [

keyCombinationGridVisibility := aKeyCombination
]

{ #category : #accessing }
PyramidSpaceShortcutGrid >> shortcutActionGridVisibility [

^ shortcutGridVisibility := BlShortcutWithAction new
name: 'Pyramid edition shortcut grid visibility';
combination: keyCombinationGridVisibility;
action: [ :event | gridFeature workplacePropertiesView visibilityButton toggleState ].
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Class {
#name : #PyramidSpaceShortcutInspectSelectedElement,
#superclass : #PyramidSpaceShortcutManagerPlugin,
#instVars : [
'projectModel',
'keyCombinationInspect',
'shortcutInspect'
],
#category : #'Pyramid-Bloc-plugin-shortcut-manager'
}

{ #category : #accessing }
PyramidSpaceShortcutInspectSelectedElement >> defaultKeyCombinationInspect [
"CTRL + S to activate this shortcut"
keyCombinationInspect := ((BlKeyCombination builder primary key: KeyboardKey I) build)
]

{ #category : #initialization }
PyramidSpaceShortcutInspectSelectedElement >> initialize [

self defaultKeyCombinationInspect.
]

{ #category : #accessing }
PyramidSpaceShortcutInspectSelectedElement >> keyCombinationInspect: aKeyCombination [

^ keyCombinationInspect := aKeyCombination
]

{ #category : #'accessing - classes' }
PyramidSpaceShortcutInspectSelectedElement >> projectModelFromPyramid: aPyramidEditor [

projectModel := aPyramidEditor projectModel
]

{ #category : #accessing }
PyramidSpaceShortcutInspectSelectedElement >> 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' ] ]
]
Loading