Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgolubev2012-09-11 20:17:58 -0400
committermgolubev2012-09-11 20:17:58 -0400
commit6ef8bfea5e3a20f237048eb4ce26de1be1efb267 (patch)
tree7a8004fb6562d478df8cc2ea87fbf55bb9c2f892
parent65b0f09430dcbd3ac87af573df61f686087714c6 (diff)
downloadorg.eclipse.gmf-tooling-R3_0+crlfs.tar.gz
org.eclipse.gmf-tooling-R3_0+crlfs.tar.xz
org.eclipse.gmf-tooling-R3_0+crlfs.zip
[388804] - TOE regenerated with GMFT3.0 SR1R3_0+crlfs
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/Department2EditPart.java1
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentEditPart.java1
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentName2EditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentNameEditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeName2EditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeNameEditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ManagerNameEditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ProjectNameEditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel2EditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel3EditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel4EditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel5EditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel6EditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabelEditPart.java89
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextNonResizableEditPolicy.java4
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextSelectionEditPolicy.java4
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorContentProvider.java161
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorLabelProvider.java48
-rw-r--r--examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/providers/TOEParserProvider.java6
19 files changed, 939 insertions, 354 deletions
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/Department2EditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/Department2EditPart.java
index 15fe1297a..f4e753029 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/Department2EditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/Department2EditPart.java
@@ -153,7 +153,6 @@ public class Department2EditPart extends ShapeNodeEditPart {
}
if (childEditPart instanceof DepartmentDepartment_staff2EditPart) {
IFigure pane = getPrimaryShape().getFigureDepartmentFigure_content_pane();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
pane.remove(((DepartmentDepartment_staff2EditPart) childEditPart).getFigure());
return true;
}
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentEditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentEditPart.java
index db1f94fc3..d3c21537b 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentEditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentEditPart.java
@@ -153,7 +153,6 @@ public class DepartmentEditPart extends ShapeNodeEditPart {
}
if (childEditPart instanceof DepartmentDepartment_staffEditPart) {
IFigure pane = getPrimaryShape().getFigureDepartmentFigure_content_pane();
- setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way
pane.remove(((DepartmentDepartment_staffEditPart) childEditPart).getFigure());
return true;
}
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentName2EditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentName2EditPart.java
index 3812a2149..d19c76c99 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentName2EditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentName2EditPart.java
@@ -27,6 +27,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -36,6 +38,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.swt.SWT;
@@ -77,6 +81,11 @@ public class DepartmentName2EditPart extends CompartmentEditPart implements ITex
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
public DepartmentName2EditPart(View view) {
super(view);
}
@@ -97,8 +106,10 @@ public class DepartmentName2EditPart extends CompartmentEditPart implements ITex
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -108,8 +119,10 @@ public class DepartmentName2EditPart extends CompartmentEditPart implements ITex
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -119,8 +132,10 @@ public class DepartmentName2EditPart extends CompartmentEditPart implements ITex
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -130,8 +145,12 @@ public class DepartmentName2EditPart extends CompartmentEditPart implements ITex
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -199,14 +218,7 @@ public class DepartmentName2EditPart extends CompartmentEditPart implements ITex
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -376,14 +388,7 @@ public class DepartmentName2EditPart extends CompartmentEditPart implements ITex
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -420,6 +425,24 @@ public class DepartmentName2EditPart extends CompartmentEditPart implements ITex
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -477,6 +500,32 @@ public class DepartmentName2EditPart extends CompartmentEditPart implements ITex
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentNameEditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentNameEditPart.java
index f2c3acfd6..33ab42e6c 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentNameEditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/DepartmentNameEditPart.java
@@ -27,6 +27,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -36,6 +38,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.swt.SWT;
@@ -77,6 +81,11 @@ public class DepartmentNameEditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
public DepartmentNameEditPart(View view) {
super(view);
}
@@ -97,8 +106,10 @@ public class DepartmentNameEditPart extends CompartmentEditPart implements IText
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -108,8 +119,10 @@ public class DepartmentNameEditPart extends CompartmentEditPart implements IText
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -119,8 +132,10 @@ public class DepartmentNameEditPart extends CompartmentEditPart implements IText
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -130,8 +145,12 @@ public class DepartmentNameEditPart extends CompartmentEditPart implements IText
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -199,14 +218,7 @@ public class DepartmentNameEditPart extends CompartmentEditPart implements IText
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -376,14 +388,7 @@ public class DepartmentNameEditPart extends CompartmentEditPart implements IText
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -420,6 +425,24 @@ public class DepartmentNameEditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -477,6 +500,32 @@ public class DepartmentNameEditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeName2EditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeName2EditPart.java
index 5e233669b..1d1c1b904 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeName2EditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeName2EditPart.java
@@ -30,6 +30,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -39,6 +41,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.swt.SWT;
@@ -80,6 +84,11 @@ public class EmployeeName2EditPart extends LabelEditPart implements ITextAwareEd
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
static {
registerSnapBackPosition(TOEVisualIDRegistry.getType(org.eclipse.gmf.examples.ocldriven.toe.diagram.edit.parts.EmployeeName2EditPart.VISUAL_ID), new Point(0, 0));
}
@@ -129,8 +138,10 @@ public class EmployeeName2EditPart extends LabelEditPart implements ITextAwareEd
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -140,8 +151,10 @@ public class EmployeeName2EditPart extends LabelEditPart implements ITextAwareEd
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -151,8 +164,10 @@ public class EmployeeName2EditPart extends LabelEditPart implements ITextAwareEd
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -162,8 +177,12 @@ public class EmployeeName2EditPart extends LabelEditPart implements ITextAwareEd
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -231,14 +250,7 @@ public class EmployeeName2EditPart extends LabelEditPart implements ITextAwareEd
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -408,14 +420,7 @@ public class EmployeeName2EditPart extends LabelEditPart implements ITextAwareEd
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -452,6 +457,24 @@ public class EmployeeName2EditPart extends LabelEditPart implements ITextAwareEd
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -509,6 +532,32 @@ public class EmployeeName2EditPart extends LabelEditPart implements ITextAwareEd
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeNameEditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeNameEditPart.java
index 661eec3c6..7faea6178 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeNameEditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/EmployeeNameEditPart.java
@@ -30,6 +30,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -39,6 +41,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.swt.SWT;
@@ -80,6 +84,11 @@ public class EmployeeNameEditPart extends LabelEditPart implements ITextAwareEdi
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
static {
registerSnapBackPosition(TOEVisualIDRegistry.getType(org.eclipse.gmf.examples.ocldriven.toe.diagram.edit.parts.EmployeeNameEditPart.VISUAL_ID), new Point(0, 0));
}
@@ -129,8 +138,10 @@ public class EmployeeNameEditPart extends LabelEditPart implements ITextAwareEdi
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -140,8 +151,10 @@ public class EmployeeNameEditPart extends LabelEditPart implements ITextAwareEdi
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -151,8 +164,10 @@ public class EmployeeNameEditPart extends LabelEditPart implements ITextAwareEdi
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -162,8 +177,12 @@ public class EmployeeNameEditPart extends LabelEditPart implements ITextAwareEdi
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -231,14 +250,7 @@ public class EmployeeNameEditPart extends LabelEditPart implements ITextAwareEdi
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -408,14 +420,7 @@ public class EmployeeNameEditPart extends LabelEditPart implements ITextAwareEdi
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -452,6 +457,24 @@ public class EmployeeNameEditPart extends LabelEditPart implements ITextAwareEdi
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -509,6 +532,32 @@ public class EmployeeNameEditPart extends LabelEditPart implements ITextAwareEdi
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ManagerNameEditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ManagerNameEditPart.java
index 00f9c6478..9980c3396 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ManagerNameEditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ManagerNameEditPart.java
@@ -30,6 +30,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -39,6 +41,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.swt.SWT;
@@ -80,6 +84,11 @@ public class ManagerNameEditPart extends LabelEditPart implements ITextAwareEdit
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
static {
registerSnapBackPosition(TOEVisualIDRegistry.getType(org.eclipse.gmf.examples.ocldriven.toe.diagram.edit.parts.ManagerNameEditPart.VISUAL_ID), new Point(0, 0));
}
@@ -129,8 +138,10 @@ public class ManagerNameEditPart extends LabelEditPart implements ITextAwareEdit
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -140,8 +151,10 @@ public class ManagerNameEditPart extends LabelEditPart implements ITextAwareEdit
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -151,8 +164,10 @@ public class ManagerNameEditPart extends LabelEditPart implements ITextAwareEdit
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -162,8 +177,12 @@ public class ManagerNameEditPart extends LabelEditPart implements ITextAwareEdit
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -231,14 +250,7 @@ public class ManagerNameEditPart extends LabelEditPart implements ITextAwareEdit
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -408,14 +420,7 @@ public class ManagerNameEditPart extends LabelEditPart implements ITextAwareEdit
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -452,6 +457,24 @@ public class ManagerNameEditPart extends LabelEditPart implements ITextAwareEdit
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -509,6 +532,32 @@ public class ManagerNameEditPart extends LabelEditPart implements ITextAwareEdit
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void handleNotificationEvent(Notification event) {
Object feature = event.getFeature();
if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ProjectNameEditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ProjectNameEditPart.java
index 9610cef54..1b0726ce7 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ProjectNameEditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/ProjectNameEditPart.java
@@ -27,6 +27,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -36,6 +38,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.swt.SWT;
@@ -77,6 +81,11 @@ public class ProjectNameEditPart extends CompartmentEditPart implements ITextAwa
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
public ProjectNameEditPart(View view) {
super(view);
}
@@ -97,8 +106,10 @@ public class ProjectNameEditPart extends CompartmentEditPart implements ITextAwa
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -108,8 +119,10 @@ public class ProjectNameEditPart extends CompartmentEditPart implements ITextAwa
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -119,8 +132,10 @@ public class ProjectNameEditPart extends CompartmentEditPart implements ITextAwa
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -130,8 +145,12 @@ public class ProjectNameEditPart extends CompartmentEditPart implements ITextAwa
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -199,14 +218,7 @@ public class ProjectNameEditPart extends CompartmentEditPart implements ITextAwa
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -376,14 +388,7 @@ public class ProjectNameEditPart extends CompartmentEditPart implements ITextAwa
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -420,6 +425,24 @@ public class ProjectNameEditPart extends CompartmentEditPart implements ITextAwa
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -477,6 +500,32 @@ public class ProjectNameEditPart extends CompartmentEditPart implements ITextAwa
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel2EditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel2EditPart.java
index 7a2a9b0ce..a287062df 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel2EditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel2EditPart.java
@@ -28,6 +28,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -37,6 +39,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.HasOclTracker;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTracker;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
@@ -80,6 +84,11 @@ public class WrappingLabel2EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
public WrappingLabel2EditPart(View view) {
super(view);
}
@@ -100,8 +109,10 @@ public class WrappingLabel2EditPart extends CompartmentEditPart implements IText
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -111,8 +122,10 @@ public class WrappingLabel2EditPart extends CompartmentEditPart implements IText
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -122,8 +135,10 @@ public class WrappingLabel2EditPart extends CompartmentEditPart implements IText
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -133,8 +148,12 @@ public class WrappingLabel2EditPart extends CompartmentEditPart implements IText
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -198,14 +217,7 @@ public class WrappingLabel2EditPart extends CompartmentEditPart implements IText
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -375,14 +387,7 @@ public class WrappingLabel2EditPart extends CompartmentEditPart implements IText
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -419,6 +424,24 @@ public class WrappingLabel2EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -492,6 +515,32 @@ public class WrappingLabel2EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel3EditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel3EditPart.java
index 187aa1479..8579ee103 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel3EditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel3EditPart.java
@@ -28,6 +28,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -37,6 +39,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.HasOclTracker;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTracker;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
@@ -80,6 +84,11 @@ public class WrappingLabel3EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
public WrappingLabel3EditPart(View view) {
super(view);
}
@@ -100,8 +109,10 @@ public class WrappingLabel3EditPart extends CompartmentEditPart implements IText
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -111,8 +122,10 @@ public class WrappingLabel3EditPart extends CompartmentEditPart implements IText
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -122,8 +135,10 @@ public class WrappingLabel3EditPart extends CompartmentEditPart implements IText
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -133,8 +148,12 @@ public class WrappingLabel3EditPart extends CompartmentEditPart implements IText
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -202,14 +221,7 @@ public class WrappingLabel3EditPart extends CompartmentEditPart implements IText
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -379,14 +391,7 @@ public class WrappingLabel3EditPart extends CompartmentEditPart implements IText
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -423,6 +428,24 @@ public class WrappingLabel3EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -496,6 +519,32 @@ public class WrappingLabel3EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel4EditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel4EditPart.java
index 6244b5124..ee221a50a 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel4EditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel4EditPart.java
@@ -28,6 +28,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -37,6 +39,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.HasOclTracker;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTracker;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
@@ -80,6 +84,11 @@ public class WrappingLabel4EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
public WrappingLabel4EditPart(View view) {
super(view);
}
@@ -100,8 +109,10 @@ public class WrappingLabel4EditPart extends CompartmentEditPart implements IText
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -111,8 +122,10 @@ public class WrappingLabel4EditPart extends CompartmentEditPart implements IText
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -122,8 +135,10 @@ public class WrappingLabel4EditPart extends CompartmentEditPart implements IText
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -133,8 +148,12 @@ public class WrappingLabel4EditPart extends CompartmentEditPart implements IText
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -202,14 +221,7 @@ public class WrappingLabel4EditPart extends CompartmentEditPart implements IText
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -379,14 +391,7 @@ public class WrappingLabel4EditPart extends CompartmentEditPart implements IText
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -423,6 +428,24 @@ public class WrappingLabel4EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -496,6 +519,32 @@ public class WrappingLabel4EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel5EditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel5EditPart.java
index 6a57ad708..3fa0b66fa 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel5EditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel5EditPart.java
@@ -28,6 +28,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -37,6 +39,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.HasOclTracker;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTracker;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
@@ -80,6 +84,11 @@ public class WrappingLabel5EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
public WrappingLabel5EditPart(View view) {
super(view);
}
@@ -100,8 +109,10 @@ public class WrappingLabel5EditPart extends CompartmentEditPart implements IText
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -111,8 +122,10 @@ public class WrappingLabel5EditPart extends CompartmentEditPart implements IText
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -122,8 +135,10 @@ public class WrappingLabel5EditPart extends CompartmentEditPart implements IText
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -133,8 +148,12 @@ public class WrappingLabel5EditPart extends CompartmentEditPart implements IText
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -198,14 +217,7 @@ public class WrappingLabel5EditPart extends CompartmentEditPart implements IText
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -375,14 +387,7 @@ public class WrappingLabel5EditPart extends CompartmentEditPart implements IText
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -419,6 +424,24 @@ public class WrappingLabel5EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -492,6 +515,32 @@ public class WrappingLabel5EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel6EditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel6EditPart.java
index e98a0f768..875503ee0 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel6EditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabel6EditPart.java
@@ -28,6 +28,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -37,6 +39,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.HasOclTracker;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTracker;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
@@ -80,6 +84,11 @@ public class WrappingLabel6EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
public WrappingLabel6EditPart(View view) {
super(view);
}
@@ -100,8 +109,10 @@ public class WrappingLabel6EditPart extends CompartmentEditPart implements IText
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -111,8 +122,10 @@ public class WrappingLabel6EditPart extends CompartmentEditPart implements IText
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -122,8 +135,10 @@ public class WrappingLabel6EditPart extends CompartmentEditPart implements IText
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -133,8 +148,12 @@ public class WrappingLabel6EditPart extends CompartmentEditPart implements IText
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -198,14 +217,7 @@ public class WrappingLabel6EditPart extends CompartmentEditPart implements IText
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -375,14 +387,7 @@ public class WrappingLabel6EditPart extends CompartmentEditPart implements IText
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -419,6 +424,24 @@ public class WrappingLabel6EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -492,6 +515,32 @@ public class WrappingLabel6EditPart extends CompartmentEditPart implements IText
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabelEditPart.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabelEditPart.java
index 4d8fe37b7..eeb341b52 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabelEditPart.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/parts/WrappingLabelEditPart.java
@@ -28,6 +28,8 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.label.ILabelDelegate;
+import org.eclipse.gmf.runtime.diagram.ui.label.WrappingLabelDelegate;
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
@@ -37,6 +39,8 @@ import org.eclipse.gmf.runtime.notation.FontStyle;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.TextDirectEditManager2;
+import org.eclipse.gmf.tooling.runtime.draw2d.labels.SimpleLabelDelegate;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.HasOclTracker;
import org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTracker;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
@@ -80,6 +84,11 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
/**
* @generated
*/
+ private ILabelDelegate labelDelegate;
+
+ /**
+ * @generated
+ */
public WrappingLabelEditPart(View view) {
super(view);
}
@@ -100,8 +109,10 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
protected String getLabelTextHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getText();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getText();
+ } else {
+ return getLabelDelegate().getText();
}
}
@@ -111,8 +122,10 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
protected void setLabelTextHelper(IFigure figure, String text) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setText(text);
- } else {
+ } else if (figure instanceof Label) {
((Label) figure).setText(text);
+ } else {
+ getLabelDelegate().setText(text);
}
}
@@ -122,8 +135,10 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
protected Image getLabelIconHelper(IFigure figure) {
if (figure instanceof WrappingLabel) {
return ((WrappingLabel) figure).getIcon();
- } else {
+ } else if (figure instanceof Label) {
return ((Label) figure).getIcon();
+ } else {
+ return getLabelDelegate().getIcon(0);
}
}
@@ -133,8 +148,12 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
protected void setLabelIconHelper(IFigure figure, Image icon) {
if (figure instanceof WrappingLabel) {
((WrappingLabel) figure).setIcon(icon);
- } else {
+ return;
+ } else if (figure instanceof Label) {
((Label) figure).setIcon(icon);
+ return;
+ } else {
+ getLabelDelegate().setIcon(icon, 0);
}
}
@@ -198,14 +217,7 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
*/
public void setLabelText(String text) {
setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -375,14 +387,7 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
protected void refreshLabel() {
setLabelTextHelper(getFigure(), getLabelText());
setLabelIconHelper(getFigure(), getLabelIcon());
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (pdEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if (sfEditPolicy instanceof TOETextSelectionEditPolicy) {
- ((TOETextSelectionEditPolicy) sfEditPolicy).refreshFeedback();
- }
+ refreshSelectionFeedback();
}
/**
@@ -419,6 +424,24 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
/**
* @generated
*/
+ private void refreshSelectionFeedback() {
+ requestEditPolicyFeedbackRefresh(EditPolicy.PRIMARY_DRAG_ROLE);
+ requestEditPolicyFeedbackRefresh(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ }
+
+ /**
+ * @generated
+ */
+ private void requestEditPolicyFeedbackRefresh(String editPolicyKey) {
+ Object editPolicy = getEditPolicy(editPolicyKey);
+ if (editPolicy instanceof IRefreshableFeedbackEditPolicy) {
+ ((IRefreshableFeedbackEditPolicy) editPolicy).refreshFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
protected void setFontColor(Color color) {
getFigure().setForegroundColor(color);
}
@@ -492,6 +515,32 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
/**
* @generated
*/
+ private ILabelDelegate getLabelDelegate() {
+ if (labelDelegate == null) {
+ IFigure label = getFigure();
+ if (label instanceof WrappingLabel) {
+ labelDelegate = new WrappingLabelDelegate((WrappingLabel) label);
+ } else {
+ labelDelegate = new SimpleLabelDelegate((Label) label);
+ }
+ }
+ return labelDelegate;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ public Object getAdapter(Class key) {
+ if (ILabelDelegate.class.equals(key)) {
+ return getLabelDelegate();
+ }
+ return super.getAdapter(key);
+ }
+
+ /**
+ * @generated
+ */
protected void addNotationalListeners() {
super.addNotationalListeners();
addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextNonResizableEditPolicy.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextNonResizableEditPolicy.java
index 25c74cb8a..b608563e3 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextNonResizableEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextNonResizableEditPolicy.java
@@ -16,11 +16,12 @@ import org.eclipse.gef.handles.MoveHandle;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
/**
* @generated
*/
-public class TOETextNonResizableEditPolicy extends NonResizableEditPolicyEx {
+public class TOETextNonResizableEditPolicy extends NonResizableEditPolicyEx implements IRefreshableFeedbackEditPolicy {
/**
* @generated
@@ -191,6 +192,7 @@ public class TOETextNonResizableEditPolicy extends NonResizableEditPolicyEx {
/**
* @generated
*/
+ @Override
public void refreshFeedback() {
refreshSelectionFeedback();
refreshFocusFeedback();
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextSelectionEditPolicy.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextSelectionEditPolicy.java
index 4472be72f..cd602e34b 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextSelectionEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/edit/policies/TOETextSelectionEditPolicy.java
@@ -10,11 +10,12 @@ import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.editpolicies.SelectionEditPolicy;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.tooling.runtime.edit.policies.labels.IRefreshableFeedbackEditPolicy;
/**
* @generated
*/
-public class TOETextSelectionEditPolicy extends SelectionEditPolicy {
+public class TOETextSelectionEditPolicy extends SelectionEditPolicy implements IRefreshableFeedbackEditPolicy {
/**
* @generated
@@ -185,6 +186,7 @@ public class TOETextSelectionEditPolicy extends SelectionEditPolicy {
/**
* @generated
*/
+ @Override
public void refreshFeedback() {
refreshSelectionFeedback();
refreshFocusFeedback();
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorContentProvider.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorContentProvider.java
index 649da890c..f394755d9 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorContentProvider.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorContentProvider.java
@@ -194,6 +194,7 @@ public class TOENavigatorContentProvider implements ICommonContentProvider {
topViews.add((View) o);
}
}
+ result.addAll(createNavigatorItems(selectViewsByType(topViews, AllHolderEditPart.MODEL_ID), file, false));
return result.toArray();
}
@@ -242,51 +243,23 @@ public class TOENavigatorContentProvider implements ICommonContentProvider {
return result.toArray();
}
- case ManagerEditPart.VISUAL_ID: {
- LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
- Node sv = (Node) view;
- TOENavigatorGroup outgoinglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Manager_2004_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- Collection<View> connectedViews;
- connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ManagerManagedDepartmentEditPart.VISUAL_ID));
- outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
- connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ManagerLeadsEditPart.VISUAL_ID));
- outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
- connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ContributionEditPart.VISUAL_ID));
- outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
- if (!outgoinglinks.isEmpty()) {
- result.add(outgoinglinks);
- }
- return result.toArray();
- }
-
- case Department2EditPart.VISUAL_ID: {
+ case ManagerManagedDepartmentEditPart.VISUAL_ID: {
LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
- Node sv = (Node) view;
- TOENavigatorGroup incominglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Department_3002_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Edge sv = (Edge) view;
+ TOENavigatorGroup target = new TOENavigatorGroup(Messages.NavigatorGroupName_ManagerManagedDepartment_4001_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ TOENavigatorGroup source = new TOENavigatorGroup(Messages.NavigatorGroupName_ManagerManagedDepartment_4001_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$
Collection<View> connectedViews;
- connectedViews = getChildrenByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentDepartment_staff2EditPart.VISUAL_ID));
- connectedViews = getChildrenByType(connectedViews, TOEVisualIDRegistry.getType(Employee2EditPart.VISUAL_ID));
- result.addAll(createNavigatorItems(connectedViews, parentElement, false));
- connectedViews = getChildrenByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentDepartment_staff2EditPart.VISUAL_ID));
- connectedViews = getChildrenByType(connectedViews, TOEVisualIDRegistry.getType(Department2EditPart.VISUAL_ID));
- result.addAll(createNavigatorItems(connectedViews, parentElement, false));
- connectedViews = getIncomingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ManagerManagedDepartmentEditPart.VISUAL_ID));
- incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- if (!incominglinks.isEmpty()) {
- result.add(incominglinks);
+ connectedViews = getLinksTargetByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentEditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksTargetByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(Department2EditPart.VISUAL_ID));
+ target.addChildren(createNavigatorItems(connectedViews, target, true));
+ connectedViews = getLinksSourceByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ManagerEditPart.VISUAL_ID));
+ source.addChildren(createNavigatorItems(connectedViews, source, true));
+ if (!target.isEmpty()) {
+ result.add(target);
}
- return result.toArray();
- }
-
- case EmployeeEditPart.VISUAL_ID: {
- LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
- Node sv = (Node) view;
- TOENavigatorGroup outgoinglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Employee_2001_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- Collection<View> connectedViews;
- connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ContributionEditPart.VISUAL_ID));
- outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
- if (!outgoinglinks.isEmpty()) {
- result.add(outgoinglinks);
+ if (!source.isEmpty()) {
+ result.add(source);
}
return result.toArray();
}
@@ -310,15 +283,15 @@ public class TOENavigatorContentProvider implements ICommonContentProvider {
return result.toArray();
}
- case DepartmentEditPart.VISUAL_ID: {
+ case Department2EditPart.VISUAL_ID: {
LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
Node sv = (Node) view;
- TOENavigatorGroup incominglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Department_2002_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ TOENavigatorGroup incominglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Department_3002_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
Collection<View> connectedViews;
- connectedViews = getChildrenByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentDepartment_staffEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentDepartment_staff2EditPart.VISUAL_ID));
connectedViews = getChildrenByType(connectedViews, TOEVisualIDRegistry.getType(Employee2EditPart.VISUAL_ID));
result.addAll(createNavigatorItems(connectedViews, parentElement, false));
- connectedViews = getChildrenByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentDepartment_staffEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentDepartment_staff2EditPart.VISUAL_ID));
connectedViews = getChildrenByType(connectedViews, TOEVisualIDRegistry.getType(Department2EditPart.VISUAL_ID));
result.addAll(createNavigatorItems(connectedViews, parentElement, false));
connectedViews = getIncomingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ManagerManagedDepartmentEditPart.VISUAL_ID));
@@ -329,40 +302,6 @@ public class TOENavigatorContentProvider implements ICommonContentProvider {
return result.toArray();
}
- case Employee2EditPart.VISUAL_ID: {
- LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
- Node sv = (Node) view;
- TOENavigatorGroup outgoinglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Employee_3001_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- Collection<View> connectedViews;
- connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ContributionEditPart.VISUAL_ID));
- outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
- if (!outgoinglinks.isEmpty()) {
- result.add(outgoinglinks);
- }
- return result.toArray();
- }
-
- case ManagerManagedDepartmentEditPart.VISUAL_ID: {
- LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
- Edge sv = (Edge) view;
- TOENavigatorGroup target = new TOENavigatorGroup(Messages.NavigatorGroupName_ManagerManagedDepartment_4001_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- TOENavigatorGroup source = new TOENavigatorGroup(Messages.NavigatorGroupName_ManagerManagedDepartment_4001_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- Collection<View> connectedViews;
- connectedViews = getLinksTargetByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentEditPart.VISUAL_ID));
- target.addChildren(createNavigatorItems(connectedViews, target, true));
- connectedViews = getLinksTargetByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(Department2EditPart.VISUAL_ID));
- target.addChildren(createNavigatorItems(connectedViews, target, true));
- connectedViews = getLinksSourceByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ManagerEditPart.VISUAL_ID));
- source.addChildren(createNavigatorItems(connectedViews, source, true));
- if (!target.isEmpty()) {
- result.add(target);
- }
- if (!source.isEmpty()) {
- result.add(source);
- }
- return result.toArray();
- }
-
case AllHolderEditPart.VISUAL_ID: {
LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
Diagram sv = (Diagram) view;
@@ -388,6 +327,23 @@ public class TOENavigatorContentProvider implements ICommonContentProvider {
return result.toArray();
}
+ case ManagerEditPart.VISUAL_ID: {
+ LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
+ Node sv = (Node) view;
+ TOENavigatorGroup outgoinglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Manager_2004_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection<View> connectedViews;
+ connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ManagerManagedDepartmentEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ManagerLeadsEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ContributionEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if (!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
case ProjectEditPart.VISUAL_ID: {
LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
Node sv = (Node) view;
@@ -402,6 +358,51 @@ public class TOENavigatorContentProvider implements ICommonContentProvider {
}
return result.toArray();
}
+
+ case DepartmentEditPart.VISUAL_ID: {
+ LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
+ Node sv = (Node) view;
+ TOENavigatorGroup incominglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Department_2002_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection<View> connectedViews;
+ connectedViews = getChildrenByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentDepartment_staffEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, TOEVisualIDRegistry.getType(Employee2EditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getChildrenByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(DepartmentDepartment_staffEditPart.VISUAL_ID));
+ connectedViews = getChildrenByType(connectedViews, TOEVisualIDRegistry.getType(Department2EditPart.VISUAL_ID));
+ result.addAll(createNavigatorItems(connectedViews, parentElement, false));
+ connectedViews = getIncomingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ManagerManagedDepartmentEditPart.VISUAL_ID));
+ incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
+ if (!incominglinks.isEmpty()) {
+ result.add(incominglinks);
+ }
+ return result.toArray();
+ }
+
+ case Employee2EditPart.VISUAL_ID: {
+ LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
+ Node sv = (Node) view;
+ TOENavigatorGroup outgoinglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Employee_3001_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection<View> connectedViews;
+ connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ContributionEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if (!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
+
+ case EmployeeEditPart.VISUAL_ID: {
+ LinkedList<TOEAbstractNavigatorItem> result = new LinkedList<TOEAbstractNavigatorItem>();
+ Node sv = (Node) view;
+ TOENavigatorGroup outgoinglinks = new TOENavigatorGroup(Messages.NavigatorGroupName_Employee_2001_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
+ Collection<View> connectedViews;
+ connectedViews = getOutgoingLinksByType(Collections.singleton(sv), TOEVisualIDRegistry.getType(ContributionEditPart.VISUAL_ID));
+ outgoinglinks.addChildren(createNavigatorItems(connectedViews, outgoinglinks, true));
+ if (!outgoinglinks.isEmpty()) {
+ result.add(outgoinglinks);
+ }
+ return result.toArray();
+ }
}
return EMPTY_ARRAY;
}
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorLabelProvider.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorLabelProvider.java
index 9df7e314f..661854646 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorLabelProvider.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/navigator/TOENavigatorLabelProvider.java
@@ -89,24 +89,24 @@ public class TOENavigatorLabelProvider extends LabelProvider implements ICommonL
switch (TOEVisualIDRegistry.getVisualID(view)) {
case ContributionEditPart.VISUAL_ID:
return getImage("Navigator?Link?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Contribution", TOEElementTypes.Contribution_4003); //$NON-NLS-1$
- case ManagerEditPart.VISUAL_ID:
- return getImage("Navigator?TopLevelNode?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Manager", TOEElementTypes.Manager_2004); //$NON-NLS-1$
- case Department2EditPart.VISUAL_ID:
- return getImage("Navigator?Node?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Department", TOEElementTypes.Department_3002); //$NON-NLS-1$
- case EmployeeEditPart.VISUAL_ID:
- return getImage("Navigator?TopLevelNode?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Employee", TOEElementTypes.Employee_2001); //$NON-NLS-1$
- case ManagerLeadsEditPart.VISUAL_ID:
- return getImage("Navigator?Link?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Manager?leads", TOEElementTypes.ManagerLeads_4002); //$NON-NLS-1$
- case DepartmentEditPart.VISUAL_ID:
- return getImage("Navigator?TopLevelNode?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Department", TOEElementTypes.Department_2002); //$NON-NLS-1$
- case Employee2EditPart.VISUAL_ID:
- return getImage("Navigator?Node?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Employee", TOEElementTypes.Employee_3001); //$NON-NLS-1$
case ManagerManagedDepartmentEditPart.VISUAL_ID:
return getImage("Navigator?Link?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Manager?managedDepartment", TOEElementTypes.ManagerManagedDepartment_4001); //$NON-NLS-1$
+ case ManagerLeadsEditPart.VISUAL_ID:
+ return getImage("Navigator?Link?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Manager?leads", TOEElementTypes.ManagerLeads_4002); //$NON-NLS-1$
+ case Department2EditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Department", TOEElementTypes.Department_3002); //$NON-NLS-1$
case AllHolderEditPart.VISUAL_ID:
return getImage("Navigator?Diagram?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?AllHolder", TOEElementTypes.AllHolder_1000); //$NON-NLS-1$
+ case ManagerEditPart.VISUAL_ID:
+ return getImage("Navigator?TopLevelNode?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Manager", TOEElementTypes.Manager_2004); //$NON-NLS-1$
case ProjectEditPart.VISUAL_ID:
return getImage("Navigator?TopLevelNode?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Project", TOEElementTypes.Project_2003); //$NON-NLS-1$
+ case DepartmentEditPart.VISUAL_ID:
+ return getImage("Navigator?TopLevelNode?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Department", TOEElementTypes.Department_2002); //$NON-NLS-1$
+ case Employee2EditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Employee", TOEElementTypes.Employee_3001); //$NON-NLS-1$
+ case EmployeeEditPart.VISUAL_ID:
+ return getImage("Navigator?TopLevelNode?http://www.eclipse.org/examples/gmf/ocldriven/table-of-organization-and-equipment?Employee", TOEElementTypes.Employee_2001); //$NON-NLS-1$
}
return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
}
@@ -159,24 +159,24 @@ public class TOENavigatorLabelProvider extends LabelProvider implements ICommonL
switch (TOEVisualIDRegistry.getVisualID(view)) {
case ContributionEditPart.VISUAL_ID:
return getContribution_4003Text(view);
- case ManagerEditPart.VISUAL_ID:
- return getManager_2004Text(view);
- case Department2EditPart.VISUAL_ID:
- return getDepartment_3002Text(view);
- case EmployeeEditPart.VISUAL_ID:
- return getEmployee_2001Text(view);
- case ManagerLeadsEditPart.VISUAL_ID:
- return getManagerLeads_4002Text(view);
- case DepartmentEditPart.VISUAL_ID:
- return getDepartment_2002Text(view);
- case Employee2EditPart.VISUAL_ID:
- return getEmployee_3001Text(view);
case ManagerManagedDepartmentEditPart.VISUAL_ID:
return getManagerManagedDepartment_4001Text(view);
+ case ManagerLeadsEditPart.VISUAL_ID:
+ return getManagerLeads_4002Text(view);
+ case Department2EditPart.VISUAL_ID:
+ return getDepartment_3002Text(view);
case AllHolderEditPart.VISUAL_ID:
return getAllHolder_1000Text(view);
+ case ManagerEditPart.VISUAL_ID:
+ return getManager_2004Text(view);
case ProjectEditPart.VISUAL_ID:
return getProject_2003Text(view);
+ case DepartmentEditPart.VISUAL_ID:
+ return getDepartment_2002Text(view);
+ case Employee2EditPart.VISUAL_ID:
+ return getEmployee_3001Text(view);
+ case EmployeeEditPart.VISUAL_ID:
+ return getEmployee_2001Text(view);
}
return getUnknownElementText(view);
}
diff --git a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/providers/TOEParserProvider.java b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/providers/TOEParserProvider.java
index 16be5ea7c..36fb89fa6 100644
--- a/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/providers/TOEParserProvider.java
+++ b/examples/org.eclipse.gmf.examples.ocldriven.diagram/src/org/eclipse/gmf/examples/ocldriven/toe/diagram/providers/TOEParserProvider.java
@@ -45,7 +45,6 @@ public class TOEParserProvider extends AbstractProvider implements IParserProvid
*/
private IParser getEmployeeName_5001Parser() {
if (employeeName_5001Parser == null) {
-
EAttribute[] features = new EAttribute[] { TOEPackage.eINSTANCE.getEmployee_Name() };
EAttribute[] editableFeatures = new EAttribute[] { TOEPackage.eINSTANCE.getEmployee_Name() };
MessageFormatParser parser = new MessageFormatParser(features, editableFeatures);
@@ -64,7 +63,6 @@ public class TOEParserProvider extends AbstractProvider implements IParserProvid
*/
private IParser getDepartmentName_5006Parser() {
if (departmentName_5006Parser == null) {
-
EAttribute[] features = new EAttribute[] { TOEPackage.eINSTANCE.getDepartment_Name() };
EAttribute[] editableFeatures = new EAttribute[] { TOEPackage.eINSTANCE.getDepartment_Name() };
MessageFormatParser parser = new MessageFormatParser(features, editableFeatures);
@@ -97,7 +95,6 @@ public class TOEParserProvider extends AbstractProvider implements IParserProvid
*/
private IParser getProjectName_5009Parser() {
if (projectName_5009Parser == null) {
-
EAttribute[] features = new EAttribute[] { TOEPackage.eINSTANCE.getProject_Name() };
EAttribute[] editableFeatures = new EAttribute[] { TOEPackage.eINSTANCE.getProject_Name() };
MessageFormatParser parser = new MessageFormatParser(features, editableFeatures);
@@ -130,7 +127,6 @@ public class TOEParserProvider extends AbstractProvider implements IParserProvid
*/
private IParser getManagerName_5012Parser() {
if (managerName_5012Parser == null) {
-
EAttribute[] features = new EAttribute[] { TOEPackage.eINSTANCE.getEmployee_Name() };
EAttribute[] editableFeatures = new EAttribute[] { TOEPackage.eINSTANCE.getEmployee_Name() };
MessageFormatParser parser = new MessageFormatParser(features, editableFeatures);
@@ -149,7 +145,6 @@ public class TOEParserProvider extends AbstractProvider implements IParserProvid
*/
private IParser getEmployeeName_5002Parser() {
if (employeeName_5002Parser == null) {
-
EAttribute[] features = new EAttribute[] { TOEPackage.eINSTANCE.getEmployee_Name() };
EAttribute[] editableFeatures = new EAttribute[] { TOEPackage.eINSTANCE.getEmployee_Name() };
MessageFormatParser parser = new MessageFormatParser(features, editableFeatures);
@@ -168,7 +163,6 @@ public class TOEParserProvider extends AbstractProvider implements IParserProvid
*/
private IParser getDepartmentName_5003Parser() {
if (departmentName_5003Parser == null) {
-
EAttribute[] features = new EAttribute[] { TOEPackage.eINSTANCE.getDepartment_Name() };
EAttribute[] editableFeatures = new EAttribute[] { TOEPackage.eINSTANCE.getDepartment_Name() };
MessageFormatParser parser = new MessageFormatParser(features, editableFeatures);

Back to the top