Author: scabanovich
Date: 2008-04-07 10:38:21 -0400 (Mon, 07 Apr 2008)
New Revision: 7384
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBAnyElementPresentation.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBPropertyImpl.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/src/org/jboss/tools/esb/core/model/ESBConstants.java
Log:
JBIDE-1998
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2008-04-07 14:37:09 UTC (rev
7383)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2008-04-07 14:38:21 UTC (rev
7384)
@@ -22,6 +22,10 @@
class="org.jboss.tools.esb.core.model.ESBFileLoader"/>
<xclass id="org.jboss.tools.esb.core.model.ESBEntityRecognizer"
class="org.jboss.tools.esb.core.model.ESBEntityRecognizer"/>
+ <xclass id="org.jboss.tools.esb.core.model.ESBPropertyImpl"
+ class="org.jboss.tools.esb.core.model.ESBPropertyImpl"/>
+ <xclass id="org.jboss.tools.esb.core.model.ESBAnyElementPresentation"
+ class="org.jboss.tools.esb.core.model.ESBAnyElementPresentation"/>
<xclass id="org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl"
class="org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"
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 2008-04-07 14:37:09
UTC (rev 7383)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2008-04-07 14:38:21
UTC (rev 7384)
@@ -4,6 +4,9 @@
<XModelEntityGroup>
<VERSION DEPENDS="Model:1.0" MODULE="ESB Editor"
VERSION="1.0"/>
<MAPPINGS>
+ <MAPPING name="AnyElementPresentation">
+ <PAIR name="route-to,object-path"
value="org.jboss.tools.esb.core.model.ESBAnyElementPresentation"/>
+ </MAPPING>
<MAPPING name="FileVersions">
<PAIR name="ESB1.0.1" value="FileESB101"/>
</MAPPING>
@@ -204,11 +207,11 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute default="bus" loader="ElementType"
name="element type">
+ <XModelAttribute default="channel" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
- name="bus id" xmlname="busid"/>
+ name="id" xmlname="busid"/>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -255,7 +258,7 @@
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Add Bus..." kind="action"
name="AddBus">
<EntityData EntityName="ESBBus">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -315,11 +318,11 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute default="fs bus" loader="ElementType"
name="element type">
+ <XModelAttribute default="channel" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
- name="bus id" xmlname="busid"/>
+ name="id" xmlname="busid"/>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -353,7 +356,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,bus id ref,max threads,is gateway"
+ attributes="name,channel id ref,max threads,is gateway"
entity="ESBListener101" name="listener"/>
<XModelAttributeReference
attributes="poll frequency seconds,schedule frequency,schedule id ref"
@@ -466,7 +469,7 @@
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="FS Bus..." kind="action"
name="AddBus">
<EntityData EntityName="ESBFSBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -491,11 +494,11 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute default="ftp bus" loader="ElementType"
name="element type">
+ <XModelAttribute default="channel" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
- name="bus id" xmlname="busid"/>
+ name="id" xmlname="busid"/>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -529,7 +532,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,bus id ref,max threads,is gateway"
+ attributes="name,channel id ref,max threads,is gateway"
entity="ESBListener101" name="listener"/>
<XModelAttributeReference
attributes="poll frequency seconds,schedule frequency,schedule id ref"
@@ -654,7 +657,7 @@
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="FTP Bus..." kind="action"
name="AddBus">
<EntityData EntityName="ESBFTPBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -682,7 +685,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,bus id ref,max threads,is gateway"
+ attributes="name,channel id ref,max threads,is gateway"
entity="ESBListener101" name="listener"/>
<XModelAttribute PROPERTIES="category=general;save=always"
name="script" xmlname="script"/>
@@ -715,11 +718,11 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute default="hibernate bus" loader="ElementType"
name="element type">
+ <XModelAttribute default="channel" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
- name="bus id" xmlname="busid"/>
+ name="id" xmlname="busid"/>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -761,7 +764,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,bus id ref,max threads,is gateway"
+ attributes="name,channel id ref,max threads,is gateway"
entity="ESBListener101" name="listener"/>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
@@ -859,7 +862,7 @@
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Hibernate Bus..." kind="action"
name="AddBus">
<EntityData EntityName="ESBHibernateBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -883,11 +886,11 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute default="jbr bus" loader="ElementType"
name="element type">
+ <XModelAttribute default="channel" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
- name="bus id" xmlname="busid"/>
+ name="id" xmlname="busid"/>
<XModelAttribute PROPERTIES="category=general;save=always"
name="port" xmlname="port">
<Constraint loader="Int"/>
@@ -925,7 +928,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,bus id ref,max threads,is gateway"
+ attributes="name,channel id ref,max threads,is gateway"
entity="ESBListener101" name="listener"/>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
@@ -983,7 +986,7 @@
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="JBR Bus..." kind="action"
name="AddBus">
<EntityData EntityName="ESBJBRBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
<AttributeData AttributeName="port"/>
</EntityData>
</XActionItem>
@@ -1013,7 +1016,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,bus id ref,max threads,is gateway"
+ attributes="name,channel id ref,max threads,is gateway"
entity="ESBListener101" name="listener"/>
<XModelAttribute PROPERTIES="category=advanced;id=true;save=always"
name="adapter" xmlname="adapter"/>
@@ -1106,11 +1109,11 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute default="jms bus" loader="ElementType"
name="element type">
+ <XModelAttribute default="channel" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
- name="bus id" xmlname="busid"/>
+ name="id" xmlname="busid"/>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -1144,7 +1147,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,bus id ref,max threads,is gateway"
+ attributes="name,channel id ref,max threads,is gateway"
entity="ESBListener101" name="listener"/>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
@@ -1177,9 +1180,9 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true" default="Filter"
name="name" visibility="false"/>
<XModelAttribute PROPERTIES="category=general;save=always"
- name="dest name" xmlname="dest-name"/>
+ name="destination name" xmlname="dest-name"/>
<XModelAttribute PROPERTIES="category=general;save=always"
- default="QUEUE" name="dest type"
xmlname="dest-type">
+ default="QUEUE" name="destination type"
xmlname="dest-type">
<Constraint loader="List">
<value name="QUEUE"/>
<value name="TOPIC"/>
@@ -1268,7 +1271,7 @@
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="JMS Bus..." kind="action"
name="AddBus">
<EntityData EntityName="ESBJMSBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -1296,7 +1299,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true"
name="name" xmlname="name"/>
- <XModelAttribute PROPERTIES="category=general" name="bus id
ref" xmlname="busidref">
+ <XModelAttribute PROPERTIES="category=general" name="channel id
ref" xmlname="busidref">
<Constraint loader="ListString"/>
<Editor name="ESBBusList"/>
</XModelAttribute>
@@ -1365,7 +1368,7 @@
displayName="Listener..." kind="action"
name="AddListener">
<EntityData EntityName="ESBListener101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="bus id ref"
Mandatory="no"/>
+ <AttributeData AttributeName="channel id ref"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
@@ -1390,7 +1393,7 @@
displayName="JMS Listener..." kind="action"
name="AddJMSListener">
<EntityData EntityName="ESBJMSListener101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="bus id ref"
Mandatory="no"/>
+ <AttributeData AttributeName="channel id ref"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
@@ -1398,7 +1401,7 @@
displayName="FS Listener..." kind="action"
name="AddFSListener">
<EntityData EntityName="ESBFSListener101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="bus id ref"
Mandatory="no"/>
+ <AttributeData AttributeName="channel id ref"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
@@ -1406,7 +1409,7 @@
displayName="FTP Listener..." kind="action"
name="AddFTPListener">
<EntityData EntityName="ESBFTPListener101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="bus id ref"
Mandatory="no"/>
+ <AttributeData AttributeName="channel id ref"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
@@ -1414,7 +1417,7 @@
displayName="SQL Listener..." kind="action"
name="AddSQLListener">
<EntityData EntityName="ESBSQLListener101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="bus id ref"
Mandatory="no"/>
+ <AttributeData AttributeName="channel id ref"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
@@ -1422,7 +1425,7 @@
displayName="Hibernate Listener..." kind="action"
name="AddHibernateListener">
<EntityData EntityName="ESBHibernateListener101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="bus id ref"
Mandatory="no"/>
+ <AttributeData AttributeName="channel id ref"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
@@ -1430,7 +1433,7 @@
displayName="JBR Listener..." kind="action"
name="AddJBRListener">
<EntityData EntityName="ESBJBRListener101">
<AttributeData AttributeName="name"/>
- <AttributeData AttributeName="bus id ref"
Mandatory="no"/>
+ <AttributeData AttributeName="channel id ref"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
@@ -1460,7 +1463,8 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.esb.core.model.ESBPropertyImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
XMLSUBPATH="property" name="ESBProperty">
<XChildrenEntities>
@@ -1481,6 +1485,9 @@
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
+ <XModelAttribute name="value presentation"
visibility="false">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
@@ -1557,7 +1564,7 @@
<AttributeData AttributeName="name"/>
</EntityData>
<EntityData EntityName="ESBBus">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
@@ -1568,7 +1575,7 @@
<AttributeData AttributeName="protocol"/>
</EntityData>
<EntityData EntityName="ESBJBRBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
<AttributeData AttributeName="port"/>
</EntityData>
</XActionItem>
@@ -1587,7 +1594,7 @@
<AttributeData AttributeName="connection factory"/>
</EntityData>
<EntityData EntityName="ESBJMSBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
@@ -1598,7 +1605,7 @@
<AttributeData AttributeName="connection factory"/>
</EntityData>
<EntityData EntityName="ESBJMSBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
@@ -1608,7 +1615,7 @@
<AttributeData AttributeName="name"/>
</EntityData>
<EntityData EntityName="ESBFSBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
@@ -1619,7 +1626,7 @@
<AttributeData AttributeName="hostname"/>
</EntityData>
<EntityData EntityName="ESBFTPBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
@@ -1629,7 +1636,7 @@
<AttributeData AttributeName="name"/>
</EntityData>
<EntityData EntityName="ESBSQLBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
@@ -1640,7 +1647,7 @@
<AttributeData AttributeName="hibernate cfg file"/>
</EntityData>
<EntityData EntityName="ESBHibernateBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
<XActionItem HIDE="always"
@@ -1675,11 +1682,11 @@
</ICONS>
</XEntityRenderer>
<XModelAttributes>
- <XModelAttribute default="sql bus" loader="ElementType"
name="element type">
+ <XModelAttribute default="channel" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;id=true;save=always"
- name="bus id" xmlname="busid"/>
+ name="id" xmlname="busid"/>
<XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -1713,7 +1720,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,bus id ref,max threads,is gateway"
+ attributes="name,channel id ref,max threads,is gateway"
entity="ESBListener101" name="listener"/>
<XModelAttributeReference attributes="poll frequency seconds"
entity="ESBScheduledListener101" name="scheduled listener"/>
@@ -1819,7 +1826,7 @@
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="SQL Bus..." kind="action"
name="AddBus">
<EntityData EntityName="ESBSQLBus101">
- <AttributeData AttributeName="bus id"/>
+ <AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -1903,7 +1910,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,bus id ref,max threads,is gateway"
+ attributes="name,channel id ref,max threads,is gateway"
entity="ESBListener101" name="listener"/>
<XModelAttribute PROPERTIES="category=advanced"
name="poll frequency seconds"
xmlname="poll-frequency-seconds"/>
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBAnyElementPresentation.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBAnyElementPresentation.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBAnyElementPresentation.java 2008-04-07
14:38:21 UTC (rev 7384)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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.XModelObject;
+import org.jboss.tools.common.model.XModelObjectPresentation;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class ESBAnyElementPresentation implements XModelObjectPresentation {
+ static String TAG_ROUTE_TO = "route-to";
+ static String TAG_OBJECT_PATH = "object-path";
+ static String PROPERTY_DESTINATIONS = "destinations";
+ static String PROPERTY_OBJECT_PATHS = "object-paths";
+
+ static String ATTR_DESTINATION_NAME = "destination-name";
+ static String ATTR_ESB = "esb";
+
+ public String getValue(XModelObject object) {
+ String tag = object.getAttributeValue("tag");
+ if(TAG_ROUTE_TO.equals(tag)) {
+ checkParentPropertyName(object, PROPERTY_DESTINATIONS);
+ return getAnyElementAttributeValue(object, ATTR_DESTINATION_NAME);
+ } else if(TAG_OBJECT_PATH.equals(tag)) {
+ checkParentPropertyName(object, PROPERTY_OBJECT_PATHS);
+ return getAnyElementAttributeValue(object, ATTR_ESB);
+ }
+ return null;
+ }
+
+ private boolean checkParentPropertyName(XModelObject object, String name) {
+ XModelObject p = object.getParent();
+ if(p == null || !ESBConstants.ENT_ESB_PROPERTY.equals(p.getModelEntity().getName())) {
+ return false;
+ }
+ if(!name.equals(p.getAttributeValue(ESBConstants.ATTR_NAME))) return false;
+ return true;
+ }
+
+ private String getAnyElementAttributeValue(XModelObject object, String name) {
+ String as = object.getAttributeValue("attributes");
+ if(as == null || as.indexOf(name) < 0) {
+ return null;
+ }
+ String[] s = as.split(";");
+ for (int i = 0; i < s.length; i++) {
+ if(!s[i].startsWith(name)) continue;
+ int j = s[i].indexOf('=');
+ String v = s[i].substring(j + 1).trim();
+ return v.length() == 0 ? null : v;
+ }
+ return null;
+ }
+
+ public boolean isEnabled(XModelObject object) {
+ return false;
+ }
+
+}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java 2008-04-07
14:37:09 UTC (rev 7383)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java 2008-04-07
14:38:21 UTC (rev 7384)
@@ -104,5 +104,8 @@
public String ATTR_NAME = "name"; //$NON-NLS-1$
public String ATTR_VALUE = "value"; //$NON-NLS-1$
+ public String ATTR_PROPERTY_VALUE_PRESENTATION = "value presentation";
+ public String ATTR_BUS_ID = "id"; //$NON-NLS-1$
+ public String ATTR_BUS_ID_REF = "channel id ref"; //$NON-NLS-1$
}
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBPropertyImpl.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBPropertyImpl.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBPropertyImpl.java 2008-04-07
14:38:21 UTC (rev 7384)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * 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.impl.CustomizedObjectImpl;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class ESBPropertyImpl extends CustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public ESBPropertyImpl() {}
+
+ public String getAttributeValue(String name) {
+ if(ESBConstants.ATTR_PROPERTY_VALUE_PRESENTATION.equals(name)) {
+ String v = getAttributeValue(ESBConstants.ATTR_VALUE);
+ if(v != null && v.length() > 0) return v;
+ int xmlChildren = getChildren("AnyElement").length;
+ if(xmlChildren > 0) return "XML";
+ }
+ return super.getAttributeValue(name);
+ }
+}