Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java
index 2caec83b22b..6b7b4dc7f02 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/src/org/eclipse/papyrus/uml/diagram/composite/edit/parts/StateMachineCompositeNameEditPart.java
@@ -64,6 +64,7 @@ import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusC
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IControlParserForDirectEdit;
import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IndirectMaskLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
@@ -320,7 +321,6 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
ie.printStackTrace();
}
}
-
// shouldn't get here
return null;
}
@@ -407,9 +407,7 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
* @generated
*/
protected void performDirectEditRequest(Request request) {
-
final Request theRequest = request;
-
if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
directEditionMode = getDirectEditionType();
}
@@ -442,7 +440,6 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
return;
}
final Dialog finalDialog = dialog;
-
if(Window.OK == dialog.open()) {
TransactionalEditingDomain domain = getEditingDomain();
RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
@@ -450,7 +447,6 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
@Override
protected void doExecute() {
configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
}
};
domain.getCommandStack().execute(command);
@@ -507,8 +503,17 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
protected void refreshLabel() {
EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
+ maskLabelPolicy = getEditPolicy(IndirectMaskLabelEditPolicy.INDRIRECT_MASK_MANAGED_LABEL);
+ }
+ if(maskLabelPolicy == null) {
+ View view = (View)getModel();
+ if(view.isVisible()) {
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+ } else {
+ setLabelTextHelper(getFigure(), ""); //$NON-NLS-1$
+ setLabelIconHelper(getFigure(), null);
+ }
}
Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
if(pdEditPolicy instanceof UMLTextSelectionEditPolicy) {
@@ -629,7 +634,6 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
if(checkDefaultEdition()) {
return IDirectEdition.DEFAULT_DIRECT_EDITOR;
}
-
// not a named element. no specific editor => do nothing
return IDirectEdition.NO_DIRECT_EDITION;
}
@@ -796,7 +800,6 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
*/
protected void addOwnerElementListeners() {
addListenerFilter(ADD_PARENT_MODEL, this, ((View)getParent().getModel())); //$NON-NLS-1$
-
}
/**
@@ -805,7 +808,6 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
public void deactivate() {
removeOwnerElementListeners();
super.deactivate();
-
}
/**
@@ -813,6 +815,5 @@ public class StateMachineCompositeNameEditPart extends PapyrusCompartmentEditPar
*/
protected void removeOwnerElementListeners() {
removeListenerFilter(ADD_PARENT_MODEL);
-
}
}

Back to the top