Author: scabanovich
Date: 2008-05-30 12:27:14 -0400 (Fri, 30 May 2008)
New Revision: 8488
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
Log:
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java 2008-05-30
16:27:04 UTC (rev 8487)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java 2008-05-30
16:27:14 UTC (rev 8488)
@@ -495,6 +495,9 @@
return;
}
SeamPagesProcessStructureHelper h = SeamPagesProcessStructureHelper.getInstance();
+ setName(h.getItemOutputPresentation(object));
+ setShortcut(h.isShortcut(object));
+
XModelObject t = h.getItemOutputTarget(object);
if(t != null) {
PagesElement to = pagesModel.findElement(t);
@@ -502,8 +505,6 @@
setToElement(to);
}
}
- setName(h.getItemOutputPresentation(object));
- setShortcut(h.isShortcut(object));
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-05-30
16:27:04 UTC (rev 8487)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-05-30
16:27:14 UTC (rev 8488)
@@ -15,6 +15,9 @@
import org.eclipse.draw2d.*;
import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.eclipse.gef.AccessibleEditPart;
import org.eclipse.gef.EditPart;
@@ -56,6 +59,9 @@
private GEFLabel pathLabel;
public void activate() {
+ if (!isActive()) {
+ ((Notifier) getModel()).eAdapters().add(adapter);
+ }
super.activate();
addEditPartListener(this);
}
@@ -138,6 +144,9 @@
public void deactivate() {
removeEditPartListener(this);
//getLink().removePropertyChangeListener(this);
+ if (isActive()) {
+ ((Notifier) getModel()).eAdapters().remove(this);
+ }
super.deactivate();
}
@@ -244,4 +253,43 @@
}
}
+ Adapter adapter = new AdapterImpl();
+
+ class AdapterImpl implements Adapter {
+
+ /**
+ * @see
org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ */
+ public void notifyChanged(Notification notification) {
+ pathLabel.setText(getLinkModel().getName());
+ //TODO for shortCut
+ refresh();
+ refreshVisuals();
+ }
+
+ /**
+ * )
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#getTarget()
+ */
+ public Notifier getTarget() {
+
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(java.lang.Object)
+ */
+ public boolean isAdapterForType(Object type) {
+ return false;
+ }
+
+ /**
+ * @see
org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier)
+ */
+ public void setTarget(Notifier newTarget) {
+ }
+
+ }
+
}
Show replies by date