forked from pharo-project/pharo
/
SycMoveMethodsToClassSideCommand.class.st
49 lines (40 loc) · 1.26 KB
/
SycMoveMethodsToClassSideCommand.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"
I am a command to move method to the class side of defining class
"
Class {
#name : #SycMoveMethodsToClassSideCommand,
#superclass : #SycMethodCommand,
#category : #'SystemCommands-MethodCommands'
}
{ #category : #testing }
SycMoveMethodsToClassSideCommand class >> canBeExecutedInContext: aToolContext [
^(super canBeExecutedInContext: aToolContext)
and: [ aToolContext isInstanceSideMethodSelected ]
]
{ #category : #activation }
SycMoveMethodsToClassSideCommand class >> methodContextMenuActivation [
<classAnnotation>
^CmdContextMenuActivation
byItemOf: ClyMoreRefactorsMenuGroup
order: 50
for: ClyMethod asCalypsoItemContext
]
{ #category : #activation }
SycMoveMethodsToClassSideCommand class >> methodShortcutActivation [
<classAnnotation>
^CmdShortcutActivation by: $t meta, $c meta for: ClyMethod asCalypsoItemContext
]
{ #category : #accessing }
SycMoveMethodsToClassSideCommand >> defaultMenuIconName [
^ #smallRedo
]
{ #category : #accessing }
SycMoveMethodsToClassSideCommand >> defaultMenuItemName [
^'Move to class side'
]
{ #category : #execution }
SycMoveMethodsToClassSideCommand >> execute [
methods
collect: [ :each | RBMoveMethodToClassRefactoring method: each class: each origin classSide]
thenDo: [ :each | each execute ]
]