diff options
| author | Florian Barbin | 2017-07-05 12:51:49 +0000 |
|---|---|---|
| committer | Steve Monnier | 2017-07-26 07:53:05 +0000 |
| commit | 2b92e230ae5d8be89d131737fe5ec12da354d763 (patch) | |
| tree | 614d37eb94f03ee43d05bf77d562f343b65e748a | |
| parent | 2ce9b7e0a4ce68820e63332f4dea28ff88509e60 (diff) | |
| download | org.eclipse.sirius-2b92e230ae5d8be89d131737fe5ec12da354d763.tar.gz org.eclipse.sirius-2b92e230ae5d8be89d131737fe5ec12da354d763.tar.xz org.eclipse.sirius-2b92e230ae5d8be89d131737fe5ec12da354d763.zip | |
[518253] Resize the combined fragment when resizing the operand
* Delegates to the parent EditPolicy (The CombinedFragment) when
resizing the lower operand.
Bug: 518253
Change-Id: I07bf9c57d4e58b01df549542558efe3a8d6b6da6
Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/policy/OperandResizableEditPolicy.java | 21 |
1 files changed, 13 insertions, 8 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 75775df011..8fb68c3038 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2010, 2017 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,6 +39,7 @@ import org.eclipse.sirius.diagram.sequence.business.internal.elements.ISequenceE import org.eclipse.sirius.diagram.sequence.business.internal.elements.Operand; import org.eclipse.sirius.diagram.sequence.ui.Messages; import org.eclipse.sirius.diagram.sequence.ui.tool.internal.edit.operation.SequenceEditPartsOperations; +import org.eclipse.sirius.diagram.sequence.ui.tool.internal.edit.part.CombinedFragmentEditPart; import org.eclipse.sirius.diagram.sequence.ui.tool.internal.edit.part.OperandEditPart; import org.eclipse.sirius.diagram.sequence.ui.tool.internal.edit.validator.OperandResizeValidator; import org.eclipse.sirius.diagram.sequence.ui.tool.internal.util.RequestQuery; @@ -171,9 +172,13 @@ public class OperandResizableEditPolicy extends AirResizableEditPolicy { } else if (request.getResizeDirection() == PositionConstants.SOUTH) { OperandEditPart followingOperandEditPart = getFollowingOperandEditPart(operandIndex); if (followingOperandEditPart == null && self.getSelected() != EditPart.SELECTED_NONE) { - // There is no following operand, resize from south face - // is forbidden - ctc.add(new CommandProxy(UnexecutableCommand.INSTANCE)); + // 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); + } else { + ctc.add(new CommandProxy(UnexecutableCommand.INSTANCE)); + } } else if (followingOperandEditPart != null) { // We apply the inverse resize to the following operand Option<Operand> followingOperandOption = ISequenceElementAccessor.getOperand(followingOperandEditPart.getNotationView()); @@ -221,8 +226,8 @@ public class OperandResizableEditPolicy extends AirResizableEditPolicy { } /** - * Finds the previous {@link OperandEditPart} of the current - * {@link OperandEditPart} identified by the index currentOperandIndex. + * Finds the previous {@link OperandEditPart} of the current {@link OperandEditPart} identified by the index + * currentOperandIndex. * * @param currentOperandIndex * the index of the current {@link OperandEditPart} @@ -243,8 +248,8 @@ public class OperandResizableEditPolicy extends AirResizableEditPolicy { } /** - * Finds the following {@link OperandEditPart} of the current - * {@link OperandEditPart} identified by the index currentOperandIndex. + * Finds the following {@link OperandEditPart} of the current {@link OperandEditPart} identified by the index + * currentOperandIndex. * * @param currentOperandIndex * the index of the current {@link OperandEditPart} |
