Author: scabanovich
Date: 2012-01-12 13:26:30 -0500 (Thu, 12 Jan 2012)
New Revision: 37792
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenBusHandler.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenScheduleHandler.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta
Log:
JBIDE-10576
https://issues.joss.org/browse/JBIDE-10576
Linking field editor is implemented for ESB attributes 'Channel ID Ref' and
'Schedule ID ref'.
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2012-01-12 18:06:29 UTC (rev
37791)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2012-01-12 18:26:30 UTC (rev
37792)
@@ -64,6 +64,11 @@
<xclass id="org.jboss.tools.esb.core.model.handlers.AddBPELInvokeHandler"
class="org.jboss.tools.esb.core.model.handlers.AddBPELInvokeHandler"/>
+ <xclass id="org.jboss.tools.esb.core.model.handlers.OpenBusHandler"
+ class="org.jboss.tools.esb.core.model.handlers.OpenBusHandler"/>
+ <xclass id="org.jboss.tools.esb.core.model.handlers.OpenScheduleHandler"
+ class="org.jboss.tools.esb.core.model.handlers.OpenScheduleHandler"/>
+
<xclass
id="org.jboss.tools.esb.core.model.handlers.RenameChannelIDHandler"
class="org.jboss.tools.esb.core.model.handlers.RenameChannelIDHandler"/>
<xclass
id="org.jboss.tools.esb.core.model.handlers.RenameScheduleIDHandler"
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2012-01-12 18:06:29
UTC (rev 37791)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2012-01-12 18:26:30
UTC (rev 37792)
@@ -479,6 +479,8 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
+ <XActionItemReference entity="ESBScheduledListener101"
name="OpenSchedule"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -686,6 +688,8 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
+ <XActionItemReference entity="ESBScheduledListener101"
name="OpenSchedule"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -843,6 +847,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -914,6 +919,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -1050,6 +1056,7 @@
</XActionItem>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -1211,6 +1218,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -1320,6 +1328,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -1451,6 +1460,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -1607,7 +1617,8 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true"
name="name" xmlname="name"/>
- <XModelAttribute PROPERTIES="category=general" name="channel id
ref" xmlname="busidref">
+ <XModelAttribute PROPERTIES="category=general;linkAction=OpenChannel"
+ name="channel id ref" xmlname="busidref">
<Constraint loader="ListString"/>
<Editor name="ESBBusList"/>
</XModelAttribute>
@@ -1631,6 +1642,9 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItem
+ HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenBusHandler"
+ ICON="action.empty" displayName="Open Channel"
kind="action" name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -2203,6 +2217,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -2419,7 +2434,8 @@
name="schedule frequency" xmlname="schedule-frequency">
<Constraint loader="%IntEL%"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced"
+ <XModelAttribute
+ PROPERTIES="category=advanced;linkAction=OpenSchedule"
name="schedule id ref" xmlname="scheduleidref">
<Constraint loader="ListString"/>
<Editor name="ESBScheduleList"/>
@@ -2445,6 +2461,10 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
+ <XActionItem
+
HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenScheduleHandler"
+ ICON="action.empty" displayName="Open Schedule"
kind="action" name="OpenSchedule"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -2773,6 +2793,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2012-01-12
18:06:29 UTC (rev 37791)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2012-01-12
18:26:30 UTC (rev 37792)
@@ -357,7 +357,9 @@
<XActionItem kind="list" name="CreateActions">
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
+ <XActionItemReference entity="ESBScheduledListener101"
name="OpenSchedule"/>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -540,6 +542,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -701,6 +704,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -808,6 +812,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -842,6 +847,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta 2012-01-12
18:06:29 UTC (rev 37791)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta 2012-01-12
18:26:30 UTC (rev 37792)
@@ -174,6 +174,7 @@
</XActionItem>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -299,6 +300,7 @@
<XActionItemReference entity="ESBAction101" name="AddProperty"
path="CreateActions/AddProperty"/>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBListener101"
name="OpenChannel"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenBusHandler.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenBusHandler.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenBusHandler.java 2012-01-12
18:26:30 UTC (rev 37792)
@@ -0,0 +1,58 @@
+package org.jboss.tools.esb.core.model.handlers;
+
+import java.util.Properties;
+
+import org.jboss.tools.common.meta.action.impl.AbstractHandler;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.model.ServiceDialog;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.plugin.ModelMessages;
+import org.jboss.tools.common.model.util.FindObjectHelper;
+import org.jboss.tools.esb.core.model.ESBConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class OpenBusHandler extends AbstractHandler {
+
+ public OpenBusHandler() {}
+
+ public boolean isEnabled(XModelObject object) {
+ return object != null
+ && object.getAttributeValue(ESBConstants.ATTR_BUS_ID_REF) != null
+ && object.getAttributeValue(ESBConstants.ATTR_BUS_ID_REF).length() > 0;
+ }
+
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
+ if(!isEnabled(object)) return;
+ String channelID = object.getAttributeValue(ESBConstants.ATTR_BUS_ID_REF);
+ XModelObject channel = findChannel(FileSystemsHelper.getFile(object), channelID);
+ if(channel != null) {
+ FindObjectHelper.findModelObject(channel, FindObjectHelper.IN_EDITOR_ONLY);
+ } else {
+ String message = "Cannot find channel " + channelID;
+ object.getModel().getService().showDialog(ModelMessages.WARNING, message, new
String[]{SpecialWizardSupport.CLOSE}, null, ServiceDialog.WARNING);
+ }
+ }
+
+ XModelObject findChannel(XModelObject file, String scheduleID) {
+ XModelObject[] ps = file.getChildByPath("Providers").getChildren();
//$NON-NLS-1$
+ for (int i = 0; i < ps.length; i++) {
+ XModelObject[] cs = ps[i].getChildren();
+ for (int j = 0; j < cs.length; j++) {
+ if(cs[j].getModelEntity().getAttribute(ESBConstants.ATTR_BUS_ID) != null) {
+ String v = cs[j].getAttributeValue(ESBConstants.ATTR_BUS_ID);
+ if(scheduleID.equals(v)) {
+ return cs[j];
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenBusHandler.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenScheduleHandler.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenScheduleHandler.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenScheduleHandler.java 2012-01-12
18:26:30 UTC (rev 37792)
@@ -0,0 +1,58 @@
+package org.jboss.tools.esb.core.model.handlers;
+
+import java.util.Properties;
+
+import org.jboss.tools.common.meta.action.impl.AbstractHandler;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.model.ServiceDialog;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.plugin.ModelMessages;
+import org.jboss.tools.common.model.util.FindObjectHelper;
+import org.jboss.tools.esb.core.model.ESBConstants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class OpenScheduleHandler extends AbstractHandler {
+
+ public OpenScheduleHandler() {}
+
+ public boolean isEnabled(XModelObject object) {
+ return object != null
+ && object.getAttributeValue(ESBConstants.ATTR_SCHEDULE_ID_REF) != null
+ && object.getAttributeValue(ESBConstants.ATTR_SCHEDULE_ID_REF).length() >
0;
+ }
+
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
+ if(!isEnabled(object)) return;
+ String scheduleID = object.getAttributeValue(ESBConstants.ATTR_SCHEDULE_ID_REF);
+ XModelObject schedule = findSchedule(FileSystemsHelper.getFile(object), scheduleID);
+ if(schedule != null) {
+ FindObjectHelper.findModelObject(schedule, FindObjectHelper.IN_EDITOR_ONLY);
+ } else {
+ String message = "Cannot find schedule " + scheduleID;
+ object.getModel().getService().showDialog(ModelMessages.WARNING, message, new
String[]{SpecialWizardSupport.CLOSE}, null, ServiceDialog.WARNING);
+ }
+ }
+
+ XModelObject findSchedule(XModelObject file, String scheduleID) {
+ XModelObject[] ps = file.getChildByPath("Providers").getChildren();
//$NON-NLS-1$
+ for (int i = 0; i < ps.length; i++) {
+ XModelObject[] cs = ps[i].getChildren();
+ for (int j = 0; j < cs.length; j++) {
+ if(cs[j].getModelEntity().getAttribute(ESBConstants.ATTR_SCHEDULE_ID) != null) {
+ String v = cs[j].getAttributeValue(ESBConstants.ATTR_SCHEDULE_ID);
+ if(scheduleID.equals(v)) {
+ return cs[j];
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenScheduleHandler.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain