JBoss Tools SVN: r7300 - in trunk/seam/plugins/org.jboss.tools.seam.xml: schemas and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-03 11:32:49 -0400 (Thu, 03 Apr 2008)
New Revision: 7300
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-async.meta
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
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-drools.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-international.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-mail.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-persistence.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-spring.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-theme.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-transaction.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta
trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/components-2.0.xsd
trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/mail-2.0.xsd
trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/security-2.0.xsd
trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/web-2.0.xsd
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:
JBIDE-1749
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-async.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-async.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-async.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -46,8 +46,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.async.dispatcher" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general"
name="thread-pool-size" xmlname="thread-pool-size"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
@@ -94,8 +94,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.async.dispatcher" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -141,8 +141,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.async.dispatcher" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,jndi-name"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,jndi-name,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
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-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-components.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -272,8 +272,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
name="component-name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,jndi-name"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,jndi-name,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute default="xml" name="extension" xmlname="EXTENSION">
<Editor name="Uneditable"/>
</XModelAttribute>
@@ -306,6 +306,15 @@
</Constraint>
<Editor name="ListString"/>
</XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(false)" name="startup" xmlname="startup">
+ <Constraint loader="ListString">
+ <value name="default(false)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
<XActionItem BaseActionName="Open" HandlerClassName="%Open%"
@@ -814,7 +823,7 @@
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData"
XMLSUBPATH="components" name="FileSeamComponents20">
<XChildrenEntities>
- <XChildEntity name="SeamComponent"/>
+ <XChildEntity name="SeamComponent20"/>
<XChildEntity name="SeamFactory20"/>
<XChildEntity name="SeamEvent20"/>
<XChildEntity name="SeamImport"/>
@@ -903,7 +912,7 @@
ICON="action.new.struts.webapp.res_ref"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Component..." kind="action" name="AddComponent">
- <EntityData EntityName="SeamComponent">
+ <EntityData EntityName="SeamComponent20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="class" Mandatory="no"/>
</EntityData>
@@ -967,7 +976,7 @@
ICON="action.new.struts.webapp.res_ref"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Component..." kind="action" name="AddComponent">
- <EntityData EntityName="SeamComponent">
+ <EntityData EntityName="SeamComponent20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="class" Mandatory="no"/>
</EntityData>
@@ -1133,8 +1142,8 @@
<Editor name="List"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" name="precedence" xmlname="precedence"/>
- <XModelAttribute PROPERTIES="category=advanced" default="default(true)"
- name="installed" xmlname="installed">
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(true)" name="installed" xmlname="installed">
<Constraint loader="ListString">
<value name="default(true)"/>
<value name="true"/>
@@ -1142,8 +1151,8 @@
</Constraint>
<Editor name="ListString"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced" default="default(false)"
- name="auto-create" xmlname="auto-create">
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(false)" name="auto-create" xmlname="auto-create">
<Constraint loader="ListString">
<value name="default(false)"/>
<value name="true"/>
@@ -1210,6 +1219,134 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="component" name="SeamComponent20">
+ <XChildrenEntities>
+ <XChildEntity name="SeamProperty"/>
+ <XChildEntity name="SeamPropertyList"/>
+ <XChildEntity name="SeamPropertyMap"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.component" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="component" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general" name="class" xmlname="class">
+ <Constraint loader="QClassName"/>
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="scope" xmlname="scope">
+ <Constraint loader="List">
+ <value/>
+ <value name="stateless"/>
+ <value name="event"/>
+ <value name="page"/>
+ <value name="conversation"/>
+ <value name="session"/>
+ <value name="business_process"/>
+ <value name="application"/>
+ <value name="STATELESS"/>
+ <value name="EVENT"/>
+ <value name="PAGE"/>
+ <value name="CONVERSATION"/>
+ <value name="SESSION"/>
+ <value name="BUSINESS_PROCESS"/>
+ <value name="APPLICATION"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced" name="precedence" xmlname="precedence"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(true)" name="installed" xmlname="installed">
+ <Constraint loader="ListString">
+ <value name="default(true)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(false)" name="auto-create" xmlname="auto-create">
+ <Constraint loader="ListString">
+ <value name="default(false)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(false)" name="startup" xmlname="startup">
+ <Constraint loader="ListString">
+ <value name="default(false)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced" name="jndi-name" xmlname="jndi-name"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" 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"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add List Property..." kind="action" name="AddListProperty">
+ <EntityData EntityName="SeamPropertyList">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" 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" displayName="Create" kind="list" name="EditActions"/>
+ <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="%Delete%"
+ 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 displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData"
XMLSUBPATH="event" name="SeamEvent">
<XChildrenEntities>
@@ -1354,8 +1491,8 @@
<Editor name="List"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" name="method" xmlname="method"/>
- <XModelAttribute PROPERTIES="category=advanced" default="default(false)"
- name="auto-create" xmlname="auto-create">
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(false)" name="auto-create" xmlname="auto-create">
<Constraint loader="ListString">
<value name="default(false)"/>
<value name="true"/>
@@ -1407,8 +1544,8 @@
<XModelAttributeReference
attributes="name,value,scope,method,auto-create,comment"
entity="SeamFactory" name="factory"/>
- <XModelAttribute PROPERTIES="category=advanced" default="default(false)"
- name="startup" xmlname="startup">
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(false)" name="startup" visibility="false" xmlname="startup">
<Constraint loader="ListString">
<value name="default(false)"/>
<value name="true"/>
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-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-core.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -1330,7 +1330,7 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;category=general"
- default="org.jboss.seam.core.resourceBundle" name="name" xmlname="name"/>
+ default="org.jboss.seam.core.resourceLoader" name="name" xmlname="name"/>
<XModelAttributeReference
attributes="class,scope,precedence,installed,auto-create"
entity="SeamComponent" name="component"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-drools.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-drools.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-drools.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -89,8 +89,8 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="name,class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=advanced"
name="configuration-file" xmlname="configuration-file"/>
<XModelAttribute PROPERTIES="category=advanced" name="config-name" xmlname="config-name"/>
@@ -318,7 +318,7 @@
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Rule Base..." kind="action" name="AddRuleAgent">
+ displayName="Rule Agent..." kind="action" name="AddRuleAgent">
<EntityData EntityName="SeamDroolsRuleAgent">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="configuration-file" Mandatory="no"/>
@@ -352,7 +352,7 @@
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Rule Base..." kind="action" name="AddRuleAgent">
+ displayName="Rule Agent..." kind="action" name="AddRuleAgent">
<EntityData EntityName="SeamDroolsRuleAgent">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="configuration-file" Mandatory="no"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-international.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-international.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-international.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -41,8 +41,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.international.localeSelector" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="locale-string" xmlname="locale-string"/>
<XModelAttribute PROPERTIES="category=advanced" name="cookie-enabled" xmlname="cookie-enabled">
<Constraint loader="List">
@@ -97,8 +97,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.international.timeZoneSelector" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="time-zone-id" xmlname="time-zone-id"/>
<XModelAttribute PROPERTIES="category=advanced" name="cookie-enabled" xmlname="cookie-enabled">
<Constraint loader="List">
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-mail.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-mail.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-mail.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -103,8 +103,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.mail.meldware" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -151,10 +151,19 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.mail.meldwareUser" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="username" xmlname="username"/>
<XModelAttribute PROPERTIES="category=general" name="password" xmlname="password"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(false)" name="administrator" xmlname="administrator">
+ <Constraint loader="ListString">
+ <value name="default(false)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -205,7 +214,8 @@
<XModelAttribute PROPERTIES="category=general" name="password" xmlname="password"/>
<XModelAttribute PROPERTIES="category=general" name="host" xmlname="host"/>
<XModelAttribute PROPERTIES="category=general" name="port" xmlname="port"/>
- <XModelAttribute PROPERTIES="category=advanced" name="debug" xmlname="debug" default="default(false)">
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(false)" name="debug" xmlname="debug">
<Constraint loader="ListString">
<value name="default(false)"/>
<value name="true"/>
@@ -213,7 +223,8 @@
</Constraint>
<Editor name="ListString"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced" name="ssl" xmlname="ssl" default="default(false)">
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(false)" name="ssl" xmlname="ssl">
<Constraint loader="List">
<value name="default(false)"/>
<value name="true"/>
@@ -226,8 +237,8 @@
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced" name="tls"
- visibility="false" xmlname="tls" default="default(true)">
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(true)" name="tls" visibility="false" xmlname="tls">
<Constraint loader="List">
<value name="default(true)"/>
<value name="true"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-persistence.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-persistence.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-persistence.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -103,8 +103,8 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general"
name="persistence-unit-name" xmlname="persistence-unit-name"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
@@ -151,8 +151,8 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="name,class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="filter name" xmlname="persistence:name.#text"/>
<XModelAttribute PROPERTIES="category=advanced" name="enabled" xmlname="enabled"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
@@ -263,8 +263,8 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general"
name="cfg-resource-name" xmlname="cfg-resource-name"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
@@ -313,8 +313,8 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general"
name="entity-manager-factory" xmlname="entity-manager-factory"/>
<XModelAttribute PROPERTIES="category=general"
@@ -365,8 +365,8 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="session-factory" xmlname="session-factory"/>
<XModelAttribute PROPERTIES="category=general"
name="session-factory-jndi-name" xmlname="session-factory-jndi-name"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-remoting.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -84,6 +84,62 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="remoting:remoting-config" name="SeamRemotingConfig20">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.remoting.config" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="remoting config" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.remoting.remoting" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="poll-interval" xmlname="poll-interval"/>
+ <XModelAttribute PROPERTIES="category=general" name="poll-timeout" xmlname="poll-timeout"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="debug" xmlname="debug">
+ <Constraint loader="ListString">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </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"/>
+ <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>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ 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 displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XEntityExtension name="FileSeamComponents12">
<XChildrenEntities>
<XChildEntity name="SeamRemotingConfig"/>
@@ -129,7 +185,7 @@
</XEntityExtension>
<XEntityExtension name="FileSeamComponents20">
<XChildrenEntities>
- <XChildEntity name="SeamRemotingConfig"/>
+ <XChildEntity name="SeamRemotingConfig20"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -139,7 +195,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Config..." kind="action" name="AddRemotingConfig">
- <EntityData EntityName="SeamRemotingConfig">
+ <EntityData EntityName="SeamRemotingConfig20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="poll-interval" Mandatory="no"/>
<AttributeData AttributeName="poll-timeout" Mandatory="no"/>
@@ -159,7 +215,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Config..." kind="action" name="AddRemotingConfig">
- <EntityData EntityName="SeamRemotingConfig">
+ <EntityData EntityName="SeamRemotingConfig20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="poll-interval" Mandatory="no"/>
<AttributeData AttributeName="poll-timeout" Mandatory="no"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-security.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -30,6 +30,51 @@
<GlobalActions kind="list"/>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="security:faces-security-events" name="SeamFacesSecurityEvents20">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.security.identity" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="faces security events" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="cookie-max-age" xmlname="cookie-max-age"/>
+ <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"/>
+ <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>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ 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 displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
XMLSUBPATH="security:identity" name="SeamSecurityIdentity">
<XChildrenEntities/>
<XEntityRenderer>
@@ -108,7 +153,10 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,class,scope,precedence,installed,auto-create,authenticate-method,remember-me,jaas-config-name,security-rules"
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="authenticate-method,remember-me,jaas-config-name,security-rules"
entity="SeamSecurityIdentity" name="sequrity"/>
<XModelAttribute PROPERTIES="category=advanced"
name="authenticate-every-request" xmlname="authenticate-every-request">
@@ -119,7 +167,6 @@
</Constraint>
<Editor name="List"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced" name="cookie-max-age" xmlname="cookie-max-age"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -192,6 +239,7 @@
<XEntityExtension name="FileSeamComponents20">
<XChildrenEntities>
<XChildEntity name="SeamSecurityIdentity20"/>
+ <XChildEntity name="SeamFacesSecurityEvents20"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -207,6 +255,14 @@
<AttributeData AttributeName="remember-me" Mandatory="no"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Faces Security Events..." kind="action" name="AddFacesSecurityEvents">
+ <EntityData EntityName="FacesSecurityEvents20">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="cookie-max-age" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
</XActionItem>
</XActionItem>
@@ -226,6 +282,14 @@
<AttributeData AttributeName="remember-me" Mandatory="no"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Faces Security Events..." kind="action" name="AddFacesSecurityEvents">
+ <EntityData EntityName="FacesSecurityEvents20">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="cookie-max-age" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
</XActionItem>
</XActionItem>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-spring.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-spring.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-spring.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -152,8 +152,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.async.dispatcher" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,jndi-name"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,jndi-name,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general;save=always"
name="task-executor" xmlname="task-executor"/>
<XModelAttribute PROPERTIES="category=general"
@@ -202,12 +202,12 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.transaction.transaction" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,jndi-name"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,jndi-name,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general;save=always"
name="platform-transaction-manager" xmlname="platform-transaction-manager"/>
- <XModelAttribute PROPERTIES="category=advanced" default="default(true)"
- name="conversation-context-required" xmlname="conversation-context-required">
+ <XModelAttribute PROPERTIES="category=advanced"
+ default="default(true)" name="conversation-context-required" xmlname="conversation-context-required">
<Constraint loader="List">
<value name="default(true)"/>
<value name="true"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-theme.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-theme.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-theme.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -158,8 +158,8 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttributeReference
- attributes="name,class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="name,class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="theme" xmlname="theme"/>
<XModelAttribute PROPERTIES="category=advanced"
name="available-themes" xmlname="available-themes"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-transaction.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-transaction.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-transaction.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -45,8 +45,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.transaction.transaction" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,jndi-name"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,jndi-name,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -91,8 +91,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.transaction.transaction" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create,jndi-name"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,jndi-name,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -137,8 +137,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.transaction.transaction" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="save=always" name="entity-manager" xmlname="entity-manager"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
@@ -184,8 +184,8 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.transaction.transaction" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="save=always" name="session" xmlname="session"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta 2008-04-03 15:32:49 UTC (rev 7300)
@@ -44,10 +44,11 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.web.ajax4jsfFilter" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
- <XModelAttribute PROPERTIES="category=general" name="url-pattern" xmlname="url-pattern"/>
- <XModelAttribute PROPERTIES="category=advanced" name="disabled" xmlname="disabled"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="url-pattern,disabled,regex-url-pattern"
+ entity="SeamWebContextFilter20" name="filter"/>
<XModelAttribute PROPERTIES="category=general" name="enable-cache" xmlname="enable-cache">
<Constraint loader="List">
<value/>
@@ -71,32 +72,19 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <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>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- 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 displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ 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="web:context-filter" name="SeamWebAuthenticationFilter20">
+ XMLSUBPATH="web:authentication-filter" name="SeamWebAuthenticationFilter20">
<XChildrenEntities/>
<XEntityRenderer>
<ICONS>
@@ -110,10 +98,11 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.web.authenticationFilter" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
- <XModelAttribute PROPERTIES="category=general" name="url-pattern" xmlname="url-pattern"/>
- <XModelAttribute PROPERTIES="category=advanced" name="disabled" xmlname="disabled"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="url-pattern,disabled,regex-url-pattern"
+ entity="SeamWebContextFilter20" name="filter"/>
<XModelAttribute PROPERTIES="category=advanced" name="realm" xmlname="realm"/>
<XModelAttribute PROPERTIES="category=advanced" name="key" xmlname="key"/>
<XModelAttribute PROPERTIES="category=advanced"
@@ -124,26 +113,13 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <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>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- 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 displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="MoveActions" path="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -164,10 +140,11 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.servlet.characterEncodingFilter" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
- <XModelAttribute PROPERTIES="category=general" name="url-pattern" xmlname="url-pattern"/>
- <XModelAttribute PROPERTIES="category=advanced" name="disabled" xmlname="disabled"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="url-pattern,disabled,regex-url-pattern"
+ entity="SeamWebContextFilter20" name="filter"/>
<XModelAttribute PROPERTIES="category=general" name="encoding" xmlname="encoding"/>
<XModelAttribute PROPERTIES="category=general" name="override-client" xmlname="override-client">
<Constraint loader="List">
@@ -182,26 +159,13 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <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>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- 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 displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="MoveActions" path="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -254,6 +218,43 @@
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="web:context-filter" name="SeamWebContextFilter20">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.web.filter" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="context filter" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.servlet.contextFilter" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create"
+ entity="SeamComponent" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="url-pattern" xmlname="url-pattern"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="disabled" xmlname="disabled"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="regex-url-pattern" xmlname="regex-url-pattern"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ 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="web:exception-filter" name="SeamWebExceptionFilter">
<XChildrenEntities/>
<XEntityRenderer>
@@ -276,31 +277,54 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <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>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- 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 displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ 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="web:exception-filter" name="SeamWebExceptionFilter20">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.web.filter" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="exception filter" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.servlet.exceptionFilter" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="url-pattern,disabled,regex-url-pattern"
+ entity="SeamWebContextFilter20" name="filter"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ 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="web:logging-filter" name="SeamWebLoggingFilter20">
<XChildrenEntities/>
<XEntityRenderer>
@@ -315,35 +339,23 @@
<XModelAttribute PROPERTIES="id=true;category=general"
default="org.jboss.seam.web.loggingFilter" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
- <XModelAttribute PROPERTIES="category=general" name="url-pattern" xmlname="url-pattern"/>
- <XModelAttribute PROPERTIES="category=advanced" name="disabled" xmlname="disabled"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="url-pattern,disabled,regex-url-pattern"
+ entity="SeamWebContextFilter20" name="filter"/>
<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"/>
- <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>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- 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 displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="MoveActions" path="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -382,31 +394,65 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <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>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- 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 displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ 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="web:multipart-filter" name="SeamWebMultipartFilter20">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.web.filter" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="multipart filter" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.servlet.multipartFilter" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="url-pattern,disabled,regex-url-pattern"
+ entity="SeamWebContextFilter20" name="filter"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="create-temp-files" xmlname="create-temp-files">
+ <Constraint loader="List">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="max-request-size" xmlname="max-request-size"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ 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="web:redirect-filter" name="SeamWebRedirectFilter">
<XChildrenEntities/>
<XEntityRenderer>
@@ -429,31 +475,54 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <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>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- 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 displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ 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="web:redirect-filter" name="SeamWebRedirectFilter20">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.web.filter" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="redirect filter" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.servlet.redirectFilter" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="url-pattern,disabled,regex-url-pattern"
+ entity="SeamWebContextFilter20" name="filter"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ 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="web:servlet-session" name="SeamWebServletSession20">
<XChildrenEntities/>
<XEntityRenderer>
@@ -467,8 +536,8 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name"/>
<XModelAttributeReference
- attributes="class,scope,precedence,installed,auto-create"
- entity="SeamComponent" name="component"/>
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general"
name="invalidate-on-scheme-change" xmlname="invalidate-on-scheme-change">
<Constraint loader="List">
@@ -483,26 +552,13 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
- <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>
- <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
- 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 displayName="move" kind="list" name="MoveActions">
- <XActionItem HIDE="always" HandlerClassName="%Move%"
- ICON="action.move" displayName="Move" kind="action" name="Move"/>
- </XActionItem>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="MoveActions" path="MoveActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -598,10 +654,10 @@
</XEntityExtension>
<XEntityExtension name="FileSeamComponents20">
<XChildrenEntities>
- <XChildEntity name="SeamWebContextFilter"/>
- <XChildEntity name="SeamWebExceptionFilter"/>
- <XChildEntity name="SeamWebMultipartFilter"/>
- <XChildEntity name="SeamWebRedirectFilter"/>
+ <XChildEntity name="SeamWebContextFilter20"/>
+ <XChildEntity name="SeamWebExceptionFilter20"/>
+ <XChildEntity name="SeamWebMultipartFilter20"/>
+ <XChildEntity name="SeamWebRedirectFilter20"/>
<XChildEntity name="SeamWebAuthenticationFilter20"/>
<XChildEntity name="SeamWebCharacterFilter20"/>
<XChildEntity name="SeamWebAjaxFilter20"/>
@@ -616,7 +672,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Context Filter..." kind="action" name="AddContextFilter">
- <EntityData EntityName="SeamWebContextFilter">
+ <EntityData EntityName="SeamWebContextFilter20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="url-pattern" Mandatory="no"/>
</EntityData>
@@ -624,7 +680,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Exception Filter..." kind="action" name="AddExceptionFilter">
- <EntityData EntityName="SeamWebExceptionFilter">
+ <EntityData EntityName="SeamWebExceptionFilter20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="url-pattern" Mandatory="no"/>
</EntityData>
@@ -632,7 +688,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Multipart Filter..." kind="action" name="AddMultipartFilter">
- <EntityData EntityName="SeamWebMultipartFilter">
+ <EntityData EntityName="SeamWebMultipartFilter20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="url-pattern" Mandatory="no"/>
</EntityData>
@@ -640,7 +696,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Redirect Filter..." kind="action" name="AddRedirectFilter">
- <EntityData EntityName="SeamWebRedirectFilter">
+ <EntityData EntityName="SeamWebRedirectFilter20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="url-pattern" Mandatory="no"/>
</EntityData>
@@ -698,7 +754,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Context Filter..." kind="action" name="AddContextFilter">
- <EntityData EntityName="SeamWebContextFilter">
+ <EntityData EntityName="SeamWebContextFilter20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="url-pattern" Mandatory="no"/>
</EntityData>
@@ -706,7 +762,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Exception Filter..." kind="action" name="AddExceptionFilter">
- <EntityData EntityName="SeamWebExceptionFilter">
+ <EntityData EntityName="SeamWebExceptionFilter20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="url-pattern" Mandatory="no"/>
</EntityData>
@@ -714,7 +770,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Multipart Filter..." kind="action" name="AddMultipartFilter">
- <EntityData EntityName="SeamWebMultipartFilter">
+ <EntityData EntityName="SeamWebMultipartFilter20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="url-pattern" Mandatory="no"/>
</EntityData>
@@ -722,7 +778,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Redirect Filter..." kind="action" name="AddRedirectFilter">
- <EntityData EntityName="SeamWebRedirectFilter">
+ <EntityData EntityName="SeamWebRedirectFilter20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="url-pattern" Mandatory="no"/>
</EntityData>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/components-2.0.xsd
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/components-2.0.xsd 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/components-2.0.xsd 2008-04-03 15:32:49 UTC (rev 7300)
@@ -1,162 +1,140 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
- targetNamespace="http://jboss.com/products/seam/components"
- xmlns:components="http://jboss.com/products/seam/components">
- <xs:element name="components">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="components:component"/>
- <xs:element ref="components:factory"/>
- <xs:element ref="components:event"/>
- <xs:element ref="components:import"/>
- <xs:any namespace="##other" processContents="strict"/>
- </xs:choice>
- </xs:complexType>
- </xs:element>
- <xs:element name="component">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" maxOccurs="unbounded" ref="components:property"/>
- </xs:sequence>
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="components:attlist.ejbcomponent"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="import" type="xs:string"/>
-
- <xs:attributeGroup name="attlist.ejbcomponent">
- <xs:attribute name="jndi-name"/>
- </xs:attributeGroup>
-
- <xs:attributeGroup name="attlist.component">
- <xs:attribute name="name"/>
- <xs:attribute name="class"/>
- <xs:attribute name="scope">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="stateless"/>
- <xs:enumeration value="event"/>
- <xs:enumeration value="page"/>
- <xs:enumeration value="conversation"/>
- <xs:enumeration value="session"/>
- <xs:enumeration value="business_process"/>
- <xs:enumeration value="application"/>
- <xs:enumeration value="STATELESS"/>
- <xs:enumeration value="EVENT"/>
- <xs:enumeration value="PAGE"/>
- <xs:enumeration value="CONVERSATION"/>
- <xs:enumeration value="SESSION"/>
- <xs:enumeration value="BUSINESS_PROCESS"/>
- <xs:enumeration value="APPLICATION"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
-
- <xs:attribute name="precedence"/>
- <xs:attribute name="installed" default="true"/>
- <xs:attribute name="auto-create" default="false">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="true"/>
- <xs:enumeration value="false"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:attributeGroup>
- <xs:element name="factory">
- <xs:complexType>
- <xs:attributeGroup ref="components:attlist.factory"/>
- </xs:complexType>
- </xs:element>
- <xs:attributeGroup name="attlist.factory">
- <xs:attribute name="name" use="required"/>
- <xs:attribute name="method"/>
- <xs:attribute name="value"/>
- <xs:attribute name="scope">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="stateless"/>
- <xs:enumeration value="event"/>
- <xs:enumeration value="page"/>
- <xs:enumeration value="conversation"/>
- <xs:enumeration value="session"/>
- <xs:enumeration value="business_process"/>
- <xs:enumeration value="application"/>
- <xs:enumeration value="STATELESS"/>
- <xs:enumeration value="EVENT"/>
- <xs:enumeration value="PAGE"/>
- <xs:enumeration value="CONVERSATION"/>
- <xs:enumeration value="SESSION"/>
- <xs:enumeration value="BUSINESS_PROCESS"/>
- <xs:enumeration value="APPLICATION"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="auto-create">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="true"/>
- <xs:enumeration value="false"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="startup">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="true"/>
- <xs:enumeration value="false"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:attributeGroup>
- <xs:element name="property">
- <xs:complexType mixed="true">
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="components:key"/>
- <xs:element ref="components:value"/>
- </xs:choice>
- <xs:attributeGroup ref="components:attlist.property"/>
- </xs:complexType>
- </xs:element>
- <xs:attributeGroup name="attlist.property">
- <xs:attribute name="name" use="required"/>
- </xs:attributeGroup>
- <xs:element name="key" type="xs:string"/>
- <xs:element name="value" type="xs:string"/>
-
- <xs:complexType name="multiValuedProperty">
- <xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="components:value"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:complexType name="mapProperty">
- <xs:sequence minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="components:key"/>
- <xs:element ref="components:value"/>
- </xs:sequence>
- </xs:complexType>
-
- <xs:element name="event">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="components:action"/>
- </xs:choice>
- <xs:attributeGroup ref="components:attlist.event"/>
- </xs:complexType>
- </xs:element>
- <xs:attributeGroup name="attlist.event">
- <xs:attribute name="type" use="required"/>
- </xs:attributeGroup>
-
- <xs:element name="action">
- <xs:complexType>
- <xs:attributeGroup ref="components:attlist.action"/>
- </xs:complexType>
- </xs:element>
- <xs:attributeGroup name="attlist.action">
- <xs:attribute name="execute" use="required"/>
- </xs:attributeGroup>
-
-</xs:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+ targetNamespace="http://jboss.com/products/seam/components"
+ xmlns:components="http://jboss.com/products/seam/components">
+ <xs:element name="components">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="components:component"/>
+ <xs:element ref="components:factory"/>
+ <xs:element ref="components:event"/>
+ <xs:element ref="components:import"/>
+ <xs:any namespace="##other" processContents="strict"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="component">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="components:property"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="components:attlist.ejbcomponent"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="import" type="xs:string"/>
+
+ <xs:attributeGroup name="attlist.ejbcomponent">
+ <xs:attribute name="jndi-name"/>
+ </xs:attributeGroup>
+
+ <xs:attributeGroup name="attlist.component">
+ <xs:attribute name="name"/>
+ <xs:attribute name="class"/>
+ <xs:attribute name="scope">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="stateless"/>
+ <xs:enumeration value="event"/>
+ <xs:enumeration value="page"/>
+ <xs:enumeration value="conversation"/>
+ <xs:enumeration value="session"/>
+ <xs:enumeration value="business_process"/>
+ <xs:enumeration value="application"/>
+ <xs:enumeration value="STATELESS"/>
+ <xs:enumeration value="EVENT"/>
+ <xs:enumeration value="PAGE"/>
+ <xs:enumeration value="CONVERSATION"/>
+ <xs:enumeration value="SESSION"/>
+ <xs:enumeration value="BUSINESS_PROCESS"/>
+ <xs:enumeration value="APPLICATION"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="precedence" type="xs:int"/>
+ <xs:attribute name="installed" default="true" type="xs:boolean"/>
+ <xs:attribute name="auto-create" default="false" type="xs:boolean"/>
+ <xs:attribute name="startup" default="false" type="xs:boolean"/>
+ </xs:attributeGroup>
+ <xs:element name="factory">
+ <xs:complexType>
+ <xs:attributeGroup ref="components:attlist.factory"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.factory">
+ <xs:attribute name="name" use="required"/>
+ <xs:attribute name="method"/>
+ <xs:attribute name="value"/>
+ <xs:attribute name="scope">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="stateless"/>
+ <xs:enumeration value="event"/>
+ <xs:enumeration value="page"/>
+ <xs:enumeration value="conversation"/>
+ <xs:enumeration value="session"/>
+ <xs:enumeration value="business_process"/>
+ <xs:enumeration value="application"/>
+ <xs:enumeration value="STATELESS"/>
+ <xs:enumeration value="EVENT"/>
+ <xs:enumeration value="PAGE"/>
+ <xs:enumeration value="CONVERSATION"/>
+ <xs:enumeration value="SESSION"/>
+ <xs:enumeration value="BUSINESS_PROCESS"/>
+ <xs:enumeration value="APPLICATION"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="auto-create" type="xs:boolean"/>
+ </xs:attributeGroup>
+ <xs:element name="property">
+ <xs:complexType mixed="true">
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="components:key"/>
+ <xs:element ref="components:value"/>
+ </xs:choice>
+ <xs:attributeGroup ref="components:attlist.property"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.property">
+ <xs:attribute name="name" use="required"/>
+ </xs:attributeGroup>
+ <xs:element name="key" type="xs:string"/>
+ <xs:element name="value" type="xs:string"/>
+
+ <xs:complexType name="multiValuedProperty">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="components:value"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="mapProperty">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="components:key"/>
+ <xs:element ref="components:value"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="event">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="components:action"/>
+ </xs:choice>
+ <xs:attributeGroup ref="components:attlist.event"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.event">
+ <xs:attribute name="type" use="required"/>
+ </xs:attributeGroup>
+
+ <xs:element name="action">
+ <xs:complexType>
+ <xs:attributeGroup ref="components:attlist.action"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.action">
+ <xs:attribute name="execute" use="required"/>
+ </xs:attributeGroup>
+
+</xs:schema>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/mail-2.0.xsd
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/mail-2.0.xsd 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/mail-2.0.xsd 2008-04-03 15:32:49 UTC (rev 7300)
@@ -1,50 +1,50 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
- targetNamespace="http://jboss.com/products/seam/mail"
- xmlns:mail="http://jboss.com/products/seam/mail"
- xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
- <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.0.xsd"/>
-
- <xs:attributeGroup name="attlist.mailSession">
- <xs:attribute name="username" type="xs:string"/>
- <xs:attribute name="password" type="xs:string"/>
- <xs:attribute name="host" type="xs:string" default="localhost"/>
- <xs:attribute name="port" type="xs:string" />
- <xs:attribute name="debug" type="xs:string" default="false" />
- <xs:attribute name="ssl" type="xs:boolean" default="false" />
- <xs:attribute name="tls" type="xs:boolean" default="true" />
- <xs:attribute name="session-jndi-name" type="xs:string" />
- </xs:attributeGroup>
- <xs:element name="mail-session">
- <xs:complexType>
- <xs:attributeGroup ref="components:attlist.component" />
- <xs:attributeGroup ref="mail:attlist.mailSession" />
- </xs:complexType>
- </xs:element>
-
- <xs:element name="users" type="components:multiValuedProperty"/>
- <xs:element name="meldware">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="mail:users" />
- </xs:choice>
- <xs:attributeGroup ref="components:attlist.component" />
- </xs:complexType>
- </xs:element>
-
- <xs:element name="aliases" type="components:multiValuedProperty"/>
- <xs:attributeGroup name="attlist.meldwareUser">
- <xs:attribute name="username" type="xs:string" />
- <xs:attribute name="password" type="xs:string" />
- <xs:attribute name="admin" type="xs:boolean" default="false"/>
- </xs:attributeGroup>
- <xs:element name="meldware-user">
- <xs:complexType>
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:element ref="mail:aliases" />
- </xs:choice>
- <xs:attributeGroup ref="components:attlist.component" />
- <xs:attributeGroup ref="mail:attlist.meldwareUser" />
- </xs:complexType>
- </xs:element>
-</xs:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+ targetNamespace="http://jboss.com/products/seam/mail"
+ xmlns:mail="http://jboss.com/products/seam/mail"
+ xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
+ <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.0.xsd"/>
+
+ <xs:attributeGroup name="attlist.mailSession">
+ <xs:attribute name="username" type="xs:string"/>
+ <xs:attribute name="password" type="xs:string"/>
+ <xs:attribute name="host" type="xs:string" default="localhost"/>
+ <xs:attribute name="port" type="xs:string" />
+ <xs:attribute name="debug" type="xs:string" default="false" />
+ <xs:attribute name="ssl" type="xs:boolean" default="false" />
+ <xs:attribute name="tls" type="xs:boolean" default="true" />
+ <xs:attribute name="session-jndi-name" type="xs:string" />
+ </xs:attributeGroup>
+ <xs:element name="mail-session">
+ <xs:complexType>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="mail:attlist.mailSession" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="users" type="components:multiValuedProperty"/>
+ <xs:element name="meldware">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="mail:users" />
+ </xs:choice>
+ <xs:attributeGroup ref="components:attlist.component" />
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="aliases" type="components:multiValuedProperty"/>
+ <xs:attributeGroup name="attlist.meldwareUser">
+ <xs:attribute name="username" type="xs:string" />
+ <xs:attribute name="password" type="xs:string" />
+ <xs:attribute name="administrator" type="xs:boolean" default="false"/>
+ </xs:attributeGroup>
+ <xs:element name="meldware-user">
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="mail:aliases" />
+ </xs:choice>
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="mail:attlist.meldwareUser" />
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/security-2.0.xsd
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/security-2.0.xsd 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/security-2.0.xsd 2008-04-03 15:32:49 UTC (rev 7300)
@@ -10,13 +10,24 @@
<xs:attributeGroup ref="security:attlist.identity"/>
</xs:complexType>
</xs:element>
+
+ <xs:element name="faces-security-events">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="security:attlist.faces-security-events"/>
+ </xs:complexType>
+ </xs:element>
+
<xs:attributeGroup name="attlist.identity">
<xs:attribute name="authenticate-method" />
<xs:attribute name="remember-me" type="xs:boolean"/>
<xs:attribute name="authenticate-every-request" type="xs:boolean"/>
<xs:attribute name="jaas-config-name" type="xs:string"/>
<xs:attribute name="security-rules" type="xs:string"/>
- <xs:attribute name="cookie-max-age" />
</xs:attributeGroup>
+ <xs:attributeGroup name="attlist.faces-security-events">
+ <xs:attribute name="cookie-max-age"/>
+ </xs:attributeGroup>
+
</xs:schema>
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/web-2.0.xsd
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/web-2.0.xsd 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/schemas/web-2.0.xsd 2008-04-03 15:32:49 UTC (rev 7300)
@@ -1,118 +1,119 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
- targetNamespace="http://jboss.com/products/seam/web" xmlns:web="http://jboss.com/products/seam/web"
- xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
- <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.0.xsd"/>
-
- <xs:element name="multipart-filter">
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="web:attlist.filter"/>
- <xs:attributeGroup ref="web:attlist.multipartFilter"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="redirect-filter">
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="web:attlist.filter"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="exception-filter">
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="web:attlist.filter"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="context-filter">
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="web:attlist.filter"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="character-encoding-filter">
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="web:attlist.filter"/>
- <xs:attribute name="encoding" type="xs:string"/>
- <xs:attribute name="override-client" type="xs:boolean"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="authentication-filter">
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="web:attlist.filter"/>
- <xs:attribute name="realm" type="xs:string"/>
- <xs:attribute name="key" type="xs:string"/>
- <xs:attribute name="nonce-validity-seconds" type="xs:int"/>
- <xs:attribute name="auth-type" type="xs:string"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="logging-filter">
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="web:attlist.filter"/>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="ajax4jsf-filter">
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="web:attlist.filter"/>
- <xs:attributeGroup ref="web:attlist.ajax4jsfFilter"/>
- </xs:complexType>
- </xs:element>
-
- <xs:attributeGroup name="attlist.filter">
- <xs:attribute name="url-pattern" type="xs:string"/>
- <xs:attribute name="disabled" type="xs:string" default="false" />
- </xs:attributeGroup>
-
- <xs:attributeGroup name="attlist.multipartFilter">
- <xs:attribute name="create-temp-files">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="true"/>
- <xs:enumeration value="false"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="max-request-size" type="xs:integer"/>
- </xs:attributeGroup>
-
- <xs:attributeGroup name="attlist.ajax4jsfFilter">
- <xs:attribute name="enable-cache">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="true"/>
- <xs:enumeration value="false"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="force-parser">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="true"/>
- <xs:enumeration value="false"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="log4j-init-file" type="xs:string"/>
- </xs:attributeGroup>
-
- <xs:element name="servlet-session">
- <xs:complexType mixed="true">
- <xs:attributeGroup ref="components:attlist.component"/>
- <xs:attributeGroup ref="web:attlist.servlet-session"/>
- </xs:complexType>
- </xs:element>
- <xs:attributeGroup name="attlist.servlet-session">
- <xs:attribute name="invalidate-on-scheme-change" type="xs:boolean"/>
- </xs:attributeGroup>
-
-</xs:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+ targetNamespace="http://jboss.com/products/seam/web" xmlns:web="http://jboss.com/products/seam/web"
+ xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
+ <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.0.xsd"/>
+
+ <xs:element name="multipart-filter">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.filter"/>
+ <xs:attributeGroup ref="web:attlist.multipartFilter"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="redirect-filter">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.filter"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="exception-filter">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.filter"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="context-filter">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.filter"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="character-encoding-filter">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.filter"/>
+ <xs:attribute name="encoding" type="xs:string"/>
+ <xs:attribute name="override-client" type="xs:boolean"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="authentication-filter">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.filter"/>
+ <xs:attribute name="realm" type="xs:string"/>
+ <xs:attribute name="key" type="xs:string"/>
+ <xs:attribute name="nonce-validity-seconds" type="xs:int"/>
+ <xs:attribute name="auth-type" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="logging-filter">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.filter"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="ajax4jsf-filter">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.filter"/>
+ <xs:attributeGroup ref="web:attlist.ajax4jsfFilter"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:attributeGroup name="attlist.filter">
+ <xs:attribute name="url-pattern" type="xs:string"/>
+ <xs:attribute name="regex-url-pattern" type="xs:string"/>
+ <xs:attribute name="disabled" type="xs:string" default="false" />
+ </xs:attributeGroup>
+
+ <xs:attributeGroup name="attlist.multipartFilter">
+ <xs:attribute name="create-temp-files">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="max-request-size" type="xs:integer"/>
+ </xs:attributeGroup>
+
+ <xs:attributeGroup name="attlist.ajax4jsfFilter">
+ <xs:attribute name="enable-cache">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="force-parser">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="log4j-init-file" type="xs:string"/>
+ </xs:attributeGroup>
+
+ <xs:element name="servlet-session">
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="web:attlist.servlet-session"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.servlet-session">
+ <xs:attribute name="invalidate-on-scheme-change" type="xs:boolean"/>
+ </xs:attributeGroup>
+
+</xs:schema>
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 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentConstants.java 2008-04-03 15:32:49 UTC (rev 7300)
@@ -20,8 +20,9 @@
public String ENT_SEAM_COMPONENTS_12 = ENT_SEAM_COMPONENTS + "12"; //$NON-NLS-1$
public String ENT_SEAM_COMPONENT_12 = "FileSeamComponent" + "12"; //$NON-NLS-1$ //$NON-NLS-2$
public String ENT_SEAM_COMPONENTS_20 = ENT_SEAM_COMPONENTS + SUFF_20;
- public String ENT_SEAM_COMPONENT_20 = "FileSeamComponent" + SUFF_20; //$NON-NLS-1$
+ public String ENT_SEAM_COMPONENT_FILE_20 = "FileSeamComponent" + SUFF_20; //$NON-NLS-1$
public String ENT_SEAM_COMPONENT = "SeamComponent"; //$NON-NLS-1$
+ public String ENT_SEAM_COMPONENT_20 = ENT_SEAM_COMPONENT + SUFF_20;
public String ENT_SEAM_FACTORY = "SeamFactory"; //$NON-NLS-1$
public String ENT_SEAM_FACTORY_20 = ENT_SEAM_FACTORY + SUFF_20;
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 2008-04-03 15:19:36 UTC (rev 7299)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/src/org/jboss/tools/seam/xml/components/model/SeamComponentsEntityRecognizer.java 2008-04-03 15:32:49 UTC (rev 7300)
@@ -49,7 +49,7 @@
int i20 = schemaLocation.indexOf("2.0"); //$NON-NLS-1$
if(i20 >= 0) {
- if(isSingleComponent) return ENT_SEAM_COMPONENT_20;
+ if(isSingleComponent) return ENT_SEAM_COMPONENT_FILE_20;
if(isMultiComponent(body)) return ENT_SEAM_COMPONENTS_20;
}
17 years, 8 months
JBoss Tools SVN: r7299 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-03 11:19:36 -0400 (Thu, 03 Apr 2008)
New Revision: 7299
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
JBIDE-1836
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-04-03 15:18:37 UTC (rev 7298)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-04-03 15:19:36 UTC (rev 7299)
@@ -742,11 +742,7 @@
DropTarget target = new DropTarget(getSourceViewer().getTextWidget(),
DND.DROP_MOVE | DND.DROP_COPY);
Transfer[] types = new Transfer[] {
- /*
- * Added by Dzmitry Sakovich (dsakovich(a)exadel.com) Fix for
- * JBIDE-1836
- */
- // ModelTransfer.getInstance(),
+ ModelTransfer.getInstance(),
HTMLTransfer.getInstance(), TextTransfer.getInstance(),
FileTransfer.getInstance() };
target.setTransfer(types);
17 years, 8 months
JBoss Tools SVN: r7298 - trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-03 11:18:37 -0400 (Thu, 03 Apr 2008)
New Revision: 7298
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java
Log:
JBIDE-1836
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java 2008-04-03 15:18:17 UTC (rev 7297)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java 2008-04-03 15:18:37 UTC (rev 7298)
@@ -19,6 +19,7 @@
import org.jboss.tools.common.meta.action.XActionInvoker;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.XModelTransferBuffer;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.ui.views.palette.PaletteInsertHelper;
import org.jboss.tools.vpe.ui.palette.model.PaletteItem;
@@ -37,6 +38,7 @@
public void dragStart(DragSourceEvent event) {
try {
+ XModelTransferBuffer.getInstance().enable();
List list = ((PaletteViewer)viewer).getSelectedEditParts();
XModelObject object = (list.size() == 0) ? null : getObject(list.get(0));
if(object == null) {
@@ -104,4 +106,8 @@
}
return null;
}
+
+ public void dragFinish(DragSourceEvent event) {
+ XModelTransferBuffer.getInstance().disable();
+ }
}
17 years, 8 months
JBoss Tools SVN: r7297 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-04-03 11:18:17 -0400 (Thu, 03 Apr 2008)
New Revision: 7297
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
Log:
JBIDE-1836
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2008-04-03 15:06:06 UTC (rev 7296)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/dnd/context/DropContext.java 2008-04-03 15:18:17 UTC (rev 7297)
@@ -27,6 +27,7 @@
import org.eclipse.wst.sse.ui.internal.TextDropAction;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.XModelTransferBuffer;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.ui.editors.dnd.FileTagProposalLoader;
@@ -171,6 +172,7 @@
class ModelTransferProcessor extends TransferProcessor {
public void process(TransferData data) {
+ if(!XModelTransferBuffer.getInstance().isEnabled()) return;
XModelObject o = PreferenceModelUtilities.getPreferenceModel().getModelBuffer().source();
if(dropAsFileObject(o)) {
flavor = "application/x-moz-file";
@@ -187,6 +189,9 @@
flavor = "text/html";
Object ooo = HTMLTransfer.getInstance().nativeToJava(event.currentDataType);
mimeData = ooo == null ? null : ooo.toString();
+ if(mimeData == null) {
+ flavor = null;
+ }
}
}
17 years, 8 months
JBoss Tools SVN: r7296 - trunk/seam/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ykryvinchanka
Date: 2008-04-03 11:06:06 -0400 (Thu, 03 Apr 2008)
New Revision: 7296
Modified:
trunk/seam/docs/reference/en/modules/directory_structure.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-135 Seam. New info added + scale param is redefined
Modified: trunk/seam/docs/reference/en/modules/directory_structure.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/directory_structure.xml 2008-04-03 14:57:29 UTC (rev 7295)
+++ trunk/seam/docs/reference/en/modules/directory_structure.xml 2008-04-03 15:06:06 UTC (rev 7296)
@@ -26,7 +26,8 @@
<title>Project Layout for WAR projects</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/directory_structure/directory_structure_1.png"/>
+ <imagedata fileref="images/directory_structure/directory_structure_1.png"
+ scale="75"/>
</imageobject>
</mediaobject>
</figure>
@@ -43,16 +44,18 @@
<note>
<title>Note:</title>
<para>Because of Eclipse WTP limits the hot deployed classes also existed in <emphasis>
- <property>WEB-INF/classes</property>
- </emphasis>, but since Seam gives <emphasis>
+ <property>WEB-INF/classes</property>, </emphasis> but since Seam gives <emphasis>
<property>WEB-INF/dev</property>
</emphasis> precedence it will work.</para>
</note>
<para>Furthermore the Seam Project wizard generates a test project that is setup to run
- <link linkend="testNG">TestNG</link> directly against the proper libraries and
+ <link linkend="testNG">TestNG</link> directly against the proper libraries and
server runtime libraries. When the TestNG plugin is installed you can just run your
tests via <emphasis><property>Run As > TestNG Test</property>.</emphasis></para>
+ <para>In order to deploy WAR project on server, right-click on the project and select <emphasis>
+ <property>Run As > Run on Server</property>.</emphasis> Studio will deploy
+ WAR project into one web application on server to <property>deploy</property> folder.</para>
</section>
@@ -64,14 +67,20 @@
<title>Project Layout for WAR projects</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/directory_structure/directory_structure_2.png"/>
+ <imagedata fileref="images/directory_structure/directory_structure_2.png"
+ scale="75"/>
</imageobject>
</mediaobject>
</figure>
<para>An EAR project can use the whole range of Seam components, including EJB3 Session
beans.</para>
-
+ <para>In order to deploy EAR project on server, right-click on the project with
+ <property>-ear</property> postfix and select <emphasis>
+ <property>Run As > Run on Server</property>.</emphasis> Studio will take care
+ about all modules and deploy EAR project into one enterprise application on server to
+ <property>deploy</property> folder. EAR application keeps <property>ejb</property>
+ and <property>war</property> modules of the EAR project.</para>
</section>
17 years, 8 months
JBoss Tools SVN: r7295 - trunk/jbpm/docs/reference/en.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2008-04-03 10:57:29 -0400 (Thu, 03 Apr 2008)
New Revision: 7295
Modified:
trunk/jbpm/docs/reference/en/master.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-292 guide version update according JBoosTools 2.0.1GA release
Modified: trunk/jbpm/docs/reference/en/master.xml
===================================================================
--- trunk/jbpm/docs/reference/en/master.xml 2008-04-03 14:55:42 UTC (rev 7294)
+++ trunk/jbpm/docs/reference/en/master.xml 2008-04-03 14:57:29 UTC (rev 7295)
@@ -21,7 +21,7 @@
<holder>Red Hat</holder>
</copyright>
<releaseinfo>
-<para>Version: 3.1.1</para>
+<para>Version: 3.1.1.GA</para>
</releaseinfo>
</bookinfo>
17 years, 8 months
JBoss Tools SVN: r7294 - trunk/hibernatetools/docs/reference/en.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2008-04-03 10:55:42 -0400 (Thu, 03 Apr 2008)
New Revision: 7294
Modified:
trunk/hibernatetools/docs/reference/en/master.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-292 guide version update according JBoosTools 2.0.1GA release
Modified: trunk/hibernatetools/docs/reference/en/master.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/master.xml 2008-04-03 14:54:13 UTC (rev 7293)
+++ trunk/hibernatetools/docs/reference/en/master.xml 2008-04-03 14:55:42 UTC (rev 7294)
@@ -15,7 +15,7 @@
<subtitle>Reference Guide</subtitle>
<releaseinfo>
- <para>Version: 3.2.0.GA</para>
+ <para>Version: 3.2.1.GA</para>
</releaseinfo>
17 years, 8 months
JBoss Tools SVN: r7293 - trunk/as/docs/reference/en.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2008-04-03 10:54:13 -0400 (Thu, 03 Apr 2008)
New Revision: 7293
Modified:
trunk/as/docs/reference/en/master.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-292 guide version update according JBoosTools 2.0.1GA release
Modified: trunk/as/docs/reference/en/master.xml
===================================================================
--- trunk/as/docs/reference/en/master.xml 2008-04-03 14:40:15 UTC (rev 7292)
+++ trunk/as/docs/reference/en/master.xml 2008-04-03 14:54:13 UTC (rev 7293)
@@ -19,7 +19,7 @@
<holder>Red Hat</holder>
</copyright>
<releaseinfo>
-<para>Version: 2.0.0.GA</para>
+<para>Version: 1.0.1.GA</para>
</releaseinfo>
</bookinfo>
17 years, 8 months
JBoss Tools SVN: r7292 - in trunk/seam/plugins/org.jboss.tools.seam.ui: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-04-03 10:40:15 -0400 (Thu, 03 Apr 2008)
New Revision: 7292
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamJavaSearchRequestor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamMatchPresentation.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamPathIndexer.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamQueryParticipant.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamDeclarationsAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamReferencesAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamElementMatch.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchQuery.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchRequestor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResult.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchScope.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchViewLabelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTableContentProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTreeContentProvider.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1860 Seam find references is not using the right extensionpoint/shortcut
Main Seam search functionality
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2008-04-03 14:40:15 UTC (rev 7292)
@@ -62,6 +62,7 @@
org.jboss.tools.seam.ui.builder,
org.jboss.tools.seam.ui.internal.project.facet;x-internal:=true,
org.jboss.tools.seam.ui.preferences,
+ org.jboss.tools.seam.ui.search,
org.jboss.tools.seam.ui.text.java;
uses:="org.eclipse.jface.text,
org.eclipse.jdt.ui.text.java,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-04-03 14:40:15 UTC (rev 7292)
@@ -448,7 +448,7 @@
</action>
<action
class="org.jboss.tools.seam.ui.actions.FindSeamDeclarationsAction"
- definitionId="org.jboss.tools.seam.ui.find.declarations"
+ definitionId="org.eclipse.jdt.ui.edit.text.java.search.declarations.in.workspace"
helpContextId="org.eclipse.jdt.ui.find_declarations_action"
icon="icons/find_seam_declarations.gif"
id="findDeclarations"
@@ -459,7 +459,7 @@
</action>
<action
class="org.jboss.tools.seam.ui.actions.FindSeamReferencesAction"
- definitionId="org.jboss.tools.seam.ui.find.references"
+ definitionId="org.eclipse.jdt.ui.edit.text.java.search.references.in.workspace"
helpContextId="org.eclipse.jdt.ui.find_references_action"
icon="icons/find_seam_references.gif"
id="findReferences"
@@ -529,14 +529,14 @@
</extension>
<!--======================================================================================-->
- <!-- queryParticipant to participate in java seraches -->
+ <!-- queryParticipant to participate in java serches -->
<!--======================================================================================-->
- <!-- extension point="org.eclipse.jdt.ui.queryParticipants">
+ <extension point="org.eclipse.jdt.ui.queryParticipants">
<queryParticipant
name="Seam Query Participant"
nature="org.eclipse.jdt.core.javanature"
class="org.jboss.tools.seam.ui.search.SeamQueryParticipant"
id="org.jboss.tools.seam.ui.search.SeamQueryParticipant" />
- </extension -->
+ </extension>
</plugin>
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,5 +1,17 @@
+/*******************************************************************************
+ * 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.seam.ui.actions;
+import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@@ -28,40 +40,45 @@
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.progress.IProgressService;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
+import org.jboss.tools.common.model.ui.texteditors.xmleditor.XMLTextEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.el.ELOperandToken;
-import org.jboss.tools.seam.internal.core.el.ElVarSearcher;
import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.internal.core.el.SeamELOperandTokenizer;
import org.jboss.tools.seam.internal.core.el.SeamELOperandTokenizerForward;
import org.jboss.tools.seam.internal.core.el.ElVarSearcher.Var;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
-import org.jboss.tools.seam.ui.SeamUIMessages;
import org.jboss.tools.seam.ui.search.SeamSearchQuery;
import org.jboss.tools.seam.ui.search.SeamSearchScope;
+/**
+ * Base class for Seam Find actions
+ *
+ * @author Jeremy
+ */
abstract public class FindSeamAction extends Action implements IWorkbenchWindowActionDelegate, IActionDelegate2 {
protected FindSeamAction() {
}
+ /**
+ * @Override
+ */
public void run() {
runWithEvent(null);
}
- private Shell getShell() {
- try {
- return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- } catch (Throwable x) {
- return null;
- }
- }
-
+ /**
+ * @Override
+ */
public void runWithEvent(Event e) {
IEditorPart editor = ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editor == null)
@@ -71,9 +88,19 @@
IDocument document = null;
ISourceViewer viewer = null;
-
+
+ if (editor instanceof EditorPartWrapper) {
+ editor = ((EditorPartWrapper)editor).getEditor();
+ }
if (editor instanceof JSPMultiPageEditor) {
viewer = ((JSPMultiPageEditor)editor).getJspEditor().getTextViewer();
+ } else if (editor instanceof XMLTextEditor) {
+ viewer = ((XMLTextEditor)editor).getTextViewer();
+ } else if (editor instanceof MultiPageEditorPart) {
+ IEditorPart activeEditor = getActiveEditor((MultiPageEditorPart)editor);
+ if (activeEditor instanceof AbstractTextEditor) {
+ viewer = getSourceViewer((AbstractTextEditor)activeEditor);
+ }
} else if (editor instanceof CompilationUnitEditor) {
viewer = ((CompilationUnitEditor)editor).getViewer();
}
@@ -83,7 +110,7 @@
document = viewer.getDocument();
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+ ISelection selection = viewer.getSelectionProvider().getSelection();
if (selection.isEmpty())
return;
@@ -112,11 +139,21 @@
if (tokens == null)
return; // No EL Operand found
+ try {
+ performNewSearch(tokens, file);
+ } catch (JavaModelException jme) {
+ SeamGuiPlugin.getPluginLog().logError(jme);
+ } catch (InterruptedException ie) {
+ SeamGuiPlugin.getPluginLog().logError(ie);
+ }
+ return;
+
+ /*
String[] varNamesToSearch = findVariableNames(seamProject, document, tokens);
if (varNamesToSearch != null) {
try {
- performNewSearch(varNamesToSearch, project);
+ performNewSearch(varNamesToSearch, file);
} catch (JavaModelException jme) {
SeamGuiPlugin.getPluginLog().logError(jme);
} catch (InterruptedException ie) {
@@ -159,10 +196,20 @@
SeamGuiPlugin.getPluginLog().logError(jme);
} catch (InterruptedException ie) {
SeamGuiPlugin.getPluginLog().logError(ie);
- }
+ }
+ */
}
+ /**
+ * Returns list of Seam ELOperandToken which are placed under the cursor position
+ *
+ * @param document
+ * @param offset
+ * @return
+ */
public static List<ELOperandToken> findTokensAtOffset(IDocument document, int offset) {
+ List<ELOperandToken> result = new ArrayList<ELOperandToken>();
+
int elStart = getELStart(document, offset);
if (elStart == -1)
@@ -171,9 +218,38 @@
SeamELOperandTokenizerForward tokenizer = new SeamELOperandTokenizerForward(document, elStart);
List<ELOperandToken> tokens = tokenizer.getTokens();
- return (tokens == null || tokens.size() == 0) ? null : tokens;
+ ELOperandToken lastSeparator = null;
+ for (int i = 0; tokens != null && i < tokens.size(); i++) {
+ ELOperandToken token = tokens.get(i);
+ if (token.getType() == ELOperandToken.EL_SEPARATOR_TOKEN) {
+ lastSeparator = token;
+ continue;
+ }
+ if (token.getType() == ELOperandToken.EL_VARIABLE_NAME_TOKEN ||
+ token.getType() == ELOperandToken.EL_METHOD_TOKEN ||
+ token.getType() == ELOperandToken.EL_PROPERTY_NAME_TOKEN) {
+ if (token.getStart() <= offset) {
+ if (lastSeparator != null)
+ result.add(lastSeparator);
+ result.add(token);
+ } else {
+ // Stop processing. We're not interrested of the rest of tokens
+ break;
+ }
+ }
+ }
+
+ return result;
}
-
+
+ /**
+ * Finds the variable names for the selected ELOperandToken tokens
+ *
+ * @param seamProject
+ * @param document
+ * @param tokens
+ * @return
+ */
public static String[] findVariableNames(ISeamProject seamProject, IDocument document, List<ELOperandToken> tokens) {
String[] varNames = null;
@@ -209,32 +285,47 @@
return varNames;
}
- // ---- IWorkbenchWindowActionDelegate
- // ------------------------------------------------
-
+ // IWorkbenchWindowActionDelegate
+ /**
+ * @Override
+ */
public void run(IAction action) {
run();
}
+ /**
+ * @Override
+ */
public void dispose() {
// do nothing.
}
+ /**
+ * @Override
+ */
public void init(IWorkbenchWindow window) {
// do nothing.
}
+ /**
+ * @Override
+ */
public void selectionChanged(IAction action, ISelection selection) {
// do nothing. Action doesn't depend on selection.
}
- // ---- IActionDelegate2
- // ------------------------------------------------
+ // IActionDelegate2
+ /**
+ * @Override
+ */
public void runWithEvent(IAction action, Event event) {
runWithEvent(event);
}
+ /**
+ * @Override
+ */
public void init(IAction action) {
// do nothing.
}
@@ -269,24 +360,30 @@
return lastToken.getStart() + lastToken.getLength();
}
- private SeamSearchQuery createQuery(String[] patterns, IProject root) throws JavaModelException, InterruptedException {
+ private SeamSearchQuery createQuery(List<ELOperandToken> tokens, IFile sourceFile) throws JavaModelException, InterruptedException {
- SeamSearchScope scope = new SeamSearchScope(new IProject[] {root}, getLimitTo());
+ SeamSearchScope scope = new SeamSearchScope(new IProject[] {sourceFile.getProject()}, getLimitTo());
- return new SeamSearchQuery(patterns, scope);
+ return new SeamSearchQuery(tokens, sourceFile, scope);
}
- private SeamSearchQuery createQuery(Var var, IFile root) throws JavaModelException, InterruptedException {
+ private SeamSearchQuery createQuery(Var var, IFile sourceFile) throws JavaModelException, InterruptedException {
- SeamSearchScope scope = new SeamSearchScope(new IFile[] {root}, getLimitTo());
+ SeamSearchScope scope = new SeamSearchScope(new IFile[] {sourceFile}, getLimitTo());
- return new SeamSearchQuery(var, scope);
+ return new SeamSearchQuery(var, sourceFile, scope);
}
+ /**
+ * Returns the limitTo flag. The possible values are:
+ * - SeamSearchScope.SEARCH_FOR_DECLARATIONS
+ * - SeamSearchScope.SEARCH_FOR_REFERENCES
+ * @return
+ */
abstract protected int getLimitTo();
-
- private void performNewSearch(String[] patterns, IProject root) throws JavaModelException, InterruptedException {
- SeamSearchQuery query= createQuery(patterns, root);
+
+ private void performNewSearch(List<ELOperandToken> tokens, IFile sourceFile) throws JavaModelException, InterruptedException {
+ SeamSearchQuery query= createQuery(tokens, sourceFile);
if (query.canRunInBackground()) {
/*
* This indirection with Object as parameter is needed to prevent the loading
@@ -310,6 +407,8 @@
}
}
+
+ @Deprecated
private void performNewLocalSearch(Var var, IFile root) throws JavaModelException, InterruptedException {
SeamSearchQuery query= createQuery(var, root);
if (query.canRunInBackground()) {
@@ -335,4 +434,67 @@
}
}
+
+ /**
+ * Returns the active editor from active MultipageEditor
+ *
+ * @param multiPageEditor
+ * @return
+ */
+ public static IEditorPart getActiveEditor(MultiPageEditorPart multiPageEditor) {
+ Class editorClass = multiPageEditor.getClass();
+ while (editorClass != null) {
+ try {
+ Method m = editorClass.getDeclaredMethod("getActiveEditor", new Class[] {});
+
+ if(m != null) {
+ m.setAccessible(true);
+ Object result = m.invoke(multiPageEditor, new Object[]{});
+ return (result instanceof IEditorPart ? (IEditorPart)result : null);
+ }
+ } catch (NoSuchMethodException ne) {
+ } catch (Exception e) {
+ }
+ editorClass = editorClass.getSuperclass();
+ }
+ return null;
+
+ }
+
+ /**
+ * Returns the source viewer from AbstractTextEditor
+ *
+ * @param multiPageEditor
+ * @return
+ */
+ public static ISourceViewer getSourceViewer(AbstractTextEditor editor) {
+ Class editorClass = editor.getClass();
+ while (editorClass != null) {
+ try {
+ Method m = editorClass.getDeclaredMethod("getSourceViewer", new Class[] {});
+
+ if(m != null) {
+ m.setAccessible(true);
+ Object result = m.invoke(editor, new Object[]{});
+ return (result instanceof ISourceViewer ? (ISourceViewer)result : null);
+ }
+ } catch (NoSuchMethodException ne) {
+ } catch (Exception e) {
+ }
+ editorClass = editorClass.getSuperclass();
+ }
+ return null;
+
+ }
+
+ /*
+ * returns current Shell
+ */
+ private Shell getShell() {
+ try {
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
+ } catch (Throwable x) {
+ return null;
+ }
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamDeclarationsAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamDeclarationsAction.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamDeclarationsAction.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * 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.seam.ui.actions;
import org.jboss.tools.seam.ui.SeamUIMessages;
@@ -3,6 +14,14 @@
import org.jboss.tools.seam.ui.search.SeamSearchScope;
+/**
+ * Find Seam Declarations action
+ *
+ * @author Jeremy
+ */
public class FindSeamDeclarationsAction extends FindSeamAction {
+ /**
+ * Constructs the FindSeamDeclarationAction
+ */
public FindSeamDeclarationsAction() {
setText(SeamUIMessages.FIND_DECLARATIONS_ACTION_ACTION_NAME);
@@ -11,6 +30,9 @@
setToolTipText(SeamUIMessages.FIND_DECLARATIONS_ACTION_TOOL_TIP);
}
+ /**
+ * Returns the search limitation to declarations
+ */
protected int getLimitTo() {
return SeamSearchScope.SEARCH_FOR_DECLARATIONS;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamReferencesAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamReferencesAction.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamReferencesAction.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * 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.seam.ui.actions;
import org.jboss.tools.seam.ui.SeamUIMessages;
@@ -3,6 +14,14 @@
import org.jboss.tools.seam.ui.search.SeamSearchScope;
+/**
+ * Find Seam References action
+ *
+ * @author Jeremy
+ */
public class FindSeamReferencesAction extends FindSeamAction {
+ /**
+ * Constructs the FindSeamReferencesAction
+ */
public FindSeamReferencesAction() {
setText(SeamUIMessages.FIND_REFERENCES_ACTION_ACTION_NAME);
@@ -11,6 +30,9 @@
setToolTipText(SeamUIMessages.FIND_REFERENCES_ACTION_TOOL_TIP);
}
+ /**
+ * Returns the search limitation to references
+ */
protected int getLimitTo() {
return SeamSearchScope.SEARCH_FOR_REFERENCES;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/SeamFindQuickAssistProcessor.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * 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.seam.ui.actions;
import java.util.List;
@@ -29,11 +40,21 @@
import org.jboss.tools.seam.ui.SeamUIMessages;
import org.jboss.tools.seam.ui.SeamUiImages;
+/**
+ * Quick Assist processor. Allows invokation of Find Seam Actions from QuickFix pop-up
+ * @author Jeremy
+ */
public class SeamFindQuickAssistProcessor implements IQuickAssistProcessor {
+ /**
+ * Constructs SeamFind
+ */
public SeamFindQuickAssistProcessor() {
}
+ /**
+ * @Override
+ */
public boolean hasAssists(IInvocationContext context) throws CoreException {
ISeamProject seamProject = getSeamProject(context);
if (seamProject==null)
@@ -70,6 +91,9 @@
document, tokens);
}
+ /**
+ * @Override
+ */
public IJavaCompletionProposal[] getAssists(IInvocationContext context,
IProblemLocation[] locations) throws CoreException {
@@ -85,17 +109,16 @@
if (seamProject == null)
return result;
- String[] variables = getVariableNames(seamProject, document, context.getSelectionOffset());
-
- if (variables == null)
+ List<ELOperandToken> tokens = FindSeamAction.findTokensAtOffset(
+ document,
+ context.getSelectionOffset());
+ if (tokens == null || tokens.size() == 0)
return result;
-
+
+
StringBuffer buf= new StringBuffer();
- for (int i= 0; i < variables.length; i++) {
- if (i > 0) {
- buf.append(", "); //$NON-NLS-1$
- }
- buf.append(variables[i]);
+ for (int i= 0; i < tokens.size(); i++) {
+ buf.append(tokens.get(i).getText()); //$NON-NLS-1$
}
searchString = buf.toString();
@@ -139,6 +162,9 @@
return document;
}
+ /**
+ * Custom Quick Assist Proposal
+ */
public abstract class ExternalActionQuickAssistProposal implements
IJavaCompletionProposal {
@@ -185,5 +211,4 @@
return proposal.getSelection( document );
}
}
-
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamElementMatch.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamElementMatch.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamElementMatch.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,37 +1,74 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.search.ui.text.Match;
-import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamDeclaration;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
-import org.jboss.tools.seam.internal.core.el.ElVarSearcher.Var;
+/**
+ * Seam Element match contains an information on the match found during the Seam Search Action
+ *
+ * @author Jeremy
+ */
public class SeamElementMatch extends Match {
private long fCreationTimeStamp;
+ /**
+ * Constructs SeamElementMatch using the {@link ISeamElement} object
+ *
+ * @param element
+ */
public SeamElementMatch(ISeamElement element) {
super(element, 0, 0);
fCreationTimeStamp= element.getResource().getModificationStamp();
}
+ /**
+ * Constructs SeamElementMatch using the {@link ISeamJavaSourceReference} object
+ *
+ * @param element
+ */
public SeamElementMatch(ISeamJavaSourceReference element) {
super(element, 0, 0);
fCreationTimeStamp= element.getSourceMember().getResource().getModificationStamp();
}
+ /**
+ * Constructs SeamElementMatch using the {@link ISeamDeclaration} object
+ *
+ * @param element
+ */
public SeamElementMatch(ISeamDeclaration element) {
super(element, 0, 0);
fCreationTimeStamp= element.getResource().getModificationStamp();
}
+ /**
+ * Constructs SeamElementMatch using the text file and text selection offset/length
+ *
+ * @param element
+ */
public SeamElementMatch(IFile element, int offset, int length) {
super(element, offset, length);
fCreationTimeStamp= ((IFile)element).getModificationStamp();
}
+ /**
+ * Returns the IFile where the Match occurres
+ * @return
+ */
public IFile getFile() {
if (getElement() instanceof ISeamJavaSourceReference) {
return (IFile) ((ISeamJavaSourceReference)getElement()).getSourceMember().getResource();
@@ -43,6 +80,10 @@
return (IFile) ((ISeamElement)getElement()).getResource();
}
+ /**
+ * Returns the creation time stamp
+ * @return
+ */
public long getCreationTimeStamp() {
return fCreationTimeStamp;
}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamJavaSearchRequestor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamJavaSearchRequestor.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamJavaSearchRequestor.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
+
+import java.util.HashMap;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchParticipant;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jdt.ui.search.ISearchRequestor;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.search.ui.text.Match;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
+
+/**
+ * Wrapper for JavaSearchRequestor. Used to process Search for IJavaElement requests
+ *
+ * @author Jeremy
+ */
+public class SeamJavaSearchRequestor extends SearchRequestor {
+ private ISearchRequestor fJavaRequestor = null;
+
+ /**
+ * Constructs the SeamJavaSearchRequestor object by default
+ */
+ public SeamJavaSearchRequestor() {
+ super();
+ }
+
+ /**
+ * Constructs the SeamJavaSearchRequestor object for parent requestor object
+ */
+ public SeamJavaSearchRequestor(ISearchRequestor javaRequestor) {
+ // need to report matches to javaRequestor
+ this.fJavaRequestor = javaRequestor;
+ }
+
+ /**
+ * Maps java search coordinates to corresponding JSP coordinates.
+ * Adds the matches to the Search Results view.
+ * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
+ */
+ public void acceptSearchMatch(SearchMatch match) throws CoreException {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jdt.core.search.SearchRequestor#beginReporting()
+ */
+ public void beginReporting() {
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.search.SearchRequestor#endReporting()
+ */
+ public void endReporting() {
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.search.SearchRequestor#enterParticipant(org.eclipse.jdt.core.search.SearchParticipant)
+ */
+ public void enterParticipant(SearchParticipant participant) {
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.search.SearchRequestor#exitParticipant(org.eclipse.jdt.core.search.SearchParticipant)
+ */
+ public void exitParticipant(SearchParticipant participant) {
+ }
+
+ /**
+ * @param searchDoc
+ * @param start
+ * @param end
+ * @param text
+ * @throws CoreException
+ */
+ protected void addSearchMatch(IDocument document, IFile file, int start, int end, String text) {
+
+ if(!file.exists())
+ return;
+
+ int lineNumber = -1;
+ try {
+ lineNumber = document.getLineOfOffset(start);
+ } catch (BadLocationException e) {
+ SeamGuiPlugin.getPluginLog().logError("offset: " + Integer.toString(start), e);
+ }
+ createSearchMarker(file, start, end, lineNumber);
+
+ if(this.fJavaRequestor != null) {
+ Match match = new Match(file, start, end - start);
+ this.fJavaRequestor.reportMatch(match);
+ }
+ }
+
+ /**
+ * Creates a search marker on a file
+ *
+ * @param File
+ * @param start
+ * @param end
+ */
+ private void createSearchMarker(IFile file, int start, int end, int lineNumber) {
+
+ try {
+ IMarker marker = file.createMarker(NewSearchUI.SEARCH_MARKER);
+ HashMap attributes = new HashMap(4);
+ attributes.put(IMarker.CHAR_START, new Integer(start));
+ attributes.put(IMarker.CHAR_END, new Integer(end));
+ attributes.put(IMarker.LINE_NUMBER, new Integer(lineNumber));
+ marker.setAttributes(attributes);
+
+ } catch (CoreException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ }
+ }
+
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamJavaSearchRequestor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamMatchPresentation.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamMatchPresentation.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamMatchPresentation.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
+
+import org.eclipse.jdt.ui.search.IMatchPresentation;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.search.internal.ui.text.FileLabelProvider;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * Seam match presentation
+ *
+ * @author Jeremy
+ */
+public class SeamMatchPresentation implements IMatchPresentation {
+
+ /**
+ * @see org.eclipse.jdt.ui.search.IMatchPresentation#createLabelProvider()
+ */
+ public ILabelProvider createLabelProvider() {
+ return new SeamSearchViewLabelProvider(null, FileLabelProvider.SHOW_LABEL_PATH);
+ }
+
+ /** (non-Javadoc)
+ * @see org.eclipse.jdt.ui.search.IMatchPresentation#showMatch(org.eclipse.search.ui.text.Match, int, int, boolean)
+ */
+ public void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException {
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamMatchPresentation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamPathIndexer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamPathIndexer.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamPathIndexer.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
+
+import java.util.HashMap;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.content.IContentDescription;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchPattern;
+
+/**
+ * Seam path indexer. Used to determine visible Seam paths
+ *
+ * @author Jeremy
+ *
+ */
+public class SeamPathIndexer {
+
+ private class FileVisitor implements IResourceProxyVisitor {
+ // hash map forces only one of each file
+ private HashMap fPaths = new HashMap();
+ IJavaSearchScope fScope = null;
+ SearchPattern fPattern = null;
+
+ public FileVisitor(SearchPattern pattern, IJavaSearchScope scope) {
+ this.fPattern = pattern;
+ this.fScope = scope;
+ }
+
+ public boolean visit(IResourceProxy proxy) throws CoreException {
+
+ if(SeamSearchEngine.getInstance().isCanceled())
+ return false;
+
+ if (proxy.getType() == IResource.FILE) {
+
+ IFile file = (IFile)proxy.requestResource();
+
+ IContentDescription contentDescription = file.getContentDescription();
+ String ctId = null;
+ if (contentDescription != null) {
+ ctId = contentDescription.getContentType().getId();
+ }
+
+ if (this.fScope.encloses(proxy.requestFullPath().toString())) {
+ fPaths.put(file.getParent().getFullPath(), SeamSearchEngine.getInstance().computeIndexLocation(file.getParent().getFullPath()));
+ }
+
+ // don't search deeper for files
+ return false;
+ }
+ return true;
+ }
+
+ public IPath[] getPaths() {
+ return (IPath[]) fPaths.values().toArray(new IPath[fPaths.size()]);
+ }
+ }
+
+ /**
+ * Returns visible Seam paths
+ *
+ * @param pattern
+ * @param scope
+ * @return
+ */
+ public IPath[] getVisibleSeamPaths(SearchPattern pattern, IJavaSearchScope scope) {
+
+ FileVisitor seamFileVisitor = new FileVisitor(pattern, scope);
+ try {
+ ResourcesPlugin.getWorkspace().getRoot().accept(seamFileVisitor, 0);
+ }
+ catch (CoreException e) {
+ e.printStackTrace();
+ }
+ return seamFileVisitor.getPaths();
+ }
+}
+
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamPathIndexer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamQueryParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamQueryParticipant.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamQueryParticipant.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.internal.core.search.JavaSearchScope;
+import org.eclipse.jdt.ui.search.ElementQuerySpecification;
+import org.eclipse.jdt.ui.search.IMatchPresentation;
+import org.eclipse.jdt.ui.search.IQueryParticipant;
+import org.eclipse.jdt.ui.search.ISearchRequestor;
+import org.eclipse.jdt.ui.search.PatternQuerySpecification;
+import org.eclipse.jdt.ui.search.QuerySpecification;
+
+/**
+ * Implements {@link IQueryParticipant} to build-in a Search for Seam references
+ * into a Java search
+ *
+ * @author Jeremy
+ */
+public class SeamQueryParticipant implements IQueryParticipant {
+
+ /**
+ * @see org.eclipse.jdt.ui.search.IQueryParticipant#estimateTicks(org.eclipse.jdt.ui.search.QuerySpecification)
+ */
+ public int estimateTicks(QuerySpecification specification) {
+ return 1;
+ }
+
+ /**
+ * @see org.eclipse.jdt.ui.search.IQueryParticipant#getUIParticipant()
+ */
+ public IMatchPresentation getUIParticipant() {
+ return new SeamMatchPresentation();
+ }
+
+ /**
+ * @see org.eclipse.jdt.ui.search.IQueryParticipant#search(org.eclipse.jdt.ui.search.ISearchRequestor, org.eclipse.jdt.ui.search.QuerySpecification, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void search(ISearchRequestor requestor, QuerySpecification querySpecification, IProgressMonitor monitor) throws CoreException {
+
+ //indexIfNeeded();
+
+ // do search based on the particular Java query
+ if(querySpecification instanceof ElementQuerySpecification) {
+ // element search (eg. from global find references in Java file)
+ ElementQuerySpecification elementQuery = (ElementQuerySpecification)querySpecification;
+ IJavaSearchScope javaScope = querySpecification.getScope();
+
+
+ // Search only for references to java element
+ if (!SeamSearchEngine.isSearchForReferences(querySpecification.getLimitTo()))
+ return;
+
+ IJavaElement element = elementQuery.getElement();
+ IResource project = element.getResource().getProject();
+
+ SeamSearchScope scope = new SeamSearchScope(querySpecification.getScope(), querySpecification.getLimitTo());
+
+ SeamSearchQuery query = new SeamSearchQuery(
+ new IJavaElement[] {element},
+ (IFile)element.getResource(),
+ scope);
+ query.setParentRequestor(requestor);
+
+ query.run(monitor);
+ } else if(querySpecification instanceof PatternQuerySpecification) {
+ // pattern search (eg. from Java search page)
+ PatternQuerySpecification patternQuery = (PatternQuerySpecification)querySpecification;
+ String pattern = patternQuery.getPattern();
+
+ SeamJavaSearchRequestor seamRequestor = new SeamJavaSearchRequestor(requestor);
+
+ SeamSearchScope scope = new SeamSearchScope(new JavaSearchScope(), patternQuery.getLimitTo());
+
+ SeamSearchEngine.getInstance().search(pattern,
+ scope,
+ patternQuery.getSearchFor(),
+ patternQuery.getLimitTo(),
+ SearchPattern.R_PATTERN_MATCH,
+ false,
+ seamRequestor);
+ }
+ }
+
+
+ private IProject getProject(IJavaElement javaElement) {
+ try {
+ return javaElement.getPrimaryElement().getResource().getProject();
+ } catch (Throwable ex) {
+ return null;
+ }
+ }
+
+
+ private String getPropertyName (IJavaElement element) {
+ if (element == null || IJavaElement.METHOD != element.getElementType())
+ return null;
+
+ String name = element.getElementName();
+ IMethod method = (IMethod)element;
+
+ if (!name.startsWith("get") && !name.startsWith("set") && !name.startsWith("is"))
+ return null;
+
+
+ if (name.startsWith("get") || name.startsWith("is") ) {
+ // the method is getter only if it has no parameters
+ if (method.getNumberOfParameters() > 0)
+ return null;
+ }
+
+ int nameOffset = (name.startsWith("set") || name.startsWith("get") ? 3 : 2);
+ name = name.substring(nameOffset, nameOffset + 1).toLowerCase() +
+ name.substring(nameOffset + 1);
+ return name;
+ }
+}
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamQueryParticipant.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,26 +1,73 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
-import java.util.regex.Pattern;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.zip.CRC32;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-
-import org.eclipse.core.resources.IFile;
-
-import org.eclipse.search.core.text.TextSearchRequestor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.core.search.SearchParticipant;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.core.search.SearchRequestor;
+import org.eclipse.jdt.internal.core.JavaModelManager;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.search.core.text.TextSearchEngine;
-import org.eclipse.search.core.text.TextSearchScope;
-import org.eclipse.search.internal.ui.SearchPlugin;
+import org.jboss.tools.seam.core.ISeamContextVariable;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.el.ELOperandToken;
+import org.jboss.tools.seam.internal.core.el.ElVarSearcher;
+import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
+import org.jboss.tools.seam.internal.core.el.ElVarSearcher.Var;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+/**
+ * A helper class used for search operations
+ *
+ * @author Jeremy
+ */
public abstract class SeamSearchEngine {
-
+ private static SeamSearchEngine fInstance = null;
+ private final IProgressMonitor fMonitor = new NullProgressMonitor();
+ private SearchParticipant fParticipant = null;
+ private IPath fSeamUIPluginLocation = null;
+ private final CRC32 fChecksumCalculator = new CRC32();
+
/**
- * Creates an instance of the search engine. By default this is the default text search engine (see {@link #createDefault()}),
- * but extensions can offer more sophisticated search engine implementations.
- * @return the created {@link TextSearchEngine}.
+ * Returns an instance. If the instance isn't initialized creates an instance
+ * of the search engine.
+ * @return the created {@link SeamSearchEngine}.
*/
- public static SeamSearchEngine create() {
- return createDefault();
+ public static SeamSearchEngine getInstance() {
+ if (fInstance == null) {
+ fInstance = createDefault();
+ }
+ return fInstance;
}
/**
@@ -29,39 +76,451 @@
* Note that clients should always use the search engine provided by {@link #create()}.
* @return an instance of the default text search engine {@link TextSearchEngine}.
*/
- public static SeamSearchEngine createDefault() {
+ private static SeamSearchEngine createDefault() {
return new SeamSearchEngine() {
- public IStatus search(TextSearchScope scope, SeamSearchRequestor requestor, Pattern[] searchPatterns, IProgressMonitor monitor) {
- return new SeamSearchVisitor(requestor, searchPatterns).search(scope, monitor);
+
+ @Override
+ public IStatus search(SeamSearchScope javaScope,
+ SeamSearchRequestor requestor,
+ IFile sourceFile,
+ List<ELOperandToken> tokens,
+ IProgressMonitor monitor) {
+
+ if (tokens == null || tokens.size() == 0) {
+ return Status.OK_STATUS;
+ }
+
+ SeamELCompletionEngine engine = new SeamELCompletionEngine();
+
+ IProject project = (sourceFile == null ? null : sourceFile.getProject());
+
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject == null)
+ return Status.OK_STATUS;
+
+
+
+ //Find Seam variable names
+ // - if the tokens are the variable name only - search for variable declaration in Seam project
+ String variableName = SeamSearchVisitor.tokensToString(tokens);
+
+ Set<ISeamContextVariable> variables = seamProject.getVariablesByName(variableName);
+ if (variables != null && variables.size() > 0) {
+ return search(javaScope, requestor, sourceFile, variables.toArray(new ISeamContextVariable[0]), monitor);
+ }
+
+ // - else try to find Java Elements and declarations/references for them
+ List<IJavaElement> elements = null;
+ try {
+ elements = engine.getJavaElementsForELOperandTokens(seamProject, sourceFile, tokens);
+ } catch (StringIndexOutOfBoundsException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ return Status.OK_STATUS;
+ } catch (BadLocationException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ return Status.OK_STATUS;
+ }
+
+ if (elements != null && elements.size() > 0) {
+ return search(javaScope, requestor, sourceFile, elements.toArray(new IJavaElement[0]), monitor);
+ }
+
+ // Try to find a local Var (a pair of variable-value attributes)
+ ElVarSearcher varSearcher = new ElVarSearcher(seamProject, sourceFile, new SeamELCompletionEngine());
+ // Find a Var in the EL
+ int start = tokens.get(0).getStart();
+ int end = tokens.get(tokens.size() - 1).getStart() +
+ tokens.get(tokens.size() - 1).getLength();
+
+ StringBuffer elText = new StringBuffer();
+ for (ELOperandToken token : tokens) {
+ if (elText.length() > 0) {
+ elText.append(".");
+ }
+ elText.append(token.getText());
+ }
+
+ if (elText == null || elText.length() == 0)
+ return Status.OK_STATUS;
+
+ List<Var> allVars= ElVarSearcher.findAllVars(sourceFile, tokens.get(0).getStart());
+ Var var = varSearcher.findVarForEl(elText.toString(), allVars, true);
+ if (var == null) {
+ // Find a Var in the current offset assuming that it's a node with var/value attribute pair
+ var = ElVarSearcher.findVar(sourceFile, tokens.get(0).getStart());
+ }
+ if (var == null)
+ return Status.OK_STATUS;
+
+ if (tokens.size() == 1) {
+ // The only Var is selected to search for
+ if (isSearchForDeclarations(javaScope.getLimitTo())) {
+
+ boolean res= SeamSearchVisitor.acceptPaternMatch(
+ requestor, sourceFile, var.getDeclarationOffset(), var.getDeclarationLength());
+ if (!res) {
+ return Status.OK_STATUS; // no further reporting requested
+ }
+ } else {
+ return search(javaScope, requestor, sourceFile, new Var[] {var}, monitor);
+ }
+
+
+ return Status.OK_STATUS;
+ }
+
+ // Need to extract the var value and search for the real elements
+
+ return Status.OK_STATUS;
}
+
-// public IStatus search(IFile[] scope, SeamSearchRequestor requestor, Pattern[] searchPatterns, IProgressMonitor monitor) {
-// return new SeamSearchVisitor(requestor, searchPatterns).search(scope, monitor);
-// }
+ @Override
+ public IStatus search(SeamSearchScope scope,
+ SeamSearchRequestor requestor,
+ IFile sourceFile,
+ IJavaElement[] elements,
+ IProgressMonitor monitor) {
+ IProject project = (sourceFile == null ? null : sourceFile.getProject());
+ return new SeamSearchVisitor(requestor, elements, project).search(scope, monitor);
+ }
+
+ @Override
+ public IStatus search(SeamSearchScope scope,
+ SeamSearchRequestor requestor,
+ IFile sourceFile,
+ Var[] vars,
+ IProgressMonitor monitor) {
+ IProject project = (sourceFile == null ? null : sourceFile.getProject());
+ return new SeamSearchVisitor(requestor, vars, sourceFile).search(scope, monitor);
+ }
+
+ @Override
+ public IStatus search(String searchText, SeamSearchScope scope,
+ int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
+
+ SeamJavaSearchJob job = new SeamJavaSearchJob(searchText, scope, searchFor, limitTo, matchMode, isCaseSensitive, requestor);
+ setCanceled(false);
+ job.setUser(true);
+ job.schedule();
+ return Status.OK_STATUS;
+ }
+
+
+ @Override
+ public IStatus search(SeamSearchScope scope,
+ SeamSearchRequestor requestor, IFile sourceFile,
+ ISeamContextVariable[] variables, IProgressMonitor monitor) {
+ IProject project = (sourceFile == null ? null : sourceFile.getProject());
+ return new SeamSearchVisitor(requestor, variables, project).search(scope, monitor);
+ }
};
}
-
+
/**
- * Uses a given search pattern to find matches in the content of workspace file resources. If a file is open in an editor, the
+ * Uses a given tokens to find matches in the content of
+ * workspace file resources. If a file is open in an editor, the
* editor buffer is searched.
-
- * @param requestor the search requestor that gets the search results
- * @param scope the scope defining the resources to search in
- * @param searchPattern The search pattern used to find matches in the file contents.
- * @param monitor the progress monitor to use
+ *
+ * @param scope
+ * @param requestor
+ * @param sourceFile
+ * @param tokens
+ * @param monitor
* @return the status containing information about problems in resources searched.
*/
- public abstract IStatus search(TextSearchScope scope, SeamSearchRequestor requestor, Pattern[] searchPatterns, IProgressMonitor monitor);
+ public abstract IStatus search(SeamSearchScope scope, SeamSearchRequestor requestor,
+ IFile sourceFile, List<ELOperandToken> tokens, IProgressMonitor monitor);
/**
- * Uses a given search pattern to find matches in the content of workspace file resources. If a file is open in an editor, the
+ * Uses a given IJavaElement-s to find matches in the content of
+ * workspace file resources. If a file is open in an editor, the
* editor buffer is searched.
+ *
+ * @param scope
+ * @param requestor
+ * @param sourceFile
+ * @param elements
+ * @param monitor
+ * @return
+ */
+ public abstract IStatus search(SeamSearchScope scope, SeamSearchRequestor requestor,
+ IFile sourceFile, IJavaElement[] elements, IProgressMonitor monitor);
- * @param requestor the search requestor that gets the search results
- * @param scope the files to search in
- * @param searchPattern The search pattern used to find matches in the file contents.
- * @param monitor the progress monitor to use
- * @return the status containing information about problems in resources searched.
+ /**
+ * Uses a given {@link ISeamContextVariable} objects to find matches in the content of
+ * workspace file resources. If a file is open in an editor, the
+ * editor buffer is searched.
+ *
+ * @param scope
+ * @param requestor
+ * @param sourceFile
+ * @param variables
+ * @param monitor
+ * @return
*/
-// public abstract IStatus search(IFile[] scope, SeamSearchRequestor requestor, Pattern[] searchPatterns, IProgressMonitor monitor);
+ public abstract IStatus search(SeamSearchScope scope, SeamSearchRequestor requestor,
+ IFile sourceFile, ISeamContextVariable[] variables, IProgressMonitor monitor);
+
+ /**
+ * Uses a given {@link Var} objects to find matches in the content of
+ * workspace file resources. If a file is open in an editor, the
+ * editor buffer is searched.
+ *
+ * @param scope
+ * @param requestor
+ * @param sourceFile
+ * @param vars
+ * @param monitor
+ * @return
+ */
+ public abstract IStatus search(SeamSearchScope scope, SeamSearchRequestor requestor,
+ IFile sourceFile, Var[] vars, IProgressMonitor monitor);
+
+ /**
+ * Perform a java search w/ the given parameters. Runs in a background Job
+ * (results may still come in after this method call)
+ *
+ * @param searchText
+ * the string of text to search on
+ * @param searchFor
+ * IJavaSearchConstants.TYPE, METHOD, FIELD, PACKAGE, etc...
+ * @param limitTo
+ * IJavaSearchConstants.DECLARATIONS,
+ * IJavaSearchConstants.REFERENCES,
+ * IJavaSearchConstants.IMPLEMENTORS, or
+ * IJavaSearchConstants.ALL_OCCURRENCES
+ * @param matchMode
+ * allow * wildcards or not
+ * @param isCaseSensitive
+ * @param requestor
+ * passed in to accept search matches (and do "something" with
+ * them)
+ */
+ public abstract IStatus search(String searchText, SeamSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor);
+
+ /**
+ * Seam Indexing and Search jobs check this
+ *
+ * @return
+ */
+ public synchronized final void setCanceled(boolean cancel) {
+ fMonitor.setCanceled(cancel);
+ }
+
+ /**
+ * Seam Indexing and Search jobs check this
+ *
+ * @return
+ */
+ public synchronized final boolean isCanceled() {
+ return fMonitor.isCanceled();
+ }
+
+ // This is called from SeamPathIndexer
+ public final IPath computeIndexLocation(IPath containerPath) {
+
+ IPath indexLocation = null;
+ String pathString = containerPath.toOSString();
+ this.fChecksumCalculator.reset();
+ this.fChecksumCalculator.update(pathString.getBytes());
+ String fileName = Long.toString(this.fChecksumCalculator.getValue()) + ".index"; //$NON-NLS-1$
+ indexLocation = getSeamUIPluginWorkingLocation().append(fileName);
+ JavaModelManager.getJavaModelManager().getIndexManager().indexLocations.put(containerPath, indexLocation);
+ return indexLocation;
+ }
+
+ // copied from JDT IndexManager
+ public IPath getSeamUIPluginWorkingLocation() {
+
+ if (this.fSeamUIPluginLocation != null)
+ return this.fSeamUIPluginLocation;
+
+ // Append the folder name "seamsearch" to keep the state location area cleaner
+ IPath stateLocation = SeamGuiPlugin.getDefault().getStateLocation().append("seamsearch");
+
+ String device = stateLocation.getDevice();
+ if (device != null && device.charAt(0) == '/')
+ stateLocation = stateLocation.setDevice(device.substring(1));
+
+ // ensure that it exists on disk
+ File folder = new File(stateLocation.toOSString());
+ if (!folder.isDirectory()) {
+ try {
+ folder.mkdir();
+ }
+ catch (SecurityException e) {
+ }
+ }
+
+ return this.fSeamUIPluginLocation = stateLocation;
+ }
+
+ /**
+ * This operation ensures that the live resource's search markers show up in
+ * the open editor. It also allows the ability to pass in a ProgressMonitor
+ */
+ private class SeamJavaSearchJob extends Job implements IJavaSearchConstants {
+
+ String fSearchText = ""; //$NON-NLS-1$
+
+ IJavaSearchScope fScope = null;
+
+ int fSearchFor = FIELD;
+
+ int fLimitTo = ALL_OCCURRENCES;
+
+ int fMatchMode = SearchPattern.R_PATTERN_MATCH;
+
+ boolean fIsCaseSensitive = false;
+
+ SearchRequestor fRequestor = null;
+
+ IJavaElement fElement = null;
+
+ // constructor w/ java element
+ public SeamJavaSearchJob(IJavaElement element, IJavaSearchScope scope, SearchRequestor requestor) {
+ super(SeamUIMessages.SeamSearch + element.getElementName());
+ this.fElement = element;
+ this.fScope = scope;
+ this.fRequestor = requestor;
+ }
+
+ // constructor w/ search text
+ public SeamJavaSearchJob(String searchText, IJavaSearchScope scope, int searchFor, int limitTo, int matchMode, boolean isCaseSensitive, SearchRequestor requestor) {
+ super(SeamUIMessages.SeamSearch + searchText);
+ this.fSearchText = searchText;
+ this.fScope = scope;
+ this.fSearchFor = searchFor;
+ this.fLimitTo = limitTo;
+ this.fMatchMode = matchMode;
+ this.fIsCaseSensitive = isCaseSensitive;
+ this.fRequestor = requestor;
+ }
+
+ public IStatus run(IProgressMonitor jobMonitor) {
+
+ if (jobMonitor != null && jobMonitor.isCanceled())
+ return Status.CANCEL_STATUS;
+ if (SeamSearchEngine.getInstance().isCanceled())
+ return Status.CANCEL_STATUS;
+
+ SearchPattern javaSearchPattern = null;
+ // if an element is available, use that to create search pattern
+ // (eg. LocalVariable)
+ // otherwise use the text and other paramters
+ boolean searchForDeclarations = isSearchForDeclarations(this.fLimitTo);
+ boolean searchForReferences = isSearchForDeclarations(this.fLimitTo);
+
+ if (this.fElement != null) {
+ javaSearchPattern = SearchPattern.createPattern(this.fElement, this.fLimitTo);
+ } else {
+ javaSearchPattern = SearchPattern.createPattern(this.fSearchText, this.fSearchFor, this.fLimitTo, this.fMatchMode);
+ }
+
+ // if is searching for the declarations:
+ // if (fElement != null):
+ // - No components can be found for the element (the declaration for the element itself will be found by java search)
+ // - No properties/methods can be found for the Variable/Method (the declaration for the element itself will be found by java search)
+ // if (fSearchText != null):
+ // try to find the Seam Variable or the Seam variable's Method/Property and search for its declaration.
+
+ if (isSearchForDeclarations(this.fLimitTo)) {
+ if (this.fElement != null) {
+ javaSearchPattern = SearchPattern.createPattern(this.fElement, this.fLimitTo);
+ } else {
+ javaSearchPattern = SearchPattern.createPattern(this.fSearchText, this.fSearchFor, this.fLimitTo, this.fMatchMode);
+ }
+ }
+ // if is searching for the references:
+ // if (fElement != null):
+ // ? Search for references to the components which are declared by this element's class
+ // - Search for properties/methods can be found for the Variable/Method
+ // if (fSearchText != null):
+ // try to find the Seam Variable or the Seam variable's Method/Property and search for its declaration.
+ if (isSearchForReferences(this.fLimitTo)) {
+ if (this.fElement != null) {
+ javaSearchPattern = SearchPattern.createPattern(this.fElement, this.fLimitTo);
+
+ } else {
+ javaSearchPattern = SearchPattern.createPattern(this.fSearchText, this.fSearchFor, this.fLimitTo, this.fMatchMode);
+ }
+ }
+
+ if (javaSearchPattern != null) {
+
+ }
+ return Status.OK_STATUS;
+ }
+
+ }
+
+ /**
+ * Checks if the given limitTo flag is limited to declarations
+ *
+ * @param limitTo
+ * @return
+ */
+ public static boolean isSearchForDeclarations(int limitTo) {
+ int maskedLimitTo = limitTo & ~(IJavaSearchConstants.IGNORE_DECLARING_TYPE+IJavaSearchConstants.IGNORE_RETURN_TYPE);
+ if (maskedLimitTo == IJavaSearchConstants.DECLARATIONS || maskedLimitTo == IJavaSearchConstants.ALL_OCCURRENCES) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks if the given limitTo flag is limited to references
+ *
+ * @param limitTo
+ * @return
+ */
+ public static boolean isSearchForReferences(int limitTo) {
+ int maskedLimitTo = limitTo & ~(IJavaSearchConstants.IGNORE_DECLARING_TYPE+IJavaSearchConstants.IGNORE_RETURN_TYPE);
+ if (maskedLimitTo == IJavaSearchConstants.REFERENCES || maskedLimitTo == IJavaSearchConstants.ALL_OCCURRENCES) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks if the given element is IField
+ *
+ * @param element
+ * @return
+ */
+ public static boolean isField(IJavaElement element) {
+ if (element == null)
+ return false;
+
+ return (element.getElementType() == IJavaElement.FIELD);
+ }
+
+ /**
+ * Checks if the given element is IMethod
+ *
+ * @param element
+ * @return
+ */
+ public static boolean isMethod(IJavaElement element) {
+ if (element == null)
+ return false;
+
+ return (element.getElementType() == IJavaElement.METHOD);
+ }
+
+ /**
+ * Checks if the given element is IType
+ *
+ * @param element
+ * @return
+ */
+ public static boolean isType(IJavaElement element) {
+ if (element == null)
+ return false;
+
+ return (element.getElementType() == IJavaElement.TYPE);
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchQuery.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchQuery.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchQuery.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,64 +1,69 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.ui.search.ElementQuerySpecification;
-import org.eclipse.jdt.ui.search.IMatchPresentation;
-import org.eclipse.jdt.ui.search.IQueryParticipant;
import org.eclipse.jdt.ui.search.ISearchRequestor;
-import org.eclipse.jdt.ui.search.QuerySpecification;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.search.core.text.TextSearchEngine;
import org.eclipse.search.core.text.TextSearchMatchAccess;
-import org.eclipse.search.core.text.TextSearchRequestor;
-import org.eclipse.search.core.text.TextSearchScope;
import org.eclipse.search.internal.core.text.PatternConstructor;
-import org.eclipse.search.internal.core.text.TextSearchVisitor;
import org.eclipse.search.internal.ui.Messages;
-//import org.eclipse.search.internal.ui.SearchMessages;
import org.eclipse.search.internal.ui.text.FileMatch;
-import org.eclipse.search.internal.ui.text.FileSearchResult;
import org.eclipse.search.internal.ui.text.SearchResultUpdater;
import org.eclipse.search.ui.ISearchQuery;
import org.eclipse.search.ui.ISearchResult;
import org.eclipse.search.ui.text.AbstractTextSearchResult;
-import org.eclipse.search.ui.text.FileTextSearchScope;
-import org.eclipse.search.ui.text.IFileMatchAdapter;
import org.eclipse.search.ui.text.Match;
-import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamDeclaration;
-import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.el.ELOperandToken;
+import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
import org.jboss.tools.seam.internal.core.el.ElVarSearcher.Var;
import org.jboss.tools.seam.ui.SeamUIMessages;
+/**
+ * Seam search query implementation
+ *
+ * @author Jeremy
+ */
public class SeamSearchQuery implements ISearchQuery {
-
- private final static class SeamSearchResultCollector extends SeamSearchRequestor {
+
+ /**
+ * Result collector is used be a holder for search results
+ *
+ * @author Jeremy
+ */
+ public final static class SeamSearchResultCollector extends SeamSearchRequestor {
private final AbstractTextSearchResult fResult;
-// private final boolean fSearchInBinaries;
- private ArrayList fCachedMatches;
+ private ArrayList<Match> fCachedMatches;
+ private final ISearchRequestor fParentRequestor;
- private SeamSearchResultCollector(AbstractTextSearchResult result) {
+ public SeamSearchResultCollector(AbstractTextSearchResult result, ISearchRequestor parentRequestor) {
fResult= result;
-// fSearchInBinaries= searchInBinaries;
-
+ fParentRequestor = parentRequestor;
}
public boolean acceptFile(IFile file) throws CoreException {
-// if (fIsFileSearchOnly) {
-// fResult.addMatch(new FileMatch(file, 0, 0));
-// }
flushMatches();
return true;
}
@@ -96,66 +101,162 @@
private void flushMatches() {
if (!fCachedMatches.isEmpty()) {
- fResult.addMatches((Match[]) fCachedMatches.toArray(new Match[fCachedMatches.size()]));
+ if (fResult != null) fResult.addMatches((Match[]) fCachedMatches.toArray(new Match[fCachedMatches.size()]));
+ if (fParentRequestor != null) {
+ for (Match match : fCachedMatches) {
+ fParentRequestor.reportMatch(match);
+ }
+ }
fCachedMatches.clear();
}
}
+
+ public void reportMatch(Match match) {
+ fCachedMatches.add(match);
+ }
+
}
+ private List<ELOperandToken> fTokens;
+ private IJavaElement[] fJavaElements;
private final SeamSearchScope fScope;
private final String[] fVariables;
private final Var fVar;
private SeamSearchResult fResult;
+ private IFile fSourceFile;
+ private ISearchRequestor fParentRequestor;
- public SeamSearchQuery(String[] variables, SeamSearchScope scope) {
- fVariables = variables;
+ /**
+ * Constructs Seam search query for a given {@link ELOperandToken} objects list
+ *
+ * @param tokens
+ * @param sourceFile
+ * @param scope
+ */
+ public SeamSearchQuery(List<ELOperandToken> tokens, IFile sourceFile, SeamSearchScope scope) {
+ fTokens = tokens;
+ fJavaElements = null;
+ fSourceFile = sourceFile;
+ fVariables = null;
fVar = null;
fScope= scope;
}
+
+ /**
+ * Constructs Seam search query for a given {@link IJavaElement} objects array
+ *
+ * @param javaElements
+ * @param sourceFile
+ * @param scope
+ */
+ public SeamSearchQuery(IJavaElement[] javaElements, IFile sourceFile, SeamSearchScope scope) {
+ fTokens = null;
+ fJavaElements = javaElements;
+ fSourceFile = sourceFile;
+ fVariables = null;
+ fVar = null;
+ fScope= scope;
+ }
- public SeamSearchQuery(Var var, SeamSearchScope scope) {
+ /**
+ * Constructs Seam search query for a given {@link Var} objects array
+ *
+ * @param var
+ * @param sourceFile
+ * @param scope
+ */
+ public SeamSearchQuery(Var var, IFile sourceFile, SeamSearchScope scope) {
+ fTokens = null;
+ fJavaElements = null;
+ fSourceFile = sourceFile;
fVariables = null;
fVar = var;
fScope= scope;
}
+
+ /**
+ * Sets up a parent ISearchRequestor
+ *
+ * @param requestor
+ */
+ public void setParentRequestor(ISearchRequestor requestor) {
+ this.fParentRequestor = requestor;
+ }
+
+ /**
+ * Returns parent requestor
+ *
+ * @return
+ */
+ public ISearchRequestor getParentRequestor() {
+ return this.fParentRequestor;
+ }
+ /**
+ * Returns Seam Search Scope
+ *
+ * @return
+ */
public SeamSearchScope getSearchScope() {
return fScope;
}
+ /**
+ * @Override
+ */
public boolean canRunInBackground() {
- return true;
+ return false;
}
+ /**
+ * @Override
+ */
public IStatus run(final IProgressMonitor monitor) {
AbstractTextSearchResult textResult= (AbstractTextSearchResult) getSearchResult();
textResult.removeAll();
- if (fVariables != null) {
- Pattern[] searchPatterns = new Pattern[fVariables == null ? 0 : fVariables.length];
- for (int i = 0; i < searchPatterns.length; i++) {
- searchPatterns[i]= getSearchPattern(fVariables[i]);
- }
- SeamSearchResultCollector collector= new SeamSearchResultCollector(textResult);
- return SeamSearchEngine.create().search(fScope, collector, searchPatterns, monitor);
- } else if (fVar != null) {
- if (fScope.isLimitToDeclarations()) {
- textResult.addMatch(new SeamElementMatch((IFile)fScope.getRoots()[0], fVar.getDeclarationOffset(), fVar.getDeclarationLength()));
- } else {
- Pattern[] searchPatterns = new Pattern[fVar == null ? 0 : 1];
- if (searchPatterns.length > 0) {
- searchPatterns[0]= getSearchPattern(fVar.getName());
- }
- SeamSearchResultCollector collector= new SeamSearchResultCollector(textResult);
- return SeamSearchEngine.create().search(fScope, collector, searchPatterns, monitor);
-
- }
- return Status.OK_STATUS;
+ if (fJavaElements != null) {
+ return queryByJavaElements(textResult, monitor);
}
+
+ if (fTokens != null) {
+ return queryByTokens(textResult, monitor);
+ }
return Status.OK_STATUS;
}
+ private IStatus queryByTokens(AbstractTextSearchResult textResult,
+ final IProgressMonitor monitor) {
+ SeamELCompletionEngine engine = new SeamELCompletionEngine();
+
+ IProject project = (fSourceFile == null ? null : fSourceFile.getProject());
+
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject == null)
+ return Status.OK_STATUS;
+
+// List<IJavaElement> elements = engine.getJavaElementsForELOperandTokens(seamProject, fSourceFile, fTokens)
+ SeamSearchResultCollector collector= new SeamSearchResultCollector(textResult, getParentRequestor());
+ return SeamSearchEngine.getInstance().search(fScope, collector, fSourceFile, fTokens, monitor);
+ }
+
+ private IStatus queryByJavaElements(
+ AbstractTextSearchResult textResult,
+ final IProgressMonitor monitor) {
+ SeamELCompletionEngine engine = new SeamELCompletionEngine();
+
+ IProject project = (fSourceFile == null ? null : fSourceFile.getProject());
+
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject == null)
+ return Status.OK_STATUS;
+
+// List<IJavaElement> elements = engine.getJavaElementsForELOperandTokens(seamProject, fSourceFile, fTokens)
+ SeamSearchResultCollector collector= new SeamSearchResultCollector(textResult, getParentRequestor());
+ return SeamSearchEngine.getInstance().search(fScope, collector, fSourceFile, fJavaElements, monitor);
+ }
+
private boolean isScopeAllFileTypes() {
String[] fileNamePatterns= fScope.getFileNamePatterns();
if (fileNamePatterns == null)
@@ -169,11 +270,18 @@
}
+ /**
+ * @see org.eclipse.search.ui.ISearchQuery#getLabel()
+ */
public String getLabel() {
Object[] args= { fScope.getLimitToDescription() };
return Messages.format(SeamUIMessages.SeamSearchQuery_label, args);
}
-
+
+ /**
+ * Returns Search String
+ * @return
+ */
public String getSearchString() {
String searchString = "";
if (fVariables != null) {
@@ -190,11 +298,17 @@
}
return searchString;
}
-
+
+ /**
+ * Returns Search Result Label
+ *
+ * @param nMatches
+ * @return
+ */
public String getResultLabel(int nMatches) {
String searchString= getSearchString();
if (searchString.length() > 0) {
- if (fScope.isLimitToDeclarations()) {
+ if (SeamSearchEngine.isSearchForDeclarations(fScope.getLimitTo())) {
// search is limited to declarations only
if (nMatches == 1) {
Object[] args= { searchString, fScope.getDescription(), fScope.getLimitToDescription() };
@@ -203,7 +317,7 @@
Object[] args= { searchString, new Integer(nMatches), fScope.getDescription(), fScope.getLimitToDescription() };
return Messages.format(SeamUIMessages.SeamSearchQuery_pluralPatternWithLimitTo, args);
}
- if (fScope.isLimitToReferences()) {
+ if (SeamSearchEngine.isSearchForReferences(fScope.getLimitTo())) {
// text search
if (isScopeAllFileTypes()) {
// search all file extensions
@@ -215,49 +329,30 @@
return Messages.format(SeamUIMessages.SeamSearchQuery_pluralPattern, args);
}
}
-/*
- *
- // text search
- if (isScopeAllFileTypes()) {
- // search all file extensions
- if (nMatches == 1) {
- Object[] args= { searchString, fScope.getDescription() };
- return Messages.format(SearchMessages.FileSearchQuery_singularLabel, args);
- }
- Object[] args= { searchString, new Integer(nMatches), fScope.getDescription() };
- return Messages.format(SearchMessages.FileSearchQuery_pluralPattern, args);
- }
- // search selected file extensions
- if (nMatches == 1) {
- Object[] args= { searchString, fScope.getDescription(), fScope.getFilterDescription() };
- return Messages.format(SearchMessages.FileSearchQuery_singularPatternWithFileExt, args);
- }
- Object[] args= { searchString, new Integer(nMatches), fScope.getDescription(), fScope.getFilterDescription() };
- return Messages.format(SearchMessages.FileSearchQuery_pluralPatternWithFileExt, args);
-*/
}
-/*
- *
- // file search
- if (nMatches == 1) {
- Object[] args= { fScope.getFilterDescription(), fScope.getDescription() };
- return Messages.format(SearchMessages.FileSearchQuery_singularLabel_fileNameSearch, args);
- }
- Object[] args= { fScope.getFilterDescription(), new Integer(nMatches), fScope.getDescription() };
- return Messages.format(SearchMessages.FileSearchQuery_pluralPattern_fileNameSearch, args);
-*/
+
return "";
}
-
- protected Pattern getSearchPattern(String variableName) {
+ /*
+ * returns a search pattern for a given name
+ */
+ public static Pattern getSearchPattern(String variableName) {
return PatternConstructor.createPattern(variableName, true, false);
}
-
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchQuery#canRerun()
+ */
public boolean canRerun() {
return true;
}
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchQuery#getSearchResult()
+ */
public ISearchResult getSearchResult() {
if (fResult == null) {
fResult= new SeamSearchResult(this);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchRequestor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchRequestor.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchRequestor.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,12 +1,29 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.ui.search.ISearchRequestor;
import org.eclipse.search.core.text.TextSearchRequestor;
+import org.eclipse.search.ui.text.Match;
import org.jboss.tools.seam.core.ISeamDeclaration;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
-public class SeamSearchRequestor extends TextSearchRequestor {
-
+/**
+ * Seam Search Requestor
+ *
+ * @author Jeremy
+ */
+public class SeamSearchRequestor extends TextSearchRequestor implements ISearchRequestor {
/**
* Notification sent before search starts in the given Seam Java Source Reference. This method is called for all Seam Java Source References are contained
* in the search scope.
@@ -39,4 +56,11 @@
return true;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jdt.ui.search.ISearchRequestor#reportMatch(org.eclipse.search.ui.text.Match)
+ */
+ public void reportMatch(Match match) {
+ }
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResult.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResult.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResult.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,7 +1,16 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
-import java.util.Map;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.search.internal.ui.SearchPluginImages;
@@ -14,34 +23,73 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IFileEditorInput;
+/**
+ * Seam Search result
+ *
+ *
+ * @author Jeremy
+ *
+ */
public class SeamSearchResult extends AbstractTextSearchResult implements IEditorMatchAdapter, IFileMatchAdapter {
private final Match[] EMPTY_ARR= new Match[0];
-
private SeamSearchQuery fQuery;
+
+ /**
+ * Constructs SeamSearchResult using a given search Job
+ *
+ * @param job
+ */
public SeamSearchResult(SeamSearchQuery job) {
fQuery= job;
}
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchResult#getImageDescriptor()
+ */
public ImageDescriptor getImageDescriptor() {
return SearchPluginImages.DESC_OBJ_TSEARCH_DPDN;
}
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchResult#getLabel()
+ */
public String getLabel() {
return fQuery.getResultLabel(getMatchCount());
}
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchResult#getTooltip()
+ */
public String getTooltip() {
return getLabel();
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.IFileMatchAdapter#computeContainedMatches(org.eclipse.search.ui.text.AbstractTextSearchResult, org.eclipse.core.resources.IFile)
+ */
public Match[] computeContainedMatches(AbstractTextSearchResult result, IFile file) {
return getMatches(file);
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.IFileMatchAdapter#getFile(java.lang.Object)
+ */
public IFile getFile(Object element) {
if (element instanceof IFile)
return (IFile)element;
return null;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.IEditorMatchAdapter#isShownInEditor(org.eclipse.search.ui.text.Match, org.eclipse.ui.IEditorPart)
+ */
public boolean isShownInEditor(Match match, IEditorPart editor) {
IEditorInput ei= editor.getEditorInput();
if (ei instanceof IFileEditorInput) {
@@ -51,6 +99,10 @@
return false;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.IEditorMatchAdapter#computeContainedMatches(org.eclipse.search.ui.text.AbstractTextSearchResult, org.eclipse.ui.IEditorPart)
+ */
public Match[] computeContainedMatches(AbstractTextSearchResult result, IEditorPart editor) {
IEditorInput ei= editor.getEditorInput();
if (ei instanceof IFileEditorInput) {
@@ -60,14 +112,26 @@
return EMPTY_ARR;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.ISearchResult#getQuery()
+ */
public ISearchQuery getQuery() {
return fQuery;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getFileMatchAdapter()
+ */
public IFileMatchAdapter getFileMatchAdapter() {
return this;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchResult#getEditorMatchAdapter()
+ */
public IEditorMatchAdapter getEditorMatchAdapter() {
return this;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
import java.util.HashMap;
@@ -5,10 +16,8 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.ui.JavaUI;
@@ -17,7 +26,6 @@
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TreeViewer;
@@ -27,20 +35,11 @@
import org.eclipse.search.internal.ui.SearchMessages;
import org.eclipse.search.internal.ui.text.EditorOpener;
import org.eclipse.search.internal.ui.text.FileLabelProvider;
-import org.eclipse.search.internal.ui.text.FileSearchPage;
import org.eclipse.search.internal.ui.text.FileSearchQuery;
-import org.eclipse.search.internal.ui.text.FileTableContentProvider;
-import org.eclipse.search.internal.ui.text.FileTreeContentProvider;
import org.eclipse.search.internal.ui.text.IFileSearchContentProvider;
import org.eclipse.search.internal.ui.text.NewTextSearchActionGroup;
-//import org.eclipse.search.internal.ui.text.ReplaceAction2;
import org.eclipse.search.internal.ui.text.ResourceTransferDragAdapter;
-import org.eclipse.search.internal.ui.text.SortAction;
-import org.eclipse.search.internal.ui.text.TextSearchPage;
-import org.eclipse.search.internal.ui.text.FileSearchPage.DecoratorIgnoringViewerSorter;
import org.eclipse.search.ui.IContextMenuConstants;
-import org.eclipse.search.ui.ISearchResult;
-import org.eclipse.search.ui.ISearchResultPage;
import org.eclipse.search.ui.ISearchResultViewPart;
import org.eclipse.search.ui.NewSearchUI;
import org.eclipse.search.ui.text.AbstractTextSearchResult;
@@ -49,8 +48,6 @@
import org.eclipse.search2.internal.ui.OpenSearchPreferencesAction;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.Transfer;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IPageLayout;
@@ -59,7 +56,6 @@
import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.actions.ActionGroup;
import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.part.IPageSite;
import org.eclipse.ui.part.IShowInTargetList;
import org.eclipse.ui.part.ResourceTransfer;
@@ -67,9 +63,15 @@
import org.jboss.tools.seam.core.IOpenableElement;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
+/**
+ * Seam Search Result page
+ *
+ * @author Jeremy
+ *
+ */
public class SeamSearchResultPage extends AbstractTextSearchViewPage implements IAdaptable {
- public static class DecoratorIgnoringViewerSorter extends ViewerComparator {
+ static class DecoratorIgnoringViewerSorter extends ViewerComparator {
private final ILabelProvider fLabelProvider;
public DecoratorIgnoringViewerSorter(ILabelProvider labelProvider) {
@@ -106,15 +108,11 @@
private static final String KEY_SORTING= "org.eclipse.search.resultpage.sorting"; //$NON-NLS-1$
private static final String KEY_LIMIT= "org.eclipse.search.resultpage.limit"; //$NON-NLS-1$
-
private static final int DEFAULT_ELEMENT_LIMIT = 1000;
private ActionGroup fActionGroup;
private IFileSearchContentProvider fContentProvider;
private int fCurrentSortOrder;
-// private SortAction fSortByNameAction;
-// private SortAction fSortByPathAction;
-
private EditorOpener fEditorOpener= new EditorOpener();
@@ -125,22 +123,31 @@
}
};
+ /**
+ * Constructs SeamSearchResultPage object
+ */
public SeamSearchResultPage() {
-// fSortByNameAction= new SortAction(SearchMessages.FileSearchPage_sort_name_label, this, FileLabelProvider.SHOW_LABEL_PATH);
-// fSortByPathAction= new SortAction(SearchMessages.FileSearchPage_sort_path_label, this, FileLabelProvider.SHOW_PATH_LABEL);
-
setElementLimit(new Integer(DEFAULT_ELEMENT_LIMIT));
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#setElementLimit(java.lang.Integer)
+ */
public void setElementLimit(Integer elementLimit) {
super.setElementLimit(elementLimit);
int limit= elementLimit.intValue();
getSettings().put(KEY_LIMIT, limit);
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#getViewer()
+ */
public StructuredViewer getViewer() {
return super.getViewer();
}
+
private void addDragAdapters(StructuredViewer viewer) {
Transfer[] transfers= new Transfer[] { ResourceTransfer.getInstance() };
@@ -148,6 +155,10 @@
viewer.addDragSupport(ops, transfers, new ResourceTransferDragAdapter(viewer));
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTableViewer(org.eclipse.jface.viewers.TableViewer)
+ */
protected void configureTableViewer(TableViewer viewer) {
viewer.setUseHashlookup(true);
SeamSearchViewLabelProvider innerLabelProvider= new SeamSearchViewLabelProvider(this, FileLabelProvider.SHOW_LABEL_PATH);
@@ -158,6 +169,10 @@
addDragAdapters(viewer);
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#configureTreeViewer(org.eclipse.jface.viewers.TreeViewer)
+ */
protected void configureTreeViewer(TreeViewer viewer) {
viewer.setUseHashlookup(true);
SeamSearchViewLabelProvider innerLabelProvider= new SeamSearchViewLabelProvider(this, FileLabelProvider.SHOW_LABEL_PATH);
@@ -168,6 +183,10 @@
addDragAdapters(viewer);
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#showMatch(org.eclipse.search.ui.text.Match, int, int, boolean)
+ */
protected void showMatch(Match match, int offset, int length, boolean activate) throws PartInitException {
if (match.getElement() instanceof ISeamJavaSourceReference) {
IJavaElement javaElement = ((ISeamJavaSourceReference)match.getElement()).getSourceMember();
@@ -176,8 +195,6 @@
if (part != null) {
JavaUI.revealInEditor(part, (IJavaElement)javaElement);
}
- } catch (PartInitException e) {
-// SeamExtPlugin.getPluginLog().logError(e);
} catch (JavaModelException e) {
// Ignore. It is probably because of Java element is not found
}
@@ -196,6 +213,17 @@
showWithMarker(editor, file, offset, length);
}
}
+ } else if (match.getElement() instanceof IJavaElement) {
+ IJavaElement javaElement = (IJavaElement)match.getElement();
+ try {
+ IEditorPart part = JavaUI.openInEditor(javaElement);
+ if (part != null) {
+ JavaUI.revealInEditor(part, (IJavaElement)javaElement);
+ }
+ } catch (JavaModelException e) {
+ // Ignore. It is probably because of Java element is not found
+ }
+
}
}
@@ -220,62 +248,75 @@
}
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#fillContextMenu(org.eclipse.jface.action.IMenuManager)
+ */
protected void fillContextMenu(IMenuManager mgr) {
super.fillContextMenu(mgr);
addSortActions(mgr);
fActionGroup.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
fActionGroup.fillContextMenu(mgr);
- FileSearchQuery query= (FileSearchQuery) getInput().getQuery();
- if (!"".equals(query.getSearchString())) { //$NON-NLS-1$
-// ReplaceAction2 replaceAction= new ReplaceAction2(this, (IStructuredSelection) getViewer().getSelection());
-// if (replaceAction.isEnabled())
-// mgr.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, replaceAction);
-
-// ReplaceAction2 replaceAll= new ReplaceAction2(this);
-// if (replaceAll.isEnabled())
-// mgr.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, replaceAll);
- }
}
private void addSortActions(IMenuManager mgr) {
if (getLayout() != FLAG_LAYOUT_FLAT)
return;
MenuManager sortMenu= new MenuManager(SearchMessages.FileSearchPage_sort_by_label);
-// sortMenu.add(fSortByNameAction);
-// sortMenu.add(fSortByPathAction);
-
-// fSortByNameAction.setChecked(fCurrentSortOrder == fSortByNameAction.getSortOrder());
-// fSortByPathAction.setChecked(fCurrentSortOrder == fSortByPathAction.getSortOrder());
-
mgr.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, sortMenu);
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#setViewPart(org.eclipse.search.ui.ISearchResultViewPart)
+ */
public void setViewPart(ISearchResultViewPart part) {
super.setViewPart(part);
fActionGroup= new NewTextSearchActionGroup(part);
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#init(org.eclipse.ui.part.IPageSite)
+ */
public void init(IPageSite site) {
super.init(site);
IMenuManager menuManager = site.getActionBars().getMenuManager();
menuManager.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, new OpenSearchPreferencesAction());
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#dispose()
+ */
public void dispose() {
fActionGroup.dispose();
super.dispose();
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#elementsChanged(java.lang.Object[])
+ */
protected void elementsChanged(Object[] objects) {
if (fContentProvider != null)
fContentProvider.elementsChanged(objects);
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#clear()
+ */
protected void clear() {
if (fContentProvider != null)
fContentProvider.clear();
}
+ /**
+ * Sets up a given sort order
+ *
+ * @param sortOrder
+ */
public void setSortOrder(int sortOrder) {
fCurrentSortOrder= sortOrder;
DecoratingLabelProvider lpWrapper= (DecoratingLabelProvider) getViewer().getLabelProvider();
@@ -284,12 +325,16 @@
getSettings().put(KEY_SORTING, fCurrentSortOrder);
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#restoreState(org.eclipse.ui.IMemento)
+ */
public void restoreState(IMemento memento) {
super.restoreState(memento);
try {
fCurrentSortOrder= getSettings().getInt(KEY_SORTING);
} catch (NumberFormatException e) {
-// fCurrentSortOrder= fSortByNameAction.getSortOrder();
+ // Ignore
}
int elementLimit= DEFAULT_ELEMENT_LIMIT;
try {
@@ -307,12 +352,21 @@
}
setElementLimit(new Integer(elementLimit));
}
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#saveState(org.eclipse.ui.IMemento)
+ */
public void saveState(IMemento memento) {
super.saveState(memento);
memento.putInteger(KEY_SORTING, fCurrentSortOrder);
memento.putInteger(KEY_LIMIT, getElementLimit().intValue());
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
public Object getAdapter(Class adapter) {
if (IShowInTargetList.class.equals(adapter)) {
return SHOW_IN_TARGET_LIST;
@@ -320,6 +374,10 @@
return null;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.ui.text.AbstractTextSearchViewPage#getLabel()
+ */
public String getLabel() {
String label= super.getLabel();
StructuredViewer viewer= getViewer();
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchScope.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchScope.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchScope.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,36 +1,47 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
-import java.io.File;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+import java.util.HashMap;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceProxy;
+import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.content.IContentType;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.search.core.text.TextSearchScope;
-import org.eclipse.search.internal.core.text.FilesOfScopeCalculator;
-import org.eclipse.search.internal.core.text.PatternConstructor;
import org.eclipse.search.internal.ui.Messages;
-import org.eclipse.search.internal.ui.SearchMessages;
-import org.eclipse.search.internal.ui.WorkingSetComparator;
-import org.eclipse.search.internal.ui.util.FileTypeEditor;
import org.eclipse.search.ui.text.FileTextSearchScope;
-import org.eclipse.ui.IWorkingSet;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
-public class SeamSearchScope extends TextSearchScope {
- public static final int SEARCH_FOR_DECLARATIONS = 0;
- public static final int SEARCH_FOR_REFERENCES = 1;
+/**
+ * Seam Search Scope object
+ *
+ * @author Jeremy
+ *
+ */
+public class SeamSearchScope extends TextSearchScope implements IJavaSearchScope {
+ public static final int SEARCH_FOR_DECLARATIONS = IJavaSearchConstants.DECLARATIONS;
+ public static final int SEARCH_FOR_REFERENCES = IJavaSearchConstants.REFERENCES;
private static final String[] FILE_NAMES = new String[] {
"*"
@@ -39,13 +50,48 @@
int fLimitTo;
String fDescription;
FileTextSearchScope fFileTextSearchScope;
+ IJavaSearchScope fJavaSearchScope;
+
+ /**
+ * Constructs SeamSearchScope object using a given {@link IJavaSearchScope}
+ *
+ * @param javaScope
+ * @param limitTo
+ */
+ public SeamSearchScope(IJavaSearchScope javaScope, int limitTo) {
+ fJavaSearchScope = javaScope;
+
+ ProjectVisitor projectVisitor = new ProjectVisitor(fJavaSearchScope);
+ try {
+ ResourcesPlugin.getWorkspace().getRoot().accept(projectVisitor, 0);
+ }
+ catch (CoreException e) {
+ e.printStackTrace();
+ }
+ IResource[] projects = projectVisitor.getProjects();
+
+ fFileTextSearchScope = FileTextSearchScope.newSearchScope(projects,
+ FILE_NAMES, true);
+ fDescription = getScopeDescription(projects);
+ fLimitTo = limitTo;
+ }
+
+ /**
+ * Constructs SeamSearchScope object using a given {@link IResources} set
+ *
+ * @param javaScope
+ * @param limitTo
+ */
public SeamSearchScope(IResource[] resources, int limitTo) {
fFileTextSearchScope = FileTextSearchScope.newSearchScope(resources,
FILE_NAMES, true);
-
+ fDescription = getScopeDescription(resources);
+ fLimitTo = limitTo;
+ }
+
+ private String getScopeDescription(IResource[] resources) {
String description;
-
if (resources.length == 0) {
description= SeamUIMessages.SeamSearchScope_scope_empty;
} else if (resources.length == 1) {
@@ -58,22 +104,16 @@
String label= SeamUIMessages.SeamSearchScope_scope_multiple;
description= Messages.format(label, new String[] { resources[0].getName(), resources[1].getName()});
}
+ return description;
+ }
- fLimitTo = limitTo;
- }
-
+ /**
+ * Returns limitTo flag value
+ */
public int getLimitTo() {
return fLimitTo;
}
-
- public boolean isLimitToDeclarations() {
- return (SEARCH_FOR_DECLARATIONS == fLimitTo);
- }
- public boolean isLimitToReferences() {
- return (SEARCH_FOR_REFERENCES == fLimitTo);
- }
-
@Override
public boolean contains(IResourceProxy proxy) {
return fFileTextSearchScope.contains(proxy);
@@ -95,7 +135,7 @@
* @return the description of the scope
*/
public String getDescription() {
- return fFileTextSearchScope.getDescription();
+ return fDescription;
}
/**
@@ -104,7 +144,7 @@
* @return the description of the scope
*/
public String getLimitToDescription() {
- return isLimitToDeclarations() ?
+ return SeamSearchEngine.isSearchForDeclarations(getLimitTo()) ?
SeamUIMessages.SeamSearchScope_scope_LimitToDeclarations :
SeamUIMessages.SeamSearchScope_scope_LimitToReferences;
}
@@ -153,4 +193,96 @@
return (ISeamProject[]) seamProjects.toArray(new ISeamProject[seamProjects.size()]);
}
+
+
+ // visitor that retieves all the files for JavaScope in workspace
+ class ProjectVisitor implements IResourceProxyVisitor {
+ // hash map forces only one of each file
+ private HashMap fProjects = new HashMap();
+ IJavaSearchScope fScope = null;
+
+ public ProjectVisitor(IJavaSearchScope scope) {
+ this.fScope = scope;
+ }
+
+ public boolean visit(IResourceProxy proxy) throws CoreException {
+
+ if(SeamSearchEngine.getInstance().isCanceled())
+ return false;
+
+ if (proxy.getType() == IResource.PROJECT) {
+
+ IProject project = (IProject)proxy.requestResource();
+ fProjects.put(project.getParent().getFullPath(), project);
+ return true;
+ }
+ if (proxy.getType() == IResource.FILE) {
+ // don't search deeper for files
+ return false;
+ }
+
+ return true;
+ }
+
+ public IProject[] getProjects() {
+ return (IProject[]) fProjects.values().toArray(new IProject[fProjects.size()]);
+ }
+ }
+
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jdt.core.search.IJavaSearchScope#encloses(java.lang.String)
+ */
+ public boolean encloses(String resourcePath) {
+ return (fJavaSearchScope == null ? true : fJavaSearchScope.encloses(resourcePath));
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jdt.core.search.IJavaSearchScope#encloses(org.eclipse.jdt.core.IJavaElement)
+ */
+ public boolean encloses(IJavaElement element) {
+ return (fJavaSearchScope == null ? true : fJavaSearchScope.encloses(element));
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jdt.core.search.IJavaSearchScope#enclosingProjectsAndJars()
+ */
+ public IPath[] enclosingProjectsAndJars() {
+ return (fJavaSearchScope == null ? new IPath[0] : fJavaSearchScope.enclosingProjectsAndJars());
+ }
+
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jdt.core.search.IJavaSearchScope#includesBinaries()
+ */
+ public boolean includesBinaries() {
+ return (fJavaSearchScope == null ? true : fJavaSearchScope.includesBinaries());
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jdt.core.search.IJavaSearchScope#includesClasspaths()
+ */
+ public boolean includesClasspaths() {
+ return (fJavaSearchScope == null ? true : fJavaSearchScope.includesClasspaths());
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jdt.core.search.IJavaSearchScope#setIncludesBinaries(boolean)
+ */
+ public void setIncludesBinaries(boolean includesBinaries) {
+ }
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jdt.core.search.IJavaSearchScope#setIncludesClasspaths(boolean)
+ */
+ public void setIncludesClasspaths(boolean includesClasspaths) {
+ }
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchViewLabelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchViewLabelProvider.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchViewLabelProvider.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
import org.eclipse.core.resources.IFile;
@@ -3,4 +14,6 @@
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.ui.viewsupport.JavaUILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.search.internal.ui.text.FileLabelProvider;
@@ -14,17 +27,31 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.ui.views.SeamLabelProvider;
+/**
+ * Seam search view label provider
+ *
+ * @author Jeremy
+ *
+ */
public class SeamSearchViewLabelProvider extends LabelProvider {
private FileLabelProvider fFileLabelProvider;
private SeamLabelProvider fSeamLabelProvider;
+ private JavaUILabelProvider fJavaLabelProvider;
private AbstractTextSearchViewPage fPage;
private int fOrderFlag;
+ /**
+ * Constructs SeamSearchViewLabelProvider for a given search results page
+ *
+ * @param page
+ * @param orderFlag
+ */
public SeamSearchViewLabelProvider(AbstractTextSearchViewPage page, int orderFlag) {
fPage = page;
fOrderFlag = orderFlag;
fFileLabelProvider = new FileLabelProvider(page, orderFlag);
fSeamLabelProvider = new SeamLabelProvider();
+ fJavaLabelProvider = new JavaUILabelProvider();
}
@Override
@@ -48,6 +75,9 @@
}
if (element instanceof IFile) {
return fFileLabelProvider.getImage(element);
+ }
+ if (element instanceof IJavaElement) {
+ return fJavaLabelProvider.getImage(element);
}
return null;
}
@@ -75,6 +105,10 @@
if (element instanceof IFolder) {
return fFileLabelProvider.getText(element);
}
+ if (element instanceof IJavaElement) {
+ return fJavaLabelProvider.getText(element);
+ }
+
return null;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
import java.io.IOException;
@@ -5,12 +16,9 @@
import java.nio.charset.UnsupportedCharsetException;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.filebuffers.ITextFileBuffer;
@@ -34,13 +42,20 @@
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.internal.core.JavaModel;
-import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.internal.ui.search.JavaSearchQuery;
+import org.eclipse.jdt.internal.ui.search.JavaSearchResult;
+import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
+import org.eclipse.jdt.ui.search.ElementQuerySpecification;
import org.eclipse.jdt.ui.text.IJavaPartitions;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Document;
@@ -51,13 +66,13 @@
import org.eclipse.search.core.text.TextSearchScope;
import org.eclipse.search.internal.core.text.DocumentCharSequence;
import org.eclipse.search.internal.core.text.FileCharSequenceProvider;
-import org.eclipse.search.internal.core.text.FilesOfScopeCalculator;
import org.eclipse.search.internal.core.text.TextSearchVisitor;
import org.eclipse.search.internal.core.text.TextSearchVisitor.ReusableMatchAccess;
import org.eclipse.search.internal.ui.Messages;
import org.eclipse.search.internal.ui.SearchMessages;
import org.eclipse.search.internal.ui.SearchPlugin;
import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.search.ui.text.Match;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
@@ -76,7 +91,7 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.IOpenableElement;
@@ -85,22 +100,13 @@
import org.jboss.tools.seam.core.ISeamContextShortVariable;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamDeclaration;
-import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.ISeamFactory;
-import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamScope;
import org.jboss.tools.seam.core.ISeamTextSourceReference;
-import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.SeamPreferences;
import org.jboss.tools.seam.internal.core.AbstractSeamDeclaration;
-import org.jboss.tools.seam.internal.core.BijectedAttribute;
-import org.jboss.tools.seam.internal.core.Role;
import org.jboss.tools.seam.internal.core.SeamComponent;
-import org.jboss.tools.seam.internal.core.SeamJavaContextVariable;
import org.jboss.tools.seam.internal.core.el.ELOperandToken;
import org.jboss.tools.seam.internal.core.el.ELStringToken;
import org.jboss.tools.seam.internal.core.el.ELToken;
@@ -120,46 +126,275 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+/**
+ * Seam Search Visitor - performs searching on the Seam Projects and their files
+ *
+ * @author Jeremy
+ *
+ */
public class SeamSearchVisitor {
- private final Matcher[] fMatchers;
+ private final SeamVariableMatcher[] fVariableMatchers;
+ private final JavaElementMatcher[] fJavaMatchers;
+ private final VarMatcher[] fVarMatchers;
private final SeamSearchRequestor fCollector;
private final MultiStatus fStatus;
private IProgressMonitor fProgressMonitor;
private int fNumberOfScannedFiles;
private int fNumberOfFilesToScan;
+ private IResource fSearchRoot;
private ISeamProject fCurrentSeamProject;
+
+
private Map fDocumentsInEditors;
private final TextSearchVisitor.ReusableMatchAccess fMatchAccess;
-
+
private IFile fCurrentFile;
private final FileCharSequenceProvider fFileCharSequenceProvider;
private final SeamELCompletionEngine fCompletionEngine;
+
+ interface ISeamMatcher {
+ String getName();
+ boolean match(Object obj);
+ Object getElement();
+ }
+ class VarMatcher implements ISeamMatcher {
+ Var fVar;
+ IFile fFile;
+
+ VarMatcher(Var var, IFile file) {
+ this.fVar = var;
+ this.fFile = file;
+ }
+
+ public IFile getFile() {
+ return fFile;
+ }
+
+ public String getName() {
+ String name = fVar == null ? null : fVar.getName();
+ return name == null ? "<null>" : name;
+ }
+
+ public boolean match(Object compare) {
+ if (fVar == null)
+ return false;
+
+ return fVar.equals(compare);
+ }
+
+ public Var getElement() {
+ return fVar;
+ }
+ }
+
+ class SeamVariableMatcher implements ISeamMatcher {
+ ISeamContextVariable fVariable;
+ IProject fProject;
+
+ SeamVariableMatcher(ISeamContextVariable variable, IProject project) {
+ this.fVariable = variable;
+ this.fProject = project;
+ }
+
+ public String getName() {
+ String name = fVariable == null ? null : fVariable.getName();
+ return name == null ? "<null>" : name;
+ }
+
+ public boolean match(Object compare) {
+ if (fVariable == null)
+ return false;
+
+ if (fVariable.equals(compare))
+ return true;
+
+ return fVariable.equals(compare);
+ }
+
+ public ISeamContextVariable getElement() {
+ return fVariable;
+ }
+ }
+
+ class JavaElementMatcher implements ISeamMatcher {
+ IJavaElement fElement;
+ IProject fProject;
+ JavaElementMatcher(IJavaElement javaElement, IProject project) {
+ this.fElement = javaElement;
+ this.fProject = project;
+ }
+
+ public String getName () {
+ return fElement.getElementName();
+ }
+
+ public IJavaElement getElement() {
+ return fElement;
+ }
+
+ public boolean match(Object object) {
+ if (!(object instanceof IJavaElement))
+ return false;
+
+ IJavaElement compare = (IJavaElement)object;
+
+ if (fElement.equals(compare))
+ return true;
+
+ if (fElement.getElementType() != compare.getElementType())
+ return false;
+
+ switch(fElement.getElementType()) {
+ case IJavaElement.FIELD:
+ return matchField((IField)compare);
+ case IJavaElement.METHOD:
+ return matchMethod((IMethod)compare);
+ case IJavaElement.TYPE:
+ return matchType((IType)compare);
+ default:
+ System.out.println("match: UnsupportedType:\n" +
+ fElement.getElementName() + " ==>> " + fElement.getElementType());
+ }
+ return false;
+ }
+
+ boolean matchType (IType compare) {
+ return internalMatchType((IType)fElement, compare);
+ }
+
+ private boolean internalMatchType (IType type, IType compare) {
+ return EclipseJavaUtil.isDerivedClass(
+ type.getFullyQualifiedName(),
+ compare.getFullyQualifiedName(),
+ fProject);
+ }
+
+ boolean matchField (IField compare) {
+ IField field = (IField)fElement;
+ if (!field.getElementName().equals(compare.getElementName()))
+ return false;
+
+ if (!internalMatchType(field.getDeclaringType(), compare.getDeclaringType()))
+ return false;
+
+ try {
+ return field.getTypeSignature().equals(compare.getTypeSignature());
+ } catch (JavaModelException e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ boolean matchMethod (IMethod compare) {
+ IMethod method = (IMethod)fElement;
+ if (!method.getElementName().equals(compare.getElementName()))
+ return false;
+
+ if (!internalMatchType(method.getDeclaringType(), compare.getDeclaringType()))
+ return false;
+
+ try {
+ return method.getSignature().equals(compare.getSignature());
+ } catch (JavaModelException e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+ }
+
+ /**
+ * Constructs SeamSearchVisitor for a given {@link Var} set
+ * using a given {@link SeamSearchRequestor}
+ *
+ * @param collector
+ * @param vars
+ * @param file
+ */
public SeamSearchVisitor(SeamSearchRequestor collector,
- Pattern[] searchPatterns) {
+ Var[] vars, IFile file) {
fCollector= collector;
fStatus= new MultiStatus(NewSearchUI.PLUGIN_ID, IStatus.OK, SearchMessages.TextSearchEngine_statusMessage, null);
- fMatchers = new Matcher[searchPatterns == null ? 0 : searchPatterns.length];
- for (int i = 0; searchPatterns != null && i < searchPatterns.length; i++) {
- fMatchers[i]= searchPatterns[i].pattern().length() == 0 ? null : searchPatterns[i].matcher(new String());
+ fSearchRoot = file;
+ fJavaMatchers = null;
+ fVariableMatchers = null;
+ fVarMatchers = new VarMatcher[vars == null ? 0 : vars.length];
+ for (int i = 0; vars != null && i < vars.length; i++) {
+ fVarMatchers[i]= vars[i] == null ? null : new VarMatcher(vars[i], file);
}
fFileCharSequenceProvider= new FileCharSequenceProvider();
fMatchAccess= new ReusableMatchAccess();
fCompletionEngine = new SeamELCompletionEngine();
}
- SeamSearchScope fCurrentScope = null;
+ /**
+ * Constructs SeamSearchVisitor for a given {@link IJavaElement} set
+ * using a given {@link SeamSearchRequestor}
+ *
+ * @param collector
+ * @param elements
+ * @param project
+ */
+ public SeamSearchVisitor(SeamSearchRequestor collector,
+ IJavaElement[] elements, IProject project) {
+ fCollector= collector;
+ fStatus= new MultiStatus(NewSearchUI.PLUGIN_ID, IStatus.OK, SearchMessages.TextSearchEngine_statusMessage, null);
+ fSearchRoot = project;
+ fVarMatchers = null;
+ fVariableMatchers = null;
+ fJavaMatchers = new JavaElementMatcher[elements == null ? 0 : elements.length];
+ for (int i = 0; elements != null && i < elements.length; i++) {
+ fJavaMatchers[i]= elements[i] == null ? null : new JavaElementMatcher(elements[i], project);
+ }
+ fFileCharSequenceProvider= new FileCharSequenceProvider();
+ fMatchAccess= new ReusableMatchAccess();
+ fCompletionEngine = new SeamELCompletionEngine();
+ }
+
+ /**
+ * Constructs SeamSearchVisitor for a given {@link ISeamContextVariable} set
+ * using a given {@link SeamSearchRequestor}
+
+ * @param collector
+ * @param variables
+ * @param project
+ */
+ public SeamSearchVisitor(SeamSearchRequestor collector,
+ ISeamContextVariable[] variables, IProject project) {
+ fCollector= collector;
+ fStatus= new MultiStatus(NewSearchUI.PLUGIN_ID, IStatus.OK, SearchMessages.TextSearchEngine_statusMessage, null);
+ fSearchRoot = project;
+ fVarMatchers = null;
+ fJavaMatchers = null;
+ fVariableMatchers = new SeamVariableMatcher[variables == null ? 0 : variables.length];
+ for (int i = 0; variables!= null && i < variables.length; i++) {
+ fVariableMatchers[i]= variables[i] == null ? null : new SeamVariableMatcher(variables[i], project);
+ }
+ fFileCharSequenceProvider= new FileCharSequenceProvider();
+ fMatchAccess= new ReusableMatchAccess();
+ fCompletionEngine = new SeamELCompletionEngine();
+ }
+
+
+ private SeamSearchScope fCurrentScope = null;
+
+ /**
+ * Performs search operation using a given scope
+ *
+ * @param scope
+ * @param monitor
+ * @return
+ */
public IStatus search(TextSearchScope scope, IProgressMonitor monitor) {
try {
if (scope instanceof SeamSearchScope) {
fCurrentScope = (SeamSearchScope)scope;
- if (((SeamSearchScope)scope).isLimitToDeclarations()) {
+ if (SeamSearchEngine.isSearchForDeclarations(((SeamSearchScope)scope).getLimitTo())) {
return searchForDeclarations(((SeamSearchScope)scope).evaluateSeamProjectsInScope(fStatus), monitor);
} else {
return searchForReferences(((SeamSearchScope)scope).evaluateSeamProjectsInScope(fStatus), monitor);
}
-
}
} finally {
fCurrentScope = null;
@@ -168,8 +403,18 @@
}
private int calculateFiles() {
- IFile[] files = fCurrentScope.evaluateFilesInScope(fStatus);
- return (files == null ? 0 : files.length);
+ if (fJavaMatchers != null && fJavaMatchers.length > 0) {
+ IFile[] files = fCurrentScope.evaluateFilesInScope(fStatus);
+ return (files == null ? 0 : files.length);
+ } else if (fVarMatchers != null && fVarMatchers.length > 0) {
+ List<IFile> fileList = new ArrayList<IFile>(fVarMatchers.length);
+ for (int i = 0; i < fVarMatchers.length; i++) {
+ if (fVarMatchers[i] != null && fVarMatchers[i].getFile() != null)
+ fileList.add(fVarMatchers[i].getFile());
+ }
+ return fileList.size();
+ }
+ return 0;
}
public IStatus searchForDeclarations(ISeamProject[] projects, IProgressMonitor monitor) {
@@ -188,9 +433,12 @@
fCollector.beginReporting();
processSeamProjects(projects, true);
return fStatus;
+ } catch (Throwable x) {
+ x.printStackTrace();
+ return fStatus;
} finally {
monitorUpdateJob.cancel();
- }
+ }
} finally {
fProgressMonitor.done();
fCollector.endReporting();
@@ -208,9 +456,24 @@
}
private ElVarSearcher fELVarSearcher;
- public boolean processSeamReferencesInProject(ISeamProject project) {
- IFile[] files = fCurrentScope == null ? null :
- evaluateProjectFilesInScope(project.getProject(), fStatus);
+ private boolean processSeamReferencesInProject(ISeamProject project) {
+ IFile[] files = null;
+ if (fCurrentScope != null) {
+ if ((fJavaMatchers != null && fJavaMatchers.length > 0) ||
+ (fVariableMatchers != null && fVariableMatchers.length > 0)) {
+ files = evaluateProjectFilesInScope(project.getProject(), fStatus);
+ } else if (fVarMatchers != null && fVarMatchers.length > 0) {
+ List<IFile> fileList = new ArrayList<IFile>(fVarMatchers.length);
+ for (int i = 0; i < fVarMatchers.length; i++) {
+ if (fVarMatchers[i] != null && fVarMatchers[i].getFile() != null)
+ fileList.add(fVarMatchers[i].getFile());
+ }
+ if (fileList.size() > 0) {
+ files = fileList.toArray(new IFile[0]);
+ }
+ }
+
+ }
fELVarSearcher = new ElVarSearcher(project, fCompletionEngine);
fDocumentsInEditors= evalNonFileBufferDocuments();
@@ -228,7 +491,9 @@
private boolean processSeamReferencesInFile(IFile file) {
try {
- if (!fCollector.acceptFile(file) || fMatchers == null) {
+ if (!fCollector.acceptFile(file) ||
+// fMatchers == null ||
+ (fJavaMatchers == null && fVarMatchers == null && fVariableMatchers == null)) {
return true;
}
@@ -287,7 +552,6 @@
return true;
}
-
private void locateMatches(IFile file, CharSequence searchInput) throws CoreException {
fELVarSearcher.setFile(file);
if("java".equalsIgnoreCase(file.getFileExtension())) { //$NON-NLS-1$
@@ -297,9 +561,9 @@
}
}
- private List<Var> varListForCurentValidatedNode = new ArrayList<Var>();
+ private List<Var> fVarListForCurentValidatedNode = new ArrayList<Var>();
private void locateMatchesInDom(IFile file, CharSequence content) {
- varListForCurentValidatedNode.clear();
+ fVarListForCurentValidatedNode.clear();
IModelManager manager = StructuredModelManager.getModelManager();
if(manager == null) {
// this can happen if plugin org.eclipse.wst.sse.core
@@ -331,7 +595,7 @@
throws CoreException {
Var var = ElVarSearcher.findVar(parent);
if(var!=null) {
- varListForCurentValidatedNode.add(var);
+ fVarListForCurentValidatedNode.add(var);
}
NodeList children = parent.getChildNodes();
for(int i=0; i<children.getLength(); i++) {
@@ -344,7 +608,7 @@
locateMatchesInChildNodes(file, curentValidatedNode, content);
}
if(var!=null) {
- varListForCurentValidatedNode.remove(var);
+ fVarListForCurentValidatedNode.remove(var);
}
}
@@ -445,117 +709,174 @@
int offsetOfToken = el.getStart() + token.getStart();
SeamELOperandTokenizerForward forwardTokenizer = new SeamELOperandTokenizerForward(operand, 0);
List<ELOperandToken>operandTokens = forwardTokenizer.getTokens();
- List<List<ELOperandToken>> variations = SeamELCompletionEngine.getPossibleVarsFromPrefix(operandTokens);
-
- for (List<ELOperandToken> variation : variations) {
- int start = variation.get(0).getStart();
- int end = variation.get(variation.size() - 1).getStart() +
- variation.get(variation.size() - 1).getLength();
- String variationText = operand.substring(start, end);
-
- if (!matches(variationText))
- continue;
-
- int offsetOfOperandToken = offsetOfToken + start;
- int lengthOfOperandToken = end - start;
- fMatchAccess.initialize(file, offsetOfOperandToken, lengthOfOperandToken, content);
- boolean res= fCollector.acceptPatternMatch(fMatchAccess);
- if (!res) {
- return; // no further reporting requested
+ if (fJavaMatchers != null) {
+ List<List<ELOperandToken>> variations = SeamELCompletionEngine.getPossibleVarsFromPrefix(operandTokens);
+
+ for (List<ELOperandToken> variation : variations) {
+ List<IJavaElement> elements = null;
+ try {
+ elements = fCompletionEngine.getJavaElementsForELOperandTokens(fCurrentSeamProject, file, variation);
+ } catch (StringIndexOutOfBoundsException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ } catch (BadLocationException e) {
+ SeamGuiPlugin.getPluginLog().logError(e);
+ }
+
+ if (elements == null || elements.size() == 0) {
+ continue;
+ }
+
+ for (int i = 0; i < elements.size(); i++) {
+ if (!matches(elements.get(i)))
+ continue;
+
+ int start = variation.get(0).getStart();
+ int end = variation.get(variation.size() - 1).getStart() +
+ variation.get(variation.size() - 1).getLength();
+ String variationText = operand.substring(start, end);
+
+ int offsetOfOperandToken = offsetOfToken + start;
+ int lengthOfOperandToken = end - start;
+ fMatchAccess.initialize(file, offsetOfOperandToken, lengthOfOperandToken, content);
+ boolean res= fCollector.acceptPatternMatch(fMatchAccess);
+ if (!res) {
+ return; // no further reporting requested
+ }
+ }
}
+ } else if (fVariableMatchers != null) {
+ List<List<ELOperandToken>> variations = SeamELCompletionEngine.getPossibleVarsFromPrefix(operandTokens);
- System.out.println("");
- }
- }
- }
- }
-
+ for (List<ELOperandToken> variation : variations) {
+ Set<ISeamContextVariable> variables = fCurrentSeamProject.getVariablesByName(tokensToString(variation));
+ if (variables == null || variables.size() == 0) {
+ continue;
+ }
+ for (ISeamContextVariable variable : variables) {
+ if (!matches(variable))
+ continue;
- public boolean processSeamDeclarationsInProject(ISeamProject project) {
- try {
- Set<ISeamContextVariable> variables = project.getVariables(true);
- Set<String> namesToExclude = new HashSet<String>();
- boolean continueSearch = true; // Is to be set to false in case of at least one component or role/out/databinder declaration is found
-
- // Search for Seam components and @Name, @Role, @Out/DataBinder
- for (ISeamContextVariable variable : variables) {
- String varName = variable.getName();
- ISeamContextVariable origin = variable;
-
- if (!matches(varName))
- continue;
-
- if (variable instanceof ISeamContextShortVariable) {
- variable = ((ISeamContextShortVariable)variable).getOriginal();
- }
-
- if (variable instanceof SeamComponent) {
- namesToExclude.add(varName);
- SeamComponent comp = (SeamComponent)variable;
- Set<ISeamComponentDeclaration> declarations = comp.getAllDeclarations();
- for (ISeamComponentDeclaration decl : declarations) {
- if (decl instanceof ISeamJavaSourceReference) {
- ISeamJavaSourceReference sourceRef = (ISeamJavaSourceReference)decl;
- IResource resource = sourceRef.getSourceMember().getResource();
- IJavaElement sourceMember = sourceRef.getSourceMember();
- String name = sourceRef.getSourceMember().getElementName();
- int offset = sourceRef.getStartPosition();
- int length = sourceRef.getLength();
- //fMatchAccess.initialize((IFile)resource, offset, length, (CharSequence)name);
- boolean res= fCollector.acceptSeamDeclarationSourceReferenceMatch(sourceRef);
+ int start = variation.get(0).getStart();
+ int end = variation.get(variation.size() - 1).getStart() +
+ variation.get(variation.size() - 1).getLength();
+ String variationText = operand.substring(start, end);
+
+ int offsetOfOperandToken = offsetOfToken + start;
+ int lengthOfOperandToken = end - start;
+ fMatchAccess.initialize(file, offsetOfOperandToken, lengthOfOperandToken, content);
+ boolean res= fCollector.acceptPatternMatch(fMatchAccess);
if (!res) {
- return true; // no further reporting requested
+ return; // no further reporting requested
}
- continueSearch = false;
- } else if (decl instanceof IOpenableElement) {
- IResource resource = decl.getResource();
- String name = decl.getName();
+ }
+ }
+ } else if (fVarMatchers != null) {
+ Var var = fELVarSearcher.findVarForEl(operand, fVarListForCurentValidatedNode, false);
+ if (var != null){
+ if (matches(var)) {
+ String varRefText = operandTokens.get(0).getText();
+ int start = operandTokens.get(0).getStart();
+ int end = operandTokens.get(0).getStart() +
+ operandTokens.get(0).getLength();
+ int offsetOfVarRefToken = offsetOfToken + start;
+ int lengthOfVarRefToken = end - start;
- ISeamTextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
- int offset = textSourceReference == null ? decl.getStartPosition() : textSourceReference.getStartPosition();
- int length = textSourceReference == null ? decl.getLength() : textSourceReference.getLength();
-
- fMatchAccess.initialize((IFile)resource, offset, length, (CharSequence)name);
+ fMatchAccess.initialize(file, offsetOfVarRefToken, lengthOfVarRefToken, content);
boolean res= fCollector.acceptPatternMatch(fMatchAccess);
if (!res) {
- return true; // no further reporting requested
+ return; // no further reporting requested
}
- continueSearch = false;
}
}
- } else if (variable instanceof IRole) {
- namesToExclude.add(varName);
- // add the declaration
- ISeamDeclaration decl = (ISeamDeclaration)variable;
- IResource resource = decl.getResource();
- String name = decl.getName();
+ }
+ }
+ }
+ }
+
+
+
+ public boolean processSeamDeclarationsInProject(ISeamProject project) {
+ if (fJavaMatchers != null && fJavaMatchers.length > 0) {
+ JavaSearchScopeFactory factory= JavaSearchScopeFactory.getInstance();
+ IJavaSearchScope scope= factory.createWorkspaceScope(true);
+ String description= factory.getWorkspaceScopeDescription(true);
+ for (int i = 0; i < fJavaMatchers.length; i++) {
+ ElementQuerySpecification elementQuerySpecification =
+ new ElementQuerySpecification(
+ fJavaMatchers[i].getElement(),
+ IJavaSearchConstants.DECLARATIONS,
+ scope, description);
+ JavaSearchQuery query= new JavaSearchQuery(elementQuerySpecification);
+ query.run(fProgressMonitor);
+ JavaSearchResult result = (JavaSearchResult)query.getSearchResult();
+ Object[] elements = result.getElements();
+ for (int j = 0; elements != null && j < elements.length; j++) {
+ Match[] matches = result.getMatches(elements[j]);
+ for (int k = 0; matches != null && k < matches.length; k++) {
+ fCollector.reportMatch(matches[k]);
+ }
+ }
+ }
+ }
+ if (fVariableMatchers != null && fVariableMatchers.length > 0) {
+ try {
+ for (int i = 0; i < fVariableMatchers.length; i++) {
+ if (fVariableMatchers[i] == null)
+ continue;
+
+ ISeamContextVariable variable = fVariableMatchers[i].getElement();
- ISeamTextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
- if (textSourceReference != null) {
- int offset = textSourceReference.getStartPosition();
- int length = textSourceReference.getLength();
- fMatchAccess.initialize((IFile)resource, offset, length, (CharSequence)name);
- boolean res= fCollector.acceptPatternMatch(fMatchAccess);
- if (!res) {
- return true; // no further reporting requested
- }
- continueSearch = false;
- }
+ if (variable instanceof ISeamContextShortVariable) {
+ variable = ((ISeamContextShortVariable)variable).getOriginal();
+ }
- } else if (variable instanceof IBijectedAttribute) {
- namesToExclude.add(varName);
- IBijectedAttribute ba = (IBijectedAttribute)variable;
- BijectedAttributeType[] types = ba.getTypes();
- boolean hasDeclarationType = false;
- for (int i = 0; !hasDeclarationType && types != null && i < types.length; i++) {
- if (types[i] == BijectedAttributeType.OUT ||
- types[i] == BijectedAttributeType.DATA_BINDER ||
- types[i] == BijectedAttributeType.DATA_MODEL_SELECTION) {
- hasDeclarationType = true;
+ boolean continueWithFactories = true;
+ if (variable instanceof SeamComponent) {
+ SeamComponent comp = (SeamComponent)variable;
+ Set<ISeamComponentDeclaration> declarations = comp.getAllDeclarations();
+ for (ISeamComponentDeclaration decl : declarations) {
+ if (decl instanceof ISeamJavaSourceReference) {
+ ISeamJavaSourceReference sourceRef = (ISeamJavaSourceReference)decl;
+ IResource resource = sourceRef.getSourceMember().getResource();
+ IJavaElement sourceMember = sourceRef.getSourceMember();
+ String name = sourceRef.getSourceMember().getElementName();
+ int offset = sourceRef.getStartPosition();
+ int length = sourceRef.getLength();
+ //fMatchAccess.initialize((IFile)resource, offset, length, (CharSequence)name);
+ boolean res= fCollector.acceptSeamDeclarationSourceReferenceMatch(sourceRef);
+ if (!res) {
+ return true; // no further reporting requested
+ }
+ continueWithFactories = false;
+ } else if (decl instanceof IOpenableElement) {
+ IResource resource = decl.getResource();
+ String name = decl.getName();
+
+ ISeamTextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
+ if (textSourceReference != null) {
+ int offset = textSourceReference.getStartPosition();
+ int length = textSourceReference.getLength();
+
+ boolean res= fCollector.acceptSeamDeclarationMatch(decl);
+ if (!res) {
+ return true; // no further reporting requested
+ }
+ continueWithFactories = false;
+ } else {
+ int offset = decl.getStartPosition();
+ int length = decl.getLength();
+
+ fMatchAccess.initialize((IFile)resource, offset, length, (CharSequence)name);
+ boolean res= fCollector.acceptPatternMatch(fMatchAccess);
+ if (!res) {
+ return true; // no further reporting requested
+ }
+ continueWithFactories = false;
+ }
+ }
}
- }
- if (hasDeclarationType) {
+ } else if (variable instanceof IRole) {
// add the declaration
ISeamDeclaration decl = (ISeamDeclaration)variable;
IResource resource = decl.getResource();
@@ -565,27 +886,47 @@
if (textSourceReference != null) {
int offset = textSourceReference.getStartPosition();
int length = textSourceReference.getLength();
-
fMatchAccess.initialize((IFile)resource, offset, length, (CharSequence)name);
boolean res= fCollector.acceptPatternMatch(fMatchAccess);
if (!res) {
return true; // no further reporting requested
}
- continueSearch = false;
+ continueWithFactories = false;
}
+ } else if (variable instanceof IBijectedAttribute) {
+ IBijectedAttribute ba = (IBijectedAttribute)variable;
+ BijectedAttributeType[] types = ba.getTypes();
+ boolean hasDeclarationType = false;
+ for (int j = 0; !hasDeclarationType && types != null && j < types.length; j++) {
+ if (types[j] == BijectedAttributeType.OUT ||
+ types[j] == BijectedAttributeType.DATA_BINDER ||
+ types[j] == BijectedAttributeType.DATA_MODEL_SELECTION) {
+ hasDeclarationType = true;
+ }
+ }
+ if (hasDeclarationType) {
+ // add the declaration
+ ISeamDeclaration decl = (ISeamDeclaration)variable;
+ IResource resource = decl.getResource();
+ String name = decl.getName();
+
+ ISeamTextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
+ if (textSourceReference != null) {
+ int offset = textSourceReference.getStartPosition();
+ int length = textSourceReference.getLength();
+
+ fMatchAccess.initialize((IFile)resource, offset, length, (CharSequence)name);
+ boolean res= fCollector.acceptPatternMatch(fMatchAccess);
+ if (!res) {
+ return true; // no further reporting requested
+ }
+ continueWithFactories = false;
+ }
+ }
}
- }
- }
- if (continueSearch) {
- // Search for Seam factories
- for (ISeamContextVariable variable : variables) {
- String varName = variable.getName();
- if (namesToExclude.contains(varName)) // Do not process used names
- continue;
- if (!matches(varName))
- continue;
-
- if (variable instanceof ISeamDeclaration) {
+
+ // Search for Seam factories
+ if (continueWithFactories && variable instanceof ISeamDeclaration) {
ISeamDeclaration decl = (ISeamDeclaration)variable;
IResource resource = decl.getResource();
String name = decl.getName();
@@ -602,73 +943,19 @@
}
}
}
+ } catch (CoreException ce) {
+ String[] args= { getExceptionMessage(ce), project.getResource().getFullPath().makeRelative().toString()};
+ String message= Messages.format(SearchMessages.TextSearchVisitor_error, args);
+ fStatus.add(new Status(IStatus.WARNING, NewSearchUI.PLUGIN_ID, IStatus.WARNING, message, ce));
}
- } catch (CoreException ce) {
- String[] args= { getExceptionMessage(ce), project.getResource().getFullPath().makeRelative().toString()};
- String message= Messages.format(SearchMessages.TextSearchVisitor_error, args);
- fStatus.add(new Status(IStatus.WARNING, NewSearchUI.PLUGIN_ID, IStatus.WARNING, message, ce));
}
- if (fProgressMonitor.isCanceled())
- throw new OperationCanceledException(SearchMessages.TextSearchVisitor_canceled);
- return true;
-/*
- IFile file = null; // was a parameter
- try {
- if (!fCollector.acceptFile(file) || fMatcher == null) {
- return true;
- }
-
- IDocument document= getOpenDocument(file);
-
- if (document != null) {
- DocumentCharSequence documentCharSequence= new DocumentCharSequence(document);
- // assume all documents are non-binary
- locateMatches(file, documentCharSequence);
- } else {
- CharSequence seq= null;
- try {
- seq= fFileCharSequenceProvider.newCharSequence(file);
- if (hasBinaryContent(seq, file) && !fCollector.reportBinaryFile(file)) {
- return true;
- }
- locateMatches(file, seq);
- } catch (FileCharSequenceProvider.FileCharSequenceException e) {
- e.throwWrappedException();
- } finally {
- if (seq != null) {
- try {
- fFileCharSequenceProvider.releaseCharSequence(seq);
- } catch (IOException e) {
- SearchPlugin.log(e);
- }
- }
- }
- }
- } catch (UnsupportedCharsetException e) {
- String[] args= { getCharSetName(file), file.getFullPath().makeRelative().toString()};
- String message= Messages.format(SearchMessages.TextSearchVisitor_unsupportedcharset, args);
- fStatus.add(new Status(IStatus.WARNING, NewSearchUI.PLUGIN_ID, IStatus.WARNING, message, e));
- } catch (IOException e) {
- String[] args= { getExceptionMessage(e), file.getFullPath().makeRelative().toString()};
- String message= Messages.format(SearchMessages.TextSearchVisitor_error, args);
- fStatus.add(new Status(IStatus.WARNING, NewSearchUI.PLUGIN_ID, IStatus.WARNING, message, e));
- } catch (CoreException e) {
- String[] args= { getExceptionMessage(e), file.getFullPath().makeRelative().toString()};
- String message= Messages.format(SearchMessages.TextSearchVisitor_error, args);
- fStatus.add(new Status(IStatus.WARNING, NewSearchUI.PLUGIN_ID, IStatus.WARNING, message, e));
- } catch (StackOverflowError e) {
- String message= SearchMessages.TextSearchVisitor_patterntoocomplex0;
- fStatus.add(new Status(IStatus.ERROR, NewSearchUI.PLUGIN_ID, IStatus.ERROR, message, e));
- return false;
- } finally {
- fNumberOfScannedFiles++;
- }
+
if (fProgressMonitor.isCanceled())
throw new OperationCanceledException(SearchMessages.TextSearchVisitor_canceled);
return true;
- */
+
}
private class MonitorUpdateJob extends Job {
@@ -700,12 +987,24 @@
}
private String getTaskName() {
- String taskName= fMatchers[0] == null ? SearchMessages.TextSearchVisitor_filesearch_task_label : Messages.format(SearchMessages.TextSearchVisitor_textsearch_task_label, fMatchers[0].pattern());
+ ISeamMatcher[] currentMatchers = (fJavaMatchers == null ? fVarMatchers : fJavaMatchers);
+
+
+ StringBuffer elements = new StringBuffer();
+ for(int i = 0; currentMatchers != null && i < currentMatchers.length; i++) {
+ if (currentMatchers[i] != null) {
+ if (elements.length() > 0) {
+ elements.append(", ");
+ }
+ elements.append(currentMatchers[i].getName());
+ }
+ }
+ String taskName= elements.length() == 0 ? SearchMessages.TextSearchVisitor_filesearch_task_label : Messages.format(SearchMessages.TextSearchVisitor_textsearch_task_label, elements.toString());
return taskName;
}
- public IStatus searchForReferences(ISeamProject[] projects, IProgressMonitor monitor) {
+ private IStatus searchForReferences(ISeamProject[] projects, IProgressMonitor monitor) {
fProgressMonitor= monitor == null ? new NullProgressMonitor() : monitor;
fNumberOfScannedFiles= 0;
fNumberOfFilesToScan= calculateFiles();
@@ -730,25 +1029,47 @@
}
}
+ ISeamMatcher fCurrentMatcher;
+ private boolean matches (IJavaElement element) {
+ fCurrentMatcher = null;
+ for (int i = 0; fJavaMatchers != null && i < fJavaMatchers.length; i++) {
+ if (fJavaMatchers[i] == null)
+ continue;
+ if (fJavaMatchers[i].match(element)) {
+ fCurrentMatcher = fJavaMatchers[i];
+ return true;
+ }
+ }
+ return false;
+ }
-
- private boolean matches(CharSequence searchInput) {
- try {
- for (int i = 0; fMatchers != null && i < fMatchers.length; i++) {
- if (fMatchers[i] == null)
- continue;
- fMatchers[i].reset(searchInput);
- if (fMatchers[i].find() && fMatchers[i].group().equals(searchInput)) {
- return true;
- }
+ private boolean matches (ISeamContextVariable element) {
+ fCurrentMatcher = null;
+ for (int i = 0; fVariableMatchers != null && i < fVariableMatchers.length; i++) {
+ if (fVariableMatchers[i] == null)
+ continue;
+ if (fVariableMatchers[i].match(element)) {
+ fCurrentMatcher = fVariableMatchers[i];
+ return true;
}
- } finally {
-// fMatcher.reset();
}
return false;
}
-
- private String getExceptionMessage(Exception e) {
+
+ private boolean matches (Var var) {
+ fCurrentMatcher = null;
+ for (int i = 0; fVarMatchers != null && i < fVarMatchers.length; i++) {
+ if (fVarMatchers[i] == null)
+ continue;
+ if (fVarMatchers[i].match(var)) {
+ fCurrentMatcher = fVarMatchers[i];
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static String getExceptionMessage(Exception e) {
String message= e.getLocalizedMessage();
if (message == null) {
return e.getClass().getName();
@@ -756,7 +1077,7 @@
return message;
}
- private boolean hasBinaryContent(CharSequence seq, IFile file) throws CoreException {
+ private static boolean hasBinaryContent(CharSequence seq, IFile file) throws CoreException {
IContentDescription desc= file.getContentDescription();
if (desc != null) {
IContentType contentType= desc.getContentType();
@@ -782,7 +1103,7 @@
/**
* @return returns a map from IFile to IDocument for all open, dirty editors
*/
- private Map evalNonFileBufferDocuments() {
+ private static Map evalNonFileBufferDocuments() {
Map result= new HashMap();
IWorkbench workbench= SearchPlugin.getDefault().getWorkbench();
IWorkbenchWindow[] windows= workbench.getWorkbenchWindows();
@@ -801,7 +1122,7 @@
return result;
}
- private void evaluateTextEditor(Map result, IEditorPart ep) {
+ private static void evaluateTextEditor(Map result, IEditorPart ep) {
IEditorInput input= ep.getEditorInput();
if (input instanceof IFileEditorInput) {
IFile file= ((IFileEditorInput) input).getFile();
@@ -823,7 +1144,18 @@
}
private IDocument getOpenDocument(IFile file) {
- IDocument document= (IDocument) fDocumentsInEditors.get(file);
+ return getOpenDocument(file, fDocumentsInEditors);
+ }
+
+
+ /**
+ * Returns the IDocument of file currently opened in an editor
+ * @param file
+ * @param documentsInEditors
+ * @return
+ */
+ public static IDocument getOpenDocument(IFile file, Map documentsInEditors) {
+ IDocument document= (IDocument) documentsInEditors.get(file);
if (document == null) {
ITextFileBufferManager bufferManager= FileBuffers.getTextFileBufferManager();
ITextFileBuffer textFileBuffer= bufferManager.getTextFileBuffer(file.getFullPath(), LocationKind.IFILE);
@@ -834,7 +1166,7 @@
return document;
}
- private String getCharSetName(IFile file) {
+ private static String getCharSetName(IFile file) {
try {
return file.getCharset();
} catch (CoreException e) {
@@ -842,7 +1174,90 @@
}
}
+ private static boolean acceptPaternMatch(SeamSearchRequestor collector, IFile file,
+ int offset, int length, CharSequence content) throws CoreException {
+ ReusableMatchAccess matchAccess = new ReusableMatchAccess();
+
+ matchAccess.initialize(file, offset, length, content);
+ collector.beginReporting();
+ boolean result = collector.acceptPatternMatch(matchAccess);
+ collector.endReporting();
+
+ return result;
+ }
+
+
/**
+ * Reports a Pattern match to a given {@link SeamSearchRequestor}
+ *
+ * @param collector
+ * @param file
+ * @param offset
+ * @param length
+ * @return
+ */
+ public static boolean acceptPaternMatch(SeamSearchRequestor collector, IFile file, int offset, int length) {
+ try {
+ IDocument document= getOpenDocument(file, evalNonFileBufferDocuments());
+
+ if (document != null) {
+ DocumentCharSequence documentCharSequence= new DocumentCharSequence(document);
+ // assume all documents are non-binary
+ return acceptPaternMatch(collector, file, offset, length, documentCharSequence);
+ } else {
+ FileCharSequenceProvider fileCharSequenceProvider = new FileCharSequenceProvider();
+ CharSequence seq= null;
+ try {
+ seq= fileCharSequenceProvider.newCharSequence(file);
+ if (hasBinaryContent(seq, file) && !collector.reportBinaryFile(file)) {
+ return true;
+ }
+ return acceptPaternMatch(collector, file, offset, length, seq);
+ } catch (FileCharSequenceProvider.FileCharSequenceException e) {
+ e.throwWrappedException();
+ } finally {
+ if (seq != null) {
+ try {
+ fileCharSequenceProvider.releaseCharSequence(seq);
+ } catch (IOException e) {
+ SearchPlugin.log(e);
+ }
+ }
+ }
+ }
+ } catch (UnsupportedCharsetException e) {
+ SearchPlugin.log(e);
+ } catch (IllegalCharsetNameException e) {
+ SearchPlugin.log(e);
+ } catch (IOException e) {
+ SearchPlugin.log(e);
+ } catch (CoreException e) {
+ SearchPlugin.log(e);
+ } catch (StackOverflowError e) {
+ }
+ return false;
+ }
+
+
+ /**
+ * Returns the text for a given {@link ELOperandToken} list
+ *
+ * @param tokens
+ * @return
+ */
+ public static String tokensToString(List<ELOperandToken> tokens) {
+ StringBuffer text = new StringBuffer();
+ if (tokens != null) {
+ for (ELOperandToken token : tokens) {
+ text = text.append(token.getText());
+ }
+ }
+
+ return text.toString();
+ }
+
+
+ /**
* Evaluates all files in this scope.
*
* @param status a {@link MultiStatus} to collect the error status that occurred while collecting resources.
@@ -852,7 +1267,7 @@
return new ProjectFilesOfScopeCalculator(project, fCurrentScope, status).process();
}
- class ProjectFilesOfScopeCalculator implements IResourceProxyVisitor {
+ private class ProjectFilesOfScopeCalculator implements IResourceProxyVisitor {
private final IProject fProject;
private final TextSearchScope fScope;
private final MultiStatus fStatus;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTableContentProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTableContentProvider.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTableContentProvider.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
import org.eclipse.jface.viewers.IStructuredContentProvider;
@@ -6,6 +17,12 @@
import org.eclipse.search.internal.ui.text.IFileSearchContentProvider;
import org.eclipse.search.ui.text.AbstractTextSearchResult;
+/**
+ * Seam table content provider used in seam search page
+ *
+ * @author Jeremy
+ *
+ */
public class SeamTableContentProvider implements IStructuredContentProvider, IFileSearchContentProvider {
private final Object[] EMPTY_ARR= new Object[0];
@@ -13,14 +30,27 @@
private SeamSearchResultPage fPage;
private AbstractTextSearchResult fResult;
+ /**
+ * Constructs SeamTableContentProvider object
+ *
+ * @param page
+ */
public SeamTableContentProvider(SeamSearchResultPage page) {
fPage= page;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
public void dispose() {
// nothing to do
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
public Object[] getElements(Object inputElement) {
if (inputElement instanceof SeamSearchResult) {
int elementLimit= getElementLimit();
@@ -35,12 +65,20 @@
return EMPTY_ARR;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput instanceof SeamSearchResult) {
fResult= (SeamSearchResult) newInput;
}
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.internal.ui.text.IFileSearchContentProvider#elementsChanged(java.lang.Object[])
+ */
public void elementsChanged(Object[] updatedElements) {
TableViewer viewer= getViewer();
int elementLimit= getElementLimit();
@@ -65,7 +103,11 @@
private TableViewer getViewer() {
return (TableViewer) fPage.getViewer();
}
-
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.internal.ui.text.IFileSearchContentProvider#clear()
+ */
public void clear() {
getViewer().refresh();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTreeContentProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTreeContentProvider.java 2008-04-03 14:38:07 UTC (rev 7291)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamTreeContentProvider.java 2008-04-03 14:40:15 UTC (rev 7292)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * 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.seam.ui.search;
import java.util.HashMap;
@@ -7,6 +18,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
@@ -15,9 +28,15 @@
import org.jboss.tools.seam.core.IRole;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.ISeamPackage;
-import org.jboss.tools.seam.core.ISeamScope;
+import org.jboss.tools.seam.core.ISeamProject;
+
+/**
+ * Seam tree content provider used in seam search page
+ *
+ * @author Jeremy
+ *
+ */
public class SeamTreeContentProvider implements ITreeContentProvider, IFileSearchContentProvider {
private final Object[] EMPTY_ARR= new Object[0];
@@ -27,11 +46,20 @@
private AbstractTreeViewer fTreeViewer;
private Map fChildrenMap;
+ /**
+ * Constructs SeamTreeContentProvider object
+ *
+ * @param page
+ */
SeamTreeContentProvider(SeamSearchResultPage page, AbstractTreeViewer viewer) {
fPage= page;
fTreeViewer= viewer;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ */
public Object[] getElements(Object inputElement) {
Object[] children= getChildren(inputElement);
int elementLimit= getElementLimit();
@@ -46,19 +74,26 @@
private int getElementLimit() {
return fPage.getElementLimit().intValue();
}
-
+
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#dispose()
+ */
public void dispose() {
// nothing to do
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput instanceof SeamSearchResult) {
initialize((SeamSearchResult) newInput);
}
}
-
- protected synchronized void initialize(AbstractTextSearchResult result) {
+ private synchronized void initialize(AbstractTextSearchResult result) {
fResult= result;
fChildrenMap= new HashMap();
if (result != null) {
@@ -69,7 +104,7 @@
}
}
- protected void insert(Object child, boolean refreshViewer) {
+ private void insert(Object child, boolean refreshViewer) {
Object parent= getParent(child);
while (parent != null) {
@@ -106,7 +141,7 @@
return children.add(child);
}
- protected void remove(Object element, boolean refreshViewer) {
+ private void remove(Object element, boolean refreshViewer) {
// precondition here: fResult.getMatchCount(child) <= 0
if (hasChildren(element)) {
@@ -139,6 +174,10 @@
}
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+ */
public Object[] getChildren(Object parentElement) {
Set children= (Set) fChildrenMap.get(parentElement);
if (children == null)
@@ -146,10 +185,18 @@
return children.toArray();
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+ */
public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.internal.ui.text.IFileSearchContentProvider#elementsChanged(java.lang.Object[])
+ */
public synchronized void elementsChanged(Object[] updatedElements) {
for (int i= 0; i < updatedElements.length; i++) {
if (fResult.getMatchCount(updatedElements[i]) > 0)
@@ -159,13 +206,21 @@
}
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.search.internal.ui.text.IFileSearchContentProvider#clear()
+ */
public void clear() {
initialize(fResult);
fTreeViewer.refresh();
}
+ /**
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+ */
public Object getParent(Object element) {
- if (element instanceof IProject)
+ if (element instanceof IProject || element instanceof IJavaProject || element instanceof ISeamProject)
return null;
if (element instanceof IResource) {
IResource resource = (IResource) element;
@@ -174,13 +229,17 @@
if(element instanceof IRole) {
ISeamElement p = ((IRole)element).getParent();
return p == null ? p : p.getParent();
- } else if(element instanceof ISeamElement) {
+ }
+ if(element instanceof ISeamElement) {
if(element instanceof ISeamComponent) {
ISeamComponent c = (ISeamComponent)element;
return c.getSeamProject().getPackage(c);
}
return ((ISeamElement)element).getParent();
}
+ if (element instanceof IJavaElement) {
+ return ((IJavaElement)element).getParent();
+ }
return null;
}
17 years, 8 months
JBoss Tools SVN: r7291 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-04-03 10:38:07 -0400 (Thu, 03 Apr 2008)
New Revision: 7291
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1860 Seam find references is not using the right extensionpoint/shortcut
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-04-03 14:37:08 UTC (rev 7290)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2008-04-03 14:38:07 UTC (rev 7291)
@@ -852,7 +852,7 @@
}
/**
- * Create the array of suggestions.
+ * Create the array of suggestions from {@link ELOperandToken} list.
* @param project Seam project
* @param file File
* @param document
@@ -860,10 +860,23 @@
* @param position Offset of the prefix
*/
public List<IJavaElement> getJavaElementsForExpression(ISeamProject project, IFile file, String expression) throws BadLocationException, StringIndexOutOfBoundsException {
- List<IJavaElement> res= new ArrayList<IJavaElement>();
SeamELOperandTokenizer tokenizer = new SeamELOperandTokenizer(expression, expression.length());
List<ELOperandToken> tokens = tokenizer.getTokens();
+ return getJavaElementsForELOperandTokens(project, file, tokens);
+ }
+ /**
+ * Create the array of suggestions.
+ * @param project Seam project
+ * @param file File
+ * @param document
+ * @param prefix the prefix to search for
+ * @param position Offset of the prefix
+ */
+ public List<IJavaElement> getJavaElementsForELOperandTokens(
+ ISeamProject project, IFile file,
+ List<ELOperandToken> tokens) throws BadLocationException, StringIndexOutOfBoundsException {
+ List<IJavaElement> res= new ArrayList<IJavaElement>();
if (tokens == null || tokens.size() == 0 || tokens.get(tokens.size() - 1).getType() == ELOperandToken.EL_SEPARATOR_TOKEN)
return res;
17 years, 8 months