Author: scabanovich
Date: 2008-05-30 07:03:06 -0400 (Fri, 30 May 2008)
New Revision: 8454
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Link.java
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/PagesElementImpl.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesModelImpl.java
Log:
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Link.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Link.java 2008-05-30
11:02:21 UTC (rev 8453)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Link.java 2008-05-30
11:03:06 UTC (rev 8454)
@@ -89,4 +89,6 @@
* @generated
*/
void setData(Object value);
+
+ public void dataChanged();
}
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
11:02:21 UTC (rev 8453)
+++
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
11:03:06 UTC (rev 8454)
@@ -15,8 +15,11 @@
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.seam.pages.xml.model.helpers.SeamPagesProcessStructureHelper;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesElement;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesModel;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesPackage;
/**
@@ -475,4 +478,33 @@
return result.toString();
}
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void dataChanged() {
+ if(data instanceof XModelObject) {
+ XModelObject object = (XModelObject)data;
+ PagesModel pagesModel = null;
+ if(getFromElement() != null) {
+ pagesModel = getFromElement().getPagesModel();
+ } else if(getToElement() != null) {
+ pagesModel = getToElement().getPagesModel();
+ } else {
+ return;
+ }
+ SeamPagesProcessStructureHelper h = SeamPagesProcessStructureHelper.getInstance();
+ XModelObject t = h.getItemOutputTarget(object);
+ if(t != null) {
+ PagesElement to = pagesModel.findElement(t);
+ if(to != getToElement()) {
+ setToElement(to);
+ }
+ }
+ setName(h.getItemOutputPresentation(object));
+ setShortcut(h.isShortcut(object));
+ }
+ }
+
} //LinkImpl
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesElementImpl.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesElementImpl.java 2008-05-30
11:02:21 UTC (rev 8453)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesElementImpl.java 2008-05-30
11:03:06 UTC (rev 8454)
@@ -617,9 +617,7 @@
Link link = PagesFactory.eINSTANCE.createLink();
pagesModel.bindLink(childData, link);
link.setFromElement(from);
- link.setToElement(to);
- link.setName(h.getItemOutputPresentation(object));
- link.setShortcut(h.isShortcut(object));
+ link.dataChanged();
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesModelImpl.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesModelImpl.java 2008-05-30
11:02:21 UTC (rev 8453)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/PagesModelImpl.java 2008-05-30
11:03:06 UTC (rev 8454)
@@ -292,11 +292,14 @@
if(!event.getModelObject().getPath().startsWith(installedProcess.getPath())) {
return;
}
- PagesElement item = findElement(event.getModelObject());
+ PagesElement item = findElement(event.getInfo().toString());
if(item != null) {
item.dataChanged();
}
- //TODO update link
+ Link link = findLink(event.getInfo().toString());
+ if(link != null) {
+ link.dataChanged();
+ }
}
/**
@@ -323,7 +326,6 @@
if(target == installedProcess) {
PagesElement removed = findElement(event.getInfo());
if(removed != null) {
-
Link[] ls = removed.getOutputLinks().toArray(new Link[0]);
for (int i = 0; i < ls.length; i++) {
ls[i].setFromElement(null);
Show replies by date