JBoss Tools SVN: r5968 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/webapp/form.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-01-25 10:01:51 -0500 (Fri, 25 Jan 2008)
New Revision: 5968
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/webapp/form/WebAppFoldersFormLayoutData.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/webapp/form/WebAppFormLayoutData.java
Log:
JBIDE-1680
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/webapp/form/WebAppFoldersFormLayoutData.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/webapp/form/WebAppFoldersFormLayoutData.java 2008-01-25 15:01:14 UTC (rev 5967)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/webapp/form/WebAppFoldersFormLayoutData.java 2008-01-25 15:01:51 UTC (rev 5968)
@@ -20,6 +20,7 @@
static String FILTER_FOLDER_ENTITY = "WebAppFolderFilters"; //$NON-NLS-1$
static String FILTER_FOLDER_24_ENTITY = "WebAppFolderFilters24"; //$NON-NLS-1$
static String LISTENER_FOLDER_ENTITY = "WebAppFolderListeners"; //$NON-NLS-1$
+ static String LISTENER_FOLDER_24_ENTITY = "WebAppFolderListeners24"; //$NON-NLS-1$
static String SERVLET_FOLDER_ENTITY = "WebAppFolderServlets"; //$NON-NLS-1$
static String MIME_FOLDER_ENTITY = "WebAppFolderMimeMappings"; //$NON-NLS-1$
static String ERROR_FOLDER_ENTITY = "WebAppFolderErrorPages"; //$NON-NLS-1$
@@ -91,6 +92,18 @@
LISTENER_LIST_DEFINITION
};
+ static IFormData LISTENER_24_LIST_DEFINITION = new FormData(
+ "Listeners",
+ EMPTY_DESCRIPTION,
+ new FormAttributeData[]{new FormAttributeData("listener-class", 100)}, //$NON-NLS-1$
+ new String[]{WebAppHelper.LISTENER_24_ENTITY},
+ FormLayoutDataUtil.createDefaultFormActionData("CreateActions.CreateListener") //$NON-NLS-1$
+ );
+
+ static IFormData[] LISTENER_FOLDER_24_DEFINITIONS = new IFormData[]{
+ LISTENER_24_LIST_DEFINITION
+ };
+
static IFormData SERVLET_LIST_DEFINITION = new FormData(
"Servlets",
EMPTY_DESCRIPTION,
@@ -264,6 +277,9 @@
final static IFormData LISTENER_FOLDER_DEFINITION = new FormData(
LISTENER_FOLDER_ENTITY, new String[]{null}, LISTENER_FOLDER_DEFINITIONS);
+ final static IFormData LISTENER_FOLDER_24_DEFINITION = new FormData(
+ LISTENER_FOLDER_24_ENTITY, new String[]{null}, LISTENER_FOLDER_24_DEFINITIONS);
+
final static IFormData SERVLET_FOLDER_DEFINITION = new FormData(
SERVLET_FOLDER_ENTITY, new String[]{null}, SERVLET_FOLDER_DEFINITIONS);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/webapp/form/WebAppFormLayoutData.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/webapp/form/WebAppFormLayoutData.java 2008-01-25 15:01:14 UTC (rev 5967)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/editors/webapp/form/WebAppFormLayoutData.java 2008-01-25 15:01:51 UTC (rev 5968)
@@ -32,6 +32,7 @@
WebAppFoldersFormLayoutData.FILTER_FOLDER_DEFINITION,
WebAppFoldersFormLayoutData.FILTER_FOLDER_24_DEFINITION,
WebAppFoldersFormLayoutData.LISTENER_FOLDER_DEFINITION,
+ WebAppFoldersFormLayoutData.LISTENER_FOLDER_24_DEFINITION,
WebAppFoldersFormLayoutData.SERVLET_FOLDER_DEFINITION,
WebAppFoldersFormLayoutData.MIME_FOLDER_DEFINITION,
WebAppFoldersFormLayoutData.ERROR_FOLDER_DEFINITION,
18 years, 2 months
JBoss Tools SVN: r5967 - in trunk/jst/plugins/org.jboss.tools.jst.web: resources/meta and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-01-25 10:01:14 -0500 (Fri, 25 Jan 2008)
New Revision: 5967
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/WebAppHelper.java
Log:
JBIDE-1680
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties 2008-01-25 15:00:35 UTC (rev 5966)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/help/keys-web.properties 2008-01-25 15:01:14 UTC (rev 5967)
@@ -383,9 +383,17 @@
WebAppFolderFilters24_CreateFilterMapping.WindowTitle=Add Filter Mapping
WebAppFolderFilters24_CreateFilterMapping.Title=Filter Mapping
+WebAppFolderListeners_Properties.WindowTitle=Properties
+WebAppFolderListeners_Properties.Title=Web Listeners
+WebAppFolderListeners24_Properties.WindowTitle=Properties
+WebAppFolderListeners24_Properties.Title=Web Listeners
+
WebAppFolderListeners_CreateListener.WindowTitle=Add Listener
WebAppFolderListeners_CreateListener.Title=Web Listener
+WebAppFolderListeners24_CreateListener.WindowTitle=Add Listener
+WebAppFolderListeners24_CreateListener.Title=Web Listener
+
WebAppFolderServices_CreateServiceRef.WindowTitle=Add Service Ref
WebAppFolderServices_CreateServiceRef.Title=Service Ref
@@ -669,6 +677,9 @@
WebAppListener_Properties.WindowTitle=Properties
WebAppListener_Properties.Title=Web Listener
+WebAppListener24_Properties.WindowTitle=Properties
+WebAppListener24_Properties.Title=Web Listener
+
##### jsp config #####
WebAppJspConfig=/struts/noHelpYet.html
WebAppJspConfig_Properties=/struts/noHelpYet.html
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta 2008-01-25 15:00:35 UTC (rev 5966)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta 2008-01-25 15:01:14 UTC (rev 5967)
@@ -93,7 +93,7 @@
<XChildrenEntities>
<XChildEntity maxCount="1" name="WebAppFolderContextParams" required="yes"/>
<XChildEntity maxCount="1" name="WebAppFolderFilters24" required="yes"/>
- <XChildEntity maxCount="1" name="WebAppFolderListeners" required="yes"/>
+ <XChildEntity maxCount="1" name="WebAppFolderListeners24" required="yes"/>
<XChildEntity maxCount="1" name="WebAppFolderServlets" required="yes"/>
<XChildEntity maxCount="1" name="WebAppSessionConfig" required="yes"/>
<XChildEntity maxCount="1" name="WebAppFolderMimeMappings" required="yes"/>
@@ -117,19 +117,13 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="deployment descriptor" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general" name="name" xmlname="NAME">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="name" xmlname="NAME"/>
<XModelAttribute default="xml" name="extension" xmlname="EXTENSION">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute loader="ElementType" name="_lateload" visibility="false">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute default="no" name="isIncorrect" visibility="false">
@@ -139,10 +133,7 @@
</Constraint>
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute name="incorrectBody" visibility="false">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="incorrectBody" visibility="false"/>
<XModelAttribute default="false" name="expanded" visibility="false">
<Constraint loader="List">
<value name="false"/>
@@ -151,26 +142,14 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="save=always"
- default="http://java.sun.com/xml/ns/j2ee" name="xmlns" xmlname="xmlns">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ default="http://java.sun.com/xml/ns/j2ee" name="xmlns" xmlname="xmlns"/>
<XModelAttribute PROPERTIES="save=always"
- default="http://www.w3.org/2001/XMLSchema-instance" name="xmlns:xsi" xmlname="xmlns:xsi">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ default="http://www.w3.org/2001/XMLSchema-instance" name="xmlns:xsi" xmlname="xmlns:xsi"/>
<XModelAttribute PROPERTIES="save=always"
default="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- name="xsi:schemaLocation" xmlname="xsi:schemaLocation">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ name="xsi:schemaLocation" xmlname="xsi:schemaLocation"/>
<XModelAttribute PROPERTIES="save=always" default="2.4"
- name="version" visibility="false" xmlname="version">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ name="version" visibility="false" xmlname="version"/>
<XModelAttribute PROPERTIES="category=advanced" name="small-icon" xmlname="icon.small-icon.#text">
<Constraint loader="Tree">
<value name="WebPageTree"/>
@@ -185,12 +164,8 @@
</Constraint>
<Editor name="TreeChooser"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general" name="display-name" xmlname="display-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="display-name" xmlname="display-name.#text"/>
<XModelAttribute PROPERTIES="category=general" name="description" xmlname="description.#text">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" default="no"
@@ -201,12 +176,8 @@
</Constraint>
<Editor name="List"/>
</XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" default="UTF-8" name="encoding">
@@ -586,7 +557,7 @@
<XChildrenEntities>
<XChildEntity maxCount="1" name="WebAppFolderContextParams" required="yes"/>
<XChildEntity maxCount="1" name="WebAppFolderFilters24" required="yes"/>
- <XChildEntity maxCount="1" name="WebAppFolderListeners" required="yes"/>
+ <XChildEntity maxCount="1" name="WebAppFolderListeners24" required="yes"/>
<XChildEntity maxCount="1" name="WebAppFolderServlets" required="yes"/>
<XChildEntity maxCount="1" name="WebAppSessionConfig" required="yes"/>
<XChildEntity maxCount="1" name="WebAppFolderMimeMappings" required="yes"/>
@@ -610,19 +581,13 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="deployment descriptor" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general" name="name" xmlname="NAME">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="name" xmlname="NAME"/>
<XModelAttribute default="xml" name="extension" xmlname="EXTENSION">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute loader="ElementType" name="_lateload" visibility="false">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute default="no" name="isIncorrect" visibility="false">
@@ -632,10 +597,7 @@
</Constraint>
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute name="incorrectBody" visibility="false">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="incorrectBody" visibility="false"/>
<XModelAttribute default="false" name="expanded" visibility="false">
<Constraint loader="List">
<value name="false"/>
@@ -644,26 +606,14 @@
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="save=always"
- default="http://java.sun.com/xml/ns/javaee" name="xmlns" xmlname="xmlns">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ default="http://java.sun.com/xml/ns/javaee" name="xmlns" xmlname="xmlns"/>
<XModelAttribute PROPERTIES="save=always"
- default="http://www.w3.org/2001/XMLSchema-instance" name="xmlns:xsi" xmlname="xmlns:xsi">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ default="http://www.w3.org/2001/XMLSchema-instance" name="xmlns:xsi" xmlname="xmlns:xsi"/>
<XModelAttribute PROPERTIES="save=always"
default="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- name="xsi:schemaLocation" xmlname="xsi:schemaLocation">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ name="xsi:schemaLocation" xmlname="xsi:schemaLocation"/>
<XModelAttribute PROPERTIES="save=always" default="2.4"
- name="version" visibility="false" xmlname="version">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ name="version" visibility="false" xmlname="version"/>
<XModelAttribute PROPERTIES="category=advanced" name="small-icon" xmlname="icon.small-icon.#text">
<Constraint loader="Tree">
<value name="WebPageTree"/>
@@ -678,12 +628,8 @@
</Constraint>
<Editor name="TreeChooser"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general" name="display-name" xmlname="display-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="display-name" xmlname="display-name.#text"/>
<XModelAttribute PROPERTIES="category=general" name="description" xmlname="description.#text">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" default="no"
@@ -703,12 +649,8 @@
</Constraint>
<Editor name="List"/>
</XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" default="UTF-8" name="encoding">
@@ -1090,21 +1032,11 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="filter mapping" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="id=true;save=always" name="filter-name" xmlname="filter-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute PROPERTIES="id=true" name="url-pattern" xmlname="url-pattern.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute PROPERTIES="id=true;save=always" name="servlet-name" xmlname="servlet-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;save=always" name="filter-name" xmlname="filter-name.#text"/>
+ <XModelAttribute PROPERTIES="id=true" name="url-pattern" xmlname="url-pattern.#text"/>
+ <XModelAttribute PROPERTIES="id=true;save=always" name="servlet-name" xmlname="servlet-name.#text"/>
<XModelAttribute name="dispatchers" xmlname="dispatchers">
<Constraint loader="ListAdd">
<value name="FORWARD"/>
@@ -1114,12 +1046,8 @@
</Constraint>
<Editor name="ListAdd"/>
</XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
</XModelAttributes>
@@ -1158,11 +1086,9 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="filters" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;" default="Filters" name="name" xmlname="NAME">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
</XModelAttributes>
@@ -1213,6 +1139,57 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.jst.web.ui.editors.webapp.form.WebAppFormLayoutData;children=%Ordered%" name="WebAppFolderListeners24">
+ <XChildrenEntities>
+ <XChildEntity name="WebAppListener24"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.jsf.components" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="listeners" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;" default="Listeners"
+ name="name" xmlname="NAME">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%CreateForWeb23%"
+ ICON="action.new.struts.webapp.listener"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Listener..." kind="action" name="CreateListener">
+ <EntityData EntityName="WebAppListener24">
+ <AttributeData AttributeName="listener-class"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ <XActionItem BaseActionName="Copy" HandlerClassName="%CopyChildren%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ </XActionItem>
+ <XActionItem kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete"
+ HandlerClassName="%DeleteChildren%" 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>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.jst.web.ui.editors.webapp.form.WebAppFormLayoutData"
XMLSUBPATH="jsp-property-group" name="WebAppJSPPropertyGroup">
<XChildrenEntities/>
@@ -1223,21 +1200,15 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="jsp property group" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute name="name" visibility="false" xmlname="#text">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" name="description" xmlname="description.#text">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced" name="display-name" xmlname="display-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced" name="display-name" xmlname="display-name.#text"/>
<XModelAttribute PROPERTIES="category=advanced" name="small-icon" xmlname="icon.small-icon.#text">
<Constraint loader="Tree">
<value name="WebPageTree"/>
@@ -1253,10 +1224,7 @@
<Editor name="TreeChooser"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;save=always;category=general"
- name="url-pattern" xmlname="url-pattern.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ name="url-pattern" xmlname="url-pattern.#text"/>
<XModelAttribute PROPERTIES="category=general" name="el-ignored" xmlname="el-ignored.#text">
<Constraint loader="List">
<value name="true"/>
@@ -1265,10 +1233,7 @@
</Constraint>
<Editor name="List"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general" name="page-encoding" xmlname="page-encoding.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="page-encoding" xmlname="page-encoding.#text"/>
<XModelAttribute PROPERTIES="category=general"
name="scripting-invalid" xmlname="scripting-invalid.#text">
<Constraint loader="List">
@@ -1286,20 +1251,10 @@
</Constraint>
<Editor name="List"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=general" name="include-prelude" xmlname="include-prelude.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute PROPERTIES="category=general" name="include-coda" xmlname="include-coda.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="include-prelude" xmlname="include-prelude.#text"/>
+ <XModelAttribute PROPERTIES="category=general" name="include-coda" xmlname="include-coda.#text"/>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
</XModelAttributes>
@@ -1339,19 +1294,13 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="jsp config" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute default="JSP Config" name="name" xmlname="NAME">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
</XModelAttributes>
@@ -1396,6 +1345,63 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%" XMLSUBPATH="listener" name="WebAppListener24">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.struts.webapp.listener" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="listener" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute name="description" xmlname="description.#text">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ <XModelAttribute name="display-name" xmlname="display-name.#text"/>
+ <XModelAttribute name="small-icon" xmlname="icon.small-icon.#text">
+ <Constraint loader="Tree">
+ <value name="WebPageTree"/>
+ <value name="extensions=gif,jpg"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
+ <XModelAttribute name="large-icon" xmlname="icon.large-icon.#text">
+ <Constraint loader="Tree">
+ <value name="WebPageTree"/>
+ <value name="extensions=gif,jpg"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true" name="listener-class" xmlname="listener-class.#text">
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <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>
+ <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.jst.web.webapp.model.WebAppLocaleEncodingMappingImpl"
XMLSUBPATH="locale-encoding-mapping" name="WebAppLocaleEncodingMapping">
@@ -1408,23 +1414,12 @@
<XModelAttributes>
<XModelAttribute default="locale-encoding-mapping"
loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute name="locale" xmlname="locale.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="encoding" xmlname="encoding.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="locale" xmlname="locale.#text"/>
+ <XModelAttribute name="encoding" xmlname="encoding.#text"/>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
</XModelAttributes>
@@ -1464,20 +1459,14 @@
<XModelAttributes>
<XModelAttribute default="locale-encoding-mapping-list"
loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute default="locale-encoding-mapping-list" name="name"
visibility="false" xmlname="NAME">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
</XModelAttributes>
@@ -1526,17 +1515,12 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="message destination" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute name="description" xmlname="description.#text">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
- <XModelAttribute name="display-name" xmlname="display-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="display-name" xmlname="display-name.#text"/>
<XModelAttribute name="small-icon" xmlname="icon.small-icon.#text">
<Constraint loader="Tree">
<value name="WebPageTree"/>
@@ -1552,16 +1536,9 @@
<Editor name="TreeChooser"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="save=always;id=true"
- name="message-destination-name" xmlname="message-destination-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ name="message-destination-name" xmlname="message-destination-name.#text"/>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
</XModelAttributes>
@@ -1599,21 +1576,15 @@
<XModelAttributes>
<XModelAttribute default="message destination reference"
loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute name="description" xmlname="description.#text">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="save=always;id=true"
- name="message-destination-ref-name" xmlname="message-destination-ref-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ name="message-destination-ref-name" xmlname="message-destination-ref-name.#text"/>
<XModelAttribute PROPERTIES="save=always"
name="message-destination-type" xmlname="message-destination-type.#text">
- <Constraint/>
<Editor name="AccessibleJava"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="save=always"
@@ -1626,16 +1597,9 @@
</Constraint>
<Editor name="List"/>
</XModelAttribute>
- <XModelAttribute name="message-destination-link" xmlname="message-destination-link.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="message-destination-link" xmlname="message-destination-link.#text"/>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
</XModelAttributes>
@@ -1672,17 +1636,12 @@
</XEntityRenderer>
<XModelAttributes>
<XModelAttribute default="service reference" loader="ElementType" name="element type">
- <Constraint/>
<Editor name="Uneditable"/>
</XModelAttribute>
<XModelAttribute name="description" xmlname="description.#text">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
- <XModelAttribute name="display-name" xmlname="display-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="display-name" xmlname="display-name.#text"/>
<XModelAttribute name="small-icon" xmlname="icon.small-icon.#text">
<Constraint loader="Tree">
<value name="WebPageTree"/>
@@ -1697,40 +1656,17 @@
</Constraint>
<Editor name="TreeChooser"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="save=always" name="service-ref-name" xmlname="service-ref-name.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute PROPERTIES="save=always" name="service-ref-name" xmlname="service-ref-name.#text"/>
<XModelAttribute PROPERTIES="save=always" name="service-interface" xmlname="service-interface.#text">
- <Constraint/>
<Editor name="AccessibleJava"/>
</XModelAttribute>
- <XModelAttribute name="wsdl-file" xmlname="wsdl-file.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="jaxrpc-mapping-file" xmlname="jaxrpc-mapping-file.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="service-qname" xmlname="service-qname.#text">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="port-component-ref" xmlname="port-component-refs">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="handler" xmlname="handlers">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
- <XModelAttribute name="id" visibility="false" xmlname="id">
- <Constraint/>
- <Editor/>
- </XModelAttribute>
+ <XModelAttribute name="wsdl-file" xmlname="wsdl-file.#text"/>
+ <XModelAttribute name="jaxrpc-mapping-file" xmlname="jaxrpc-mapping-file.#text"/>
+ <XModelAttribute name="service-qname" xmlname="service-qname.#text"/>
+ <XModelAttribute name="port-component-ref" xmlname="port-component-refs"/>
+ <XModelAttribute name="handler" xmlname="handlers"/>
+ <XModelAttribute name="id" visibility="false" xmlname="id"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
- <Constraint/>
<Editor name="Note"/>
</XModelAttribute>
</XModelAttributes>
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/WebAppHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/WebAppHelper.java 2008-01-25 15:00:35 UTC (rev 5966)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/WebAppHelper.java 2008-01-25 15:01:14 UTC (rev 5967)
@@ -24,6 +24,7 @@
public static String FILTER_MAPPING_ENTITY = "WebAppFilterMapping";
public static String FILTER_MAPPING_24_ENTITY = "WebAppFilterMapping24";
public static String LISTENER_ENTITY = "WebAppListener";
+ public static String LISTENER_24_ENTITY = "WebAppListener24";
public static String SERVLET_ENTITY = "WebAppServlet";
public static String SERVLET_MAPPING_ENTITY = "WebAppServletMapping";
public static String TAGLIB_ENTITY = "WebAppTaglib";
18 years, 2 months
JBoss Tools SVN: r5966 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-01-25 10:00:35 -0500 (Fri, 25 Jan 2008)
New Revision: 5966
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
Log:
final save of config used the wrong launchconfiguration.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2008-01-25 14:59:42 UTC (rev 5965)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/AddConfigurationAction.java 2008-01-25 15:00:35 UTC (rev 5966)
@@ -88,6 +88,7 @@
if(i!=Window.OK) {
saved.delete();
} else {
+ wc = saved.getWorkingCopy();
wc.setAttribute(TEMPORARY_CONFIG_FLAG, (String)null); // Must be set to null since it should never be in the actual saved configuration!
wc.doSave();
}
18 years, 2 months
JBoss Tools SVN: r5965 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-01-25 09:59:42 -0500 (Fri, 25 Jan 2008)
New Revision: 5965
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenQueryEditorAction.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1620
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java 2008-01-25 14:22:35 UTC (rev 5964)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/CriteriaEditorAction.java 2008-01-25 14:59:42 UTC (rev 5965)
@@ -21,10 +21,14 @@
*/
package org.hibernate.eclipse.console.actions;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.osgi.util.NLS;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
public class CriteriaEditorAction extends OpenQueryEditorAction {
public CriteriaEditorAction() {
@@ -36,6 +40,56 @@
protected void openQueryEditor(ConsoleConfiguration config, String query) {
HibernateConsolePlugin.getDefault().openCriteriaEditor( config==null?null:config.getName(), query );
-
- }
+ }
+
+ /* (non-Javadoc)
+ * @see org.hibernate.eclipse.console.actions.OpenQueryEditorAction#generateQuery(org.eclipse.jface.viewers.TreePath)
+ */
+ protected String generateQuery(TreePath path) {
+ final String criteria = ".createCriteria({0})";
+ final String alias = "\n.createCriteria(\"{0}\", \"{1}\")";
+ final String projection = "\n.setProjection( Property.forName(\"{0}\").as(\"{0}\"))";
+ final String sess = "session";
+ String enCriteria = "";
+ String propCriteria = "";
+ String enName = "";
+ Object node = path.getLastSegment();
+ if (node instanceof PersistentClass){
+ enName = ((PersistentClass)node).getEntityName();
+ enName = enName.substring(enName.lastIndexOf('.') + 1);
+ } else if (node instanceof Property){
+ Property prop = (Property)node;
+ String prName = prop.getName();
+ PersistentClass pClass = ((Property)node).getPersistentClass();
+ if (pClass != null){
+ enName = pClass.getEntityName();
+ enName = enName.substring(enName.lastIndexOf('.') + 1);
+ if (prop.getValue().isSimpleValue()) {
+ propCriteria = NLS.bind(projection, prName);
+ } else {
+ propCriteria = NLS.bind(alias, prName, prName.charAt(0));
+ }
+ } else {
+ // Generate script for Component property
+ for (int i = path.getSegmentCount() - 1; i > 0; i--) {
+ if (path.getSegment(i) instanceof PersistentClass){
+ enName = ((PersistentClass)path.getSegment(i)).getEntityName();
+ enName = enName.substring(enName.lastIndexOf('.') + 1);
+ } else if (path.getSegment(i) instanceof Property){
+ prName = ((Property)path.getSegment(i)).getName();
+ if (prop.getValue().isSimpleValue()) {
+ propCriteria += NLS.bind(projection, prName);
+ } else {
+ propCriteria += NLS.bind(alias, prName, prName.charAt(0));
+ }
+ //propCriteria += NLS.bind(projection, prName);
+ }
+ }
+ }
+ } else {
+ return "";
+ }
+ enCriteria = NLS.bind(criteria, enName + ".class");
+ return sess + enCriteria + propCriteria + "\n.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP)";
+ }
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2008-01-25 14:22:35 UTC (rev 5964)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/HQLScratchpadAction.java 2008-01-25 14:59:42 UTC (rev 5965)
@@ -21,10 +21,13 @@
*/
package org.hibernate.eclipse.console.actions;
+import org.eclipse.jface.viewers.TreePath;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
public class HQLScratchpadAction extends OpenQueryEditorAction {
public HQLScratchpadAction() {
@@ -38,4 +41,34 @@
HibernateConsolePlugin.getDefault().openScratchHQLEditor(config==null?null:config.getName(), query);
}
+ /* (non-Javadoc)
+ * @see org.hibernate.eclipse.console.actions.OpenQueryEditorAction#generateQuery(org.eclipse.jface.viewers.TreePath)
+ */
+ protected String generateQuery(TreePath path) {
+ Object node = path.getLastSegment();
+ if (node instanceof PersistentClass){
+ String name = ((PersistentClass)node).getEntityName();
+ return "from " + name;
+ } else if (node instanceof Property){
+ String prName = ((Property)node).getName();
+ PersistentClass pClass = ((Property)node).getPersistentClass();
+ String enName = "";
+ if (pClass != null){
+ enName = pClass.getEntityName();
+ enName = enName.substring(enName.lastIndexOf('.') + 1);
+ } else {
+ // Generate script for Component property
+ for (int i = path.getSegmentCount() - 2; i > 0; i--) {
+ if (path.getSegment(i) instanceof PersistentClass){
+ enName = ((PersistentClass)path.getSegment(i)).getEntityName();
+ enName = enName.substring(enName.lastIndexOf('.') + 1);
+ } else if (path.getSegment(i) instanceof Property){
+ prName = ((Property)path.getSegment(i)).getName() + "." + prName;
+ }
+ }
+ }
+ return "select o." + prName + " from " + enName + " o";
+ }
+ return "";
+ }
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenQueryEditorAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenQueryEditorAction.java 2008-01-25 14:22:35 UTC (rev 5964)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenQueryEditorAction.java 2008-01-25 14:59:42 UTC (rev 5965)
@@ -1,18 +1,15 @@
package org.hibernate.eclipse.console.actions;
-import java.io.FileNotFoundException;
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.SelectionListenerAction;
import org.hibernate.HibernateException;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
+import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
public abstract class OpenQueryEditorAction extends SelectionListenerAction {
@@ -21,30 +18,38 @@
}
public void runWithEvent(Event event) {
- doRun();
- }
-
- protected void doRun() {
boolean showed = false;
IStructuredSelection sel = getStructuredSelection();
if (sel instanceof TreeSelection){
TreePath[] paths = ((TreeSelection)sel).getPaths();
- for (int i = 0; i < paths.length; i++) {
- TreePath path = paths[i];
- ConsoleConfiguration config = (ConsoleConfiguration) path.getSegment(0);
- try {
- openQueryEditor( config, "" );
- } catch(HibernateException he) {
- HibernateConsolePlugin.getDefault().showError(null, "Exception while trying to open HQL editor", he);
- }
- showed = true;
- }
+ showed = doRun(paths);
}
-
if(!showed) {
openQueryEditor( null, "" );
- }
+ }
}
+ protected boolean doRun(TreePath[] paths) {
+ boolean showed = false;
+ for (int i = 0; i < paths.length; i++) {
+ TreePath path = paths[i];
+ ConsoleConfiguration config = (ConsoleConfiguration) path.getSegment(0);
+ try {
+ openQueryEditor( config, generateQuery(path) );
+ showed = true;
+ } catch(HibernateException he) {
+ HibernateConsolePlugin.getDefault().showError(null, "Exception while trying to open HQL editor", he);
+ }
+ }
+ return showed;
+ }
+
protected abstract void openQueryEditor(final ConsoleConfiguration config, String query);
+
+ /**
+ * Generates default query for selected element.
+ * @param selection
+ * @return
+ */
+ protected abstract String generateQuery(TreePath path);
}
18 years, 2 months
JBoss Tools SVN: r5964 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-01-25 09:22:35 -0500 (Fri, 25 Jan 2008)
New Revision: 5964
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/AddViewSupport.java
Log:
JBIDE-1680
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/AddViewSupport.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/AddViewSupport.java 2008-01-25 12:48:09 UTC (rev 5963)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/AddViewSupport.java 2008-01-25 14:22:35 UTC (rev 5964)
@@ -223,8 +223,17 @@
return isCorrectPath(path) && !fileExists(path);
}
+ String FORBIDDEN_INDICES = "\"\n\t*\\:<>?|";
+
private boolean isCorrectPath(String path) {
if(path == null || path.equals("/") || path.indexOf("//") >= 0) return false;
+ if(path.endsWith("/") || path.indexOf("../") >= 0) return false;
+ if(path.endsWith("..")) return false;
+ for (int i = 0; i < FORBIDDEN_INDICES.length(); i++) {
+ if(path.indexOf(FORBIDDEN_INDICES.charAt(i)) >= 0) {
+ return false;
+ }
+ }
return true;
}
18 years, 2 months
JBoss Tools SVN: r5963 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse: mapper and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-01-25 07:48:09 -0500 (Fri, 25 Jan 2008)
New Revision: 5963
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorStub.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1624
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorStub.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorStub.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorStub.java 2008-01-25 12:48:09 UTC (rev 5963)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.mapper;
+
+import org.hibernate.eclipse.mapper.extractor.HBMInfoExtractor;
+import org.w3c.dom.Node;
+
+/**
+ * @author Vitali
+ *
+ */
+public class HBMInfoExtractorStub extends HBMInfoExtractor {
+
+ protected String packageName = null;
+
+ protected String getPackageName(Node root) {
+ return packageName;
+ }
+
+ public void setPackageName(String packageName) {
+ this.packageName = packageName;
+ }
+
+}
Added: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/mapper/HBMInfoExtractorTest.java 2008-01-25 12:48:09 UTC (rev 5963)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.mapper;
+
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.hibernate.eclipse.console.test.mappingproject.MappingTestProject;
+import org.hibernate.eclipse.mapper.extractor.JavaTypeHandler;
+import org.hibernate.eclipse.mapper.extractor.PackageHandler;
+import junit.framework.TestCase;
+
+/**
+ * @author Vitali
+ *
+ */
+public class HBMInfoExtractorTest extends TestCase {
+ private HBMInfoExtractorStub sourceLocator = new HBMInfoExtractorStub();
+
+ public void executeJavaTypeHandlerTest(String start, String attributeName) {
+ sourceLocator.setPackageName("org");
+ MappingTestProject testProj = MappingTestProject.getTestProject();
+ IJavaProject project = testProj.getIJavaProject();
+ JavaTypeHandler javaTypeHandler = new JavaTypeHandler(sourceLocator);
+ ICompletionProposal[] res =
+ javaTypeHandler.attributeCompletionProposals(project, null,
+ attributeName, start, 0);
+
+ assertTrue( res.length > 0 );
+ }
+
+ public void testJavaTypeHandler1() {
+ executeJavaTypeHandlerTest("a", "name");
+ }
+
+ public void testJavaTypeHandler2() {
+ executeJavaTypeHandlerTest("", "name");
+ }
+
+ public void testJavaTypeHandler3() {
+ executeJavaTypeHandlerTest("a", "class");
+ }
+
+ public void testJavaTypeHandler4() {
+ executeJavaTypeHandlerTest("", "class");
+ }
+
+ public void executePackageHandlerTest(String start, String attributeName) {
+ sourceLocator.setPackageName("org");
+ MappingTestProject testProj = MappingTestProject.getTestProject();
+ IJavaProject project = testProj.getIJavaProject();
+ PackageHandler packageHandler = new PackageHandler(sourceLocator);
+ ICompletionProposal[] res =
+ packageHandler.attributeCompletionProposals(project, null,
+ attributeName, start, 0);
+
+ assertTrue( res.length > 0 );
+ }
+
+ public void testPackageHandler1() {
+ executePackageHandlerTest("o", "package");
+ }
+
+ public void testPackageHandler2() {
+ executePackageHandlerTest("", "package");
+ }
+
+}
18 years, 2 months
JBoss Tools SVN: r5962 - trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-01-25 07:45:33 -0500 (Fri, 25 Jan 2008)
New Revision: 5962
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/JavaTypeHandler.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PackageHandler.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1624
change access modifier for JUnit tests
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java 2008-01-24 23:57:31 UTC (rev 5961)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/HBMInfoExtractor.java 2008-01-25 12:45:33 UTC (rev 5962)
@@ -477,7 +477,7 @@
* @param root TODO
* @return nearest package attribute, null if none found.
*/
- String getPackageName(Node root) {
+ protected String getPackageName(Node root) {
if(root!=null) {
while(!"hibernate-mapping".equals(root.getNodeName() ) ) {
root = root.getParentNode();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/JavaTypeHandler.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/JavaTypeHandler.java 2008-01-24 23:57:31 UTC (rev 5961)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/JavaTypeHandler.java 2008-01-25 12:45:33 UTC (rev 5962)
@@ -42,7 +42,7 @@
/**
* @param extractor
*/
- JavaTypeHandler(HBMInfoExtractor extractor) {
+ public JavaTypeHandler(HBMInfoExtractor extractor) {
this.extractor = extractor;
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PackageHandler.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PackageHandler.java 2008-01-24 23:57:31 UTC (rev 5961)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/extractor/PackageHandler.java 2008-01-25 12:45:33 UTC (rev 5962)
@@ -28,7 +28,7 @@
import org.hibernate.util.StringHelper;
import org.w3c.dom.Node;
-class PackageHandler extends JavaTypeHandler {
+public class PackageHandler extends JavaTypeHandler {
public PackageHandler(HBMInfoExtractor extractor) {
super(extractor);
18 years, 2 months
JBoss Tools SVN: r5961 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-24 18:57:31 -0500 (Thu, 24 Jan 2008)
New Revision: 5961
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java
Log:
JBIDE-1485 - restoreDefaults implemented in EventLog's preference page as proof it works.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java 2008-01-24 23:45:14 UTC (rev 5960)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java 2008-01-24 23:57:31 UTC (rev 5961)
@@ -330,7 +330,6 @@
protected class EventLogPreferenceComposite extends ViewProviderPreferenceComposite {
private Button newestFirst, oldestFirst, showTime, sort;
private Group firstGroup;
- private Label newestFirstLabel, oldestFirstLabel, showTimeLabel, sortLabel;
public EventLogPreferenceComposite(Composite parent) {
super(parent, SWT.NONE);
setLayout(new FormLayout());
@@ -339,7 +338,6 @@
fillWidgetsWithValues();
}
protected void fillWidgetsWithValues() {
- Preferences store = JBossServerUIPlugin.getDefault().getPluginPreferences();
boolean showTimestamp = getShowTimestamp();
boolean categorize = getCategorize();
boolean onTop = getSortOrder();
@@ -381,17 +379,12 @@
d.left = new FormAttachment(0, 5);
d.top = new FormAttachment(showTime, 5);
sort.setLayoutData(d);
-
-// d = new FormData();
-// d.left = new FormAttachment(sort, 5);
-// d.top = new FormAttachment(showTime, 5);
-// sortLabel.setLayoutData(d);
}
public boolean isValid() {
return true;
}
public boolean performCancel() {
- return false;
+ return true;
}
public boolean performOk() {
Preferences store = JBossServerUIPlugin.getDefault().getPluginPreferences();
@@ -400,6 +393,12 @@
store.setValue(EVENT_ON_TOP, newestFirst.getSelection() ? NEWEST_ON_TOP : OLDEST_ON_TOP);
return true;
}
+ public void performDefaults() {
+ showTime.setSelection(false);
+ newestFirst.setSelection(true);
+ oldestFirst.setSelection(false);
+ sort.setSelection(false);
+ }
}
18 years, 2 months
JBoss Tools SVN: r5960 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-24 18:45:14 -0500 (Thu, 24 Jan 2008)
New Revision: 5960
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewPreferencePage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewProviderPreferenceComposite.java
Log:
JBIDE-1485 - API slightly modified (safely fix!), restoreDefaults implemented.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewPreferencePage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewPreferencePage.java 2008-01-24 23:03:44 UTC (rev 5959)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewPreferencePage.java 2008-01-24 23:45:14 UTC (rev 5960)
@@ -126,6 +126,23 @@
}
+ protected void performDefaults() {
+ for( int i = 0; i < enabledButtons.size(); i++ ) {
+ ((Button)enabledButtons.get(i)).setSelection(true);
+ }
+ TableItem[] items = table.getItems();
+ for( int i = 0; i < items.length; i++ ) {
+ items[i].setData(ENABLED, new Boolean(true));
+ }
+ ViewProviderPreferenceComposite comp;
+ for( int i = 0; i < preferenceComposites.size(); i++ ) {
+ comp = (ViewProviderPreferenceComposite)preferenceComposites.get(i);
+ comp.performDefaults();
+ }
+
+ updateApplyButton();
+ }
+
public void dispose() {
super.dispose();
ViewProviderPreferenceComposite comp;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewProviderPreferenceComposite.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewProviderPreferenceComposite.java 2008-01-24 23:03:44 UTC (rev 5959)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewProviderPreferenceComposite.java 2008-01-24 23:45:14 UTC (rev 5960)
@@ -32,7 +32,8 @@
public ViewProviderPreferenceComposite(Composite parent, int style) {
super(parent, style);
}
- public abstract boolean isValid();
- public abstract boolean performOk();
- public abstract boolean performCancel();
+ public boolean isValid(){ return true; };
+ public boolean performOk(){ return true; };
+ public boolean performCancel(){ return true; };
+ public void performDefaults() {};
}
18 years, 2 months
JBoss Tools SVN: r5959 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-24 18:03:44 -0500 (Thu, 24 Jan 2008)
New Revision: 5959
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
Log:
JBIDE-1487 removed try/catch. If an error is now thrown we should know.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2008-01-24 22:22:42 UTC (rev 5958)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2008-01-24 23:03:44 UTC (rev 5959)
@@ -113,25 +113,22 @@
Runnable r = new Runnable() {
public void run() {
if( isEnabled() ) {
- try {
- if( o == null || o == provider ) {
- JBossServerView.getDefault().getExtensionFrame().getViewer().refresh(provider);
- } else {
- ExtensionTableViewer viewer = JBossServerView.getDefault().getExtensionFrame().getViewer();
- ContentWrapper wrapped = new ContentWrapper(o, provider);
- if( viewer.elementInTree(wrapped))
- viewer.refresh(new ContentWrapper(o, provider));
- else
- viewer.refresh(provider);
- }
- } catch(Exception e) {
- // non-critical error, ignore
+ if( o == null || o == provider ) {
+ JBossServerView.getDefault().getExtensionFrame().getViewer().refresh(provider);
+ } else {
+ ExtensionTableViewer viewer = JBossServerView.getDefault().getExtensionFrame().getViewer();
+ ContentWrapper wrapped = new ContentWrapper(o, provider);
+ if( viewer.elementInTree(wrapped))
+ viewer.refresh(new ContentWrapper(o, provider));
+ else
+ viewer.refresh(provider);
}
}
}
};
- if( JBossServerView.getDefault() == null ) return;
+ if( JBossServerView.getDefault() == null )
+ return;
if( Display.getCurrent() == null )
Display.getDefault().asyncExec(r);
18 years, 2 months