Author: scabanovich
Date: 2010-09-14 11:27:36 -0400 (Tue, 14 Sep 2010)
New Revision: 24917
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.xml/images/
trunk/cdi/plugins/org.jboss.tools.cdi.xml/images/exclude.gif
trunk/cdi/plugins/org.jboss.tools.cdi.xml/images/include.gif
trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/meta/cdi-weld.meta
trunk/cdi/plugins/org.jboss.tools.cdi.xml/schemas/beans_1_1.xsd
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/WeldIncludeObjectImpl.java
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/handlers/
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/handlers/AddIncludeSupport.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.xml/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.xml/build.properties
trunk/cdi/plugins/org.jboss.tools.cdi.xml/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/help/keys-cdi-attrs.properties
trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/help/keys-cdi.properties
Log:
https://jira.jboss.org/browse/JBIDE-6998
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.xml/META-INF/MANIFEST.MF 2010-09-14 15:06:48 UTC
(rev 24916)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.xml/META-INF/MANIFEST.MF 2010-09-14 15:27:36 UTC
(rev 24917)
@@ -7,7 +7,8 @@
Bundle-SymbolicName: org.jboss.tools.cdi.xml;singleton:=true
Bundle-Localization: plugin
Export-Package: org.jboss.tools.cdi.xml,
- org.jboss.tools.cdi.xml.beans.model
+ org.jboss.tools.cdi.xml.beans.model,
+ org.jboss.tools.cdi.xml.beans.model.handlers
Require-Bundle: org.jboss.tools.jst.web;visibility:=reexport,
org.eclipse.ui.ide,
org.eclipse.ui.views,
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.xml/build.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.xml/build.properties 2010-09-14 15:06:48 UTC
(rev 24916)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.xml/build.properties 2010-09-14 15:27:36 UTC
(rev 24917)
@@ -3,7 +3,8 @@
plugin.properties,\
about.html,\
schemas/,\
- .
+ .,\
+ images/
jars.compile.order = .
src.includes = src/,\
schemas/,\
@@ -12,7 +13,8 @@
plugin.properties,\
build.properties,\
about.html,\
- META-INF/
+ META-INF/,\
+ images/
output.. = bin/
source.. = resources/,\
src/
Added: trunk/cdi/plugins/org.jboss.tools.cdi.xml/images/exclude.gif
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.xml/images/exclude.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/plugins/org.jboss.tools.cdi.xml/images/include.gif
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.xml/images/include.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.xml/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.xml/plugin.xml 2010-09-14 15:06:48 UTC (rev
24916)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.xml/plugin.xml 2010-09-14 15:27:36 UTC (rev
24917)
@@ -4,6 +4,7 @@
<extension point="org.jboss.tools.common.model.meta">
<meta path="meta/cdi-beans.meta"/>
+ <meta path="meta/cdi-weld.meta"/>
</extension>
<extension point="org.jboss.tools.common.model.keys">
@@ -19,7 +20,12 @@
class="org.jboss.tools.cdi.xml.beans.model.CDIBeansFileLoader"/>
<xclass id="org.jboss.tools.cdi.xml.beans.model.CDIBeansEntityRecognizer"
class="org.jboss.tools.cdi.xml.beans.model.CDIBeansEntityRecognizer"/>
+ <xclass id="org.jboss.tools.cdi.xml.beans.model.WeldIncludeObjectImpl"
+ class="org.jboss.tools.cdi.xml.beans.model.WeldIncludeObjectImpl"/>
+ <xclass
id="org.jboss.tools.cdi.xml.beans.model.handlers.AddIncludeSupport"
+ class="org.jboss.tools.cdi.xml.beans.model.handlers.AddIncludeSupport"/>
+
</extension>
<extension point="org.eclipse.wst.xml.core.catalogContributions">
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/help/keys-cdi-attrs.properties
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/help/keys-cdi-attrs.properties 2010-09-14
15:06:48 UTC (rev 24916)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/help/keys-cdi-attrs.properties 2010-09-14
15:27:36 UTC (rev 24917)
@@ -1,163 +1,5 @@
-Seam.element_type=Element Type
-Seam.name=Name
-Seam.thread-pool-size=Thread-Pool-Size
-Seam.component-name=Component-Name
-Seam.extension=Extension
-Seam.xmlns=Xmlns
-Seam.xmlns_xsi=Xmlns\:xsi
-Seam.xsi_schemaLocation=Xsi\:schemaLocation
-Seam.namespaceMapping=NamespaceMapping
-Seam.encoding=Encoding
-Seam.startup=Startup
-Seam.expression=Expression
-Seam.execute=Execute
-Seam.class=Class
-Seam.scope=Scope
-Seam.precedence=Precedence
-Seam.installed=Installed
-Seam.auto-create=Auto-Create
-Seam.jndi-name=Jndi-Name
-Seam.startupDepends=StartupDepends
-Seam.type=Type
-Seam.value=Value
-Seam.method=Method
-Seam.import=Import
-Seam.key=Key
-Seam.group-actor-ids=Group-Actor-Ids
-Seam.persistence-unit-name=Persistence-Unit-Name
-Seam.filter_name=Filter Name
-Seam.enabled=Enabled
-Seam.consequence-exception-handler=Consequence-Exception-Handler
-Seam.mode=Mode
-Seam.debug=Debug
-Seam.jndi-pattern=Jndi-Pattern
-Seam.client-side-conversations=Client-Side-Conversations
-Seam.my-faces-lifecycle-bug=My-Faces-Lifecycle-Bug
-Seam.user-transaction-name=User-Transaction-Name
-Seam.transaction-management-enabled=Transaction-Management-Enabled
-Seam.locale-string=Locale-String
-Seam.cookie-enabled=Cookie-Enabled
-Seam.entity-manager-factory=Entity-Manager-Factory
-Seam.persistence-unit-jndi-name=Persistence-Unit-Jndi-Name
-Seam.conversation-timeout=Conversation-Timeout
-Seam.concurrent-request-timeout=Concurrent-Request-Timeout
-Seam.conversation-id-parameter=Conversation-ID-Parameter
-Seam.parent-conversation-id-parameter=Parent-Conversation-ID-Parameter
-Seam.conversation-is-long-running-parameter=Conversation-is-Long-Running-Parameter
-Seam.uri-encoding=URI-Encoding
-Seam.default-flush-mode=Default-Flush-Mode
-Seam.no-conversation-view-id=No-Conversation-View-ID
-Seam.login-view-id=Login-View-ID
-Seam.http-port=Http-Port
-Seam.https-port=Https-Port
-Seam.cfg-resource-name=Cfg-Resource-Name
-Seam.bundle-names=Bundle-Names
-Seam.time-zone-id=Time-Zone-ID
-Seam.rule-base=Rule-Base
-Seam.configuration-file=Configuration-File
-Seam.config-name=Config-Name
-Seam.new-instance=New-Instance
-Seam.files=Files
-Seam.url=URL
-Seam.local-cache-dir=Local-Cache-Dir
-Seam.poll=Poll
-Seam.dsl-file=Dsl-File
-Seam.rule-files=Rule-Files
-Seam.entity-class=Entity-Class
-Seam.id=ID
-Seam.created-message=Created-Message
-Seam.updated-message=Updated-Message
-Seam.deleted-message=Deleted-Message
-Seam.entity-manager=Entity-Manager
-Seam.ejbql=Ejbql
-Seam.order=Order
-Seam.max-results=Max-Results
-Seam.group-by=Group-by
-Seam.session=Session
-Seam.cacheable=Cacheable
-Seam.cache-region=Cache-Region
-Seam.fetch-size=Fetch-Size
-Seam.cookie-max-age=Cookie-Max-Age
-Seam.default-locale=Default-Locale
-Seam.supported-locales=Supported-Locales
-Seam.factory-jndi-name=Factory-Jndi-Name
-Seam.queue-jndi-name=Queue-Jndi-Name
-Seam.topic-jndi-name=Topic-Jndi-Name
-Seam.username=Username
-Seam.password=Password
-Seam.administrator=Administrator
-Seam.host=Host
-Seam.port=Port
-Seam.ssl=Ssl
-Seam.session-jndi-name=Session-Jndi-Name
-Seam.error-page=Error-Page
-Seam.use-extensions=Use-Extensions
-Seam.key-store=Key-Store
-Seam.key-store-password=Key-Store-Password
-Seam.key-password=Key-Password
-Seam.key-alias=Key-Alias
-Seam.naming-strategy=Naming-Strategy
-Seam.session-factory=Session-Factory
-Seam.session-factory-jndi-name=Session-Factory-Jndi-Name
-Seam.poll-interval=Poll-Interval
-Seam.poll-timeout=Poll-Timeout
-Seam.authenticate-method=Authenticate-Method
-Seam.remember-me=Remember-me
-Seam.jaas-config-name=Jaas-Config-Name
-Seam.security-rules=Security-Rules
-Seam.authenticate-every-request=Authenticate-Every-Request
-Seam.identity-store=Identity-Store
-Seam.role-identity-store=Role-Identity-Store
-Seam.user-class=User-Class
-Seam.role-class=Role-Class
-Seam.token-class=Token-Class
-Seam.features=Features
-Seam.user-permission-class=User-Permission-Class
-Seam.role-permission-class=Role-Permission-Class
-Seam.server-address=Server-Address
-Seam.server-port=Server-Port
-Seam.bind-DN=Bind-DN
-Seam.bind-credentials=Bind-Credentials
-Seam.user-DN-prefix=User-DN-Prefix
-Seam.user-DN-suffix=User-DN-Suffix
-Seam.role-DN-prefix=Role-DN-Prefix
-Seam.role-DN-suffix=Role-DN-Suffix
-Seam.user-context-DN=User-Context-DN
-Seam.role-context-DN=Role-Context-DN
-Seam.user-role-attribute=User-Role-Attribute
-Seam.user-name-attribute=User-Name-Attribute
-Seam.role-name-attribute=Role-Name-Attribute
-Seam.role-attribute-is-DN=Role-Attribute-is-DN
-Seam.user-object-classes=User-Object-Classes
-Seam.role-object-classes=Role-Object-Classes
-Seam.enabled-attribute=Enabled-Attribute
-Seam.search-scope=Search-Scope
-Seam.first-name-attribute=First-Name-Attribute
-Seam.last-name-attribute=Last-Name-Attribute
-Seam.user-password-attribute=User-Password-Attribute
-Seam.permission-store=Permission-Store
-Seam.config-locations=Config-Locations
-Seam.task-executor=Task-Executor
-Seam.schedule-dispatcher=Schedule-Dispatcher
-Seam.platform-transaction-manager=Platform-Transaction-Manager
-Seam.conversation-context-required=Conversation-Context-Required
-Seam.join-transaction=Join-Transaction
-Seam.theme=Theme
-Seam.available-themes=Available-Themes
-Seam.entity-loader=Entity-Loader
-Seam.enable-cache=Enable-Cache
-Seam.force-parser=Force-Parser
-Seam.log4j-init-file=Log4j-Init-File
-Seam.realm=Realm
-Seam.nonce-validity-seconds=Nonce-Validity-Seconds
-Seam.auth-type=Auth-Type
-Seam.override-client=Override-Client
-Seam.url-pattern=URL-Pattern
-Seam.disabled=Disabled
-Seam.regex-url-pattern=Regex-URL-Pattern
-Seam.create-temp-files=Create-Temp-Files
-Seam.max-request-size=Max-Request-Size
-Seam.invalidate-on-scheme-change=Invalidate-on-Scheme-Change
-Seam.application-class=Application-Class
-Seam.application-factory-class=Application-Factory-Class
-Seam.detect-portlet-context=Detect-Portlet-Context
+CDI.name=Name
+CDI.value=Value
+CDI.class=Class
+CDI.stereotype=Stereotype
+CDI.pattern=Pattern
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/help/keys-cdi.properties
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/help/keys-cdi.properties 2010-09-14
15:06:48 UTC (rev 24916)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/help/keys-cdi.properties 2010-09-14
15:27:36 UTC (rev 24917)
@@ -1 +1,29 @@
-FileCDIBeans.editorTitle=Beans XML 1.0 Editor
\ No newline at end of file
+FileCDIBeans.editorTitle=Beans XML 1.0 Editor
+
+FileCDIBeans_Properties.Title=File CDI beans.xml
+
+CDIWeldScan_Properties.Title=Weld Scan
+
+CDIWeldScan_AddItem_0.WindowTitle=Add Include/Exclude
+CDIWeldScan_AddItem_0.Title=Weld Include/Exclude
+
+CDIWeldClass_Properties.Title=Weld If Class Available
+
+CDIWeldExclude_Properties.Title=Weld Exclude
+
+CDIWeldExclude_AddClass.WindowTitle=Add If Class Available
+CDIWeldExclude_AddClass.Title=Weld If Class Available
+
+CDIWeldExclude_AddProperty.WindowTitle=Add If System Property
+CDIWeldExclude_AddProperty.Title=Weld If System Property
+
+CDIWeldInclude_Properties.Title=Weld Include
+
+CDIWeldInclude_AddClass.WindowTitle=Add If Class Available
+CDIWeldInclude_AddClass.Title=Weld If Class Available
+
+CDIWeldInclude_AddProperty.WindowTitle=Add If System Property
+CDIWeldInclude_AddProperty.Title=Weld If System Property
+
+CDIWeldProperty_Properties.Title=Weld If System Property
+
Added: trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/meta/cdi-weld.meta
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/meta/cdi-weld.meta
(rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.xml/resources/meta/cdi-weld.meta 2010-09-14
15:27:36 UTC (rev 24917)
@@ -0,0 +1,446 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE XModelEntityGroup PUBLIC "-//Red Hat, Inc.//DTD Meta 1.0//EN"
+ "meta.dtd">
+<XModelEntityGroup>
+ <VERSION DEPENDS="Model:1.0" MODULE="CDI"
VERSION="1.0"/>
+ <MAPPINGS>
+ <MAPPING name="CDINamespaces">
+ <PAIR name="weld"
value="http://jboss.org/schema/weld/beans"/>
+ </MAPPING>
+ <MAPPING name="CDISchemas">
+ <PAIR name="weld"
value="http://jboss.org/schema/weld/beans_1_1.xsd"/>
+ </MAPPING>
+ </MAPPINGS>
+ <ICONS>
+ <GROUP name="action">
+ <GROUP name="new">
+ <GROUP name="cdi"/>
+ </GROUP>
+ </GROUP>
+ <GROUP name="main">
+ <GROUP name="cdi">
+ <GROUP name="weld">
+ <ICON name="exclude"
path="plugin:org.jboss.tools.cdi.xml:images/exclude.gif"/>
+ <ICON name="include"
path="plugin:org.jboss.tools.cdi.xml:images/include.gif"/>
+ <ICON name="scan" path="images/struts/plug_in.gif"/>
+ </GROUP>
+ </GROUP>
+ </GROUP>
+ </ICONS>
+ <GlobalActions kind="list"/>
+ <XModelEntity ImplementingClass="%Custom%"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.cdi.xml.ui.editor.form.CDIXMLFormLayoutData"
+ XMLSUBPATH="weld:if-class-available" name="CDIWeldClass">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.cdi.weld.scan" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="if-class-available"
loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general;save=always"
+ name="name" xmlname="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 Class Available" kind="action"
name="AddClass">
+ <EntityData EntityName="CDIWeldClass">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add System Property" kind="action"
name="AddProperty">
+ <EntityData EntityName="CDIWeldProperty">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ <XActionItem BaseActionName="Copy" 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="org.jboss.tools.cdi.xml.beans.model.WeldIncludeObjectImpl"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.cdi.xml.ui.editor.form.CDIXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="weld:exclude" name="CDIWeldExclude">
+ <XChildrenEntities>
+ <XChildEntity name="CDIWeldClass"/>
+ <XChildEntity name="CDIWeldProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.cdi.weld.exclude" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="exclude" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute name="name/pattern" visibility="false"/>
+ <XModelAttribute PROPERTIES="id=true;category=general"
name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="id=true;category=general"
name="pattern" xmlname="pattern"/>
+ <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 Class Available" kind="action"
name="AddClass">
+ <EntityData EntityName="CDIWeldClass">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add System Property" kind="action"
name="AddProperty">
+ <EntityData EntityName="CDIWeldProperty">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ <XActionItem BaseActionName="Copy" 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="org.jboss.tools.cdi.xml.beans.model.WeldIncludeObjectImpl"
+
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.cdi.xml.ui.editor.form.CDIXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="weld:include" name="CDIWeldInclude">
+ <XChildrenEntities>
+ <XChildEntity name="CDIWeldClass"/>
+ <XChildEntity name="CDIWeldProperty"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.cdi.weld.include" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="include" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute name="name/pattern" visibility="false"/>
+ <XModelAttribute PROPERTIES="id=true;category=general"
name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="id=true;category=general"
name="pattern" xmlname="pattern"/>
+ <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 Class Available" kind="action"
name="AddClass">
+ <EntityData EntityName="CDIWeldClass">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add System Property" kind="action"
name="AddProperty">
+ <EntityData EntityName="CDIWeldProperty">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ <XActionItem BaseActionName="Copy" 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 name="CDIWeldIncludeWizard">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.cdi.weld.include" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute PROPERTIES="horizontal=true;label=false"
+ default="include" name="kind">
+ <Constraint loader="List">
+ <value name="include"/>
+ <value name="exclude"/>
+ </Constraint>
+ <Editor name="RadioArray"/>
+ </XModelAttribute>
+ <XModelAttribute name="name/pattern"/>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="false" name="is regular expression">
+ <Constraint loader="List">
+ <value name="false"/>
+ <value name="true"/>
+ </Constraint>
+ <Editor name="CheckBox"/>
+ </XModelAttribute>
+ <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 Class Available" kind="action"
name="AddClass">
+ <EntityData EntityName="CDIWeldClass">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add System Property" kind="action"
name="AddProperty">
+ <EntityData EntityName="CDIWeldProperty">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ <XActionItem BaseActionName="Copy" 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.cdi.xml.ui.editor.form.CDIXMLFormLayoutData"
+ XMLSUBPATH="weld:if-system-property" name="CDIWeldProperty">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.cdi.weld.scan" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="if-system-property"
loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general" name="value"
xmlname="value"/>
+ <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 Class Available" kind="action"
name="AddClass">
+ <EntityData EntityName="CDIWeldClass">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add System Property" kind="action"
name="AddProperty">
+ <EntityData EntityName="CDIWeldProperty">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ <XActionItem BaseActionName="Copy" 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.cdi.xml.ui.editor.form.CDIXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="weld:scan" name="CDIWeldScan">
+ <XChildrenEntities>
+ <XChildEntity name="CDIWeldInclude"/>
+ <XChildEntity name="CDIWeldExclude"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.cdi.weld.scan" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="scan" loader="ElementType"
name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
default="Scan"
+ name="name" visibility="false">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment"
visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
+
PROPERTIES="validator.add=true;support=org.jboss.tools.cdi.xml.beans.model.handlers.AddIncludeSupport;entity=CDIWeldInclude"
+ displayName="Add Include/Exclude" kind="action"
name="AddItem">
+ <EntityData EntityName="CDIWeldIncludeWizard">
+ <AttributeData AttributeName="kind" Mandatory="no"/>
+ <AttributeData AttributeName="name/pattern"/>
+ <AttributeData AttributeName="is regular expression"
Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create"
kind="list" name="EditActions">
+ <XActionItemReference entity="SeamComponent" name="Rename"
path="EditActions/Rename"/>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy"
kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action"
name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action"
name="Cut"/>
+ </XActionItem>
+ <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="FileCDIBeans">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="CDIWeldScan"/>
+ </XChildrenEntities>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New"
group="1"
+ kind="list" name="CreateActions">
+ <XActionItem ICON="action.empty" displayName="Weld"
group="1"
+ kind="list" name="Weld">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" displayName="Scan..."
+ kind="action" name="AddScan">
+ <EntityData EntityName="CDIWeldScan"/>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XEntityExtension>
+ <XEntityExtension name="FileCDIBeans_EditorActionList">
+ <XChildrenEntities/>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New"
group="1"
+ kind="list" name="CreateActions">
+ <XActionItem ICON="action.empty" displayName="Weld"
group="1"
+ kind="list" name="Weld">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" displayName="Scan..."
+ kind="action" name="AddScan">
+ <EntityData EntityName="CDIWeldScan"/>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ </XEntityExtension>
+</XModelEntityGroup>
Added: trunk/cdi/plugins/org.jboss.tools.cdi.xml/schemas/beans_1_1.xsd
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.xml/schemas/beans_1_1.xsd
(rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.xml/schemas/beans_1_1.xsd 2010-09-14 15:27:36
UTC (rev 24917)
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+ JBoss, Home of Professional Open Source Copyright 2008, Red Hat
+ Middleware LLC, and individual contributors by the @authors tag.
+ See the copyright.txt in the distribution for a full listing of
+ individual contributors. Licensed under the Apache License,
+ Version 2.0 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License
+ at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+ applicable law or agreed to in writing, software distributed under
+ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+ OR CONDITIONS OF ANY KIND, either express or implied. See the
+ License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+
targetNamespace="http://jboss.org/schema/weld/beans"
+
xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+
xmlns:weld="http://jboss.org/schema/weld/beans"
+ version="1.1">
+
+ <xs:annotation>
+ <xs:documentation>
+ Weld defines a number of extensions to beans.xml, in the namespace
+
http://jboss.org/schema/weld/beans
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:element name="scan">
+ <xs:annotation>
+ <xs:documentation>
+ <scan> provides fine control over the classes loaded by
+ Weld for scanning by nesting a number of include and exclude
+ filters. Exclusions cause the class to not be loaded, not have
+ any container lifecycle events fired for them, and not be deployed
+ as beans.
+
+ In general, the semantics defined by Ant's pattern
+ sets (
http://ant.apache.org/manual/dirtasks.html#patternset)
+ are followed. If no include filters are defined, all classes are
+ included. If both include filters and excludes filters are provided,
+ only class names which match at least one include filter and don't
+ match any exclude filter are scanned.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:choice minOccurs="0" maxOccurs="unbounded">
+ <xs:element ref="weld:include" />
+ <xs:element ref="weld:exclude" />
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="include" type="weld:filter">
+ <xs:annotation>
+ <xs:documentation>
+ An include filter causes a class to be scanned. If no include filters
+ are specified, then all classes are scanned. If both include filters
+ and excludes filters are specified, only class names which match at
+ least one include filter and don't match any exclude filter are
+ scanned.
+
+ A filter may specify match against either the name of a class (or
+ package) or a regular expression to match.
+
+ A filter is active by default, or may specify activation conditions. If
+ activation conditions are specified, then the filter is active only if
+ all activation conditions are met. If all conditions are met, then
+ classes matching either the name or pattern will be filtered.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:element name="exclude" type="weld:filter">
+ <xs:annotation>
+ <xs:documentation>
+ An exclude filter causes a class to not be scanned. If no exclude
+ filters are specified, then all classes are scanned. If both include
+ filters and excludes filters are specified, only class names which
+ match at least one include filter and don't match any exclude filter
+ are scanned.
+
+ A filter may specify match against either the name of a class (or
+ package) or a regular expression to match.
+
+ A filter is active by default, or may specify activation conditions. If
+ activation conditions are specified, then the filter is active only if
+ all activation conditions are met. If all conditions are met, then
+ classes matching either the name or pattern will be filtered.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+
+ <xs:attributeGroup name="filter-attributes"
id="filter-attributes">
+ <xs:attribute name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>
+ The filter applies to classes whose fully qualified name matches this
+ pattern. Ant-style patterns (see
+
http://ant.apache.org/manual/dirtasks.html#patterns) are used, such that
+ '*' matches zero or more characters (in the current package) and
'?'
+ matches one character in the current package. Additionally, '**'
matches
+ this package, and all sub packages.
+
+ For example:
+ com.redhat.J???? will match any class in the com.redhat package,
+ whose name starts with the letter 'J' and is five characters
long.
+ com.redhat.R* will match any class in the com.redhat package, whose name
+ starts with the letter 'R'.
+ com.redhat.* will match any class in the com.redhat package, but not
+ subpackages.
+ com.redhat.** will match any class in the com.redhat package, and all
+ subpackages.
+
+ If you wish to use a Java regular expression, then pattern should be
used.
+ Only one of name or pattern should be specified
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="pattern" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>
+ The filter applies to classes whose fully qualified name matches this
+ regular expression.
+
+ If you wish to use a simple, Ant-style pattern, then name should be used.
+ Only one of name or pattern should be specified
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:attributeGroup>
+
+ <xs:complexType name="filter" id="filter">
+ <xs:choice maxOccurs="unbounded" minOccurs="0">
+ <xs:element name="if-class-available">
+ <xs:annotation>
+ <xs:documentation>
+ Activate the filter only activated if a class with the specified name
+ is available on the application's classpath. If the name starts
with
+ a !, then the filter is active if the class is not available
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"
use="required"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="if-system-property">
+ <xs:annotation>
+ <xs:documentation>
+ Activate the filter only if the specified system property is set.
+ If no value is specified, then it will match the system property
+ on property name alone. If the property name starts with a !, then
+ the filter is active if the property is not set. If the property
value
+ starts with a !, then the filter is active if the property values do
+ not match.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"
use="required"/>
+ <xs:attribute name="value" type="xs:string" />
+ </xs:complexType>
+ </xs:element>
+ </xs:choice>
+ <xs:attributeGroup ref="weld:filter-attributes" />
+ </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.xml/schemas/beans_1_1.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/WeldIncludeObjectImpl.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/WeldIncludeObjectImpl.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/WeldIncludeObjectImpl.java 2010-09-14
15:27:36 UTC (rev 24917)
@@ -0,0 +1,22 @@
+package org.jboss.tools.cdi.xml.beans.model;
+
+import org.jboss.tools.common.model.impl.CustomizedObjectImpl;
+
+public class WeldIncludeObjectImpl extends CustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public String name() {
+ String name = getAttributeValue("name");
+ if(name == null || name.length() == 0) {
+ name = getAttributeValue("pattern");
+ }
+ return name;
+ }
+
+ public String getAttributeValue(String name) {
+ if("name/pattern".equals(name)) {
+ return name();
+ }
+ return super.getAttributeValue(name);
+ }
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/WeldIncludeObjectImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/handlers/AddIncludeSupport.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/handlers/AddIncludeSupport.java
(rev 0)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/handlers/AddIncludeSupport.java 2010-09-14
15:27:36 UTC (rev 24917)
@@ -0,0 +1,54 @@
+package org.jboss.tools.cdi.xml.beans.model.handlers;
+
+import java.util.Properties;
+
+import org.jboss.tools.common.meta.XChild;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.meta.action.impl.handlers.DefaultCreateHandler;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.FindObjectHelper;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+
+public class AddIncludeSupport extends SpecialWizardSupport {
+
+ @Override
+ public void action(String name) throws XModelException {
+ if(FINISH.equals(name)) {
+ execute();
+ setFinished(true);
+ } else if(CANCEL.equals(name)) {
+ setFinished(true);
+ } else if(HELP.equals(name)) {
+ help();
+ }
+ }
+
+ protected void execute() throws XModelException {
+ Properties p0 = extractStepData(0);
+ boolean include = "include".equals(p0.getProperty("kind"));
+ String entity = getObjectEntity(include);
+
+ XModelObject object = XModelObjectLoaderUtil.createValidObject(getTarget().getModel(),
entity, null);
+
+ boolean isRegEx = "true".equals(p0.getProperty("is regular
expression"));
+ String nameValue = p0.getProperty("name/pattern");
+ String nameAttr = isRegEx ? "pattern" : "name";
+ object.setAttributeValue(nameAttr, nameValue);
+
+ DefaultCreateHandler.addCreatedObject(getTarget(), object,
FindObjectHelper.EVERY_WHERE);
+ }
+
+ String getObjectEntity(boolean include) {
+ XChild[] cs = getTarget().getModelEntity().getChildren();
+ String search = include ? "Include" : "Exclude";
+ for (XChild c: cs) {
+ String name = c.getName();
+ if(name.indexOf(search) >= 0) {
+ return name;
+ }
+ }
+ return null;
+ }
+
+}
Property changes on:
trunk/cdi/plugins/org.jboss.tools.cdi.xml/src/org/jboss/tools/cdi/xml/beans/model/handlers/AddIncludeSupport.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain