Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcletavernie2012-02-14 10:37:08 +0000
committercletavernie2012-02-14 10:37:08 +0000
commitccf0287c8367473f899da18107e2cbc016d83b0c (patch)
treec81b1e52ec174990397bbd037e1bbbe28745b5bb /plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common
parentdc04ee2eeb88562d8222b8a31c4937a7f6a45111 (diff)
downloadorg.eclipse.papyrus-ccf0287c8367473f899da18107e2cbc016d83b0c.tar.gz
org.eclipse.papyrus-ccf0287c8367473f899da18107e2cbc016d83b0c.tar.xz
org.eclipse.papyrus-ccf0287c8367473f899da18107e2cbc016d83b0c.zip
371460: [UML Diagram Common] The UML Diagram Common plug-in should be split
https://bugs.eclipse.org/bugs/show_bug.cgi?id=371460
Diffstat (limited to 'plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common')
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF4
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedNodeEditPart.java2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java30
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java24
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java36
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java25
10 files changed, 88 insertions, 41 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
index ae45b1e4a4d..3a5d83fbf55 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
@@ -21,7 +21,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.gmf.runtime.diagram.core;bundle-version="1.4.1",
org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
org.eclipse.papyrus.uml.tools;bundle-version="0.9.0",
- org.eclipse.papyrus.infra.emf;bundle-version="0.9.0"
+ org.eclipse.papyrus.infra.emf;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.9.0",
+ org.eclipse.papyrus.infra.emf.appearance;bundle-version="0.9.0"
Export-Package: org.eclipse.papyrus.gmf.diagram.common.commands,
org.eclipse.papyrus.gmf.diagram.common.compatibility,
org.eclipse.papyrus.gmf.diagram.common.edit.part,
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java
index 38a9f85fb7a..1fe6aafd21f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java
@@ -23,11 +23,11 @@ import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
import org.eclipse.papyrus.sysml.diagram.common.Activator;
import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLabelEditPart;
import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.tools.utils.ui.helper.NameLabelIconHelper;
import org.eclipse.swt.graphics.Image;
/**
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedNodeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedNodeEditPart.java
index 123ad23f985..5a9aec1f8f6 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedNodeEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedNodeEditPart.java
@@ -33,13 +33,13 @@ import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.ExternalLabelPrimaryDragRoleEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
import org.eclipse.papyrus.sysml.diagram.common.Activator;
import org.eclipse.papyrus.sysml.diagram.common.figure.FlowPortFigure;
import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
import org.eclipse.papyrus.sysml.portandflows.FlowPort;
import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementBorderEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editparts.IPapyrusEditPart;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy;
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java
index ecb7cf126c6..04f15c92dda 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java
@@ -69,18 +69,18 @@ import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDirectEditPolicy;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextNonResizableEditPolicy;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextSelectionEditPolicy;
import org.eclipse.papyrus.gmf.diagram.common.locator.CellEditorLocatorUtil;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.sysml.diagram.common.Activator;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.edit.policy.MaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.tools.utils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.tools.utils.ui.helper.NameLabelIconHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.graphics.Color;
@@ -113,6 +113,7 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
super(view);
}
+ @Override
public DragTracker getDragTracker(Request request) {
if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
return null;
@@ -122,6 +123,7 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
return new SelectEditPartTracker(this);
}
+ @Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MaskManagedLabelEditPolicy());
@@ -178,10 +180,12 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
refreshVisuals();
}
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -275,18 +279,18 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
}
public ParserOptions getParserOptions() {
-
+
if(getNotationView() == null || getNotationView().getDiagram() == null) {
return ParserOptions.NONE;
}
- EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstant.CUSTOM_APPEARENCE_ANNOTATION);
+ EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
if(display == null) {
return getDefaultParserOptions();
}
// display != null
- int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstant.CUSTOM_APPEARANCE_MASK_VALUE));
+ int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstants.CUSTOM_APPEARANCE_MASK_VALUE));
return new ParserOptions(displayOptions);
}
@@ -356,6 +360,7 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
/**
* @generated
*/
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
@@ -381,7 +386,7 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
} else if(configuration instanceof IAdvancedEditorConfiguration) {
dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
} else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
@@ -430,6 +435,7 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
}
}
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -468,6 +474,7 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
}
}
+ @Override
protected void refreshFont() {
FontStyle style = (FontStyle)getView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if(style != null) {
@@ -476,10 +483,12 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
}
}
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
+ @Override
protected void addSemanticListeners() {
if(getParser() instanceof ISemanticParser) {
EObject element = resolveSemanticElement();
@@ -492,6 +501,7 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
}
}
+ @Override
protected void removeSemanticListeners() {
if(parserElements != null) {
for(int i = 0; i < parserElements.size(); i++) {
@@ -502,10 +512,12 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
}
}
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
if(accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -586,16 +598,19 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
}
}
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
}
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
}
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
@@ -625,6 +640,7 @@ public class AbstractElementChildLabelEditPart extends GraphicalEditPart impleme
super.handleNotificationEvent(event);
}
+ @Override
protected IFigure createFigure() {
IFigure label = createFigurePrim();
defaultText = getLabelTextHelper(label);
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java
index 9234b709025..c6aa943cccb 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java
@@ -68,6 +68,8 @@ import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultSnapBackEditPol
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDirectEditPolicy;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextSelectionEditPolicy;
import org.eclipse.papyrus.gmf.diagram.common.locator.TextCellEditorLocator;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
@@ -75,10 +77,8 @@ import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEdi
import org.eclipse.papyrus.uml.diagram.common.edit.policy.MaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
-import org.eclipse.papyrus.uml.tools.utils.ui.VisualInformationPapyrusConstant;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.graphics.Color;
@@ -183,10 +183,12 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
refreshVisuals();
}
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -268,18 +270,18 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
}
public ParserOptions getParserOptions() {
-
+
if(getNotationView() == null || getNotationView().getDiagram() == null) {
return ParserOptions.NONE;
}
- EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstant.CUSTOM_APPEARENCE_ANNOTATION);
+ EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
if(display == null) {
return getDefaultParserOptions();
}
// display != null
- int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstant.CUSTOM_APPEARANCE_MASK_VALUE));
+ int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstants.CUSTOM_APPEARANCE_MASK_VALUE));
return new ParserOptions(displayOptions);
}
@@ -334,6 +336,7 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
}
}
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
@@ -359,7 +362,7 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
} else if(configuration instanceof IAdvancedEditorConfiguration) {
dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
} else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
@@ -408,6 +411,7 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
}
}
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -446,6 +450,7 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
}
}
+ @Override
protected void refreshFont() {
FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if(style != null) {
@@ -454,10 +459,12 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
}
}
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
+ @Override
protected void addSemanticListeners() {
if(getParser() instanceof ISemanticParser) {
EObject element = getParserElement();
@@ -470,6 +477,7 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
}
}
+ @Override
protected void removeSemanticListeners() {
if(parserElements != null) {
for(int i = 0; i < parserElements.size(); i++) {
@@ -480,10 +488,12 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
}
}
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
if(accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -591,6 +601,7 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
}
}
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
@@ -621,6 +632,7 @@ public abstract class AbstractElementLabelEditPart extends LabelEditPart impleme
super.handleNotificationEvent(event);
}
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java
index 92b1a010b92..c446cd3a7ef 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java
@@ -73,18 +73,18 @@ import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDirectEditPolicy;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextNonResizableEditPolicy;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextSelectionEditPolicy;
import org.eclipse.papyrus.gmf.diagram.common.locator.TextCellEditorLocator;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
import org.eclipse.papyrus.uml.diagram.common.edit.policy.MaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.tools.utils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.tools.utils.ui.helper.NameLabelIconHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.graphics.Color;
@@ -131,6 +131,7 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
*
* @see CompartmentEditPart#isSelectable()
*/
+ @Override
public boolean isSelectable() {
if(super.isSelectable()) {
EditPart focusPart = getViewer().getFocusEditPart();
@@ -143,8 +144,9 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
Iterator<?> selection = getViewer().getSelectedEditParts().iterator();
while(selection.hasNext()) {
Object editPart = selection.next();
- if(editPart instanceof IGraphicalEditPart && (((IGraphicalEditPart)editPart).getTopGraphicEditPart() != myTopEP))
+ if(editPart instanceof IGraphicalEditPart && (((IGraphicalEditPart)editPart).getTopGraphicEditPart() != myTopEP)) {
return false;
+ }
}
return true;
}
@@ -224,10 +226,12 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
refreshVisuals();
}
+ @Override
protected List getModelChildren() {
return Collections.EMPTY_LIST;
}
+ @Override
public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
return null;
}
@@ -321,18 +325,18 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
}
public ParserOptions getParserOptions() {
-
+
if(getNotationView() == null || getNotationView().getDiagram() == null) {
return ParserOptions.NONE;
}
- EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstant.CUSTOM_APPEARENCE_ANNOTATION);
+ EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
if(display == null) {
return getDefaultParserOptions();
}
// display != null
- int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstant.CUSTOM_APPEARANCE_MASK_VALUE));
+ int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstants.CUSTOM_APPEARANCE_MASK_VALUE));
return new ParserOptions(displayOptions);
}
@@ -350,7 +354,7 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
return new ParserOptions(displayOptions);
}
-
+
public IParser getParser() {
if(parser == null) {
parser = ParserService.getInstance().getParser(new DefaultParserHintAdapter(getNotationView().getDiagram(), getParserElement(), getNotationView().getType()));
@@ -387,6 +391,7 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
}
}
+ @Override
protected void performDirectEditRequest(Request request) {
final Request theRequest = request;
@@ -412,7 +417,7 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
} else if(configuration instanceof IAdvancedEditorConfiguration) {
dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
} else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
} else {
return;
}
@@ -461,6 +466,7 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
}
}
+ @Override
protected void refreshVisuals() {
super.refreshVisuals();
refreshLabel();
@@ -499,6 +505,7 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
}
}
+ @Override
protected void refreshFont() {
FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
if(style != null) {
@@ -507,10 +514,12 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
}
}
+ @Override
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
+ @Override
protected void addSemanticListeners() {
if(getParser() instanceof ISemanticParser) {
EObject element = getParserElement();
@@ -523,6 +532,7 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
}
}
+ @Override
protected void removeSemanticListeners() {
if(parserElements != null) {
for(int i = 0; i < parserElements.size(); i++) {
@@ -533,10 +543,12 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
}
}
+ @Override
protected AccessibleEditPart getAccessibleEditPart() {
if(accessibleEP == null) {
accessibleEP = new AccessibleGraphicalEditPart() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = getLabelTextHelper(getFigure());
}
@@ -644,6 +656,7 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
}
}
+ @Override
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
@@ -671,23 +684,26 @@ public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart
}
}
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstant.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
refreshLabel();
}
super.handleNotificationEvent(event);
}
+ @Override
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
}
+ @Override
protected void removeNotationalListeners() {
super.removeNotationalListeners();
removeListenerFilter("PrimaryView"); //$NON-NLS-1$
}
+ @Override
protected IFigure createFigure() {
// Parent should assign one using setLabel() method
return null;
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java
index c798d8b898c..17af6b88407 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java
@@ -20,7 +20,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.editparts.IPapyrusEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java
index da5f51772ea..17b5d3e3911 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java
@@ -22,10 +22,10 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
import org.eclipse.papyrus.sysml.diagram.common.Activator;
import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.tools.utils.ui.helper.NameLabelIconHelper;
import org.eclipse.swt.graphics.Image;
import org.eclipse.uml2.uml.NamedElement;
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java
index da7e66d1958..59d921924ba 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java
@@ -22,10 +22,10 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
import org.eclipse.papyrus.sysml.diagram.common.Activator;
import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.tools.utils.ui.helper.NameLabelIconHelper;
import org.eclipse.swt.graphics.Image;
import org.eclipse.uml2.uml.Port;
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java
index 90c662cd2b6..3f07f190931 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java
@@ -24,10 +24,10 @@ import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
+import org.eclipse.papyrus.infra.emf.appearance.commands.AddMaskManagedLabelDisplayCommand;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
import org.eclipse.papyrus.infra.emf.commands.RemoveEAnnotationCommand;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.tools.utils.ui.VisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.tools.utils.ui.command.AddMaskManagedLabelDisplayCommand;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
/**
@@ -37,18 +37,18 @@ import org.eclipse.papyrus.uml.tools.utils.ui.command.AddMaskManagedLabelDisplay
* </pre>
*/
public class MaskManagedLabelEditPolicy extends GraphicalEditPolicy implements IMaskManagedLabelEditPolicy {
-
+
/**
* {@inheritDoc}
*/
public Map<Integer, String> getMasks() {
Map<Integer, String> masks = new HashMap<Integer, String>();
-
+
IParser parser = getHostLabelEditPart().getParser();
- if (parser instanceof IMaskManagedSemanticParser) {
- masks = ((IMaskManagedSemanticParser) parser).getMasks();
+ if(parser instanceof IMaskManagedSemanticParser) {
+ masks = ((IMaskManagedSemanticParser)parser).getMasks();
}
-
+
return masks;
}
@@ -82,7 +82,7 @@ public class MaskManagedLabelEditPolicy extends GraphicalEditPolicy implements I
public void setDefaultDisplayValue() {
TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
if(editingDomain != null) {
- editingDomain.getCommandStack().execute(new RemoveEAnnotationCommand(editingDomain, (EModelElement)getHost().getModel(), VisualInformationPapyrusConstant.CUSTOM_APPEARENCE_ANNOTATION));
+ editingDomain.getCommandStack().execute(new RemoveEAnnotationCommand(editingDomain, (EModelElement)getHost().getModel(), VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION));
}
}
@@ -97,7 +97,7 @@ public class MaskManagedLabelEditPolicy extends GraphicalEditPolicy implements I
// Not implemented.
return null;
}
-
+
// @unused.
public Collection<Integer> getMaskValues() {
// Not implemented.
@@ -114,12 +114,13 @@ public class MaskManagedLabelEditPolicy extends GraphicalEditPolicy implements I
// Not implemented.
return null;
}
-
+
/**
* Get the host label edit part (has to implement {@link ITextAwareEditPart}).
+ *
* @return the host label edit part.
*/
private ITextAwareEditPart getHostLabelEditPart() {
- return (ITextAwareEditPart) getHost();
+ return (ITextAwareEditPart)getHost();
}
}

Back to the top