Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2008-10-27 20:09:00 +0000
committeratikhomirov2008-10-27 20:09:00 +0000
commit64084afb2627cbd67eb39a2640bb7431ac3dbaab (patch)
tree8917883447ab0100141d66753c84b8d0e7b817b5
parentfc330a2630656c5aad82c834e69ddc9a3d42b0ab (diff)
downloadorg.eclipse.gmf-tooling-64084afb2627cbd67eb39a2640bb7431ac3dbaab.tar.gz
org.eclipse.gmf-tooling-64084afb2627cbd67eb39a2640bb7431ac3dbaab.tar.xz
org.eclipse.gmf-tooling-64084afb2627cbd67eb39a2640bb7431ac3dbaab.zip
regenerated with recent gmfgen/templates changes
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextNonResizableEditPolicy.java23
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextSelectionEditPolicy.java23
-rw-r--r--examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/CreateShortcutAction.java4
3 files changed, 47 insertions, 3 deletions
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextNonResizableEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextNonResizableEditPolicy.java
index 44f09c619..1e1931602 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextNonResizableEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextNonResizableEditPolicy.java
@@ -16,6 +16,7 @@ import java.util.List;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
@@ -45,6 +46,11 @@ public class EcoreTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
/**
* @generated
*/
+ private FigureListener hostPositionListener;
+
+ /**
+ * @generated
+ */
protected void showPrimarySelection() {
if (getHostFigure() instanceof WrappingLabel) {
((WrappingLabel) getHostFigure()).setSelected(true);
@@ -65,6 +71,7 @@ public class EcoreTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
} else {
hideSelection();
addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
refreshSelectionFeedback();
hideFocus();
}
@@ -80,6 +87,7 @@ public class EcoreTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
} else {
if (selectionFeedbackFigure != null) {
removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
selectionFeedbackFigure = null;
}
hideFocus();
@@ -202,6 +210,21 @@ public class EcoreTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
/**
* @generated
*/
+ private FigureListener getHostPositionListener() {
+ if (hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+
+ /**
+ * @generated
+ */
protected List createSelectionHandles() {
MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
moveHandle.setBorder(null);
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextSelectionEditPolicy.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextSelectionEditPolicy.java
index 80c5ad4b7..feee587e8 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextSelectionEditPolicy.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/edit/policies/EcoreTextSelectionEditPolicy.java
@@ -13,6 +13,7 @@ package org.eclipse.gmf.ecore.edit.policies;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
@@ -39,6 +40,11 @@ public class EcoreTextSelectionEditPolicy extends SelectionEditPolicy {
/**
* @generated
*/
+ private FigureListener hostPositionListener;
+
+ /**
+ * @generated
+ */
protected void showPrimarySelection() {
if (getHostFigure() instanceof WrappingLabel) {
((WrappingLabel) getHostFigure()).setSelected(true);
@@ -59,6 +65,7 @@ public class EcoreTextSelectionEditPolicy extends SelectionEditPolicy {
} else {
hideSelection();
addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
refreshSelectionFeedback();
hideFocus();
}
@@ -74,6 +81,7 @@ public class EcoreTextSelectionEditPolicy extends SelectionEditPolicy {
} else {
if (selectionFeedbackFigure != null) {
removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
selectionFeedbackFigure = null;
}
hideFocus();
@@ -192,4 +200,19 @@ public class EcoreTextSelectionEditPolicy extends SelectionEditPolicy {
refreshSelectionFeedback();
refreshFocusFeedback();
}
+
+ /**
+ * @generated
+ */
+ private FigureListener getHostPositionListener() {
+ if (hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
}
diff --git a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/CreateShortcutAction.java b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/CreateShortcutAction.java
index c8c0d36fa..e5ef5f00e 100644
--- a/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/CreateShortcutAction.java
+++ b/examples/org.eclipse.gmf.ecore.editor/src/org/eclipse/gmf/ecore/part/CreateShortcutAction.java
@@ -72,9 +72,7 @@ public class CreateShortcutAction extends AbstractHandler {
if (selectedElement == null) {
return null;
}
- CreateViewRequest.ViewDescriptor viewDescriptor = new CreateViewRequest.ViewDescriptor(new EObjectAdapter(selectedElement), Node.class, null,
-
- EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
+ CreateViewRequest.ViewDescriptor viewDescriptor = new CreateViewRequest.ViewDescriptor(new EObjectAdapter(selectedElement), Node.class, null, EcoreDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
ICommand command = new CreateCommand(editingDomain, viewDescriptor, view);
command = command.compose(new EcoreCreateShortcutDecorationsCommand(editingDomain, view, viewDescriptor));
try {

Back to the top