Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2017-08-23 14:35:43 +0000
committerLaurent Redor2017-08-31 08:46:24 +0000
commit1039dee85973458a623896374dc6d6d73d7f5815 (patch)
tree1cc07ca313a752566cc22aaa1762409ee4c511d9
parent51cb3154014865fb303d0892b1f09e1ea92f8888 (diff)
downloadorg.eclipse.sirius-1039dee85973458a623896374dc6d6d73d7f5815.tar.gz
org.eclipse.sirius-1039dee85973458a623896374dc6d6d73d7f5815.tar.xz
org.eclipse.sirius-1039dee85973458a623896374dc6d6d73d7f5815.zip
[518253] Handle case of resizing the first operand in top direction
This case was missed in previous commit 2b92e230 [1]. [1] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=2b92e230ae5d8be89d131737fe5ec12da354d763 Bug: 518253 Change-Id: I14585348bd4dcef61997035dca378ae5467be86c Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/OperandResizableEditPolicy.java17
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.html3
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile1
3 files changed, 17 insertions, 4 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/OperandResizableEditPolicy.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/OperandResizableEditPolicy.java
index 8fb68c3038..7f1c60f041 100644
--- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/OperandResizableEditPolicy.java
+++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/OperandResizableEditPolicy.java
@@ -143,6 +143,7 @@ public class OperandResizableEditPolicy extends AirResizableEditPolicy {
}
private Command getResizeCustomCommand(OperandEditPart self, ChangeBoundsRequest request) {
+ Command result = null;
CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(self.getEditingDomain(), Messages.OperandResizableEditPolicy_resizeCompositeCommand);
ctc.add(OperandResizableEditPolicy.getResizeBorderItemTCommand(self, request));
Option<Operand> operandOption = ISequenceElementAccessor.getOperand(self.getNotationView());
@@ -154,9 +155,13 @@ public class OperandResizableEditPolicy extends AirResizableEditPolicy {
// previous operand
OperandEditPart previousOperandEditPart = getPreviousOperandEditPart(operandIndex);
if (previousOperandEditPart == null && self.getSelected() != EditPart.SELECTED_NONE) {
- // There is no previous operand, resize from north face
- // is forbidden
- ctc.add(new CommandProxy(UnexecutableCommand.INSTANCE));
+ // There is no previous operand, resize from north face is forwarded to the parent
+ // CombinedFragmentEditPart in order to resize it instead.
+ if (getHost() != null && getHost().getParent() != null && getHost().getParent().getParent() instanceof CombinedFragmentEditPart) {
+ result = getHost().getParent().getParent().getCommand(request);
+ } else {
+ ctc.add(new CommandProxy(UnexecutableCommand.INSTANCE));
+ }
} else if (previousOperandEditPart != null) {
// We apply the inverse resize to the previous operand
Option<Operand> previousOperandOption = ISequenceElementAccessor.getOperand(previousOperandEditPart.getNotationView());
@@ -175,7 +180,7 @@ public class OperandResizableEditPolicy extends AirResizableEditPolicy {
// There is no following operand, resize from south face is forwarded to the parent
// CombinedFragmentEditPart in order to resize it instead.
if (getHost() != null && getHost().getParent() != null && getHost().getParent().getParent() instanceof CombinedFragmentEditPart) {
- return getHost().getParent().getParent().getCommand(request);
+ result = getHost().getParent().getParent().getCommand(request);
} else {
ctc.add(new CommandProxy(UnexecutableCommand.INSTANCE));
}
@@ -193,6 +198,10 @@ public class OperandResizableEditPolicy extends AirResizableEditPolicy {
}
}
}
+ if (result != null) {
+ // The resulting has been computing from another edit part, return it
+ return result;
+ }
return new ICommandProxy(ctc);
}
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
index e5589ef31f..a3d5589f96 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
@@ -131,6 +131,9 @@
<p>
<img border="0" src="./images/borderNodesWithSnapToGrid.png"/>
</p>
+ <ul>
+ <li><span class="label label-info">Modified</span> In a sequence diagram, it is now possible to resize the combined fragment when the first or the last operand is selected (increase the size of the first operand to the top, or increase the size of the last operand to the bottom). Before, it was necessary to select the combined fragment itself to resize it. </li>
+ </ul>
<h3 id="SpecifierVisibleChanges">Specifier-Visible Changes</h3>
<ul>
<li><span class="label label-success">Added</span> An
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
index 30b082236b..ef3974abdb 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
@@ -16,6 +16,7 @@ h3. User-Visible Changes
* <span class="label label-info">Modified</span> In a diagram, when selecting an edge or a node that are not fully displayed in the editor, now, the reveal is not done anymore, that is, the displayed content of the editor is not moved anymore. If the user want to fully see the selected element, he may drag the editor content using center mouse button.
* <span class="label label-info">Modified</span> In a diagram with _snapToGrid_ enabled, when you create an edge with a tool that also create the associated border nodes, the border nodes are now snapped near the click location. Before, it was created to respect a shortest path.
!./images/borderNodesWithSnapToGrid.png!
+* <span class="label label-info">Modified</span> In a sequence diagram, it is now possible to resize the combined fragment when the first or the last operand is selected (increase the size of the first operand to the top, or increase the size of the last operand to the bottom). Before, it was necessary to select the combined fragment itself to resize it.
h3. Specifier-Visible Changes

Back to the top