Author: scabanovich
Date: 2008-05-16 09:20:55 -0400 (Fri, 16 May 2008)
New Revision: 8139
Modified:
branches/jbosstools-2.1.x/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/attribute/adapter/BusListAdapter.java
Log:
JBIDE-2175
Modified:
branches/jbosstools-2.1.x/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/attribute/adapter/BusListAdapter.java
===================================================================
---
branches/jbosstools-2.1.x/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/attribute/adapter/BusListAdapter.java 2008-05-16
13:18:28 UTC (rev 8138)
+++
branches/jbosstools-2.1.x/esb/plugins/org.jboss.tools.esb.ui/src/org/jboss/tools/esb/ui/editor/attribute/adapter/BusListAdapter.java 2008-05-16
13:20:55 UTC (rev 8139)
@@ -31,6 +31,8 @@
XModelObject f = context;
while(f != null && f.getFileType() != XModelObject.FILE) f = f.getParent();
if(f == null) return;
+ String listenerEntity = attribute.getModelEntity().getName();
+ String prefix = getBusEntityPrefix(listenerEntity);
XModelObject[] ps = f.getChildByPath("Providers").getChildren();
TreeSet<String> set = new TreeSet<String>();
for (int i = 0; i < ps.length; i++) {
@@ -39,7 +41,9 @@
if(cs[j].getModelEntity().getAttribute(ESBConstants.ATTR_BUS_ID) != null) {
String v = cs[j].getAttributeValue(ESBConstants.ATTR_BUS_ID);
if(v != null && v.length() > 0) {
- set.add(v);
+ if(prefix == null || cs[j].getModelEntity().getName().startsWith(prefix)) {
+ set.add(v);
+ }
}
}
}
@@ -47,6 +51,19 @@
tags = set.toArray(new String[0]);
}
+
+ private String getBusEntityPrefix(String listenerEntity) {
+ if(listenerEntity == null) return null;
+ if(listenerEntity.startsWith("ESBListener")) {
+ return null;
+ }
+ if(listenerEntity.startsWith("ESBJCAGateway")) {
+ return "ESBJMSBus";
+ }
+ int i = listenerEntity.indexOf("Listener");
+ if(i < 0) return null;
+ return listenerEntity.substring(0, i) + "Bus";
+ }
}