Skip to content

Commit 25e6a02

Browse files
Merge pull request #269 from OpenSmock/devStage_fixIssueUndo187
fix issue : Undo of remove element doesn’t put it back in the same po…
2 parents 297e672 + 4134e51 commit 25e6a02

90 files changed

Lines changed: 308 additions & 193 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Pyramid-Bloc/PyramidAbstractBorderCommand.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ PyramidAbstractBorderCommand >> borderBuilderOf: aBlElement [
2020
^ builder
2121
]
2222

23-
{ #category : #'as yet unclassified' }
23+
{ #category : #setter }
2424
PyramidAbstractBorderCommand >> setValueFor: aBlElement with: anArgument [
2525

2626
| builder |

src/Pyramid-Bloc/PyramidAbstractChangeDrawOrderCommand.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PyramidAbstractChangeDrawOrderCommand >> canBeUsedFor: anObject [
1616
^ (super canBeUsedFor: anObject) and: [ anObject hasParent]
1717
]
1818

19-
{ #category : #'as yet unclassified' }
19+
{ #category : #getter }
2020
PyramidAbstractChangeDrawOrderCommand >> getValueFor: aBlElement [
2121
"return current index for testing."
2222

src/Pyramid-Bloc/PyramidAddChildCommand.class.st

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,26 @@ Class {
44
#category : #'Pyramid-Bloc-plugin-bloc'
55
}
66

7-
{ #category : #'as yet unclassified' }
7+
{ #category : #history }
88
PyramidAddChildCommand >> commandInverse [
99

1010
^ PyramidRemoveChildCommand new
1111
]
1212

13-
{ #category : #'as yet unclassified' }
13+
{ #category : #private }
14+
PyramidAddChildCommand >> savedIndexFor: aChild in: aParent [
15+
16+
| index |
17+
index := aChild userData at: #removedAtIndex ifAbsent: [ 0 ].
18+
(index = 0 or: [ index > aParent children size ])
19+
ifTrue: [ ^ aParent children size + 1 ]
20+
ifFalse: [ ^ index ]
21+
]
22+
23+
{ #category : #setter }
1424
PyramidAddChildCommand >> setValueFor: aBlElement with: aChildToAdd [
1525

16-
aBlElement addChild: aChildToAdd
26+
aBlElement
27+
addChild: aChildToAdd
28+
at: (self savedIndexFor: aChildToAdd in: aBlElement)
1729
]

src/Pyramid-Bloc/PyramidAddChildrenCommand.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Class {
44
#category : #'Pyramid-Bloc-plugin-bloc'
55
}
66

7-
{ #category : #'as yet unclassified' }
7+
{ #category : #history }
88
PyramidAddChildrenCommand >> commandInverse [
99

1010
^ PyramidRemoveChildrenCommand new
1111
]
1212

13-
{ #category : #'as yet unclassified' }
13+
{ #category : #setter }
1414
PyramidAddChildrenCommand >> setValueFor: aBlElement with: aChildrenToAdd [
1515

16-
aBlElement addChildren: aChildrenToAdd
16+
aBlElement addChildren: aChildrenToAdd
1717
]

src/Pyramid-Bloc/PyramidBackgroundImageCommand.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ PyramidBackgroundImageCommand >> canBeUsedFor: anObject [
1111
anObject background isKindOf: BlImageBackground ]
1212
]
1313

14-
{ #category : #'as yet unclassified' }
14+
{ #category : #getter }
1515
PyramidBackgroundImageCommand >> getValueFor: aBlElement [
1616

1717
^ aBlElement background image
1818
]
1919

20-
{ #category : #'as yet unclassified' }
20+
{ #category : #setter }
2121
PyramidBackgroundImageCommand >> setValueFor: aBlElement with: anArgument [
2222

2323
aBlElement background: (BlBackground image: anArgument)

src/Pyramid-Bloc/PyramidBackgroundOpacityCommand.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Class {
44
#category : #'Pyramid-Bloc-plugin-bloc-visuals'
55
}
66

7-
{ #category : #'as yet unclassified' }
7+
{ #category : #getter }
88
PyramidBackgroundOpacityCommand >> getValueFor: aBlElement [
99

1010
^ aBlElement background opacity
1111
]
1212

13-
{ #category : #'as yet unclassified' }
13+
{ #category : #setter }
1414
PyramidBackgroundOpacityCommand >> setValueFor: aBlElement with: anArgument [
1515

1616
| background |

src/Pyramid-Bloc/PyramidBackgroundPaintColorCommand.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ PyramidBackgroundPaintColorCommand >> canBeUsedFor: anObject [
1212
anObject background paint isKindOf: BlColorPaint ] ]
1313
]
1414

15-
{ #category : #'as yet unclassified' }
15+
{ #category : #getter }
1616
PyramidBackgroundPaintColorCommand >> getValueFor: aBlElement [
1717

1818
^ aBlElement background paint color
1919
]
2020

21-
{ #category : #'as yet unclassified' }
21+
{ #category : #setter }
2222
PyramidBackgroundPaintColorCommand >> setValueFor: aBlElement with: anArgument [
2323

2424
aBlElement background: (BlBackground paint: anArgument asBlPaint)

src/Pyramid-Bloc/PyramidBackgroundPaintCommand.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ PyramidBackgroundPaintCommand >> canBeUsedFor: anObject [
1111
anObject background isKindOf: BlPaintBackground ]
1212
]
1313

14-
{ #category : #'as yet unclassified' }
14+
{ #category : #getter }
1515
PyramidBackgroundPaintCommand >> getGroupedValueFor: aBlElement [
1616

1717
^ aBlElement background paint class
1818
]
1919

20-
{ #category : #'as yet unclassified' }
20+
{ #category : #getter }
2121
PyramidBackgroundPaintCommand >> getValueFor: aBlElement [
2222

2323
^ aBlElement background paint
2424
]
2525

26-
{ #category : #'as yet unclassified' }
26+
{ #category : #setter }
2727
PyramidBackgroundPaintCommand >> setValueFor: aBlElement with: anArgument [
2828

2929
aBlElement background: (BlBackground paint: anArgument value)

src/Pyramid-Bloc/PyramidBackgroundPaintLinearEndCommand.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Class {
44
#category : #'Pyramid-Bloc-plugin-bloc-visuals'
55
}
66

7-
{ #category : #'as yet unclassified' }
7+
{ #category : #getter }
88
PyramidBackgroundPaintLinearEndCommand >> getValueFor: aBlElement [
99

1010
^ aBlElement background paint end
1111
]
1212

13-
{ #category : #'as yet unclassified' }
13+
{ #category : #setter }
1414
PyramidBackgroundPaintLinearEndCommand >> setValueFor: aBlElement with: anArgument [
1515

1616
aBlElement background paint end: anArgument

src/Pyramid-Bloc/PyramidBackgroundPaintLinearStartCommand.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Class {
44
#category : #'Pyramid-Bloc-plugin-bloc-visuals'
55
}
66

7-
{ #category : #'as yet unclassified' }
7+
{ #category : #getter }
88
PyramidBackgroundPaintLinearStartCommand >> getValueFor: aBlElement [
99

1010
^ aBlElement background paint start
1111
]
1212

13-
{ #category : #'as yet unclassified' }
13+
{ #category : #setter }
1414
PyramidBackgroundPaintLinearStartCommand >> setValueFor: aBlElement with: anArgument [
1515

1616
aBlElement background paint start: anArgument

0 commit comments

Comments
 (0)