Author: scabanovich
Date: 2009-11-13 06:14:51 -0500 (Fri, 13 Nov 2009)
New Revision: 18679
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenSmooksConfigHandler.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-5191
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-11-13 11:10:41 UTC (rev
18678)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-11-13 11:14:51 UTC (rev
18679)
@@ -34,6 +34,8 @@
class="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"/>
<xclass
id="org.jboss.tools.esb.core.model.handlers.AddGenericActionSupport"
class="org.jboss.tools.esb.core.model.handlers.AddGenericActionSupport"/>
+ <xclass
id="org.jboss.tools.esb.core.model.handlers.OpenSmooksConfigHandler"
+ class="org.jboss.tools.esb.core.model.handlers.OpenSmooksConfigHandler"/>
</extension>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-11-13
11:10:41 UTC (rev 18678)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-11-13
11:14:51 UTC (rev 18679)
@@ -735,6 +735,7 @@
<Constraint loader="Tree">
<value name="ESBResourceTree"/>
<value name="extensions=xml"/>
+ <value name="linkAction=OpenConfig"/>
</Constraint>
<Editor name="TreeChooser"/>
</XModelAttribute>
@@ -776,6 +777,10 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
+ <XActionItem
+
HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenSmooksConfigHandler"
+ ICON="action.empty" PROPERTIES="actionpath=Open"
+ displayName="Open Config" kind="action"
name="OpenConfig"/>
<XActionItem kind="list" name="CreateActions"/>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenSmooksConfigHandler.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenSmooksConfigHandler.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenSmooksConfigHandler.java 2009-11-13
11:14:51 UTC (rev 18679)
@@ -0,0 +1,20 @@
+package org.jboss.tools.esb.core.model.handlers;
+
+import org.jboss.tools.common.meta.action.impl.handlers.DefaultRedirectHandler;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+
+public class OpenSmooksConfigHandler extends DefaultRedirectHandler {
+ static String ATTR_SMOOKS_CONFIG = "smooks config";
+
+ protected XModelObject getTrueSource(XModelObject source) {
+ String path = source.getAttributeValue(ATTR_SMOOKS_CONFIG);
+ if(path == null || path.length() == 0) return null;
+ XModelObject o = source.getModel().getByPath(path);
+ if(o != null) return o;
+ XModelObject r = FileSystemsHelper.getWebRoot(source.getModel());
+ if(r == null) return null;
+ return r.getChildByPath(path);
+ }
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/OpenSmooksConfigHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain