Author: scabanovich
Date: 2007-07-17 07:41:53 -0400 (Tue, 17 Jul 2007)
New Revision: 2457
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentConstants.java
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentsEntityRecognizer.java
Log:
EXIN-217 .component.xml files processed
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 2007-07-17
11:41:15 UTC (rev 2456)
+++
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta 2007-07-17
11:41:53 UTC (rev 2457)
@@ -55,6 +55,224 @@
</ICONS>
<GlobalActions kind="list"/>
<XModelEntity
+
ImplementationLoadingClass="org.jboss.tools.seam.xml.components.model.SeamComponentsFileLoader"
+
ImplementingClass="org.jboss.tools.seam.xml.components.model.FileSeamComponentsImpl"
+ ObjectEditorClass="%XML%"
+
PROPERTIES="formFactoryClassName=org.jboss.tools.common.model.ui.forms.LayouredFormFactory;formLayoutDataClassName=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData"
+ XMLSUBPATH="component" name="FileSeamComponent12">
+ <XChildrenEntities>
+ <XChildEntity name="SeamProperty"/>
+ <XChildEntity name="SeamPropertyList"/>
+ <XChildEntity name="SeamPropertyMap"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.file" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="components" loader="ElementType"
name="element type">
+ <Constraint/>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="name"
xmlname="NAME">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ name="component-name" xmlname="name">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,jndi-name"
+ entity="SeamComponent" name="component"/>
+ <XModelAttribute default="xml" name="extension"
xmlname="EXTENSION">
+ <Constraint/>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
+ <Constraint/>
+ <Editor name="Note"/>
+ </XModelAttribute>
+ <XModelAttribute loader="ElementType" name="_lateload"
visibility="false">
+ <Constraint/>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute default="no" name="isIncorrect"
visibility="false">
+ <Constraint loader="List">
+ <value name="yes"/>
+ <value name="no"/>
+ </Constraint>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute name="incorrectBody" visibility="false">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="save=always"
+
default="http://jboss.com/products/seam/components" name="xmlns"
xmlname="xmlns">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="save=always"
+
default="http://www.w3.org/2001/XMLSchema-instance"
name="xmlns:xsi" xmlname="xmlns:xsi">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="save=always"
+
default="http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-1.2.xsd"
+ name="xsi:schemaLocation" xmlname="xsi:schemaLocation">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttribute name="namespaceMapping">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttribute name="encoding">
+ <Constraint loader="ListString">
+ <value name="ISO-8859-1"/>
+ <value name="UTF-8"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem BaseActionName="Open" HandlerClassName="%Open%"
+ ICON="action.empty" displayName="Open" kind="action"
name="Open"/>
+ <XActionItem displayName="Open With" group="1"
kind="list" name="OpenWith">
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.OpenWithExternalHandler"
+ ICON="action.empty" PROPERTIES="extension=struts-config"
+ displayName="Open with External Program" kind="action"
name="OpenWithSelected"/>
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.OpenWithChoiceHandler"
+ ICON="action.empty" PROPERTIES="extension=struts-config"
+ displayName="Choose Program..." kind="action"
name="OpenWithChoice">
+ <EntityData EntityName="OpenWithHelper">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="default"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem kind="list" name="EditActions">
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.jsf.model.handlers.RenameFacesConfigHandler"
+ ICON="action.empty" PROPERTIES="validator.edit=true"
+ WizardClassName="%Default%" displayName="Rename..."
kind="action" name="Rename">
+ <EntityData EntityName="FacesConfig">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem
+
HandlerClassName="org.jboss.tools.common.model.filesystems.impl.handlers.RenameEclipseFileHandler"
+ ICON="action.empty" displayName="Rename..."
kind="action" name="RenameEclipse"/>
+ </XActionItem>
+ <XActionItem kind="list" name="SaveActions">
+ <XActionItem HIDE="always" HandlerClassName="%SaveFile%"
+ ICON="action.save" displayName="Save" kind="action"
name="Save"/>
+ </XActionItem>
+ <XActionItem ICON="action.newclass" displayName="New"
group="1"
+ kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ WizardClassName="%Default%" displayName="Add Simple
Property..."
+ kind="action" name="AddProperty">
+ <EntityData EntityName="SeamProperty">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ WizardClassName="%Default%" displayName="Add List Property..."
+ kind="action" name="AddListProperty">
+ <EntityData EntityName="SeamPropertyList">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ WizardClassName="%Default%" displayName="Add Map Property..."
+ kind="action" name="AddMapProperty">
+ <EntityData EntityName="SeamPropertyMap">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.ShowMenuHandler"
+ PROPERTIES="actionList=CreateActions" displayName="Property..."
+ kind="action" name="AddAnyProperty"/>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ <XActionItem BaseActionName="Paste"
HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action"
name="Paste"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete"
kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete"
+
HandlerClassName="org.jboss.tools.jsf.model.handlers.DeleteFacesConfigHandler"
+ ICON="action.delete" displayName="Delete"
kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list"
name="Properties">
+ <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
+ displayName="Properties..." kind="action"
name="Properties"/>
+ </XActionItem>
+ <XActionItem kind="list" name="DiscardActions">
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.jsf.model.handlers.DiscardConfigHandler"
+ ICON="action.delete"
+
PROPERTIES="significanceMessageClass=org.jboss.tools.common.model.filesystems.impl.DiscardFileSignificanceMessage"
+ displayName="Discard Changes" kind="action"
name="Discard"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity name="FileSeamComponent12_EditorActionList">
+ <XChildrenEntities/>
+ <XEntityRenderer/>
+ <XModelAttributes/>
+ <XActionItem kind="list">
+ <XActionItem displayName="New" group="1" kind="list"
name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ WizardClassName="%Default%" displayName="Add Simple
Property..."
+ kind="action" name="AddProperty">
+ <EntityData EntityName="SeamProperty">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ WizardClassName="%Default%" displayName="Add List Property..."
+ kind="action" name="AddListProperty">
+ <EntityData EntityName="SeamPropertyList">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ WizardClassName="%Default%" displayName="Add Map Property..."
+ kind="action" name="AddMapProperty">
+ <EntityData EntityName="SeamPropertyMap">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HIDE="always"
+
HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.ShowMenuHandler"
+ PROPERTIES="actionList=CreateActions" displayName="Property..."
+ kind="action" name="AddAnyProperty"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list"
name="Properties">
+ <XActionItem HandlerClassName="%Properties%"
ICON="action.empty"
+ displayName="Properties..." kind="action"
name="Properties"/>
+ </XActionItem>
+ <XActionItem kind="list" name="VerifyActions">
+ <XActionItem kind="list" name="StaticActions"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity
ImplementationLoadingClass="org.jboss.tools.seam.xml.components.model.SeamComponents11FileLoader"
ImplementingClass="org.jboss.tools.seam.xml.components.model.FileSeamComponentsImpl"
ObjectEditorClass="%XML%"
@@ -1041,6 +1259,7 @@
<XChildrenEntities>
<XChildEntity name="FileSeamComponents11"/>
<XChildEntity name="FileSeamComponents12"/>
+ <XChildEntity name="FileSeamComponent12"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New"
group="1"
@@ -1068,6 +1287,7 @@
<XChildrenEntities>
<XChildEntity name="FileSeamComponents11"/>
<XChildEntity name="FileSeamComponents12"/>
+ <XChildEntity name="FileSeamComponent12"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New"
group="1"
@@ -1095,6 +1315,7 @@
<XChildrenEntities>
<XChildEntity name="FileSeamComponents12"/>
<XChildEntity name="FileSeamComponents11"/>
+ <XChildEntity name="FileSeamComponent12"/>
</XChildrenEntities>
<XActionItem kind="list"/>
</XEntityExtension>
@@ -1102,6 +1323,7 @@
<XChildrenEntities>
<XChildEntity name="FileSeamComponents11"/>
<XChildEntity name="FileSeamComponents12"/>
+ <XChildEntity name="FileSeamComponent12"/>
</XChildrenEntities>
<XActionItem kind="list"/>
</XEntityExtension>
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentConstants.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentConstants.java 2007-07-17
11:41:15 UTC (rev 2456)
+++
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentConstants.java 2007-07-17
11:41:53 UTC (rev 2457)
@@ -17,6 +17,7 @@
public String ENT_SEAM_COMPONENTS = "FileSeamComponents";
public String ENT_SEAM_COMPONENTS_11 = ENT_SEAM_COMPONENTS + "11";
public String ENT_SEAM_COMPONENTS_12 = ENT_SEAM_COMPONENTS + "12";
+ public String ENT_SEAM_COMPONENT_12 = "FileSeamComponent" + "12";
public String ENT_SEAM_COMPONENT = "SeamComponent";
public String ENT_SEAM_FACTORY = "SeamFactory";
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentsEntityRecognizer.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentsEntityRecognizer.java 2007-07-17
11:41:15 UTC (rev 2456)
+++
trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentsEntityRecognizer.java 2007-07-17
11:41:53 UTC (rev 2457)
@@ -19,7 +19,7 @@
static {
try {
- Class c = SeamComponentsEntityRecognizer.class;
+ Class<?> c = SeamComponentsEntityRecognizer.class;
XMLEntityResolver.registerPublicEntity(PUBLIC_ID_11,
FileLocator.resolve(c.getResource("/meta/components-1.1.dtd")).toString());
} catch (Exception e) {
SeamXMLPlugin.log(e);
@@ -34,6 +34,7 @@
return ENT_SEAM_COMPONENTS_11;
}
if(is12(body)) return ENT_SEAM_COMPONENTS_12;
+ if(is12Component(body)) return ENT_SEAM_COMPONENT_12;
return null;
}
@@ -46,4 +47,13 @@
return
s.indexOf("\"http://jboss.com/products/seam/components\"&q... > 0;
}
+ private boolean is12Component(String body) {
+ int i = body.indexOf("<component");
+ int is = body.indexOf("<components");
+ if(i < 0 || is >= 0) return false;
+ int j = body.indexOf(">", i);
+ if(j < 0) return false;
+ String s = body.substring(i, j);
+ return
s.indexOf("\"http://jboss.com/products/seam/components\"&q... > 0;
+ }
}