Author: scabanovich
Date: 2008-10-07 11:56:50 -0400 (Tue, 07 Oct 2008)
New Revision: 10715
Added:
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ELConstraint.java
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/IntELConstraint.java
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ListELConstraint.java
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ListIntELConstraint.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.xml/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta
Log:
JBIDE-2855
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/META-INF/MANIFEST.MF 2008-10-07 15:55:01
UTC (rev 10714)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/META-INF/MANIFEST.MF 2008-10-07 15:56:50
UTC (rev 10715)
@@ -8,7 +8,8 @@
Bundle-SymbolicName: org.jboss.tools.seam.xml;singleton:=true
Bundle-Localization: plugin
Provide-Package: org.jboss.tools.seam.xml,
- org.jboss.tools.seam.xml.components.model
+ org.jboss.tools.seam.xml.components.model,
+ org.jboss.tools.seam.xml.components.model.constraint
Require-Bundle: org.jboss.tools.jst.web;visibility:=reexport,
org.eclipse.ui.ide,
org.eclipse.ui.views,
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/plugin.xml 2008-10-07 15:55:01 UTC (rev
10714)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/plugin.xml 2008-10-07 15:56:50 UTC (rev
10715)
@@ -41,6 +41,14 @@
class="org.jboss.tools.seam.xml.components.model.SeamComponents11FileLoader"/>
<xclass
id="org.jboss.tools.seam.xml.components.model.SeamComponentsEntityRecognizer"
class="org.jboss.tools.seam.xml.components.model.SeamComponentsEntityRecognizer"/>
+
+ <xclass
id="org.jboss.tools.seam.xml.components.model.constraint.ListELConstraint"
+ class="org.jboss.tools.seam.xml.components.model.constraint.ListELConstraint"/>
+ <xclass
id="org.jboss.tools.seam.xml.components.model.constraint.IntELConstraint"
+ class="org.jboss.tools.seam.xml.components.model.constraint.IntELConstraint"/>
+ <xclass
id="org.jboss.tools.seam.xml.components.model.constraint.ListIntELConstraint"
+ class="org.jboss.tools.seam.xml.components.model.constraint.ListIntELConstraint"/>
+
</extension>
<extension point="org.eclipse.wst.xml.core.catalogContributions">
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta 2008-10-07
15:55:01 UTC (rev 10714)
+++
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta 2008-10-07
15:56:50 UTC (rev 10715)
@@ -4,6 +4,11 @@
<XModelEntityGroup>
<VERSION DEPENDS="Model:1.0" MODULE="Struts Editor"
VERSION="1.0"/>
<MAPPINGS>
+ <MAPPING name="AttributeConstraints">
+ <PAIR name="IntEL"
value="org.jboss.tools.seam.xml.components.model.constraint.IntELConstraint"/>
+ <PAIR name="ListEL"
value="org.jboss.tools.seam.xml.components.model.constraint.ListELConstraint"/>
+ <PAIR name="ListIntEL"
value="org.jboss.tools.seam.xml.components.model.constraint.ListIntELConstraint"/>
+ </MAPPING>
<MAPPING name="FileVersions">
<PAIR name="SeamComponents1.1"
value="FileSeamComponents11"/>
<PAIR name="SeamComponents1.2"
value="FileSeamComponents12"/>
@@ -1112,9 +1117,40 @@
name="EditActions" path="EditActions"/>
<XActionItemReference entity="FileSeamComponents20"
name="SaveActions" path="SaveActions"/>
+ <XActionItem ICON="action.empty" displayName="New"
group="1"
+ kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%"
+ ICON="action.new.struts.webapp.res_ref"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Component..." kind="action"
name="AddComponent">
+ <EntityData EntityName="SeamComponent20">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%"
+ ICON="action.new.struts.webapp.res_ref"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Factory..." kind="action"
name="AddFactory">
+ <EntityData EntityName="SeamFactory20">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ WizardClassName="%Default%" displayName="Event..."
kind="action" name="AddEvent">
+ <EntityData EntityName="SeamEvent20">
+ <AttributeData AttributeName="type"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ WizardClassName="%Default%" displayName="Import..."
kind="action" name="AddImport">
+ <EntityData EntityName="SeamImport">
+ <AttributeData AttributeName="import"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
<XActionItemReference entity="FileSeamComponents20"
- name="CreateActions" path="CreateActions"/>
- <XActionItemReference entity="FileSeamComponents20"
name="CopyActions" path="CopyActions"/>
<XActionItemReference entity="FileSeamComponents20"
name="DeleteActions" path="DeleteActions"/>
@@ -1366,7 +1402,7 @@
<Editor name="AccessibleJava"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general" name="scope"
xmlname="scope">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="stateless"/>
<value name="event"/>
@@ -1385,10 +1421,19 @@
</Constraint>
<Editor name="List"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced"
name="precedence" xmlname="precedence"/>
+ <XModelAttribute PROPERTIES="category=advanced"
name="precedence" xmlname="precedence">
+ <Constraint loader="%ListIntEL%">
+ <value name=""/>
+ <value name="BUILT_IN"/>
+ <value name="FRAMEWORK"/>
+ <value name="APPLICATION"/>
+ <value name="DEPLOYMENT"/>
+ <value name="MOCK"/>
+ </Constraint>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced"
default="default(true)" name="installed"
xmlname="installed">
- <Constraint loader="ListString">
+ <Constraint loader="%ListEL%">
<value name="default(true)"/>
<value name="true"/>
<value name="false"/>
@@ -1397,7 +1442,7 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced"
default="default(false)" name="auto-create"
xmlname="auto-create">
- <Constraint loader="ListString">
+ <Constraint loader="%ListEL%">
<value name="default(false)"/>
<value name="true"/>
<value name="false"/>
@@ -1406,7 +1451,7 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced"
default="default(false)" name="startup"
xmlname="startup">
- <Constraint loader="ListString">
+ <Constraint loader="%ListEL%">
<value name="default(false)"/>
<value name="true"/>
<value name="false"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta 2008-10-07
15:55:01 UTC (rev 10714)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta 2008-10-07
15:56:50 UTC (rev 10715)
@@ -747,6 +747,77 @@
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="core:init" name="SeamCoreInit21">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamCoreInterceptors"
required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.core.init" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="init" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.core.init" name="name"
xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+
attributes="debug,jndi-pattern,transaction-management-enabled,user-transaction-name"
+ entity="SeamCoreInit20" name="init"/>
+ <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="SeamCoreInit20"
name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamCoreInit20"
name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamCoreInit20" name="Properties"
path="Properties"/>
+ <XActionItemReference entity="SeamCoreInit20"
name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData;children=%Ordered%;childrenLoader=list;saveDefault=false"
+ XMLSUBPATH="core:interceptors" name="SeamCoreInterceptors">
+ <XChildrenEntities>
+ <XChildEntity name="SeamListEntry"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.property" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="interceptors" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="interceptors" name="name">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamCoreBundleNames"
+ name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="SeamCoreBundleNames"
name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamCoreBundleNames"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamCoreBundleNames"
name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamCoreBundleNames"
name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
XMLSUBPATH="core:jbpm" name="SeamCoreJBPM">
<XChildrenEntities>
<XChildEntity maxCount="1" name="SeamCoreProcessDefinitions"
required="yes"/>
@@ -959,6 +1030,52 @@
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="core:manager" name="SeamCoreManager21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.core.manager" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="manager" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.core.manager" name="name"
xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create"
+ entity="SeamComponent" name="component"/>
+ <XModelAttributeReference
+
attributes="conversation-timeout,concurrent-request-timeout,conversation-id-parameter,parent-conversation-id-parameter"
+ entity="SeamCoreManager" name="manager"/>
+ <XModelAttribute PROPERTIES="category=advanced"
name="uri-encoding" xmlname="uri-encoding"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="default-flush-mode" xmlname="default-flush-mode">
+ <Constraint loader="List">
+ <value/>
+ <value name="MANUAL"/>
+ <value name="AUTO"/>
+ <value name="COMMIT"/>
+ </Constraint>
+ <Editor name="List"/>
+ </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="SeamCoreManager"
name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamCoreManager"
name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamCoreManager"
name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamCoreManager"
name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
XMLSUBPATH="core:microcontainer" name="SeamCoreMicrocontainer">
<XChildrenEntities/>
<XEntityRenderer>
@@ -1891,8 +2008,8 @@
</XEntityExtension>
<XEntityExtension name="FileSeamComponents21">
<XChildrenEntities>
- <XChildEntity name="SeamCoreInit20"/>
- <XChildEntity name="SeamCoreManager"/>
+ <XChildEntity name="SeamCoreInit21"/>
+ <XChildEntity name="SeamCoreManager21"/>
<XChildEntity name="SeamCorePojoCache"/>
<XChildEntity name="SeamCoreResourceLoader20"/>
<XChildEntity name="SeamBPMActor20"/>
@@ -1906,7 +2023,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Init..." kind="action"
name="AddInit">
- <EntityData EntityName="SeamCoreInit20">
+ <EntityData EntityName="SeamCoreInit21">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="jndi-pattern"
Mandatory="no"/>
<AttributeData AttributeName="debug" Mandatory="no"/>
@@ -1915,7 +2032,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Manager..." kind="action"
name="AddManager">
- <EntityData EntityName="SeamCoreManager">
+ <EntityData EntityName="SeamCoreManager21">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="conversation-timeout"
Mandatory="no"/>
</EntityData>
Added:
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ELConstraint.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ELConstraint.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ELConstraint.java 2008-10-07
15:56:50 UTC (rev 10715)
@@ -0,0 +1,40 @@
+package org.jboss.tools.seam.xml.components.model.constraint;
+
+import org.jboss.tools.common.meta.constraint.XAttributeConstraint;
+import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintImpl;
+
+public class ELConstraint extends XAttributeConstraintImpl {
+ public static ELConstraint INSTANCE = new ELConstraint();
+
+ public static XAttributeConstraint getInstance() {
+ return INSTANCE;
+ }
+
+ public boolean accepts(String value) {
+ if(value != null) {
+ if(value.startsWith("#{") && value.endsWith("}")) {
+ return true;
+ }
+ if(value.length() >= 2 && value.startsWith("@") &&
value.endsWith("@")) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns not null only if value starts with EL tokens.
+ */
+ public String getError(String value) {
+ if(accepts(value)) return null;
+ if(value.startsWith("#{")) {
+ return "value is not a correct EL.";
+ }
+ if(value.startsWith("@")) {
+ return "value is not a correct property.";
+ }
+
+ return super.getError(value);
+ }
+
+}
Added:
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/IntELConstraint.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/IntELConstraint.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/IntELConstraint.java 2008-10-07
15:56:50 UTC (rev 10715)
@@ -0,0 +1,23 @@
+package org.jboss.tools.seam.xml.components.model.constraint;
+
+import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintInt;
+
+public class IntELConstraint extends XAttributeConstraintInt {
+
+ public boolean accepts(String value) {
+ if(ELConstraint.getInstance().accepts(value)) {
+ return true;
+ }
+ return super.accepts(value);
+ }
+
+ public String getError(String value) {
+ if(accepts(value)) return null;
+ String error = ELConstraint.getInstance().getError(value);
+ if(error != null) {
+ return error;
+ }
+ return super.getError(value);
+ }
+
+}
Added:
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ListELConstraint.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ListELConstraint.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ListELConstraint.java 2008-10-07
15:56:50 UTC (rev 10715)
@@ -0,0 +1,23 @@
+package org.jboss.tools.seam.xml.components.model.constraint;
+
+import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintList;
+
+public class ListELConstraint extends XAttributeConstraintList {
+
+ public boolean accepts(String value) {
+ if(ELConstraint.getInstance().accepts(value)) {
+ return true;
+ }
+ return super.accepts(value);
+ }
+
+ public String getError(String value) {
+ if(accepts(value)) return null;
+ String error = ELConstraint.getInstance().getError(value);
+ if(error != null) {
+ return error;
+ }
+ return super.getError(value);
+ }
+
+}
Added:
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ListIntELConstraint.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ListIntELConstraint.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/constraint/ListIntELConstraint.java 2008-10-07
15:56:50 UTC (rev 10715)
@@ -0,0 +1,23 @@
+package org.jboss.tools.seam.xml.components.model.constraint;
+
+import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintListInt;
+
+public class ListIntELConstraint extends XAttributeConstraintListInt {
+
+ public boolean accepts(String value) {
+ if(ELConstraint.getInstance().accepts(value)) {
+ return true;
+ }
+ return super.accepts(value);
+ }
+
+ public String getError(String value) {
+ if(accepts(value)) return null;
+ String error = ELConstraint.getInstance().getError(value);
+ if(error != null) {
+ return error;
+ }
+ return super.getError(value);
+ }
+
+}