Author: scabanovich
Date: 2010-02-24 08:13:49 -0500 (Wed, 24 Feb 2010)
New Revision: 20468
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
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-5873
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 2010-02-24
12:59:31 UTC (rev 20467)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-02-24
13:13:49 UTC (rev 20468)
@@ -3049,6 +3049,9 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
name="class" xmlname="class"/>
+ <XModelAttribute PROPERTIES="any=true" name="attributes">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -3062,6 +3065,14 @@
<AttributeData AttributeName="tag"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
+
PROPERTIES="support=org.jboss.tools.common.meta.action.impl.handlers.AddAttributeToAnyElementSupport"
+ displayName="Add Attribute..." kind="action"
name="CreateAttribute">
+ <EntityData EntityName="AnyElementNew">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
<XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions"/>
<XActionItemReference entity="ESBPreAlias"
name="CopyActions"/>
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 2010-02-24
12:59:31 UTC (rev 20467)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/ListConverter.java 2010-02-24
13:13:49 UTC (rev 20468)
@@ -80,7 +80,7 @@
String name = attrs[j].getName();
String xml = attrs[j].getXMLName();
if(xml == null || xml.length() == 0) continue;
- String value = attr.get(xml);
+ String value = attr.remove(xml);
if(value == null || value.length() == 0) {
value = attrs[j].getDefaultValue();
}
@@ -88,6 +88,17 @@
a.setAttributeValue(name, value);
}
}
+ if(entity.getAttribute("attributes") != null) {
+ attr.remove("#text");
+ StringBuffer sb = new StringBuffer();
+ for (String n: attr.keySet()) {
+ String v = attr.get(n);
+ if(sb.length() > 0) sb.append(';');
+ sb.append(n).append('=').append(v);
+ }
+ a.setAttributeValue("attributes", sb.toString());
+ }
+
XModelObject[] cs = any.getChildren();
if(cs.length > 0 && a.getModelEntity().getChildren().length > 0) {
//TODO consider case of several child entities, possibly including AnyElement
@@ -139,6 +150,13 @@
sb.append(xml).append('=').append(value);
}
}
+ if(entity.getAttribute("attributes") != null) {
+ String as = specific.getAttributeValue("attributes");
+ if(as.length() > 0) {
+ if(sb.length() > 0) sb.append(';');
+ sb.append(as);
+ }
+ }
String attributes = sb.toString();
t.setAttributeValue("attributes", attributes);
t.setAttributeValue(XModelObjectLoaderUtil.ATTR_ID_NAME, "" + (index + 1));