Author: scabanovich
Date: 2010-01-13 08:30:34 -0500 (Wed, 13 Jan 2010)
New Revision: 19730
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ContentBasedRouter.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-5627
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2010-01-13 11:43:18 UTC (rev
19729)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2010-01-13 13:30:34 UTC (rev
19730)
@@ -38,6 +38,8 @@
class="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"/>
<xclass id="org.jboss.tools.esb.core.model.impl.FTPMessageFilterImpl"
class="org.jboss.tools.esb.core.model.impl.FTPMessageFilterImpl"/>
+ <xclass id="org.jboss.tools.esb.core.model.impl.ContentBasedRouter"
+ class="org.jboss.tools.esb.core.model.impl.ContentBasedRouter"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"
class="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"/>
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-01-13
11:43:18 UTC (rev 19729)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-01-13
13:30:34 UTC (rev 19730)
@@ -485,7 +485,8 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.esb.core.model.impl.ContentBasedRouter"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%"
XMLSUBPATH="action" name="ESBPreActionContentBasedRouter120">
<XChildrenEntities>
@@ -529,7 +530,14 @@
<Editor name="TreeChooser"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;pre=true;save=always"
- name="rule language" xmlname="ruleLanguage"/>
+ name="rule language" xmlname="ruleLanguage">
+ <Constraint loader="Tree">
+ <value name="ESBResourceTree"/>
+ <value name="extensions=dsl"/>
+ <value name="linkAction=OpenRuleLanguage"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="pre=true;category=general"
default="Default(false)" name="rule reload"
xmlname="ruleReload">
<Constraint loader="ListString">
@@ -555,6 +563,11 @@
HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
ICON="action.empty" PROPERTIES="actionpath=Open;attribute=rule
set"
displayName="Open Rule Set" kind="action"
name="OpenRuleSet"/>
+ <XActionItem
+
HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
+ ICON="action.empty"
+ PROPERTIES="actionpath=Open;attribute=rule language"
+ displayName="Open Rule Language" kind="action"
name="OpenRuleLanguage"/>
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
@@ -3041,7 +3054,13 @@
<Editor name="TreeChooser"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general;pre=true;save=always"
- name="rule language" xmlname="ruleLanguage"/>
+ name="rule language" xmlname="ruleLanguage">
+ <Constraint loader="Tree">
+ <value name="ESBResourceTree"/>
+ <value name="extensions=dsl"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="pre=true;category=general"
default="Default(false)" name="rule reload"
xmlname="ruleReload">
<Constraint loader="ListString">
@@ -3535,7 +3554,7 @@
</XActionItem>
<XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
-
PROPERTIES="validator.add=true;support=org.jboss.tools.esb.core.model.handlers.AddContentBasedRouterSupport;cbrAlias=XPath;entity=ESBPreActionContentBasedRouter120"
+
PROPERTIES="validator.add=true;support=org.jboss.tools.esb.core.model.handlers.AddContentBasedRouterSupport;cbrAlias=Xpath;entity=ESBPreActionContentBasedRouter120"
displayName="Content Based Router (XPath)..." kind="action"
name="AddContentBasedRouterXPath">
<EntityData EntityName="ESBWizardXPathRouter">
<AttributeData AttributeName="name"/>
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ContentBasedRouter.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ContentBasedRouter.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ContentBasedRouter.java 2010-01-13
13:30:34 UTC (rev 19730)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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.impl;
+
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class ContentBasedRouter extends ESBCustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+ static String ATTR_CBR_ALIAS = "cbr alias";
+ static String ATTR_RULE_LANGUAGE = "rule language";
+
+ public ContentBasedRouter() {}
+
+ @Override
+ public boolean isAttributeEditable(String name) {
+ if(ATTR_RULE_LANGUAGE.equals(name)) {
+ String alias = getAttributeValue(ATTR_CBR_ALIAS);
+ if(isRegexOrXPath(alias)) {
+ return false;
+ }
+ }
+ return super.isAttributeEditable(name);
+ }
+
+ private boolean isRegexOrXPath(String alias) {
+ return ("Regex".equalsIgnoreCase(alias) ||
"Xpath".equalsIgnoreCase(alias));
+ }
+
+ @Override
+ protected void onAttributeValueEdit(String name, String oldValue,
+ String newValue) throws XModelException {
+ if(ATTR_CBR_ALIAS.equals(name)) {
+ if(isRegexOrXPath(newValue)) {
+ setAttributeValue(ATTR_RULE_LANGUAGE, "");
+ }
+ }
+ }
+
+
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ContentBasedRouter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain