JBoss Tools SVN: r16961 - trunk/hibernatetools/docs/reference/en/images/plugins.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-08-04 11:35:12 -0400 (Tue, 04 Aug 2009)
New Revision: 16961
Added:
trunk/hibernatetools/docs/reference/en/images/plugins/plugins_4_b.png
trunk/hibernatetools/docs/reference/en/images/plugins/plugins_4_c.png
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-794 - Created new section "Modifying a Hibernate Console Configuration" ,in which described additional properties being added to Properties View.Restructured some chapters in the Doc - Hibernate.</p>
</body></html>
Added: trunk/hibernatetools/docs/reference/en/images/plugins/plugins_4_b.png
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/docs/reference/en/images/plugins/plugins_4_b.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/hibernatetools/docs/reference/en/images/plugins/plugins_4_c.png
===================================================================
(Binary files differ)
Property changes on: trunk/hibernatetools/docs/reference/en/images/plugins/plugins_4_c.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 5 months
JBoss Tools SVN: r16960 - trunk/hibernatetools/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-08-04 11:34:21 -0400 (Tue, 04 Aug 2009)
New Revision: 16960
Modified:
trunk/hibernatetools/docs/reference/en/modules/codegenarchitecture.xml
trunk/hibernatetools/docs/reference/en/modules/plugins.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-794 - Created new section "Modifying a Hibernate Console Configuration" ,in which described additional properties being added to Properties View.Restructured some chapters in the Doc - Hibernate.</p>
</body></html>
Modified: trunk/hibernatetools/docs/reference/en/modules/codegenarchitecture.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/codegenarchitecture.xml 2009-08-04 12:20:51 UTC (rev 16959)
+++ trunk/hibernatetools/docs/reference/en/modules/codegenarchitecture.xml 2009-08-04 15:34:21 UTC (rev 16960)
@@ -97,8 +97,8 @@
<section>
<title>Exporters</title>
- <para>Code generation is done in so called Exporters. An <literal>Exporter</literal> is handed a
- Hibernate Meta Model represented as a <literal>Configuration</literal> instance and it is then
+ <para>Code generation is done in so called Exporters. An <code>Exporter</code> is handed a
+ Hibernate Meta Model represented as a <code>Configuration</code> instance and it is then
the job of the exporter to generate a set of code artifacts.</para>
<para>The tools provides a default set of Exporter's which can be used in both Ant and the
Modified: trunk/hibernatetools/docs/reference/en/modules/plugins.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/plugins.xml 2009-08-04 12:20:51 UTC (rev 16959)
+++ trunk/hibernatetools/docs/reference/en/modules/plugins.xml 2009-08-04 15:34:21 UTC (rev 16960)
@@ -137,7 +137,7 @@
</section>
<section id="console_conf">
- <title>Creating a Hibernate Console Configuration</title>
+ <title>Hibernate Console Configuration</title>
<para>A Console configuration describes how the <property>Hibernate plugin</property> should
configure <property>Hibernate</property> and what configuration files, including which
@@ -145,7 +145,10 @@
query prototyping, reverse engineering and code generation. You can have multiple named
console configurations. Normally you would just need one per project, but more is definitely
possible if your project requires this.</para>
-
+ <section id="creat_console_conf">
+ <title>Creating a Hibernate Console Configuration</title>
+
+
<para>You create a console configuration by running the <property>Console Configuration
Wizard</property>, shown in the following screenshot. The same wizard will also be used if
you are coming from the <emphasis>
@@ -620,7 +623,185 @@
</mediaobject>
</figure>
- </section>
+ </section>
+ <section id="modif_console_conf">
+ <title>Modifying a Hibernate Console Configuration
+ </title>
+ <para>When you created a hibernate console configuration you can modify it in 2 ways:
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>right click on the configuration in
+ <emphasis>
+ <property>Hibernate Configurations View->Edit Configuration
+ </property>
+ </emphasis>.</para>
+
+ <figure>
+ <title>Opening Edit Configuration Wizard</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/plugins/plugins_4_c.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para> After clicking you will see the Edit Configuration Wizard that is similar to <emphasis>
+ <property>Create Console Configuration</property>
+ </emphasis>,described in <link
+ linkend="creat_console_conf">Creating a Hibernate Console Configuration section</link>.
+ </para>
+ </listitem>
+ <listitem><para>use Properties view for modifying some of Console Configuration properties.</para>
+ <figure>
+ <title>Properties View</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/plugins/plugins_4_b.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The following table describes the available settings in the Properties view. Most properties are changeable by left click but some are not.
+
+ <table>
+ <title>Properties</title>
+
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="1*"/>
+
+ <colspec colnum="2" colwidth="3*"/>
+
+ <colspec colnum="3" align="left" colwidth="1*"/>
+
+ <thead>
+ <row>
+ <entry align="center">
+ <para>Property</para>
+ </entry>
+
+ <entry align="center">
+ <para>Description</para>
+ </entry>
+
+ <entry align="center">
+ <para>Is Changeable</para>
+ </entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>
+ <para>Additional mapping files </para>
+ </entry>
+
+ <entry>
+ <para>List of additional mapping files that should be loaded.
+ </para>
+ </entry>
+
+ <entry>
+ <para>False</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Configuration file</para>
+ </entry>
+
+ <entry>
+ <para>Path to a hibernate.cfg.xml file</para>
+ </entry>
+
+ <entry>
+ <para>False</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Connection</para>
+ </entry>
+
+ <entry>
+ <para>DTP provided connection that you can use instead of what is in cfg.xml and jpa
+ persistence.xml. It's possible to use either already configured hibernate or
+ JPA connection or specify a new one here.</para>
+ </entry>
+
+ <entry>
+ <para>True</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Name</para>
+ </entry>
+
+ <entry>
+ <para>The unique name of the console configuration</para>
+ </entry>
+
+ <entry>
+ <para>True</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Project</para>
+ </entry>
+
+ <entry>
+ <para>The name of a java project which classpath should be used in the console
+ configuration</para>
+ </entry>
+
+ <entry>
+ <para>True</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Properties file</para>
+ </entry>
+
+ <entry>
+ <para>Path to a hibernate.properties file</para>
+ </entry>
+
+ <entry>
+ <para>False</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>Type</para>
+ </entry>
+
+ <entry>
+ <para>Choose between "CORE", "ANNOTATIONS" and
+ "JPA" according to the method of relational mapping you want to use. Note that the two latter requires running Eclipse IDE with
+ a JDK 5 runtime, otherwise you will get classloading and/or version errors.</para>
+ </entry>
+
+ <entry>
+ <para>True</para>
+ </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ </section>
+
+
<section id="refeng_codegen" role="updated">
<title>Reverse Engineering and Code Generation</title>
@@ -1850,7 +2031,7 @@
<section>
<title>Properties View</title>
- <para>As you can see on the figure, <property>Properties view</property> shows the number of
+ <para>As you can see on the figure,when clicking on class/entity <property>Properties view</property> shows the number of
query results as well as the time of executing.</para>
<figure>
@@ -1883,6 +2064,9 @@
</imageobject>
</mediaobject>
</figure>
+ <para>You can also use <property>Properties view</property> when clicking on the configuration
+ itself in Hibernate Configuration View( <link
+ linkend="modif_console_conf">Modifying a Hibernate Console Configuration section</link>). </para>
</section>
</section>
<section id="jpa_annotations">
16 years, 5 months
JBoss Tools SVN: r16959 - in workspace/yzhishko: org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-08-04 08:20:51 -0400 (Tue, 04 Aug 2009)
New Revision: 16959
Added:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTagsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java
Removed:
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTags.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpaces.java
Modified:
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java
workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java
workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java
Log:
Tests were updated. Some try/catch blocks were corrected.
Modified: workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3148and4441Test.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -73,7 +73,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("CSS Class").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -83,7 +83,7 @@
try {
bot.shell("CSS Class").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
Modified: workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3577Test.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -55,7 +55,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("CSS Class").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -65,7 +65,7 @@
try {
bot.shell("CSS Class").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
Modified: workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3579Test.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -55,7 +55,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("CSS Class").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -65,7 +65,7 @@
try {
bot.shell("CSS Class").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
Modified: workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE3920Test.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -45,7 +45,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("CSS Class").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -55,7 +55,7 @@
try {
bot.shell("CSS Class").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
Modified: workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.jsf.ui.bot.test/src/org/jboss/tools/jsf/ui/bot/test/cssdialog/jbide/JBIDE4391Test.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -56,7 +56,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("CSS Class").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -66,7 +66,7 @@
try {
bot.shell("CSS Class").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAllTests.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -8,11 +8,11 @@
import org.jboss.tools.vpe.ui.bot.test.editor.BlockCommentTest;
import org.jboss.tools.vpe.ui.bot.test.editor.BorderForUnknownTagsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.ChangeEditorTabForTheFirstOpenPageTest;
-import org.jboss.tools.vpe.ui.bot.test.editor.ShowNonVisualTags;
+import org.jboss.tools.vpe.ui.bot.test.editor.ShowNonVisualTagsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.ShowResourceBundlesUsageasELexpressionsTest;
import org.jboss.tools.vpe.ui.bot.test.editor.ShowSelectionTagBarTest;
import org.jboss.tools.vpe.ui.bot.test.editor.ToggleCommentTest;
-import org.jboss.tools.vpe.ui.bot.test.editor.VerificationOfNameSpaces;
+import org.jboss.tools.vpe.ui.bot.test.editor.VerificationOfNameSpacesTest;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4306Test;
import org.jboss.tools.vpe.ui.bot.test.jbide.JBIDE4556Test;
import org.jboss.tools.vpe.ui.bot.test.palette.CancelTagLibDefenitionTest;
@@ -28,12 +28,12 @@
suite.addTestSuite(JBIDE4306Test.class);
suite.addTestSuite(JBIDE4556Test.class);
suite.addTestSuite(ChangeEditorTabForTheFirstOpenPageTest.class);
- suite.addTestSuite(VerificationOfNameSpaces.class);
+ suite.addTestSuite(VerificationOfNameSpacesTest.class);
suite.addTestSuite(BorderForUnknownTagsTest.class);
suite.addTestSuite(ShowResourceBundlesUsageasELexpressionsTest.class);
suite.addTestSuite(ShowSelectionTagBarTest.class);
suite.addTestSuite(AlwaysHideSelectionBarWithoutPromptTest.class);
- suite.addTestSuite(ShowNonVisualTags.class);
+ suite.addTestSuite(ShowNonVisualTagsTest.class);
return new TestSetup(suite);
}
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/VPEAutoTestCase.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -73,16 +73,16 @@
bot.button("Next >").click();
try {
bot.comboBoxWithLabel("Runtime*").setSelection("jboss-eap Runtime");
- delay();
+ waitForJobs();
bot.button("Finish").click();
try {
bot.button("Yes").click();
openErrorLog();
openPackageExplorer();
// openProgressStatus();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
bot.button(0).click();
SWTBotTree innerTree = bot.tree();
waitForJobs();
@@ -97,7 +97,7 @@
openErrorLog();
openPackageExplorer();
// openProgressStatus();
- } catch (Exception e2) {
+ } catch (WidgetNotFoundException e2) {
}
}
waitForJobs();
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/AlwaysHideSelectionBarWithoutPromptTest.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -83,7 +83,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("Preferences (Filtered)").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -93,7 +93,7 @@
try {
bot.shell("Preferences (Filtered)").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
@@ -108,7 +108,7 @@
try {
tree.expandNode(projectProperties.getProperty("JSFProjectName"))
.expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -143,7 +143,7 @@
checkBox.click();
}
bot.button("OK").click();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
super.tearDown();
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BlockCommentTest.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -5,6 +5,7 @@
import org.eclipse.swt.widgets.Event;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
@@ -23,7 +24,7 @@
try {
tree.expandNode(projectProperties.getProperty("JSFProjectName"))
.expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/BorderForUnknownTagsTest.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -2,6 +2,7 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.test.WidgetVariables;
@@ -21,7 +22,7 @@
try {
tree.expandNode(projectProperties.getProperty("JSFProjectName"))
.expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
@@ -62,7 +63,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("Preferences (Filtered)").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -72,7 +73,7 @@
try {
bot.shell("Preferences (Filtered)").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
Deleted: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTags.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTags.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTags.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -1,103 +0,0 @@
-package org.jboss.tools.vpe.ui.bot.test.editor;
-
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.jboss.tools.ui.bot.test.WidgetVariables;
-import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-
-public class ShowNonVisualTags extends VPEAutoTestCase{
-
- public void testShowNonVisualTags() throws Throwable{
-
- //Test open page
-
- openPage();
-
- //Test set default Show Tag value
-
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Non-Visual Tags");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
- checkVPE("DumpedTestPage.xml");
-
- //Test Show Non-Visual Tags
-
- selectShowNonVisual();
- closePage();
- openPage();
- checkVPE("ShowNonVisualTags.xml");
-
- //Test Hide Non-Visual Tags
- selectShowNonVisual();
- closePage();
- openPage();
- checkVPE("DumpedTestPage.xml");
-
- }
-
- private void checkVPE(String testPage) throws Throwable{
- waitForJobs();
- performContentTestByDocument(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
- }
-
- @Override
- protected void closeUnuseDialogs() {
- try {
- bot.shell("Preferences (Filtered)").close();
- } catch (Exception e) {
- }
- }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- boolean isOpened = false;
- try {
- bot.shell("Preferences (Filtered)").activate();
- isOpened = true;
- } catch (Exception e) {
- }
- return isOpened;
- }
-
- @Override
- protected void tearDown() throws Exception {
- try {
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- SWTBotCheckBox checkBox = bot.checkBox("Show Non-Visual Tags");
- if (checkBox.isChecked()) {
- checkBox.click();
- }
- bot.button("OK").click();
- } catch (Exception e) {
- }
- super.tearDown();
- }
-
- private void closePage(){
- bot.editorByTitle(TEST_PAGE).close();
- }
-
- private void openPage(){
- SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
- SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (Exception e) {
- }
- }
-
- private void selectShowNonVisual(){
- bot.toolbarButtonWithTooltip("Preferences").click();
- bot.shell("Preferences (Filtered)").activate();
- bot.checkBox("Show Non-Visual Tags").click();
- bot.button("OK").click();
- }
-
-}
Copied: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTagsTest.java (from rev 16941, workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTags.java)
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTagsTest.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowNonVisualTagsTest.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -0,0 +1,104 @@
+package org.jboss.tools.vpe.ui.bot.test.editor;
+
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.bot.test.WidgetVariables;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+public class ShowNonVisualTagsTest extends VPEAutoTestCase{
+
+ public void testShowNonVisualTags() throws Throwable{
+
+ //Test open page
+
+ openPage();
+
+ //Test set default Show Tag value
+
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ SWTBotCheckBox checkBox = bot.checkBox("Show Non-Visual Tags");
+ if (checkBox.isChecked()) {
+ checkBox.click();
+ }
+ bot.button("OK").click();
+ checkVPE("DumpedTestPage.xml");
+
+ //Test Show Non-Visual Tags
+
+ selectShowNonVisual();
+ closePage();
+ openPage();
+ checkVPE("ShowNonVisualTags.xml");
+
+ //Test Hide Non-Visual Tags
+ selectShowNonVisual();
+ closePage();
+ openPage();
+ checkVPE("DumpedTestPage.xml");
+
+ }
+
+ private void checkVPE(String testPage) throws Throwable{
+ waitForJobs();
+ performContentTestByDocument(testPage, bot.multiPageEditorByTitle(TEST_PAGE));
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+ try {
+ bot.shell("Preferences (Filtered)").close();
+ } catch (WidgetNotFoundException e) {
+ }
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ boolean isOpened = false;
+ try {
+ bot.shell("Preferences (Filtered)").activate();
+ isOpened = true;
+ } catch (WidgetNotFoundException e) {
+ }
+ return isOpened;
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ try {
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ SWTBotCheckBox checkBox = bot.checkBox("Show Non-Visual Tags");
+ if (checkBox.isChecked()) {
+ checkBox.click();
+ }
+ bot.button("OK").click();
+ } catch (WidgetNotFoundException e) {
+ }
+ super.tearDown();
+ }
+
+ private void closePage(){
+ bot.editorByTitle(TEST_PAGE).close();
+ }
+
+ private void openPage(){
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
+ } catch (WidgetNotFoundException e) {
+ }
+ }
+
+ private void selectShowNonVisual(){
+ bot.toolbarButtonWithTooltip("Preferences").click();
+ bot.shell("Preferences (Filtered)").activate();
+ bot.checkBox("Show Non-Visual Tags").click();
+ bot.button("OK").click();
+ }
+
+}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowResourceBundlesUsageasELexpressionsTest.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -2,6 +2,7 @@
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.test.WidgetVariables;
@@ -21,7 +22,7 @@
try {
tree.expandNode(projectProperties.getProperty("JSFProjectName"))
.expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
@@ -53,7 +54,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("Preferences (Filtered)").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -63,7 +64,7 @@
try {
bot.shell("Preferences (Filtered)").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
@@ -81,7 +82,7 @@
checkBox.click();
}
bot.button("OK").click();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
editor.setFocus();
bot.menu("Edit").menu("Select All").click();
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ShowSelectionTagBarTest.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -84,7 +84,7 @@
protected void closeUnuseDialogs() {
try {
bot.shell("Preferences (Filtered)").close();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
@@ -94,7 +94,7 @@
try {
bot.shell("Preferences (Filtered)").activate();
isOpened = true;
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
return isOpened;
}
@@ -116,7 +116,7 @@
checkBox.click();
}
bot.button("OK").click();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
super.tearDown();
}
@@ -138,7 +138,7 @@
try {
tree.expandNode(projectProperties.getProperty("JSFProjectName"))
.expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
}
Modified: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/ToggleCommentTest.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -5,6 +5,7 @@
import org.eclipse.swt.widgets.Event;
import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.jboss.tools.ui.bot.test.WidgetVariables;
import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
@@ -23,7 +24,7 @@
try {
tree.expandNode(projectProperties.getProperty("JSFProjectName"))
.expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (Exception e) {
+ } catch (WidgetNotFoundException e) {
}
Deleted: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpaces.java
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpaces.java 2009-08-04 11:39:16 UTC (rev 16958)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpaces.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -1,76 +0,0 @@
-package org.jboss.tools.vpe.ui.bot.test.editor;
-
-import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
-import org.eclipse.swtbot.swt.finder.SWTBot;
-import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
-import org.jboss.tools.ui.bot.test.WidgetVariables;
-import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
-
-public class VerificationOfNameSpaces extends VPEAutoTestCase{
-
- private static String textEditor;
- private static String testText = "<jsp:root\n" +
- "xmlns:jsp=\"http://java.sun.com/JSP/Page\n" +
- "xmlns:public=\"http://www.jspcentral.com/tags\"\n" +
- "version=\"1.2\">\n" +
- "...\n" +
- "</jsp:root>";
- private static SWTBotEclipseEditor editor;
-
- public void testVerificationOfNameSpaces() throws Throwable{
-
- //Test open page
-
- SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
- SWTBotTree tree = innerBot.tree();
- try {
- tree.expandNode(projectProperties.getProperty("JSFProjectName"))
- .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
- } catch (Exception e) {
- }
-
- editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
- textEditor = editor.getText();
-
- //Test clear source
-
- editor.setFocus();
- bot.menu("Edit").menu("Select All").click();
- waitForJobs();
- bot.menu("Edit").menu("Delete").click();
-
- //Test insert test text
-
- editor.setText(testText);
- editor.save();
- waitForJobs();
- performContentTestByDocument("VerificationOfNameSpaces.xml", bot.multiPageEditorByTitle(TEST_PAGE));
-
- }
-
- @Override
- protected void closeUnuseDialogs() {
-
- }
-
- @Override
- protected boolean isUnuseDialogOpened() {
- return false;
- }
-
- @Override
- protected void tearDown() throws Exception {
-
- //Restore page state before tests
-
- editor.setFocus();
- bot.menu("Edit").menu("Select All").click();
- bot.menu("Edit").menu("Delete").click();
- editor.setText(textEditor);
- editor.save();
- waitForJobs();
- editor.close();
- super.tearDown();
- }
-
-}
Copied: workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java (from rev 16906, workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpaces.java)
===================================================================
--- workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java (rev 0)
+++ workspace/yzhishko/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/editor/VerificationOfNameSpacesTest.java 2009-08-04 12:20:51 UTC (rev 16959)
@@ -0,0 +1,77 @@
+package org.jboss.tools.vpe.ui.bot.test.editor;
+
+import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
+import org.eclipse.swtbot.swt.finder.SWTBot;
+import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.jboss.tools.ui.bot.test.WidgetVariables;
+import org.jboss.tools.vpe.ui.bot.test.VPEAutoTestCase;
+
+public class VerificationOfNameSpacesTest extends VPEAutoTestCase{
+
+ private static String textEditor;
+ private static String testText = "<jsp:root\n" +
+ "xmlns:jsp=\"http://java.sun.com/JSP/Page\n" +
+ "xmlns:public=\"http://www.jspcentral.com/tags\"\n" +
+ "version=\"1.2\">\n" +
+ "...\n" +
+ "</jsp:root>";
+ private static SWTBotEclipseEditor editor;
+
+ public void testVerificationOfNameSpaces() throws Throwable{
+
+ //Test open page
+
+ SWTBot innerBot = bot.viewByTitle(WidgetVariables.PACKAGE_EXPLORER).bot();
+ SWTBotTree tree = innerBot.tree();
+ try {
+ tree.expandNode(projectProperties.getProperty("JSFProjectName"))
+ .expandNode("WebContent").expandNode("pages").getNode(TEST_PAGE).doubleClick();
+ } catch (WidgetNotFoundException e) {
+ }
+
+ editor = bot.editorByTitle(TEST_PAGE).toTextEditor();
+ textEditor = editor.getText();
+
+ //Test clear source
+
+ editor.setFocus();
+ bot.menu("Edit").menu("Select All").click();
+ waitForJobs();
+ bot.menu("Edit").menu("Delete").click();
+
+ //Test insert test text
+
+ editor.setText(testText);
+ editor.save();
+ waitForJobs();
+ performContentTestByDocument("VerificationOfNameSpaces.xml", bot.multiPageEditorByTitle(TEST_PAGE));
+
+ }
+
+ @Override
+ protected void closeUnuseDialogs() {
+
+ }
+
+ @Override
+ protected boolean isUnuseDialogOpened() {
+ return false;
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+
+ //Restore page state before tests
+
+ editor.setFocus();
+ bot.menu("Edit").menu("Select All").click();
+ bot.menu("Edit").menu("Delete").click();
+ editor.setText(textEditor);
+ editor.save();
+ waitForJobs();
+ editor.close();
+ super.tearDown();
+ }
+
+}
16 years, 5 months
JBoss Tools SVN: r16958 - in trunk/jst/plugins/org.jboss.tools.jst.jsp: src/org/jboss/tools/jst/jsp/contentassist and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-08-04 07:39:16 -0400 (Tue, 04 Aug 2009)
New Revision: 16958
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3750
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2009-08-04 09:22:50 UTC (rev 16957)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2009-08-04 11:39:16 UTC (rev 16958)
@@ -451,6 +451,7 @@
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.DELIMITER" />
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+ <partitiontype id="org.eclipse.wst.css.STYLE" />
</contenttype>
</contentAssistProcessor>
@@ -476,6 +477,7 @@
<partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
<partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+ <partitiontype id="org.eclipse.wst.css.STYLE" />
</contenttype>
</contentAssistProcessor>
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-08-04 09:22:50 UTC (rev 16957)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/AbstractXMLContentAssistProcessor.java 2009-08-04 11:39:16 UTC (rev 16958)
@@ -521,6 +521,10 @@
*/
protected ContentAssistRequest computeCompletionProposals(int documentPosition, String matchString, ITextRegion completionRegion, IDOMNode treeNode, IDOMNode xmlnode) {
ContentAssistRequest contentAssistRequest = super.computeCompletionProposals(documentPosition, matchString, completionRegion, treeNode, xmlnode);
+ if (contentAssistRequest == null) {
+ IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+ contentAssistRequest = newContentAssistRequest((Node) treeNode, treeNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
+ }
String regionType = completionRegion.getType();
IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
@@ -531,7 +535,11 @@
if ((xmlnode.getNodeType() == Node.ELEMENT_NODE) || (xmlnode.getNodeType() == Node.DOCUMENT_NODE)) {
if (regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE) {
addAttributeNameProposals(contentAssistRequest);
- } else if ((regionType == DOMRegionContext.XML_CONTENT) || (regionType == DOMRegionContext.XML_CHAR_REFERENCE) || (regionType == DOMRegionContext.XML_ENTITY_REFERENCE) || (regionType == DOMRegionContext.XML_PE_REFERENCE)) {
+ } else if ((regionType == DOMRegionContext.XML_CONTENT)
+ || (regionType == DOMRegionContext.XML_CHAR_REFERENCE)
+ || (regionType == DOMRegionContext.XML_ENTITY_REFERENCE)
+ || (regionType == DOMRegionContext.XML_PE_REFERENCE)
+ || (regionType == DOMRegionContext.BLOCK_TEXT)) {
addTextELProposals(contentAssistRequest);
}
}
@@ -673,7 +681,7 @@
// Get Fixed Structured Document Region
IStructuredDocumentRegion sdFixedRegion = this.getStructuredDocumentRegion(getOffset());
if (sdFixedRegion == null)
- return EMPTY_TAGS;
+ return null;
n = findNodeForOffset(xmlDocument, sdFixedRegion.getStartOffset());
}
16 years, 5 months
JBoss Tools SVN: r16957 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-08-04 05:22:50 -0400 (Tue, 04 Aug 2009)
New Revision: 16957
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-441
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2009-08-04 08:43:28 UTC (rev 16956)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2009-08-04 09:22:50 UTC (rev 16957)
@@ -967,44 +967,6 @@
feedback and contextual error checking as you type.</para>
</section>
-<section id="XHTMLvalidator">
- <title>XHTML Syntax Validator</title>
-
- <para>XHTML Syntax validator in JBoss Tools provides the XML-like validation for the namespaced tags and HTML-tags as well. It can be enabled in <emphasis><property>Window -> Preferences -> Validation</property></emphasis>:</para>
-
- <figure>
- <title>Validation Preferences: XHTML Validator</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/visual_page/XHTMLvalid.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>The process of validation can be observed in the <property>Progress</property> view, you can also press the Stop button to stop validation if needed:</para>
- <figure>
- <title>Validation Progress</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/visual_page/validation_progress.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- <para>Any problems in validation of your XHTML file will be displayed in the <property>Problems</property> view:</para>
- <figure>
- <title>Validation Problems</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/visual_page/problems.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
-
-</section>
<section id="taglib_versions_support">
<title>Support for Taglib versions</title>
@@ -1865,38 +1827,6 @@
</imageobject>
</mediaobject>
</figure>
- <para><emphasis>
- <property>Up</property></emphasis>
- and <emphasis>
- <property>Down</property>
- </emphasis> buttons allow you to move you attribute on the list. For delete the attribute, choose it and press <emphasis>
- <property>Delete</property></emphasis> button.</para>
- <para>If you want to change a value or a name of your attribute, click on it and than on <emphasis>
- <property>Edit</property></emphasis> button.</para>
-
- <para>If the .properties file is rather big and there are a lot of entries in it, you can use filtering to find the necessary ones. The Filter is implemented by an expandable panel, closed by default: </para>
- <figure>
- <title>Filter Panel</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/more_editors/more_editors_3a.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para> Enter the characters that should be searched for in the entries to the 'name' or 'value' input fields accordingly. The filtered results will be displayed in the table below:</para>
-
- <figure>
- <title>Filter Results</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/more_editors/more_editors_3b.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
-
</section>
<section id="GraphicalTLDEditor">
16 years, 5 months
JBoss Tools SVN: r16956 - in trunk/seam/plugins/org.jboss.tools.seam.ui: src/org/jboss/tools/seam/ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-08-04 04:43:28 -0400 (Tue, 04 Aug 2009)
New Revision: 16956
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesTablesWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4702
SeamGenerateEnitiesWizard name misprint fixed.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-08-04 08:17:02 UTC (rev 16955)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-08-04 08:43:28 UTC (rev 16956)
@@ -85,7 +85,7 @@
</wizard>
<wizard
category="org.jboss.tools.seam.ui"
- class="org.jboss.tools.seam.ui.wizard.SeamGenerateEnitiesWizard"
+ class="org.jboss.tools.seam.ui.wizard.SeamGenerateEntitiesWizard"
icon="icons/seam16.png"
id="org.jboss.tools.seam.ui.wizard.SeamGenerateEnitiesWizard"
name="Seam Generate Entities">
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2009-08-04 08:17:02 UTC (rev 16955)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2009-08-04 08:43:28 UTC (rev 16956)
@@ -1,388 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.ui.wizard;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.PlatformUI;
-import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.KnownConfigurations;
-import org.hibernate.eclipse.launch.HibernateLaunchConstants;
-import org.jboss.tools.jst.web.WebUtils;
-import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.SeamProjectsSet;
-import org.jboss.tools.seam.core.project.facet.SeamRuntime;
-import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
-import org.jboss.tools.seam.core.project.facet.SeamVersion;
-import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
-import org.jboss.tools.seam.ui.ISeamHelpContextIds;
-import org.jboss.tools.seam.ui.SeamUIMessages;
-import org.jboss.tools.seam.ui.widget.editor.INamedElement;
-
-/**
- * Seam Generate Entities Wizard.
- * @author Alexey Kazakov
- */
-public class SeamGenerateEnitiesWizard extends SeamBaseWizard implements INewWizard {
-
- SeamGenerateEnitiesWizardPage page1 = new SeamGenerateEnitiesWizardPage();
- IWizardPage page2 = new SeamGenerateEntitiesTablesWizardPage();
-
- public void createPageControls(Composite pageContainer) {
- super.createPageControls(pageContainer);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer, ISeamHelpContextIds.GENERATE_SEAM_ENTITIES);
- }
-
- public SeamGenerateEnitiesWizard() {
- super(GENERATE_SEAM_ENTITIES);
- setWindowTitle(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_TITLE);
- setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(SeamGenerateEnitiesWizard.class, "SeamWebProjectWizBan.png"));
- addPage(page1);
- addPage(page2);
- }
-
- @Override
- public boolean canFinish() {
- return page1.isPageComplete();
- }
-
- public static final IUndoableOperation GENERATE_SEAM_ENTITIES = new SeamBaseOperation(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_ACTION_CREATING_OPERATION) {
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.seam.ui.wizard.SeamBaseOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
- */
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Map<String, INamedElement> params = (Map)info.getAdapter(Map.class);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(params.get(IParameter.SEAM_PROJECT_NAME).getValueAsString());
-
- try {
-
- ISeamProject seamProject = (ISeamProject)project.getNature(ISeamProject.NATURE_ID);
- boolean seam2 = seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_0) >= 0;
-
- ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType launchConfigurationType =
- launchManager.getLaunchConfigurationType("org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType"); //$NON-NLS-1$
- // we put null in location to avoid it being inside the project by default since the launch config currenlty will be machine independent with respect to the paths.
- launchConfigurationType.getAttribute("");
- ILaunchConfigurationWorkingCopy wc =
- launchConfigurationType.newInstance(null, project.getName() + "-generate-entities"); //$NON-NLS-1$
-
- //Main
- wc.setAttribute(
- HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME,
- params.get(IParameter.HIBERNATE_CONFIGURATION_NAME).getValueAsString());
-
- SeamProjectsSet seamProjectsSet = SeamProjectsSet.create(project);
-
- wc.setAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR,
- seamProjectsSet.getModelFolder()==null?
- "":seamProjectsSet.getModelFolder().getFullPath().toString()); //$NON-NLS-1$
-
- boolean isReverseEngineer = "true".equals(params.get(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER).getValueAsString()); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, isReverseEngineer);
-
- if(isReverseEngineer) {
- wc.setAttribute(HibernateLaunchConstants.ATTR_PACKAGE_NAME, seamProjectsSet.getEntityPackage());
- wc.setAttribute(HibernateLaunchConstants.ATTR_PREFER_BASIC_COMPOSITE_IDS, true);
- wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_MANY_TO_MANY, true);
- wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_VERSIONING, true);
-
- boolean seam21 = seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_1) >= 0 ||
- seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_2) >= 0;
- // Only Seam 2.1 does not break when generating from one-to-one
- wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_ONE_TO_ONE, seam21);
- }
-
- SeamRuntime seamRt = getRuntime(project);
- if(seamRt==null) {
- seamRt = getRuntime(project);
- }
- if(seamRt == null) {
- throw new CoreException(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
- NLS.bind(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_CAN_NOT_FIND_SEAM_RUNTIME, project.getName())));
- }
- String seamTemplatesRoot = seamRt.getTemplatesDir();
-
- wc.setAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, seamTemplatesRoot);
- wc.setAttribute(HibernateLaunchConstants.ATTR_USE_OWN_TEMPLATES, true);
-
- wc.setAttribute(HibernateLaunchConstants.ATTR_ENABLE_JDK5, true);
- wc.setAttribute(HibernateLaunchConstants.ATTR_ENABLE_EJB3_ANNOTATIONS, true);
-
- // Create exporters
- // TODO Add others exporters
- List<String> exporters = new ArrayList<String>();
-
- if(isReverseEngineer) {
- exporters.add("hbmtemplate0"); //$NON-NLS-1$
- }
- exporters.add("hbmtemplate1"); //$NON-NLS-1$
- exporters.add("hbmtemplate2"); //$NON-NLS-1$
- exporters.add("hbmtemplate3"); //$NON-NLS-1$
- exporters.add("hbmtemplate4"); //$NON-NLS-1$
- exporters.add("hbmtemplate5"); //$NON-NLS-1$
- exporters.add("hbmtemplate6"); //$NON-NLS-1$
- exporters.add("hbmtemplate7"); //$NON-NLS-1$
- exporters.add("hbmtemplate8"); //$NON-NLS-1$
- exporters.add("hbmtemplate9"); //$NON-NLS-1$
-
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, exporters);
-
- if(isReverseEngineer) {
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate0", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate0.extension_id", "org.hibernate.tools.hbm2java"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate1", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate1.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate2", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate2.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate3", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate3.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate4", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate4.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate5", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate5.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate6", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate6.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate7", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate7.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate8", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate8.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate9", true); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate9.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
-
- Map<String, String> hbmtemplateAttributes = new HashMap<String, String>();
-
-// <hbmtemplate filepattern="{class-name}List.xhtml"
-// template="view/list.xhtml.ftl"
-// destdir="${project.home}/view"
-// foreach="entity"/>
-
- hbmtemplateAttributes.put("file_pattern", "{class-name}List.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("template_name", "view/list.xhtml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("outputdir", seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
- hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("hibernatetool.util.toolclass",SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_54); //$NON-NLS-1$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate1.properties", hbmtemplateAttributes); //$NON-NLS-1$
-
-// <hbmtemplate filepattern="{class-name}.xhtml"
-// template="view/view.xhtml.ftl"
-// destdir="${project.home}/view"
-// foreach="entity"/>
-
- hbmtemplateAttributes = new HashMap<String, String>();
- hbmtemplateAttributes.put("file_pattern", "{class-name}.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("template_name", "view/view.xhtml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
- hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate2.properties", hbmtemplateAttributes); //$NON-NLS-1$
-
-// <hbmtemplate filepattern="{class-name}.page.xml"
-// template="view/view.page.xml.ftl"
-// destdir="${project.home}/view"
-// foreach="entity"/>
-
- hbmtemplateAttributes = new HashMap<String, String>();
- hbmtemplateAttributes.put("file_pattern", "{class-name}.page.xml"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("template_name", "view/view.page.xml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
- hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate3.properties", hbmtemplateAttributes); //$NON-NLS-1$
-
-// <hbmtemplate filepattern="{class-name}Edit.xhtml"
-// template="view/edit.xhtml.ftl"
-// destdir="${project.home}/view"
-// foreach="entity"/>
-
- hbmtemplateAttributes = new HashMap<String, String>();
- hbmtemplateAttributes.put("file_pattern", "{class-name}Edit.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("template_name", "view/edit.xhtml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
- hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate4.properties", hbmtemplateAttributes); //$NON-NLS-1$
-
-// <hbmtemplate filepattern="{class-name}Edit.page.xml"
-// template="view/edit.page.xml.ftl"
-// destdir="${project.home}/view"
-// foreach="entity"/>
-
- hbmtemplateAttributes = new HashMap<String, String>();
- hbmtemplateAttributes.put("file_pattern", "{class-name}Edit.page.xml"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("template_name", "view/edit.page.xml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
- hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate5.properties", hbmtemplateAttributes); //$NON-NLS-1$
-
-// <hbmtemplate filepattern="{package-name}/{class-name}List.java"
-// template="src/EntityList.java.ftl"
-// destdir="${project.home}/src"
-// foreach="entity"/>
-
- IEclipsePreferences seamFacetPrefs = SeamCorePlugin.getSeamPreferences(project);
- final String actionpackage = seamFacetPrefs.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "");
- final String actionDir = actionpackage.replace('.','/');
-
- hbmtemplateAttributes = new HashMap<String, String>();
-
- if(seam2) {
- //Seam2: <property key="actionPackage" value="${action.package}" />
- hbmtemplateAttributes.put("actionPackage",actionpackage); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("file_pattern", actionDir + "/{class-name}List.java"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- hbmtemplateAttributes.put("file_pattern", "{package-name}/{class-name}List.java"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- hbmtemplateAttributes.put("template_name", "src/EntityList.java.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("outputdir",seamProjectsSet.getActionFolder().getFullPath().toString()); //$NON-NLS-1$
- hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
-
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate6.properties", hbmtemplateAttributes); //$NON-NLS-1$
-
-// <hbmtemplate filepattern="{class-name}List.page.xml"
-// template="view/list.page.xml.ftl"
-// destdir="${project.home}/view"
-// foreach="entity"/>
-
- hbmtemplateAttributes = new HashMap<String, String>();
- hbmtemplateAttributes.put("file_pattern", "{class-name}List.page.xml"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("template_name", "view/list.page.xml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
- hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate7.properties", hbmtemplateAttributes); //$NON-NLS-1$
-
-// <hbmtemplate filepattern="{package-name}/{class-name}Home.java"
-// template="src/EntityHome.java.ftl"
-// destdir="${project.home}/src"
-// foreach="entity"/>
-
- hbmtemplateAttributes = new HashMap<String, String>();
- if(seam2) {
- //Seam2: <property key="actionPackage" value="${action.package}" />
- hbmtemplateAttributes.put("actionPackage",actionpackage); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("file_pattern", actionDir + "/{class-name}Home.java"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- hbmtemplateAttributes.put("file_pattern", "{package-name}/{class-name}Home.java"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- hbmtemplateAttributes.put("template_name", "src/EntityHome.java.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("outputdir",seamProjectsSet.getActionFolder().getFullPath().toString()); //$NON-NLS-1$
- hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate8.properties", hbmtemplateAttributes); //$NON-NLS-1$
-
-// <hbmtemplate filepattern="menu.xhtml"
-// template="view/layout/menu.xhtml.ftl"
-// destdir="${project.home}/view/layout"
-// foreach="entity"/>
-
- hbmtemplateAttributes = new HashMap<String, String>();
- hbmtemplateAttributes.put("file_pattern", "menu.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("template_name", "view/layout/menu.xhtml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()+"/layout"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
- hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate9.properties", hbmtemplateAttributes); //$NON-NLS-1$
-
- //save before adding additional attribute
- wc.doSave();
-
- if (params.containsKey(HibernateLaunchConstants.ATTR_REVENG_TABLES)){
- //create reveng.xml file
- IPath revengPath = project.getLocation().append(".settings").append("gen-entities.hibernate.reveng.xml"); //$NON-NLS-1$ //$NON-NLS-2$
- File location = revengPath.toFile();
- org.jboss.tools.common.util.FileUtil.writeFile(location, params.get(HibernateLaunchConstants.ATTR_REVENG_TABLES).getValueAsString());
- wc.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS, revengPath.toString());
- }
-
- launchManager.addLaunch(wc.launch(ILaunchManager.RUN_MODE, monitor));
-
- WebUtils.changeTimeStamp(project);
- } catch (CoreException e) {
- SeamCorePlugin.getDefault().showError(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_CAN_NOT_GENERATE_SEAM_ENTITIES, e);
- }
- return Status.OK_STATUS;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.seam.ui.wizard.SeamBaseOperation#getFileMappings(java.util.Map)
- */
- @Override
- public List<FileMapping> getFileMappings(Map<String, Object> vars) {
-// throw new UnsupportedOperationException(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_THIS_METHOD_IS_NOT_RELEVANT_IN_GENERATING_SEAM_ENTITIES);
- // Return empty list;
- return new ArrayList<FileMapping>();
- }
- };
-
- static SeamRuntime getRuntime(IProject project) {
- if(project==null) {
- return null;
- }
- SeamRuntime seamRt = SeamRuntimeManager.getInstance().getRuntimeForProject(project);
-
- String runtimeName = SeamCorePlugin.getSeamPreferences(project)
- .get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,""); //$NON-NLS-1$
-
- if(!"".equals(runtimeName)) { //$NON-NLS-1$
- seamRt = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName);
- }
- return seamRt;
- }
-
- @Override
- public boolean performFinish() {
- boolean result = super.performFinish();
- if (result){
- String ccName = page1.getConsoleCongigurationName();
- ConsoleConfiguration config = KnownConfigurations.getInstance().find(ccName);
- //fix for JBIDE-3599
- if (config != null) config.reset();
- }
- return result;
- }
-
-
-}
\ No newline at end of file
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-08-04 08:17:02 UTC (rev 16955)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-08-04 08:43:28 UTC (rev 16956)
@@ -1,319 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.ui.wizard;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.KnownConfigurations;
-import org.hibernate.eclipse.console.utils.ProjectUtils;
-import org.hibernate.eclipse.launch.HibernateLaunchConstants;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.SeamProjectsSet;
-import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
-import org.jboss.tools.seam.internal.core.validation.SeamProjectPropertyValidator;
-import org.jboss.tools.seam.ui.SeamUIMessages;
-import org.jboss.tools.seam.ui.internal.project.facet.IValidator;
-import org.jboss.tools.seam.ui.internal.project.facet.ValidatorFactory;
-import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
-import org.jboss.tools.seam.ui.widget.editor.INamedElement;
-import org.jboss.tools.seam.ui.widget.field.RadioField;
-
-/**
- * @author Alexey Kazakov
- */
-public class SeamGenerateEnitiesWizardPage extends WizardPage implements PropertyChangeListener, IAdaptable {
-
- private IFieldEditor projectEditor;
- private IFieldEditor configEditor;
- private RadioField radios;
- IProject rootSeamProject;
-
- public SeamGenerateEnitiesWizardPage() {
- super("seam.generate.entities.page", SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_TITLE, null); //$NON-NLS-1$
- setMessage(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_PAGE_MESSAGE);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- rootSeamProject = SeamWizardUtils.getCurrentSelectedRootSeamProject();
- String projectName = rootSeamProject==null?"":rootSeamProject.getName();
- projectEditor = SeamWizardFactory.createSeamProjectSelectionFieldEditor(projectName);
- projectEditor.addPropertyChangeListener(this);
- if(projectName!=null && projectName.length()>0) {
- Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectEditor.getValue(), null);
- if(!errors.isEmpty()) {
- IStatus message = errors.get(IValidator.DEFAULT_ERROR);
- if(message.getSeverity()==IStatus.ERROR) {
- setErrorMessage(message.getMessage());
- setPageComplete(false);
- } else {
- setMessage(message.getMessage());
- }
- } else {
- setMessage(null);
- }
- } else {
- setMessage(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_PAGE_MESSAGE);
- setPageComplete(false);
- }
-
- Composite top = new GridLayoutComposite(parent);
- Composite projectComposite = new GridLayoutComposite(top, SWT.NONE, 4);
-
- projectEditor.doFillIntoGrid(projectComposite);
-
- configEditor = SeamWizardFactory.createHibernateConsoleConfigurationSelectionFieldEditor(getConsoleConfigurationName(projectName));
- configEditor.addPropertyChangeListener(this);
- configEditor.doFillIntoGrid(projectComposite);
- configEditor.setEditable(false);
- configEditor.addPropertyChangeListener(this);
-
- String config = (String)configEditor.getValue();
- if(config==null || config.length()==0) {
- setMessage(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_HIBERNATE_CONFIGURATION_MESSAGE);
- setPageComplete(false);
- }
-
- Composite groupComposite = new GridLayoutComposite(top);
- Group group = new Group(groupComposite, SWT.NONE);
- group.setText(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_GROUP_LABEL);
- group.setLayout(new GridLayout(1, false));
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Composite radioComposite = new GridLayoutComposite(group, SWT.NONE, 2);
- ArrayList<Object> values = new ArrayList<Object>();
- values.add("reverse"); //$NON-NLS-1$
- values.add("existing"); //$NON-NLS-1$
- ArrayList<String> labels = new ArrayList<String>();
- labels.add(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_REVERSE_ENGINEER_LABEL);
- labels.add(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_EXISTING_ENTITIES_LABEL);
- radios = new RadioField(radioComposite, labels, values, null, true);
- radios.addPropertyChangeListener(this);
-
- setControl(top);
- validate();
- }
-
- private static String getConsoleConfigurationName(String seamWebProjectName) {
- if(seamWebProjectName==null || seamWebProjectName.trim().length()==0) {
- return null;
- }
- String seamProjectName = seamWebProjectName;
- IProject webProject = ResourcesPlugin.getWorkspace().getRoot().getProject(seamWebProjectName);
- if(webProject==null) {
- return null;
- }
- SeamProjectsSet projectSet = SeamProjectsSet.create(webProject);
- if(!projectSet.isWarConfiguration()) {
- IProject ejbProject = projectSet.getEjbProject();
- if(ejbProject==null) {
- return null;
- }
- seamProjectName = ejbProject.getName();
- }
- ConsoleConfiguration[] configs = KnownConfigurations.getInstance().getConfigurations();
- for (int i = 0; i < configs.length; i++) {
- IJavaProject javaProject = ProjectUtils.findJavaProject(configs[i]);
- if(javaProject!=null && javaProject.getProject().getName().equals(seamProjectName)) {
- return configs[i].getName();
- }
- }
- return null;
- }
-
- public static class GridLayoutComposite extends Composite {
-
- public GridLayoutComposite(Composite parent, int style, int columnNumber) {
- super(parent, style);
- GridLayout gl = new GridLayout(columnNumber, false);
- setLayout(gl);
- setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- }
-
- public GridLayoutComposite(Composite parent) {
- this(parent, SWT.NONE, 1);
- }
- }
-
- /* (non-Javadoc)
- * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent event) {
- if(IParameter.SEAM_PROJECT_NAME.equals(event.getPropertyName()) &&
- event.getNewValue()!=null &&
- !event.getNewValue().equals(event.getOldValue())) {
- String consoleConfigName = getConsoleConfigurationName(event.getNewValue().toString());
- if(consoleConfigName!=null) {
- configEditor.setValue(consoleConfigName);
- }
- }
- validate();
- }
-
- protected boolean isProjectSettingsOk() {
- if(rootSeamProject!=null) {
- if(!isValidRuntimeConfigured(rootSeamProject)) {
- return false;
- }
- IEclipsePreferences prefs = SeamCorePlugin.getSeamPreferences(rootSeamProject);
- return SeamProjectPropertyValidator.isFolderPathValid(prefs.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, ""), false) &&
- SeamProjectPropertyValidator.isFolderPathValid(prefs.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, ""), false) &&
- SeamProjectPropertyValidator.isFolderPathValid(prefs.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, ""), false) &&
- (ISeamFacetDataModelProperties.DEPLOY_AS_WAR.equals(prefs.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, ISeamFacetDataModelProperties.DEPLOY_AS_WAR).trim()) || SeamProjectPropertyValidator.isProjectNameValid(prefs.get(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, ""), false));
- }
- return true;
- }
-
- /**
- * @param project
- */
- protected boolean isValidRuntimeConfigured(IProject project) {
- Map<String, IStatus> errors;
- String seamRt = SeamCorePlugin.getSeamPreferences(project).get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,""); //$NON-NLS-1$
- errors = ValidatorFactory.SEAM_RUNTIME_VALIDATOR.validate(seamRt, null);
- if(!errors.isEmpty()) {
- setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
- setPageComplete(false);
- return false;
- }
- return true;
- }
-
- private void validate() {
- String projectName = projectEditor.getValue().toString();
- Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectName, null);
-
- if(!errors.isEmpty() || !isProjectSettingsOk()) {
- IStatus errorMessage = errors.get(IValidator.DEFAULT_ERROR);
- if(errorMessage==null) {
- setErrorMessage(SeamUIMessages.VALIDATOR_INVALID_SETTINGS);
- setPageComplete(false);
- } else {
- if(errorMessage.getSeverity()==IStatus.ERROR) {
- setErrorMessage(errorMessage.getMessage());
- setPageComplete(false);
- } else {
- setMessage(errorMessage.getMessage());
- }
- }
- return;
- }
- String config = (String)configEditor.getValue();
- if(config==null || config.length()==0) {
- setErrorMessage(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_HIBERNATE_CONFIGURATION_ERROR);
- setPageComplete(false);
- return;
- }
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- SeamProjectsSet seamProjectsSet = SeamProjectsSet.create(project);
- IContainer viewsFolder = seamProjectsSet.getViewsFolder();
- if (viewsFolder != null){
- if (!viewsFolder.getFolder(new Path("layout")).exists()){//$NON-NLS-1$
- setErrorMessage(SeamUIMessages.bind(SeamUIMessages.VALIDATOR_FACTORY_FOLDER_DOES_NOT_EXIST,
- viewsFolder.getName() + "/layout"));//$NON-NLS-1$
- setPageComplete(false);
- return;
- }
- }
-
- setErrorMessage(null);
- setMessage(null);
- setPageComplete(true);
- }
-
- @SuppressWarnings("unchecked")
- public Object getAdapter(Class adapter) {
- if(adapter == Map.class) {
- Map<String, INamedElement> values = new HashMap<String, INamedElement>();
- values.put(projectEditor.getName(), new NamedElementImpl(projectEditor.getName(), projectEditor.getValueAsString()));
- values.put(configEditor.getName(), new NamedElementImpl(configEditor.getName(), configEditor.getValueAsString()));
- String mode = radios.getValue().toString();
- String value = "reverse".equals(mode) ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- values.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, new NamedElementImpl("reverse", value)); //$NON-NLS-1$
- IWizardPage page2 = getWizard().getPage(SeamGenerateEntitiesTablesWizardPage.pageName);
- if (page2 instanceof SeamGenerateEntitiesTablesWizardPage){
- SeamGenerateEntitiesTablesWizardPage page = (SeamGenerateEntitiesTablesWizardPage)page2;
- String filters = page.getFilters();
- if (filters.length() > 0) values.put(HibernateLaunchConstants.ATTR_REVENG_TABLES, new NamedElementImpl("filters", filters)); //$NON-NLS-1$
- }
- return values;
- }
- return null;
- }
-
- class NamedElementImpl implements INamedElement {
-
- private String name;
- private Object value;
-
- public NamedElementImpl(String name, Object value) {
- this.name = name;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public Object getValue() {
- return value;
- }
-
- public String getValueAsString() {
- return value.toString();
- }
-
- public void setValue(Object newValue) {
- this.value = newValue;
- }
-
- public void setValueAsString(String value) {
- this.value = value;
- }
-
- @Override
- public String toString() {
- return getValueAsString();
- }
- }
-
- @Override
- public boolean canFlipToNextPage() {
- return "reverse".equals(radios.getValue()) && (getErrorMessage() == null); //$NON-NLS-1$
- }
-
- public String getConsoleCongigurationName(){
- return configEditor.getValueAsString();
- }
-}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesTablesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesTablesWizardPage.java 2009-08-04 08:17:02 UTC (rev 16955)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesTablesWizardPage.java 2009-08-04 08:43:28 UTC (rev 16956)
@@ -63,7 +63,7 @@
//set console configuration as treeViewer input
public void pageChanged(PageChangedEvent event) {
if (event.getSelectedPage() == SeamGenerateEntitiesTablesWizardPage.this){
- SeamGenerateEnitiesWizardPage page1 = (SeamGenerateEnitiesWizardPage)getWizard().getPreviousPage(SeamGenerateEntitiesTablesWizardPage.this);
+ SeamGenerateEntitiesWizardPage page1 = (SeamGenerateEntitiesWizardPage)getWizard().getPreviousPage(SeamGenerateEntitiesTablesWizardPage.this);
cfgName = page1.getConsoleCongigurationName();
}
}});
Copied: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizard.java (from rev 16753, trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java)
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizard.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizard.java 2009-08-04 08:43:28 UTC (rev 16956)
@@ -0,0 +1,389 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.wizard;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.IUndoableOperation;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.PlatformUI;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.launch.HibernateLaunchConstants;
+import org.jboss.tools.jst.web.WebUtils;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamProjectsSet;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.ui.ISeamHelpContextIds;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.widget.editor.INamedElement;
+
+/**
+ * Seam Generate Entities Wizard.
+ * @author Alexey Kazakov
+ */
+public class SeamGenerateEntitiesWizard extends SeamBaseWizard implements INewWizard {
+
+ SeamGenerateEntitiesWizardPage page1 = new SeamGenerateEntitiesWizardPage();
+ IWizardPage page2 = new SeamGenerateEntitiesTablesWizardPage();
+
+ public void createPageControls(Composite pageContainer) {
+ super.createPageControls(pageContainer);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(pageContainer, ISeamHelpContextIds.GENERATE_SEAM_ENTITIES);
+ }
+
+ public SeamGenerateEntitiesWizard() {
+ super(GENERATE_SEAM_ENTITIES);
+ setWindowTitle(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_TITLE);
+ setDefaultPageImageDescriptor(ImageDescriptor.createFromFile(SeamGenerateEntitiesWizard.class, "SeamWebProjectWizBan.png"));
+ addPage(page1);
+ addPage(page2);
+ }
+
+ @Override
+ public boolean canFinish() {
+ return page1.isPageComplete();
+ }
+
+ public static final IUndoableOperation GENERATE_SEAM_ENTITIES = new SeamBaseOperation(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_ACTION_CREATING_OPERATION) {
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.wizard.SeamBaseOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Map<String, INamedElement> params = (Map<String, INamedElement>)info.getAdapter(Map.class);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(params.get(IParameter.SEAM_PROJECT_NAME).getValueAsString());
+
+ try {
+
+ ISeamProject seamProject = (ISeamProject)project.getNature(ISeamProject.NATURE_ID);
+ boolean seam2 = seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_0) >= 0;
+
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType launchConfigurationType =
+ launchManager.getLaunchConfigurationType("org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType"); //$NON-NLS-1$
+ // we put null in location to avoid it being inside the project by default since the launch config currenlty will be machine independent with respect to the paths.
+ launchConfigurationType.getAttribute("");
+ ILaunchConfigurationWorkingCopy wc =
+ launchConfigurationType.newInstance(null, project.getName() + "-generate-entities"); //$NON-NLS-1$
+
+ //Main
+ wc.setAttribute(
+ HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME,
+ params.get(IParameter.HIBERNATE_CONFIGURATION_NAME).getValueAsString());
+
+ SeamProjectsSet seamProjectsSet = SeamProjectsSet.create(project);
+
+ wc.setAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR,
+ seamProjectsSet.getModelFolder()==null?
+ "":seamProjectsSet.getModelFolder().getFullPath().toString()); //$NON-NLS-1$
+
+ boolean isReverseEngineer = "true".equals(params.get(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER).getValueAsString()); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, isReverseEngineer);
+
+ if(isReverseEngineer) {
+ wc.setAttribute(HibernateLaunchConstants.ATTR_PACKAGE_NAME, seamProjectsSet.getEntityPackage());
+ wc.setAttribute(HibernateLaunchConstants.ATTR_PREFER_BASIC_COMPOSITE_IDS, true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_MANY_TO_MANY, true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_VERSIONING, true);
+
+ boolean seam21 = seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_1) >= 0 ||
+ seamProject.getRuntime().getVersion().compareTo(SeamVersion.SEAM_2_2) >= 0;
+ // Only Seam 2.1 does not break when generating from one-to-one
+ wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_ONE_TO_ONE, seam21);
+ }
+
+ SeamRuntime seamRt = getRuntime(project);
+ if(seamRt==null) {
+ seamRt = getRuntime(project);
+ }
+ if(seamRt == null) {
+ throw new CoreException(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
+ NLS.bind(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_CAN_NOT_FIND_SEAM_RUNTIME, project.getName())));
+ }
+ String seamTemplatesRoot = seamRt.getTemplatesDir();
+
+ wc.setAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, seamTemplatesRoot);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_USE_OWN_TEMPLATES, true);
+
+ wc.setAttribute(HibernateLaunchConstants.ATTR_ENABLE_JDK5, true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_ENABLE_EJB3_ANNOTATIONS, true);
+
+ // Create exporters
+ // TODO Add others exporters
+ List<String> exporters = new ArrayList<String>();
+
+ if(isReverseEngineer) {
+ exporters.add("hbmtemplate0"); //$NON-NLS-1$
+ }
+ exporters.add("hbmtemplate1"); //$NON-NLS-1$
+ exporters.add("hbmtemplate2"); //$NON-NLS-1$
+ exporters.add("hbmtemplate3"); //$NON-NLS-1$
+ exporters.add("hbmtemplate4"); //$NON-NLS-1$
+ exporters.add("hbmtemplate5"); //$NON-NLS-1$
+ exporters.add("hbmtemplate6"); //$NON-NLS-1$
+ exporters.add("hbmtemplate7"); //$NON-NLS-1$
+ exporters.add("hbmtemplate8"); //$NON-NLS-1$
+ exporters.add("hbmtemplate9"); //$NON-NLS-1$
+
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, exporters);
+
+ if(isReverseEngineer) {
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate0", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate0.extension_id", "org.hibernate.tools.hbm2java"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate1", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate1.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate2", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate2.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate3", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate3.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate4", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate4.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate5", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate5.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate6", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate6.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate7", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate7.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate8", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate8.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate9", true); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate9.extension_id", "org.hibernate.tools.hbmtemplate"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ Map<String, String> hbmtemplateAttributes = new HashMap<String, String>();
+
+// <hbmtemplate filepattern="{class-name}List.xhtml"
+// template="view/list.xhtml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
+
+ hbmtemplateAttributes.put("file_pattern", "{class-name}List.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("template_name", "view/list.xhtml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("outputdir", seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
+ hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass",SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_54); //$NON-NLS-1$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate1.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+// <hbmtemplate filepattern="{class-name}.xhtml"
+// template="view/view.xhtml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern", "{class-name}.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("template_name", "view/view.xhtml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
+ hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate2.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+// <hbmtemplate filepattern="{class-name}.page.xml"
+// template="view/view.page.xml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern", "{class-name}.page.xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("template_name", "view/view.page.xml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
+ hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate3.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+// <hbmtemplate filepattern="{class-name}Edit.xhtml"
+// template="view/edit.xhtml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern", "{class-name}Edit.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("template_name", "view/edit.xhtml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
+ hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate4.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+// <hbmtemplate filepattern="{class-name}Edit.page.xml"
+// template="view/edit.page.xml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern", "{class-name}Edit.page.xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("template_name", "view/edit.page.xml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
+ hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate5.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+// <hbmtemplate filepattern="{package-name}/{class-name}List.java"
+// template="src/EntityList.java.ftl"
+// destdir="${project.home}/src"
+// foreach="entity"/>
+
+ IEclipsePreferences seamFacetPrefs = SeamCorePlugin.getSeamPreferences(project);
+ final String actionpackage = seamFacetPrefs.get(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "");
+ final String actionDir = actionpackage.replace('.','/');
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+
+ if(seam2) {
+ //Seam2: <property key="actionPackage" value="${action.package}" />
+ hbmtemplateAttributes.put("actionPackage",actionpackage); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("file_pattern", actionDir + "/{class-name}List.java"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ hbmtemplateAttributes.put("file_pattern", "{package-name}/{class-name}List.java"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ hbmtemplateAttributes.put("template_name", "src/EntityList.java.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getActionFolder().getFullPath().toString()); //$NON-NLS-1$
+ hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate6.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+// <hbmtemplate filepattern="{class-name}List.page.xml"
+// template="view/list.page.xml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern", "{class-name}List.page.xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("template_name", "view/list.page.xml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()); //$NON-NLS-1$
+ hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate7.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+// <hbmtemplate filepattern="{package-name}/{class-name}Home.java"
+// template="src/EntityHome.java.ftl"
+// destdir="${project.home}/src"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ if(seam2) {
+ //Seam2: <property key="actionPackage" value="${action.package}" />
+ hbmtemplateAttributes.put("actionPackage",actionpackage); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("file_pattern", actionDir + "/{class-name}Home.java"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ hbmtemplateAttributes.put("file_pattern", "{package-name}/{class-name}Home.java"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ hbmtemplateAttributes.put("template_name", "src/EntityHome.java.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getActionFolder().getFullPath().toString()); //$NON-NLS-1$
+ hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate8.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+// <hbmtemplate filepattern="menu.xhtml"
+// template="view/layout/menu.xhtml.ftl"
+// destdir="${project.home}/view/layout"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern", "menu.xhtml"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("template_name", "view/layout/menu.xhtml.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()+"/layout"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$ //$NON-NLS-2$
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil"); //$NON-NLS-1$ //$NON-NLS-2$
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate9.properties", hbmtemplateAttributes); //$NON-NLS-1$
+
+ //save before adding additional attribute
+ wc.doSave();
+
+ if (params.containsKey(HibernateLaunchConstants.ATTR_REVENG_TABLES)){
+ //create reveng.xml file
+ IPath revengPath = project.getLocation().append(".settings").append("gen-entities.hibernate.reveng.xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ File location = revengPath.toFile();
+ org.jboss.tools.common.util.FileUtil.writeFile(location, params.get(HibernateLaunchConstants.ATTR_REVENG_TABLES).getValueAsString());
+ wc.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER_SETTINGS, revengPath.toString());
+ }
+
+ launchManager.addLaunch(wc.launch(ILaunchManager.RUN_MODE, monitor));
+
+ WebUtils.changeTimeStamp(project);
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().showError(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_CAN_NOT_GENERATE_SEAM_ENTITIES, e);
+ }
+ return Status.OK_STATUS;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.ui.wizard.SeamBaseOperation#getFileMappings(java.util.Map)
+ */
+ @Override
+ public List<FileMapping> getFileMappings(Map<String, Object> vars) {
+// throw new UnsupportedOperationException(SeamUIMessages.SEAM_GENERATE_ENTITIES_WIZARD_THIS_METHOD_IS_NOT_RELEVANT_IN_GENERATING_SEAM_ENTITIES);
+ // Return empty list;
+ return new ArrayList<FileMapping>();
+ }
+ };
+
+ static SeamRuntime getRuntime(IProject project) {
+ if(project==null) {
+ return null;
+ }
+ SeamRuntime seamRt = SeamRuntimeManager.getInstance().getRuntimeForProject(project);
+
+ String runtimeName = SeamCorePlugin.getSeamPreferences(project)
+ .get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,""); //$NON-NLS-1$
+
+ if(!"".equals(runtimeName)) { //$NON-NLS-1$
+ seamRt = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName);
+ }
+ return seamRt;
+ }
+
+ @Override
+ public boolean performFinish() {
+ boolean result = super.performFinish();
+ if (result){
+ String ccName = page1.getConsoleCongigurationName();
+ ConsoleConfiguration config = KnownConfigurations.getInstance().find(ccName);
+ //fix for JBIDE-3599
+ if (config != null) config.reset();
+ }
+ return result;
+ }
+
+
+}
\ No newline at end of file
Copied: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java (from rev 16955, trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java)
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEntitiesWizardPage.java 2009-08-04 08:43:28 UTC (rev 16956)
@@ -0,0 +1,319 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.wizard;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.utils.ProjectUtils;
+import org.hibernate.eclipse.launch.HibernateLaunchConstants;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamProjectsSet;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.validation.SeamProjectPropertyValidator;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.internal.project.facet.IValidator;
+import org.jboss.tools.seam.ui.internal.project.facet.ValidatorFactory;
+import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.seam.ui.widget.editor.INamedElement;
+import org.jboss.tools.seam.ui.widget.field.RadioField;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamGenerateEntitiesWizardPage extends WizardPage implements PropertyChangeListener, IAdaptable {
+
+ private IFieldEditor projectEditor;
+ private IFieldEditor configEditor;
+ private RadioField radios;
+ IProject rootSeamProject;
+
+ public SeamGenerateEntitiesWizardPage() {
+ super("seam.generate.entities.page", SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_TITLE, null); //$NON-NLS-1$
+ setMessage(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_PAGE_MESSAGE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+ rootSeamProject = SeamWizardUtils.getCurrentSelectedRootSeamProject();
+ String projectName = rootSeamProject==null?"":rootSeamProject.getName();
+ projectEditor = SeamWizardFactory.createSeamProjectSelectionFieldEditor(projectName);
+ projectEditor.addPropertyChangeListener(this);
+ if(projectName!=null && projectName.length()>0) {
+ Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectEditor.getValue(), null);
+ if(!errors.isEmpty()) {
+ IStatus message = errors.get(IValidator.DEFAULT_ERROR);
+ if(message.getSeverity()==IStatus.ERROR) {
+ setErrorMessage(message.getMessage());
+ setPageComplete(false);
+ } else {
+ setMessage(message.getMessage());
+ }
+ } else {
+ setMessage(null);
+ }
+ } else {
+ setMessage(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_PAGE_MESSAGE);
+ setPageComplete(false);
+ }
+
+ Composite top = new GridLayoutComposite(parent);
+ Composite projectComposite = new GridLayoutComposite(top, SWT.NONE, 4);
+
+ projectEditor.doFillIntoGrid(projectComposite);
+
+ configEditor = SeamWizardFactory.createHibernateConsoleConfigurationSelectionFieldEditor(getConsoleConfigurationName(projectName));
+ configEditor.addPropertyChangeListener(this);
+ configEditor.doFillIntoGrid(projectComposite);
+ configEditor.setEditable(false);
+ configEditor.addPropertyChangeListener(this);
+
+ String config = (String)configEditor.getValue();
+ if(config==null || config.length()==0) {
+ setMessage(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_HIBERNATE_CONFIGURATION_MESSAGE);
+ setPageComplete(false);
+ }
+
+ Composite groupComposite = new GridLayoutComposite(top);
+ Group group = new Group(groupComposite, SWT.NONE);
+ group.setText(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_GROUP_LABEL);
+ group.setLayout(new GridLayout(1, false));
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Composite radioComposite = new GridLayoutComposite(group, SWT.NONE, 2);
+ ArrayList<Object> values = new ArrayList<Object>();
+ values.add("reverse"); //$NON-NLS-1$
+ values.add("existing"); //$NON-NLS-1$
+ ArrayList<String> labels = new ArrayList<String>();
+ labels.add(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_REVERSE_ENGINEER_LABEL);
+ labels.add(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_EXISTING_ENTITIES_LABEL);
+ radios = new RadioField(radioComposite, labels, values, null, true);
+ radios.addPropertyChangeListener(this);
+
+ setControl(top);
+ validate();
+ }
+
+ private static String getConsoleConfigurationName(String seamWebProjectName) {
+ if(seamWebProjectName==null || seamWebProjectName.trim().length()==0) {
+ return null;
+ }
+ String seamProjectName = seamWebProjectName;
+ IProject webProject = ResourcesPlugin.getWorkspace().getRoot().getProject(seamWebProjectName);
+ if(webProject==null) {
+ return null;
+ }
+ SeamProjectsSet projectSet = SeamProjectsSet.create(webProject);
+ if(!projectSet.isWarConfiguration()) {
+ IProject ejbProject = projectSet.getEjbProject();
+ if(ejbProject==null) {
+ return null;
+ }
+ seamProjectName = ejbProject.getName();
+ }
+ ConsoleConfiguration[] configs = KnownConfigurations.getInstance().getConfigurations();
+ for (int i = 0; i < configs.length; i++) {
+ IJavaProject javaProject = ProjectUtils.findJavaProject(configs[i]);
+ if(javaProject!=null && javaProject.getProject().getName().equals(seamProjectName)) {
+ return configs[i].getName();
+ }
+ }
+ return null;
+ }
+
+ public static class GridLayoutComposite extends Composite {
+
+ public GridLayoutComposite(Composite parent, int style, int columnNumber) {
+ super(parent, style);
+ GridLayout gl = new GridLayout(columnNumber, false);
+ setLayout(gl);
+ setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+
+ public GridLayoutComposite(Composite parent) {
+ this(parent, SWT.NONE, 1);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ if(IParameter.SEAM_PROJECT_NAME.equals(event.getPropertyName()) &&
+ event.getNewValue()!=null &&
+ !event.getNewValue().equals(event.getOldValue())) {
+ String consoleConfigName = getConsoleConfigurationName(event.getNewValue().toString());
+ if(consoleConfigName!=null) {
+ configEditor.setValue(consoleConfigName);
+ }
+ }
+ validate();
+ }
+
+ protected boolean isProjectSettingsOk() {
+ if(rootSeamProject!=null) {
+ if(!isValidRuntimeConfigured(rootSeamProject)) {
+ return false;
+ }
+ IEclipsePreferences prefs = SeamCorePlugin.getSeamPreferences(rootSeamProject);
+ return SeamProjectPropertyValidator.isFolderPathValid(prefs.get(ISeamFacetDataModelProperties.ENTITY_BEAN_SOURCE_FOLDER, ""), false) &&
+ SeamProjectPropertyValidator.isFolderPathValid(prefs.get(ISeamFacetDataModelProperties.SESSION_BEAN_SOURCE_FOLDER, ""), false) &&
+ SeamProjectPropertyValidator.isFolderPathValid(prefs.get(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER, ""), false) &&
+ (ISeamFacetDataModelProperties.DEPLOY_AS_WAR.equals(prefs.get(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, ISeamFacetDataModelProperties.DEPLOY_AS_WAR).trim()) || SeamProjectPropertyValidator.isProjectNameValid(prefs.get(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT, ""), false));
+ }
+ return true;
+ }
+
+ /**
+ * @param project
+ */
+ protected boolean isValidRuntimeConfigured(IProject project) {
+ Map<String, IStatus> errors;
+ String seamRt = SeamCorePlugin.getSeamPreferences(project).get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,""); //$NON-NLS-1$
+ errors = ValidatorFactory.SEAM_RUNTIME_VALIDATOR.validate(seamRt, null);
+ if(!errors.isEmpty()) {
+ setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
+ setPageComplete(false);
+ return false;
+ }
+ return true;
+ }
+
+ private void validate() {
+ String projectName = projectEditor.getValue().toString();
+ Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectName, null);
+
+ if(!errors.isEmpty() || !isProjectSettingsOk()) {
+ IStatus errorMessage = errors.get(IValidator.DEFAULT_ERROR);
+ if(errorMessage==null) {
+ setErrorMessage(SeamUIMessages.VALIDATOR_INVALID_SETTINGS);
+ setPageComplete(false);
+ } else {
+ if(errorMessage.getSeverity()==IStatus.ERROR) {
+ setErrorMessage(errorMessage.getMessage());
+ setPageComplete(false);
+ } else {
+ setMessage(errorMessage.getMessage());
+ }
+ }
+ return;
+ }
+ String config = (String)configEditor.getValue();
+ if(config==null || config.length()==0) {
+ setErrorMessage(SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_HIBERNATE_CONFIGURATION_ERROR);
+ setPageComplete(false);
+ return;
+ }
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ SeamProjectsSet seamProjectsSet = SeamProjectsSet.create(project);
+ IContainer viewsFolder = seamProjectsSet.getViewsFolder();
+ if (viewsFolder != null){
+ if (!viewsFolder.getFolder(new Path("layout")).exists()){//$NON-NLS-1$
+ setErrorMessage(SeamUIMessages.bind(SeamUIMessages.VALIDATOR_FACTORY_FOLDER_DOES_NOT_EXIST,
+ viewsFolder.getName() + "/layout"));//$NON-NLS-1$
+ setPageComplete(false);
+ return;
+ }
+ }
+
+ setErrorMessage(null);
+ setMessage(null);
+ setPageComplete(true);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ if(adapter == Map.class) {
+ Map<String, INamedElement> values = new HashMap<String, INamedElement>();
+ values.put(projectEditor.getName(), new NamedElementImpl(projectEditor.getName(), projectEditor.getValueAsString()));
+ values.put(configEditor.getName(), new NamedElementImpl(configEditor.getName(), configEditor.getValueAsString()));
+ String mode = radios.getValue().toString();
+ String value = "reverse".equals(mode) ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ values.put(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, new NamedElementImpl("reverse", value)); //$NON-NLS-1$
+ IWizardPage page2 = getWizard().getPage(SeamGenerateEntitiesTablesWizardPage.pageName);
+ if (page2 instanceof SeamGenerateEntitiesTablesWizardPage){
+ SeamGenerateEntitiesTablesWizardPage page = (SeamGenerateEntitiesTablesWizardPage)page2;
+ String filters = page.getFilters();
+ if (filters.length() > 0) values.put(HibernateLaunchConstants.ATTR_REVENG_TABLES, new NamedElementImpl("filters", filters)); //$NON-NLS-1$
+ }
+ return values;
+ }
+ return null;
+ }
+
+ class NamedElementImpl implements INamedElement {
+
+ private String name;
+ private Object value;
+
+ public NamedElementImpl(String name, Object value) {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public String getValueAsString() {
+ return value.toString();
+ }
+
+ public void setValue(Object newValue) {
+ this.value = newValue;
+ }
+
+ public void setValueAsString(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return getValueAsString();
+ }
+ }
+
+ @Override
+ public boolean canFlipToNextPage() {
+ return "reverse".equals(radios.getValue()) && (getErrorMessage() == null); //$NON-NLS-1$
+ }
+
+ public String getConsoleCongigurationName(){
+ return configEditor.getValueAsString();
+ }
+}
\ No newline at end of file
16 years, 5 months
JBoss Tools SVN: r16955 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-08-04 04:17:02 -0400 (Tue, 04 Aug 2009)
New Revision: 16955
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4695
https://jira.jboss.org/jira/browse/JBIDE-4012
Specified by user view path should be used.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-08-04 06:21:53 UTC (rev 16954)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-08-04 08:17:02 UTC (rev 16955)
@@ -237,7 +237,7 @@
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
SeamProjectsSet seamProjectsSet = SeamProjectsSet.create(project);
- IContainer viewsFolder = seamProjectsSet.getDefaultViewsFolder();
+ IContainer viewsFolder = seamProjectsSet.getViewsFolder();
if (viewsFolder != null){
if (!viewsFolder.getFolder(new Path("layout")).exists()){//$NON-NLS-1$
setErrorMessage(SeamUIMessages.bind(SeamUIMessages.VALIDATOR_FACTORY_FOLDER_DOES_NOT_EXIST,
16 years, 5 months
JBoss Tools SVN: r16954 - trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-08-04 02:21:53 -0400 (Tue, 04 Aug 2009)
New Revision: 16954
Modified:
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/Validator.java
Log:
JBIDE-4699: hook bpel validator with project build action
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/Validator.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/Validator.java 2009-08-03 22:29:19 UTC (rev 16953)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/Validator.java 2009-08-04 06:21:53 UTC (rev 16954)
@@ -10,9 +10,15 @@
*******************************************************************************/
package org.eclipse.bpel.validator;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.bpel.validator.model.IProblem;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdapterManager;
@@ -75,7 +81,12 @@
String s[] = helper.getURIs();
if (s.length < 1) {
- return ;
+ if(helper instanceof ValidatorHelper){
+ s = getURIsByProject(((ValidatorHelper)helper).getProject());
+ }
+ else{
+ return ;
+ }
}
for (String f : s) {
@@ -108,9 +119,32 @@
}
}
+ private String[] getURIsByProject(IProject project){
+
+ final List<String> bpelFolders = new ArrayList<String>();
+ IResourceVisitor bpelFolderFinder = new IResourceVisitor() {
+
+ public boolean visit(IResource resource) throws CoreException {
+ if( resource.getType() == IResource.FILE){
+ if("bpel".equals(resource.getFileExtension())){
+ bpelFolders.add(resource.getFullPath().toOSString());
+ return false;
+ }
+ }
+ return true;
+ }
+ };
+ try {
+ project.accept(bpelFolderFinder);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ String[] URIs = new String[bpelFolders.size()];
+ return bpelFolders.toArray(URIs);
+ }
-
void p(String msg) {
if (bDebug) {
System.out.printf("[%1$s]>> %2$s\n", getClass().getName(),msg);
16 years, 5 months
JBoss Tools SVN: r16953 - trunk/bpel/tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-08-03 18:29:19 -0400 (Mon, 03 Aug 2009)
New Revision: 16953
Added:
trunk/bpel/tests/org.jboss.tools.bpel.ui.test/
Removed:
trunk/bpel/tests/org.eclipse.tools.bpel.ui.test/
Log:
Copied: trunk/bpel/tests/org.jboss.tools.bpel.ui.test (from rev 16952, trunk/bpel/tests/org.eclipse.tools.bpel.ui.test)
16 years, 5 months
JBoss Tools SVN: r16952 - trunk/bpel/features/org.jboss.tools.bpel.tests.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-08-03 15:13:53 -0400 (Mon, 03 Aug 2009)
New Revision: 16952
Modified:
trunk/bpel/features/org.jboss.tools.bpel.tests.feature/feature.xml
Log:
left only reuired bpel.ui.test plugin in bpel.test feature
Modified: trunk/bpel/features/org.jboss.tools.bpel.tests.feature/feature.xml
===================================================================
--- trunk/bpel/features/org.jboss.tools.bpel.tests.feature/feature.xml 2009-08-03 18:59:52 UTC (rev 16951)
+++ trunk/bpel/features/org.jboss.tools.bpel.tests.feature/feature.xml 2009-08-03 19:13:53 UTC (rev 16952)
@@ -33,39 +33,9 @@
</requires>
<plugin
- id="org.eclipse.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.common"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.test"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
id="org.jboss.tools.bpel.ui.test"
download-size="0"
install-size="0"
version="0.0.0"/>
- <plugin
- id="org.jboss.tools.bpel.ui.test.source"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
</feature>
16 years, 5 months