Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #3385 Partial changelog: - Add tests - Improve robustness of some tests - Make transmissions an independent package - Begin to work on commands (WIP) - Clean API of some presenters (such as lists) - Work on context menu of Text presenter and table presenter - Drop box list items can now be sorted - Proceed the decomposition of Text and Code presenters - Replace some variables and value holder by observable slots - Improve demos - Table columns are now expendables - ...
- Loading branch information
Showing
124 changed files
with
1,536 additions
and
1,094 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Extension { #name : #CmdMenu } | ||
|
||
{ #category : #'*Spec-Commands' } | ||
CmdMenu >> buildContextMenu [ | ||
| menu | | ||
|
||
menu := MenuPresenter new. | ||
rootGroup buildContextMenu: menu. | ||
^ menu | ||
] |
25 changes: 25 additions & 0 deletions
25
src/Spec-Commands/CmdMenuCommandActivationStrategy.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Extension { #name : #CmdMenuCommandActivationStrategy } | ||
|
||
{ #category : #'*Spec-Commands' } | ||
CmdMenuCommandActivationStrategy class >> buildContextKeyBindingsInContext: aToolContext [ | ||
| bindings | | ||
|
||
bindings := Dictionary new. | ||
CmdShortcutActivation | ||
visibleInstancesInContext: aToolContext | ||
do: [ :activation | | ||
| activator | | ||
activator := activation newActivatorFor: aToolContext. | ||
bindings | ||
at: activator activationStrategy keyCombination | ||
put: [ activator executeCommand ] ]. | ||
^ bindings | ||
] | ||
|
||
{ #category : #'*Spec-Commands' } | ||
CmdMenuCommandActivationStrategy class >> buildContextMenuInContext: aToolContext [ | ||
| menu | | ||
|
||
menu := self buildMenuInContext: aToolContext. | ||
^ menu buildContextMenu | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Extension { #name : #CmdMenuGroup } | ||
|
||
{ #category : #'*Spec-Commands' } | ||
CmdMenuGroup >> inlineContextMenuItemsInto: aMenu [ | ||
self flag: #pharoFixMe. "This is an ugly hack because this part of Spec is still in development. Later this should be removed." | ||
(aMenu isKindOf: Morph) | ||
ifTrue: [ aMenu addLine. | ||
contents do: [ :each | each buildContextMenu: aMenu ]. | ||
aMenu addLine ] | ||
ifFalse: [ aMenu addGroup: [ :group | contents do: [ :each | each buildContextMenu: group ] ] ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Extension { #name : #MenuGroupPresenter } | ||
|
||
{ #category : #'*Spec-Commands' } | ||
MenuGroupPresenter >> add: aName target: targetObject selector: aSelector [ | ||
|
||
self flag: #TODO. "This is for compatibility with the old menu builder and needs to be removed!" | ||
self addItem: [ :item | | ||
item | ||
name: aName; | ||
action: [ targetObject perform: aSelector ] ]. | ||
^ self menuItems last | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Extension { #name : #MenuItemPresenter } | ||
|
||
{ #category : #'*Spec-Commands' } | ||
MenuItemPresenter >> keyText: aString [ | ||
|
||
self flag: #TODO. "This is for backward compatibility and needs to be removed!" | ||
self shortcut: aString first meta | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Class { | ||
#name : #SpecCodeCommand, | ||
#superclass : #CmdCommand, | ||
#category : #'Spec-Commands-Code' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Class { | ||
#name : #SpecCodeContext, | ||
#superclass : #CmdToolContext, | ||
#category : #'Spec-Commands-Code' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Class { | ||
#name : #SpecCodeDebugItCommand, | ||
#superclass : #SpecCodeSelectionCommand, | ||
#category : #'Spec-Commands-Code' | ||
} | ||
|
||
{ #category : #activating } | ||
SpecCodeDebugItCommand class >> contextMenuActivation [ | ||
<classAnnotation> | ||
|
||
^ CmdContextMenuActivation byRootGroupItemOrder: 40 for: SpecCodeContext | ||
] | ||
|
||
{ #category : #activating } | ||
SpecCodeDebugItCommand class >> shortcutActivation [ | ||
<classAnnotation> | ||
|
||
^ CmdShortcutActivation | ||
by: $d shift meta | ||
for: SpecCodeContext | ||
] | ||
|
||
{ #category : #accessing } | ||
SpecCodeDebugItCommand >> defaultMenuItemName [ | ||
|
||
^ 'Debug it' | ||
] | ||
|
||
{ #category : #execution } | ||
SpecCodeDebugItCommand >> execute [ | ||
|
||
'OK' crLog | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Class { | ||
#name : #SpecCodeDoItCommand, | ||
#superclass : #SpecCodeSelectionCommand, | ||
#category : #'Spec-Commands-Code' | ||
} | ||
|
||
{ #category : #activating } | ||
SpecCodeDoItCommand class >> contextMenuActivation [ | ||
<classAnnotation> | ||
|
||
^ CmdContextMenuActivation byRootGroupItemOrder: 10 for: SpecCodeContext | ||
] | ||
|
||
{ #category : #activating } | ||
SpecCodeDoItCommand class >> shortcutActivation [ | ||
<classAnnotation> | ||
|
||
^ CmdShortcutActivation | ||
by: $d meta | ||
for: SpecCodeContext | ||
] | ||
|
||
{ #category : #accessing } | ||
SpecCodeDoItCommand >> defaultMenuItemName [ | ||
|
||
^ 'Do it' | ||
] | ||
|
||
{ #category : #execution } | ||
SpecCodeDoItCommand >> execute [ | ||
|
||
'OK' crLog | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Class { | ||
#name : #SpecCodeInspectItCommand, | ||
#superclass : #SpecCodeSelectionCommand, | ||
#category : #'Spec-Commands-Code' | ||
} | ||
|
||
{ #category : #activating } | ||
SpecCodeInspectItCommand class >> contextMenuActivation [ | ||
<classAnnotation> | ||
|
||
^ CmdContextMenuActivation byRootGroupItemOrder: 30 for: SpecCodeContext | ||
] | ||
|
||
{ #category : #activating } | ||
SpecCodeInspectItCommand class >> shortcutActivation [ | ||
<classAnnotation> | ||
|
||
^ CmdShortcutActivation | ||
by: $i meta | ||
for: SpecCodeContext | ||
] | ||
|
||
{ #category : #accessing } | ||
SpecCodeInspectItCommand >> defaultMenuItemName [ | ||
|
||
^ 'Inspect it' | ||
] | ||
|
||
{ #category : #execution } | ||
SpecCodeInspectItCommand >> execute [ | ||
|
||
'OK' crLog | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Class { | ||
#name : #SpecCodePrintItCommand, | ||
#superclass : #SpecCodeSelectionCommand, | ||
#category : #'Spec-Commands-Code' | ||
} | ||
|
||
{ #category : #activating } | ||
SpecCodePrintItCommand class >> contextMenuActivation [ | ||
<classAnnotation> | ||
|
||
^ CmdContextMenuActivation byRootGroupItemOrder: 10 for: SpecCodeContext | ||
] | ||
|
||
{ #category : #activating } | ||
SpecCodePrintItCommand class >> shortcutActivation [ | ||
<classAnnotation> | ||
|
||
^ CmdShortcutActivation | ||
by: $p meta | ||
for: SpecCodeContext | ||
] | ||
|
||
{ #category : #accessing } | ||
SpecCodePrintItCommand >> defaultMenuItemName [ | ||
|
||
^ 'Print it' | ||
] | ||
|
||
{ #category : #execution } | ||
SpecCodePrintItCommand >> execute [ | ||
|
||
'OK' crLog | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Class { | ||
#name : #SpecCodeProfileItCommand, | ||
#superclass : #SpecCodeSelectionCommand, | ||
#category : #'Spec-Commands-Code' | ||
} | ||
|
||
{ #category : #activating } | ||
SpecCodeProfileItCommand class >> contextMenuActivation [ | ||
<classAnnotation> | ||
|
||
^ CmdContextMenuActivation byRootGroupItemOrder: 50 for: SpecCodeContext | ||
] | ||
|
||
{ #category : #accessing } | ||
SpecCodeProfileItCommand >> defaultMenuItemName [ | ||
|
||
^ 'Profile it' | ||
] | ||
|
||
{ #category : #execution } | ||
SpecCodeProfileItCommand >> execute [ | ||
|
||
'OK' crLog | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Class { | ||
#name : #SpecCodeSelectionCommand, | ||
#superclass : #SpecCodeCommand, | ||
#category : #'Spec-Commands-Code' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : #'Spec-Commands' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.