diff --git a/src/Spec2-Adapters-Morphic/SpMorphicTextAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicTextAdapter.class.st index 1a873a34..ea146944 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicTextAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicTextAdapter.class.st @@ -17,6 +17,12 @@ SpMorphicTextAdapter >> accept: aString notifying: aNotifyier [ notifying: aNotifyier ] +{ #category : 'widget API' } +SpMorphicTextAdapter >> addExtraActionsTo: actionGroup [ + + "override to add extra actions between user defined and edition" +] + { #category : 'initialization' } SpMorphicTextAdapter >> addFocusRotationKeyBindings [ "Text areas needs to be able to process tab. Cancel the binding." @@ -91,9 +97,10 @@ SpMorphicTextAdapter >> codePaneMenu: aMenu shifted: shifted [ self presenter internalActions ifNotNil: [ :group | actionGroup add: group beRoot ]. + self addExtraActionsTo: actionGroup. self presenter actions ifNotNil: [ :group | actionGroup add: group beRoot ]. - self presenter hasEditionContextMenu ifTrue: [ + self presenter hasEditionContextMenu ifTrue: [ actionGroup add: self presenter editionCommandsGroup beRoot ]. menuPresenter := self presenter newMenu. diff --git a/src/Spec2-Code-Commands/SpCodeDebugItCommand.class.st b/src/Spec2-Code-Commands/SpCodeDebugItCommand.class.st index f93d142f..e843d45a 100644 --- a/src/Spec2-Code-Commands/SpCodeDebugItCommand.class.st +++ b/src/Spec2-Code-Commands/SpCodeDebugItCommand.class.st @@ -31,9 +31,7 @@ SpCodeDebugItCommand class >> defaultName [ { #category : 'default' } SpCodeDebugItCommand class >> defaultShortcutKey [ - ^ $d shift command mac - | $d shift control win - | $d shift control unix + ^ $d shift actionModifier ] { #category : 'private' } diff --git a/src/Spec2-Code-Commands/SpCodeDoItCommand.class.st b/src/Spec2-Code-Commands/SpCodeDoItCommand.class.st index f9d141fe..fba5b5a5 100644 --- a/src/Spec2-Code-Commands/SpCodeDoItCommand.class.st +++ b/src/Spec2-Code-Commands/SpCodeDoItCommand.class.st @@ -31,9 +31,7 @@ SpCodeDoItCommand class >> defaultName [ { #category : 'default' } SpCodeDoItCommand class >> defaultShortcutKey [ - ^ $d command mac - | $d control win - | $d control unix + ^ $d actionModifier ] { #category : 'accessing' } diff --git a/src/Spec2-Code-Commands/SpCodeInspectItCommand.class.st b/src/Spec2-Code-Commands/SpCodeInspectItCommand.class.st index f3bd1a10..ae0f6674 100644 --- a/src/Spec2-Code-Commands/SpCodeInspectItCommand.class.st +++ b/src/Spec2-Code-Commands/SpCodeInspectItCommand.class.st @@ -31,9 +31,7 @@ SpCodeInspectItCommand class >> defaultName [ { #category : 'default' } SpCodeInspectItCommand class >> defaultShortcutKey [ - ^ $i command mac - | $i control win - | $i control unix + ^ $i actionModifier ] { #category : 'documentation' } diff --git a/src/Spec2-Code-Commands/SpCodePrintItCommand.class.st b/src/Spec2-Code-Commands/SpCodePrintItCommand.class.st index 860e0bc4..434272df 100644 --- a/src/Spec2-Code-Commands/SpCodePrintItCommand.class.st +++ b/src/Spec2-Code-Commands/SpCodePrintItCommand.class.st @@ -31,9 +31,7 @@ SpCodePrintItCommand class >> defaultName [ { #category : 'default' } SpCodePrintItCommand class >> defaultShortcutKey [ - ^ $p command mac - | $p control win - | $p control unix + ^ $p actionModifier ] { #category : 'execution' } diff --git a/src/Spec2-Code-Morphic/SpMorphicCodeAdapter.class.st b/src/Spec2-Code-Morphic/SpMorphicCodeAdapter.class.st index 4c5c2cf2..93a1467e 100644 --- a/src/Spec2-Code-Morphic/SpMorphicCodeAdapter.class.st +++ b/src/Spec2-Code-Morphic/SpMorphicCodeAdapter.class.st @@ -5,6 +5,14 @@ Class { #package : 'Spec2-Code-Morphic' } +{ #category : 'widget API' } +SpMorphicCodeAdapter >> addExtraActionsTo: group [ + + self presenter isOverrideContextMenu ifTrue: [ ^ self ]. + + group add: self presenter rootCommandsGroup beRoot +] + { #category : 'widget API' } SpMorphicCodeAdapter >> behavior [ diff --git a/src/Spec2-Code/SpCodePresenter.class.st b/src/Spec2-Code/SpCodePresenter.class.st index f6865c75..f4df6b0f 100644 --- a/src/Spec2-Code/SpCodePresenter.class.st +++ b/src/Spec2-Code/SpCodePresenter.class.st @@ -434,7 +434,7 @@ SpCodePresenter >> hasEditionContextMenu [ "Answer if edition context menu is active. Edition context menu is available by default, but it can be disabled by calling `SpTextPresenter>>#withoutEditionContextMenu` or `SpCodePresenter>>#overridingContextMenu`" - ^ super hasEditionContextMenu and: [ overrideContextMenu not ] + ^ super hasEditionContextMenu and: [ self isOverrideContextMenu not ] ] { #category : 'testing' } @@ -539,6 +539,12 @@ SpCodePresenter >> interactionModel: anInteractionModel [ self basicInteractionModel: anInteractionModel ] +{ #category : 'private - testing' } +SpCodePresenter >> isOverrideContextMenu [ + + ^ overrideContextMenu +] + { #category : 'private - bindings' } SpCodePresenter >> isScripting [