Author: scabanovich
Date: 2009-12-22 09:27:00 -0500 (Tue, 22 Dec 2009)
New Revision: 19535
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.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
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ConverterConstants.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5552
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-12-22 14:21:09 UTC (rev
19534)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-12-22 14:27:00 UTC (rev
19535)
@@ -31,6 +31,9 @@
class="org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl"/>
<xclass id="org.jboss.tools.esb.core.model.ESBRouteToImpl"
class="org.jboss.tools.esb.core.model.ESBRouteToImpl"/>
+ <xclass id="org.jboss.tools.esb.core.model.EJBParamImpl"
+ class="org.jboss.tools.esb.core.model.EJBParamImpl"/>
+
<xclass id="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"
class="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"/>
<xclass
id="org.jboss.tools.esb.core.model.handlers.AddGenericActionSupport"
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-12-22
14:21:09 UTC (rev 19534)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2009-12-22
14:27:00 UTC (rev 19535)
@@ -534,10 +534,11 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
-
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%ESBOrdered%"
XMLSUBPATH="action" name="ESBPreActionEJBProcessor120">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
+ <XChildEntity name="ESBPreEJBParam"/>
</XChildrenEntities>
<XEntityRenderer>
<ICONS>
@@ -587,7 +588,17 @@
HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
ICON="action.empty"
PROPERTIES="actionpath=Open;attribute=script"
displayName="Open Script" kind="action"
name="OpenScript"/>
- <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add EJB Param..." kind="action"
name="AddEJBParam">
+ <EntityData EntityName="ESBPreEJBParam">
+ <AttributeData AttributeName="index"/>
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="type" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
<XActionItemReference entity="ESBProperty"
name="CopyActions"/>
<XActionItemReference entity="ESBProperty"
name="DeleteActions"/>
<XActionItemReference entity="ESBProperty"
name="Properties"/>
@@ -787,7 +798,7 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
-
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%ESBOrdered%"
XMLSUBPATH="action" name="ESBPreActionHTTPRouter120">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -1438,7 +1449,7 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
-
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%ESBOrdered%"
XMLSUBPATH="action" name="ESBPreActionSOAPProxy120">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -1762,7 +1773,7 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
-
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%"
XMLSUBPATH="action" name="ESBPreActionSmooksAction101">
<XChildrenEntities>
<XChildEntity name="ESBProperty"/>
@@ -2482,6 +2493,41 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.esb.core.model.EJBParamImpl"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=arg"
+ XMLSUBPATH="arg" name="ESBPreEJBParam">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.property" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="EJB param" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true"
name="index">
+ <Constraint loader="Int"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="name"
xmlname="text"/>
+ <XModelAttribute PROPERTIES="category=general" name="type"
xmlname="type">
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias"
name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=fieldalias"
XMLSUBPATH="field-alias" name="ESBPreFieldAlias">
@@ -2508,24 +2554,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list"
name="Properties">
- <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
- displayName="Properties..." kind="action"
name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list"
name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action"
name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias"
name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias"
name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2553,24 +2585,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list"
name="Properties">
- <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
- displayName="Properties..." kind="action"
name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list"
name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action"
name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias"
name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias"
name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2601,24 +2619,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list"
name="Properties">
- <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
- displayName="Properties..." kind="action"
name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list"
name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action"
name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias"
name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias"
name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2646,24 +2650,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list"
name="Properties">
- <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
- displayName="Properties..." kind="action"
name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list"
name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action"
name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias"
name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias"
name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2691,7 +2681,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="entity=AnyElement" WizardClassName="%Default%"
+ PROPERTIES="entity=ESBPreTarget" WizardClassName="%Default%"
displayName="Add Target..." kind="action"
name="CreateTarget">
<EntityData EntityName="ESBPreTarget">
<AttributeData AttributeName="class"/>
@@ -2793,24 +2783,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list"
name="Properties">
- <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
- displayName="Properties..." kind="action"
name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list"
name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action"
name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias"
name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias"
name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2837,24 +2813,10 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions"/>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list"
name="Properties">
- <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
- displayName="Properties..." kind="action"
name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list"
name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action"
name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias"
name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias"
name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -2890,24 +2852,10 @@
</XActionItem>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
- <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
- <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
- ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
- </XActionItem>
- <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete"
HandlerClassName="%Delete%"
- ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list"
name="Properties">
- <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
- displayName="Properties..." kind="action"
name="Properties"/>
- </XActionItem>
- <XActionItem displayName="move" kind="list"
name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action"
name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="ESBPreAlias"
name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias"
name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias"
name="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
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 2009-12-22 14:21:09
UTC (rev 19534)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2009-12-22 14:27:00
UTC (rev 19535)
@@ -1823,7 +1823,7 @@
</XModelEntity>
<XModelEntity
ImplementingClass="org.jboss.tools.esb.core.model.ESBPropertyImpl"
-
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="property" name="ESBProperty">
<XChildrenEntities>
<XChildEntity name="AnyElement"/>
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java 2009-12-22
14:27:00 UTC (rev 19535)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.model;
+
+import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.impl.CustomizedObjectImpl;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class EJBParamImpl extends CustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public EJBParamImpl() {}
+
+ public String getPresentationString() {
+ return getAttributeValue("index") + " " +
getAttributeValue(XModelObjectConstants.ATTR_NAME);
+ }
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/EJBParamImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java 2009-12-22
14:21:09 UTC (rev 19534)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java 2009-12-22
14:27:00 UTC (rev 19535)
@@ -63,6 +63,7 @@
propertyConverters.put("attributealias",
ConverterConstants.ATTRIBUTE_ALIAS_CONVERTER);
propertyConverters.put("converter", ConverterConstants.CONVERTER_CONVERTER);
propertyConverters.put("routernamespace",
ConverterConstants.ROUTER_NAMESPACES_CONVERTER);
+ propertyConverters.put("arg", ConverterConstants.EJB_PARAM_CONVERTER);
}
public boolean isPreActionEntity(XModelObject object) {
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ConverterConstants.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ConverterConstants.java 2009-12-22
14:21:09 UTC (rev 19534)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ConverterConstants.java 2009-12-22
14:27:00 UTC (rev 19535)
@@ -65,4 +65,7 @@
String ATTRIBUTE_ALIASES = "attribute-aliases";
IPropertyConverter ATTRIBUTE_ALIAS_CONVERTER = new BasicListConverter(ATTRIBUTE_ALIASES,
ATTRIBUTE_ALIAS_ENTITY);
+ String EJB_PARAM_ENTITY = "ESBPreEJBParam";
+ String EJB_PARAMS = "ejb-params";
+ IPropertyConverter EJB_PARAM_CONVERTER = new EJBParamConverter(EJB_PARAMS,
EJB_PARAM_ENTITY);
}
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.java 2009-12-22
14:27:00 UTC (rev 19535)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.model.converters;
+
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class EJBParamConverter extends BasicListConverter {
+
+ public EJBParamConverter(String propertyName, String itemEntityName) {
+ super(propertyName, itemEntityName);
+ }
+
+ protected boolean isRelevantTag(String tag, XModelObject object) {
+ if(object == null || tag == null) {
+ return false;
+ }
+ String baseName = object.getModelEntity().getXMLSubPath();
+ if(!tag.startsWith(baseName)) {
+ return false;
+ }
+ String suff = tag.substring(baseName.length());
+ if(suff.length() == 0) {
+ return false;
+ }
+ int index = 0;
+ try {
+ index = Integer.parseInt(suff);
+ } catch (NumberFormatException e) {
+ return false;
+ }
+ object.setAttributeValue("index", "" + index);
+ return true;
+ }
+
+ protected String getTagName(XModelObject specific, int index) {
+ return "" + super.getTagName(specific, index) + "" +
specific.getAttributeValue("index");
+ }
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/EJBParamConverter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2009-12-22
14:21:09 UTC (rev 19534)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2009-12-22
14:27:00 UTC (rev 19535)
@@ -58,12 +58,12 @@
basicAction.addChild(p);
}
- public static XModelObject fromAnyElement(XModelObject any, String toEntity) {
+ public XModelObject fromAnyElement(XModelObject any, String toEntity) {
String tag = any.getAttributeValue("tag");
Map<String, String> attr = toMap(((AnyElementObjectImpl)any).getAttributes());
XModelObject a = any.getModel().createModelObject(toEntity, null);
- if(a == null || tag == null || !tag.equals(a.getModelEntity().getXMLSubPath())) {
+ if(!isRelevantTag(tag, a)) {
return null;
}
@@ -101,9 +101,13 @@
return a;
}
- public static XModelObject toAnyElement(XModelObject specific, int index) {
+ protected boolean isRelevantTag(String tag, XModelObject object) {
+ return (object != null && tag != null &&
tag.equals(object.getModelEntity().getXMLSubPath()));
+ }
+
+ public XModelObject toAnyElement(XModelObject specific, int index) {
XModelObject t = specific.getModel().createModelObject("AnyElement", null);
- t.setAttributeValue("tag", specific.getModelEntity().getXMLSubPath());
+ t.setAttributeValue("tag", getTagName(specific, index));
StringBuffer sb = new StringBuffer();
XModelEntity entity = specific.getModelEntity();
XAttribute[] attrs = entity.getAttributes();
@@ -142,7 +146,11 @@
return t;
}
- static Map<String, String> toMap(String[][] attributes) {
+ protected String getTagName(XModelObject specific, int index) {
+ return specific.getModelEntity().getXMLSubPath();
+ }
+
+ protected Map<String, String> toMap(String[][] attributes) {
Map<String,String> map = new HashMap<String, String>();
for (int i = 0; i < attributes.length; i++) {
map.put(attributes[i][0], attributes[i][1]);