@@ -46,22 +46,21 @@ PyramidMoveChildInParentPlugin >> contextMenuMoveChildInParent: aBuilder [
4646
4747 aBuilder
4848 addGroupSingleSelection: [ :group :single |
49- group
50- addItem: [ :item |
51- item
52- icon: (Smalltalk ui icons iconNamed: #up );
53- name: ' Move index child up' ;
54- action: [ self moveChildIndexUpInParent ];
55- yourself ];
56-
57- addItem: [ :item |
58- item
59- icon: (Smalltalk ui icons iconNamed: #down );
60- name: ' Move index child down' ;
61- action: [ self moveChildIndexDownInParent ];
62- yourself ];
63- yourself ]
64- order: 10 .
49+ group
50+ addItem: [ :item |
51+ item
52+ icon: (Smalltalk ui icons iconNamed: #up );
53+ name: ' Move child up' ;
54+ action: [ self moveChildIndexDownInParent ];
55+ yourself ];
56+ addItem: [ :item |
57+ item
58+ icon: (Smalltalk ui icons iconNamed: #down );
59+ name: ' Move child down' ;
60+ action: [self moveChildIndexUpInParent];
61+ yourself ];
62+ yourself ]
63+ order: 10
6564]
6665
6766{ #category : #accessing }
@@ -91,28 +90,23 @@ PyramidMoveChildInParentPlugin >> moveChildIndexDownCommand: aBlElementParent wi
9190PyramidMoveChildInParentPlugin >> moveChildIndexDownInParent [
9291
9392 | childToMoveCollection childToMove childIndexToMove parentChild navigationSelectionPanel |
94-
9593 childToMoveCollection := projectModel selection collection.
9694 navigationSelectionPanel := navigationPlugin navigation selectionPanel.
97-
98- childToMoveCollection size = 1
99- ifFalse: [ ^ self ].
95+
96+ childToMoveCollection size = 1 ifFalse: [ ^ self ].
10097 childToMove := childToMoveCollection first.
101-
102- childToMove hasParent
103- ifFalse: [ ^ self ].
98+
99+ childToMove hasParent ifFalse: [ ^ self ].
104100 parentChild := childToMove parent.
105-
106- childIndexToMove := (parentChild childIndexOf: childToMove).
107-
108- childIndexToMove > 1
109- ifTrue: [ self moveChildIndexDownCommand: parentChild with: childToMove.
110- self refreshTreeTable ]
111- ifFalse: [ self inform: ' Cannot move down' ].
112101
113-
114-
102+ childIndexToMove := parentChild childIndexOf: childToMove.
115103
104+ childIndexToMove > 1
105+ ifTrue: [
106+ self moveChildIndexDownCommand: parentChild with: childToMove.
107+ self refreshTreeTable ]
108+ ifFalse: [ " cannot move the child up and the index down"
109+ self inform: ' Cannot move up' ]
116110]
117111
118112{ #category : #' as yet unclassified' }
@@ -129,27 +123,23 @@ PyramidMoveChildInParentPlugin >> moveChildIndexUpCommand: aBlElementParent with
129123PyramidMoveChildInParentPlugin >> moveChildIndexUpInParent [
130124
131125 | childToMoveCollection childToMove childIndexToMove parentChild navigationSelectionPanel |
132-
133126 childToMoveCollection := projectModel selection collection.
134127 navigationSelectionPanel := navigationPlugin navigation selectionPanel.
135-
136- childToMoveCollection size = 1
137- ifFalse: [ ^ self ].
128+
129+ childToMoveCollection size = 1 ifFalse: [ ^ self ].
138130 childToMove := childToMoveCollection first.
139-
140- childToMove hasParent
141- ifFalse: [ ^ self ].
131+
132+ childToMove hasParent ifFalse: [ ^ self ].
142133 parentChild := childToMove parent.
143-
144- childIndexToMove := (parentChild childIndexOf: childToMove).
145-
146- childIndexToMove < (parentChild children size)
147- ifTrue: [ self moveChildIndexUpCommand: parentChild with: childToMove.
148- self refreshTreeTable ]
149- ifFalse: [ self inform: ' Cannot move up' ].
150-
151-
152134
135+ childIndexToMove := parentChild childIndexOf: childToMove.
136+
137+ childIndexToMove < parentChild children size
138+ ifTrue: [
139+ self moveChildIndexUpCommand: parentChild with: childToMove.
140+ self refreshTreeTable ]
141+ ifFalse: [ " cannot move the child down and the index up"
142+ self inform: ' Cannot move down' ]
153143]
154144
155145{ #category : #accessing }
0 commit comments