JBoss Tools SVN: r9771 - in trunk/as/docs/reference/en/images: tptp_support and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-08-18 08:09:24 -0400 (Mon, 18 Aug 2008)
New Revision: 9771
Added:
trunk/as/docs/reference/en/images/tptp_support/
trunk/as/docs/reference/en/images/tptp_support/tptp_support_1.png
trunk/as/docs/reference/en/images/tptp_support/tptp_support_2.png
Log:
https://jira.jboss.org/jira/browse/JBDS-385 - adding screens for new "TPTP support" chapter
Added: trunk/as/docs/reference/en/images/tptp_support/tptp_support_1.png
===================================================================
(Binary files differ)
Property changes on: trunk/as/docs/reference/en/images/tptp_support/tptp_support_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/as/docs/reference/en/images/tptp_support/tptp_support_2.png
===================================================================
(Binary files differ)
Property changes on: trunk/as/docs/reference/en/images/tptp_support/tptp_support_2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 8 months
JBoss Tools SVN: r9770 - in trunk/as/docs/reference/en/images: perspective and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-08-18 08:08:30 -0400 (Mon, 18 Aug 2008)
New Revision: 9770
Modified:
trunk/as/docs/reference/en/images/modules/modules_3.png
trunk/as/docs/reference/en/images/perspective/perspective_1.png
trunk/as/docs/reference/en/images/perspective/perspective_17.png
trunk/as/docs/reference/en/images/perspective/perspective_18.png
trunk/as/docs/reference/en/images/perspective/perspective_19.png
trunk/as/docs/reference/en/images/perspective/perspective_21.png
trunk/as/docs/reference/en/images/perspective/perspective_4.png
trunk/as/docs/reference/en/images/perspective/perspective_5.png
trunk/as/docs/reference/en/images/perspective/perspective_6.png
trunk/as/docs/reference/en/images/perspective/perspective_7.png
trunk/as/docs/reference/en/images/perspective/perspective_8.png
trunk/as/docs/reference/en/images/perspective/perspective_9.png
trunk/as/docs/reference/en/images/quick_start/quick_start_1.png
trunk/as/docs/reference/en/images/quick_start/quick_start_2.png
trunk/as/docs/reference/en/images/quick_start/quick_start_3.png
trunk/as/docs/reference/en/images/quick_start/quick_start_5.png
Log:
https://jira.jboss.org/jira/browse/JBDS-385 - updating screens
Modified: trunk/as/docs/reference/en/images/modules/modules_3.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_1.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_17.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_18.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_19.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_21.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_4.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_5.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_6.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_7.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_8.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/perspective/perspective_9.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/quick_start/quick_start_1.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/quick_start/quick_start_2.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/quick_start/quick_start_3.png
===================================================================
(Binary files differ)
Modified: trunk/as/docs/reference/en/images/quick_start/quick_start_5.png
===================================================================
(Binary files differ)
17 years, 8 months
JBoss Tools SVN: r9769 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/util.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-08-18 08:08:22 -0400 (Mon, 18 Aug 2008)
New Revision: 9769
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/util/XModelTreeListenerSWTASync.java
Log:
Fixed problem caused by the previous commit:
Tree views would not update on adding/removing model objects.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/util/XModelTreeListenerSWTASync.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/util/XModelTreeListenerSWTASync.java 2008-08-18 12:08:00 UTC (rev 9768)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/util/XModelTreeListenerSWTASync.java 2008-08-18 12:08:22 UTC (rev 9769)
@@ -16,12 +16,10 @@
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.*;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
public class XModelTreeListenerSWTASync implements XModelTreeListener {
private XModelTreeListener listener;
-
Queue<XModelTreeEvent> queue = new ConcurrentLinkedQueue<XModelTreeEvent>();
private Set<XModelObject> nodes = new HashSet<XModelObject>();
@@ -30,12 +28,15 @@
private synchronized void add(XModelTreeEvent event) {
if(event.kind() == XModelTreeEvent.NODE_CHANGED) {
+ //If event has other kind than NODE_CHANGED, it should never be filtered out!
if(nodes.contains(event.getModelObject())) {
return;
}
- queue.add(event);
+ //Add to filter
+ nodes.add(event.getModelObject());
}
-
+ //Add event to queue.
+ queue.add(event);
}
private void run(XModelTreeEvent event) {
@@ -72,12 +73,16 @@
public void run() {
XModelTreeListener listener = getListener();
if (listener != null) {
- for (XModelTreeEvent event : queue) {
- if(event.kind() == XModelTreeEvent.NODE_CHANGED) {
- listener.nodeChanged(event);
- } else {
- listener.structureChanged(event);
+ try {
+ for (XModelTreeEvent event : queue) {
+ if (event.kind() == XModelTreeEvent.NODE_CHANGED) {
+ listener.nodeChanged(event);
+ } else {
+ listener.structureChanged(event);
+ }
}
+ } finally {
+ runnable = null;
}
}
}
17 years, 8 months
JBoss Tools SVN: r9768 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-08-18 08:08:00 -0400 (Mon, 18 Aug 2008)
New Revision: 9768
Modified:
trunk/as/docs/reference/en/modules/modules.xml
trunk/as/docs/reference/en/modules/webtools.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-385 - updating some screens titles
Modified: trunk/as/docs/reference/en/modules/modules.xml
===================================================================
--- trunk/as/docs/reference/en/modules/modules.xml 2008-08-18 12:07:33 UTC (rev 9767)
+++ trunk/as/docs/reference/en/modules/modules.xml 2008-08-18 12:08:00 UTC (rev 9768)
@@ -181,9 +181,4 @@
<para>The last chapter covers a variety of methods on how you can deploy needed modules onto a
server.</para>
-
- <para>In summary, this reference supplies you with all necessary information on the
- functionality that <property>JBoss Server Manager</property> provides for work with <ulink
- url="http://www.jboss.org/jbossas">JBoss AS</ulink>.</para>
-
</chapter>
Modified: trunk/as/docs/reference/en/modules/webtools.xml
===================================================================
--- trunk/as/docs/reference/en/modules/webtools.xml 2008-08-18 12:07:33 UTC (rev 9767)
+++ trunk/as/docs/reference/en/modules/webtools.xml 2008-08-18 12:08:00 UTC (rev 9768)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<chapter id="webtools">
<title>Projects</title>
<para>The most popular of the projects we deal with are the J2EE ones, such as Dynamic Web
17 years, 8 months
JBoss Tools SVN: r9767 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-08-18 08:07:33 -0400 (Mon, 18 Aug 2008)
New Revision: 9767
Modified:
trunk/as/docs/reference/en/modules/perspective.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-385 - adding link to TPTP support chapter
Modified: trunk/as/docs/reference/en/modules/perspective.xml
===================================================================
--- trunk/as/docs/reference/en/modules/perspective.xml 2008-08-18 12:06:05 UTC (rev 9766)
+++ trunk/as/docs/reference/en/modules/perspective.xml 2008-08-18 12:07:33 UTC (rev 9767)
@@ -58,8 +58,16 @@
<para>In order to debug your applications or EJB's that are deployed to the server, you must
start the server in debug mode. By starting the server in debug mode, eclipse will allow
you to set breakpoints on code in your workspace and step through the code.</para>
-
- <para>The publish icon on the extreme right will republish any modules where it has
+
+ <para><emphasis>
+ <property>Start the server in profiling mode</property>
+ </emphasis> button allows to enable profiling actions for your application. For more
+ details on how to start using TPTP profiling with <property>JBoss Tools</property> refer
+ to <link linkend="tptp_support">TPTP Support</link> chapter.</para>
+
+ <para><emphasis>
+ <property>Publish to the server</property>
+ </emphasis> button on the extreme right will republish any modules where it has
determined the workspace is out of sync with the server. It will attempt to do an
incremental publish if it turns out that the module in question is capable of doing one.</para>
@@ -146,8 +154,8 @@
</mediaobject>
</figure>
- <para id="com_line_arg">The editor will also allow you to modify that server's launch
- configuration. It's just after clicking <emphasis>
+ <para id="com_line_arg">The editor will also allow you to modify that server's
+ launch configuration. It's just after clicking <emphasis>
<property>Open launch configuration</property>
</emphasis> link. In the open window there are the tabs for setting command line
arguments and other things that are relevant to launching the server.</para>
@@ -171,7 +179,7 @@
on a server.</para>
<figure>
- <title>Launch Configuration</title>
+ <title>Twiddle Server</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/perspective/perspective_21.png"/>
@@ -374,7 +382,7 @@
</figure>
<figure>
- <title>Stopping the Server</title>
+ <title>Starting the Server</title>
<mediaobject>
<imageobject>
<imagedata fileref="images/perspective/perspective_6.png"/>
@@ -780,13 +788,13 @@
<title>Relevant Resources Links</title>
<para>Refer to <ulink url="http://ant.apache.org/manual/index.html">Ant manual</ulink>
to find more on how to build your applications with help of Ant.</para>
-
+
<para>At this point, you are guessed to be familiar with <property>JBoss AS
- Perspective</property> and your next step now is to explore how to work with different kinds
- of projects.</para>
+ Perspective</property> and your next step now is to explore how to work with
+ different kinds of projects.</para>
</section>
-
+
</section>
-
+
</chapter>
17 years, 8 months
JBoss Tools SVN: r9766 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-08-18 08:06:05 -0400 (Mon, 18 Aug 2008)
New Revision: 9766
Added:
trunk/as/docs/reference/en/modules/tptp_support.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-385 -adding new chapter "TPTPT support"
Added: trunk/as/docs/reference/en/modules/tptp_support.xml
===================================================================
--- trunk/as/docs/reference/en/modules/tptp_support.xml (rev 0)
+++ trunk/as/docs/reference/en/modules/tptp_support.xml 2008-08-18 12:06:05 UTC (rev 9766)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="tptp_support" role="new">
+ <title>TPTP Support</title>
+ <para>This chapter provides an overview on how to enable TPTP Profiling for <property>JBoss
+ AS</property> adapters in <property>JBoss Tools</property>.</para>
+
+ <section>
+ <title>TPTP Profiling</title>
+
+ <para>To get TPTP profiling work on <property>JBoss Application Server</property> you should
+ first download <ulink
+ url="http://www.eclipse.org/downloads/download.php?file=/tptp/4.5.0/TPTP-4.5.0..."
+ >TPTP 4.5.0 Runtime</ulink> and install it, i. e. just add the content of <emphasis>
+ <property>plugins/features</property>
+ </emphasis> folders from downloaded directory to the same folders in your eclipse
+ installation directory.</para>
+
+ <para>And now all profile actions should work for you. To start <property>JBoss
+ AS</property> in profiling mode use <emphasis>
+ <property>Start the server in profiling mode</property>
+ </emphasis> button or <emphasis>
+ <property>Profile As > Profile on Server</property>
+ </emphasis> option in the context menu of the project.</para>
+
+ <figure>
+ <title>Start the Server in Profiling mode</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tptp_support/tptp_support_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>To enable TPTP features in your workbench use <property>Profiling and Logging
+ Perspective</property> that you can find in the list of proposed perspectives: <emphasis>
+ <property>Window > Open Perspective > Other…</property>
+ </emphasis>
+ </para>
+
+ <figure>
+ <title>Profiling and Logging Perspective</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tptp_support/tptp_support_2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <section>
+ <title>Relevant Resources Links</title>
+ <para>All additional information on TPTP(Test and Performance Tools Platform) you can find
+ in <ulink
+ url="http://www.eclipse.org/tptp/home/downloads/4.5.0/documents/quicktour/quic..."
+ >eclipse documentation</ulink>.</para>
+ </section>
+
+ <para>In summary, this reference should help you to start with <ulink
+ url="http://www.jboss.org/jbossas">JBoss AS</ulink> and get to know with functionality
+ for work with it.</para>
+</chapter>
17 years, 8 months
JBoss Tools SVN: r9765 - trunk/as/docs/reference/en.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-08-18 08:05:13 -0400 (Mon, 18 Aug 2008)
New Revision: 9765
Modified:
trunk/as/docs/reference/en/master.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-385 - adding new chapter "TPTP support"
Modified: trunk/as/docs/reference/en/master.xml
===================================================================
--- trunk/as/docs/reference/en/master.xml 2008-08-18 10:24:07 UTC (rev 9764)
+++ trunk/as/docs/reference/en/master.xml 2008-08-18 12:05:13 UTC (rev 9765)
@@ -7,6 +7,7 @@
<!ENTITY perspective SYSTEM "modules/perspective.xml">
<!ENTITY webtools SYSTEM "modules/webtools.xml">
<!ENTITY modules SYSTEM "modules/modules.xml">
+<!ENTITY tptp_support SYSTEM "modules/tptp_support.xml">
<!ENTITY seamlink "../../seam/html_single/index.html">
<!ENTITY aslink "../../as/html_single/index.html">
@@ -51,4 +52,6 @@
&perspective;
&webtools;
&modules;
+ &tptp_support;
+
</book>
17 years, 8 months
JBoss Tools SVN: r9764 - in workspace/Denny: org.jboss.tools.esb/META-INF and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-08-18 06:24:07 -0400 (Mon, 18 Aug 2008)
New Revision: 9764
Added:
workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.ui.template.exsd
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBPlugin.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/IJBossESBFacetDataModelProperties.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationConfig.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationDelegate.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/actions/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/actions/IInstallTemplateDelegate.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/AbstractESBWizardPage.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/IESBTemplatePage.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplatePackageNameWizardPage.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/utils/
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/utils/ResourceUtils.java
Removed:
workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.template.exsd
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/Activator.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/IJBossESBFacetDataModelProperties.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationConfig.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationDelegate.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplagePackageNameWizardPage.java
Modified:
workspace/Denny/org.jboss.tools.esb.editor/.project
workspace/Denny/org.jboss.tools.esb.editor/META-INF/MANIFEST.MF
workspace/Denny/org.jboss.tools.esb/.project
workspace/Denny/org.jboss.tools.esb/META-INF/MANIFEST.MF
workspace/Denny/org.jboss.tools.esb/plugin.xml
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/AbstractESBProjectCreationWizard.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/ESBProjectCreationWizard.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/JBossESBFacetProjectCreationDataModelProvider.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBFacetInstallationPage.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBProjectTemplateWizardPage.java
workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/NewESBProjectWizardPage.java
Log:
Modified: workspace/Denny/org.jboss.tools.esb/.project
===================================================================
--- workspace/Denny/org.jboss.tools.esb/.project 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/.project 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.jboss.tools.esb</name>
+ <name>org.jboss.tools.esb.project.ui</name>
<comment></comment>
<projects>
</projects>
Modified: workspace/Denny/org.jboss.tools.esb/META-INF/MANIFEST.MF
===================================================================
--- workspace/Denny/org.jboss.tools.esb/META-INF/MANIFEST.MF 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/META-INF/MANIFEST.MF 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,9 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Esbproject Plug-in
-Bundle-SymbolicName: org.jboss.tools.esb;singleton:=true
+Bundle-SymbolicName: org.jboss.tools.esb.project.ui;singleton:=true
Bundle-Version: 1.0.0
-Bundle-Activator: org.jboss.tools.esb.Activator
+Bundle-Activator: org.jboss.tools.esb.JBossESBPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.pde.ui,
@@ -24,7 +24,7 @@
org.eclipse.jst.servlet.ui;bundle-version="1.1.200",
org.eclipse.jst.common.frameworks;bundle-version="1.1.200",
org.eclipse.jst.common.project.facet.core;bundle-version="1.3.0",
- org.jboss.tools.esb.editor;bundle-version="1.0.0",
+ org.jboss.tools.esb.project.editor;bundle-version="1.0.0",
org.eclipse.jst.j2ee;bundle-version="1.1.200",
org.eclipse.jst.j2ee.web;bundle-version="1.1.200",
org.eclipse.jst.j2ee.core;bundle-version="1.1.200",
Modified: workspace/Denny/org.jboss.tools.esb/plugin.xml
===================================================================
--- workspace/Denny/org.jboss.tools.esb/plugin.xml 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/plugin.xml 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
- <extension-point id="org.jboss.tools.esb.project.template" name="ESB Template" schema="schema/org.jboss.tools.esb.project.template.exsd"/>
+ <extension-point id="org.jboss.tools.esb.project.ui.template" name="ESB Template" schema="schema/org.jboss.tools.esb.project.ui.template.exsd"/>
<extension
point="org.eclipse.ui.newWizards">
<wizard
@@ -32,10 +32,10 @@
type="install"
version="4.2">
<delegate
- class="org.jboss.tools.esb.JBossESBFacetInstallationDelegate">
+ class="org.jboss.tools.esb.project.facet.JBossESBFacetInstallationDelegate">
</delegate>
<config-factory
- class="org.jboss.tools.esb.JBossESBFacetInstallationConfig">
+ class="org.jboss.tools.esb.project.facet.JBossESBFacetInstallationConfig">
</config-factory>
</action>
</project-facet-version>
@@ -48,10 +48,10 @@
type="install"
version="4.3">
<delegate
- class="org.jboss.tools.esb.JBossESBFacetInstallationDelegate">
+ class="org.jboss.tools.esb.project.facet.JBossESBFacetInstallationDelegate">
</delegate>
<config-factory
- class="org.jboss.tools.esb.JBossESBFacetInstallationConfig">
+ class="org.jboss.tools.esb.project.facet.JBossESBFacetInstallationConfig">
</config-factory>
</action>
</project-facet-version>
@@ -105,5 +105,29 @@
</page>
</wizard-pages>
</extension>
+ <extension
+ point="org.jboss.tools.esb.project.ui.template">
+ <templates
+ ESBversion="4.2,4.3"
+ class="org.jboss.tools.esb.project.ui.templates.HelloWorldInstallTemplateDelegate"
+ description="Hello world"
+ id="org.jboss.tools.esb.project.ui.templates.helloworld"
+ name="HelloWorld"
+ wizardPage="org.jboss.tools.esb.project.ui.templates.HelloWorldTemplateWizardPage">
+ </templates>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <supported>
+ <facet
+ id="jboss.esb"
+ version="4.2,4.3">
+ </facet>
+ <runtime-component
+ id="org.jboss.ide.eclipse.as.runtime.component"
+ version="4.2">
+ </runtime-component>
+ </supported>
+ </extension>
</plugin>
Deleted: workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.template.exsd
===================================================================
--- workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.template.exsd 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.template.exsd 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,120 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.jboss.tools.esb" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.jboss.tools.esb" id="org.jboss.tools.esb.project.template" name="ESB Template"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="template">
- <complexType>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="ESBversion" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute kind="java"/>
- </appinfo>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
Copied: workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.ui.template.exsd (from rev 9461, workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.template.exsd)
===================================================================
--- workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.ui.template.exsd (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/schema/org.jboss.tools.esb.project.ui.template.exsd 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,140 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.esb.project.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.esb.project.ui" id="org.jboss.tools.esb.project.ui.template" name="ESB Template"/>
+ </appinfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="templates" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="templates">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="ESBversion" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.esb.projects.wizards.actions.IInstallTemplateDelegate"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="wizardPage" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn=":org.jboss.tools.esb.projects.wizards.pages.IESBTemplatepage"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Deleted: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/Activator.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/Activator.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/Activator.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,50 +0,0 @@
-package org.jboss.tools.esb;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "esbproject";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
Deleted: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/IJBossESBFacetDataModelProperties.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/IJBossESBFacetDataModelProperties.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/IJBossESBFacetDataModelProperties.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,7 +0,0 @@
-package org.jboss.tools.esb;
-
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-
-public interface IJBossESBFacetDataModelProperties extends IActionConfigFactory {
-
-}
Deleted: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationConfig.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationConfig.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationConfig.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,25 +0,0 @@
-package org.jboss.tools.esb;
-
-import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-
-public class JBossESBFacetInstallationConfig extends
- FacetInstallDataModelProvider implements
- IJBossESBFacetDataModelProperties {
-
- public Object create() {
- // TODO Auto-generated method stub
- return DataModelFactory.createDataModel(this);
-
- }
-
- public Object getDefaultProperty(String propertyName) {
- if (IFacetDataModelProperties.FACET_ID.equals(propertyName)) {
-
- return "jboss.esb";
- }
- return super.getDefaultProperty(propertyName);
- }
-
-}
Deleted: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationDelegate.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationDelegate.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationDelegate.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,61 +0,0 @@
-package org.jboss.tools.esb;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.StringBufferInputStream;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class JBossESBFacetInstallationDelegate implements IDelegate {
-
- private IDataModel model;
- public void execute(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
- System.out.print(config);
- IFile esbFile = null;
- model = (IDataModel)config;
- IFolder esbContent = project.getFolder("ESBContent");
- if(!esbContent.exists()) {
- esbContent.create(true, true, null);
- }
-
- esbContent.getFolder("lib").create(true, true, null);
- esbContent.getFolder("META-INF").create(true, true, null);
- esbFile = createJBossESBXML(esbContent.getFolder("META-INF"));
-
- project.refreshLocal(IResource.DEPTH_ZERO, null);
-
-
- //String prjName = model.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
- //IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjName);
-
-
- }
-
- private IFile createJBossESBXML(IFolder folder) throws CoreException{
- StringBuffer emptyESB = new StringBuffer();
- emptyESB.append("<?xml version = \"1.0\" encoding = \"UTF-8\"?>");
- emptyESB.append("\n");
- emptyESB.append("<jbossesb xmlns=\"http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..." parameterReloadSecs=\"5\">");
- emptyESB.append("\n");
- emptyESB.append("</jbossesb>");
- IFile esbfile = folder.getFile("jboss-esb.xml");
- esbfile.create(new ByteArrayInputStream(emptyESB.toString().getBytes()), true, null);
-
- return esbfile;
- }
-
-}
Copied: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBPlugin.java (from rev 9461, workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/Activator.java)
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBPlugin.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBPlugin.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,50 @@
+package org.jboss.tools.esb;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class JBossESBPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "esbproject";
+
+ // The shared instance
+ private static JBossESBPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public JBossESBPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static JBossESBPlugin getDefault() {
+ return plugin;
+ }
+
+}
Copied: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/IJBossESBFacetDataModelProperties.java (from rev 9461, workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/IJBossESBFacetDataModelProperties.java)
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/IJBossESBFacetDataModelProperties.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/IJBossESBFacetDataModelProperties.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,11 @@
+package org.jboss.tools.esb.project.facet;
+
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+
+public interface IJBossESBFacetDataModelProperties extends IFacetProjectCreationDataModelProperties {
+
+ public static final String USER_DEFINED_LOCATION = "IProjectCreationPropertiesNew.USER_DEFINED_LOCATION"; //$NON-NLS-1$
+ public static final String DEFAULT_LOCATION = "IProjectCreationPropertiesNew.DEFAULT_LOCATION"; //$NON-NLS-1$
+ public static final String USE_DEFAULT_LOCATION = "IProjectCreationPropertiesNew.USE_DEFAULT_LOCATION"; //$NON-NLS-1$
+ public static final String PROJECT_LOCATION = "IProjectCreationPropertiesNew.PROJECT_LOCATION";
+}
Copied: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationConfig.java (from rev 9461, workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationConfig.java)
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationConfig.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationConfig.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,26 @@
+package org.jboss.tools.esb.project.facet;
+
+import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+
+public class JBossESBFacetInstallationConfig extends
+ FacetInstallDataModelProvider implements
+ IJBossESBFacetDataModelProperties, IActionConfigFactory{
+
+ public Object create() {
+ // TODO Auto-generated method stub
+ return DataModelFactory.createDataModel(this);
+
+ }
+
+ public Object getDefaultProperty(String propertyName) {
+ if (IFacetDataModelProperties.FACET_ID.equals(propertyName)) {
+
+ return "jboss.esb";
+ }
+ return super.getDefaultProperty(propertyName);
+ }
+
+}
Copied: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationDelegate.java (from rev 9461, workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/JBossESBFacetInstallationDelegate.java)
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationDelegate.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/project/facet/JBossESBFacetInstallationDelegate.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,61 @@
+package org.jboss.tools.esb.project.facet;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.StringBufferInputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+public class JBossESBFacetInstallationDelegate implements IDelegate {
+
+ private IDataModel model;
+ public void execute(IProject project, IProjectFacetVersion fv,
+ Object config, IProgressMonitor monitor) throws CoreException {
+ System.out.print(config);
+ IFile esbFile = null;
+ model = (IDataModel)config;
+ IFolder esbContent = project.getFolder("ESBContent");
+ if(!esbContent.exists()) {
+ esbContent.create(true, true, null);
+ }
+
+ esbContent.getFolder("lib").create(true, true, null);
+ esbContent.getFolder("META-INF").create(true, true, null);
+ esbFile = createJBossESBXML(esbContent.getFolder("META-INF"));
+
+ project.refreshLocal(IResource.DEPTH_ZERO, null);
+
+
+ //String prjName = model.getStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME);
+ //IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjName);
+
+
+ }
+
+ private IFile createJBossESBXML(IFolder folder) throws CoreException{
+ StringBuffer emptyESB = new StringBuffer();
+ emptyESB.append("<?xml version = \"1.0\" encoding = \"UTF-8\"?>");
+ emptyESB.append("\n");
+ emptyESB.append("<jbossesb xmlns=\"http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml..." parameterReloadSecs=\"5\">");
+ emptyESB.append("\n");
+ emptyESB.append("</jbossesb>");
+ IFile esbfile = folder.getFile("jboss-esb.xml");
+ esbfile.create(new ByteArrayInputStream(emptyESB.toString().getBytes()), true, null);
+
+ return esbfile;
+ }
+
+}
Modified: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/AbstractESBProjectCreationWizard.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/AbstractESBProjectCreationWizard.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/AbstractESBProjectCreationWizard.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,21 +1,14 @@
package org.jboss.tools.esb.projects.wizards;
-import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -23,18 +16,11 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
-import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
@@ -46,9 +32,6 @@
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
-import org.eclipse.wst.web.internal.DelegateConfigurationElement;
-import org.eclipse.wst.web.ui.internal.Logger;
-import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
public abstract class AbstractESBProjectCreationWizard extends ModifyFacetedProjectWizard implements INewWizard, IFacetProjectCreationDataModelProperties {
@@ -62,6 +45,7 @@
this.model = ( model == null ? createDataModel() : model );
this.template = getTemplate();
+ setWindowTitle("New JBoss ESB Project");
setFacetedProjectWorkingCopy((IFacetedProjectWorkingCopy)this.model.getProperty(FACETED_PROJECT_WORKING_COPY));
getFacetedProjectWorkingCopy().setFixedProjectFacets( this.template.getFixedProjectFacets() );
setDefaultPageImageDescriptor(getDefaultPageImageDescriptor());
@@ -262,18 +246,18 @@
{
monitor.beginTask("", 10); //$NON-NLS-1$
- storeDefaultSettings();
+
try {
super.performFinish(new SubProgressMonitor(monitor, 8));
- try {
+ /* try {
getFacetProjectNotificationOperation().execute(new NullProgressMonitor(), null);
} catch (ExecutionException e) {
String msg = e.getMessage();
if( msg == null ) msg = ""; //$NON-NLS-1$
final IStatus st = new Status( IStatus.ERROR, WSTWebUIPlugin.PLUGIN_ID, 0, msg, e );
throw new CoreException( st );
- }
+ }*/
} finally {
monitor.done();
}
@@ -284,11 +268,11 @@
return false;
}
- try {
+ /* try {
postPerformFinish();
} catch (InvocationTargetException e) {
Logger.logException(e);
- }
+ }*/
return true;
}
@@ -375,7 +359,7 @@
*
* @see org.eclipse.wst.common.frameworks.internal.ui.wizard.WTPWizard#postPerformFinish()
*/
- protected void postPerformFinish() throws InvocationTargetException {
+/* protected void postPerformFinish() throws InvocationTargetException {
if (getFinalPerspectiveID() != null && getFinalPerspectiveID().length() > 0) {
final IConfigurationElement element = new DelegateConfigurationElement(configurationElement) {
public String getAttribute(String aName) {
@@ -391,9 +375,9 @@
String projName = getProjectName();
BasicNewResourceWizard.selectAndReveal(ResourcesPlugin.getWorkspace().getRoot().getProject(projName), WSTWebUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
- }
+ }*/
- protected IDataModelOperation getFacetProjectNotificationOperation() {
+ /*protected IDataModelOperation getFacetProjectNotificationOperation() {
return new DataModelPausibleOperationImpl(new AbstractDataModelOperation(this.model) {
public String getID() {
return AbstractESBProjectCreationWizard.class.getName();
@@ -403,7 +387,7 @@
return AbstractDataModelProvider.OK_STATUS;
}
});
- }
+ }*/
/**
* Need to keep the model in sync with the UI. This method will pickup changes coming from the
@@ -442,23 +426,6 @@
model.notifyPropertyChange(FACET_RUNTIME, IDataModel.VALID_VALUES_CHG);
}
- protected void storeDefaultSettings() {
- IWizardPage[] pages = getPages();
- for (int i = 0; i < pages.length; i++)
- storeDefaultSettings(pages[i], i);
- }
-
- /**
- * Subclasses may override if they need to do something special when storing the default
- * settings for a particular page.
- *
- * @param page
- * @param pageIndex
- */
- protected void storeDefaultSettings(IWizardPage page, int pageIndex) {
- if (page instanceof DataModelWizardPage)
- ((DataModelWizardPage) page).storeDefaultSettings();
- }
Modified: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/ESBProjectCreationWizard.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/ESBProjectCreationWizard.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/ESBProjectCreationWizard.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -16,11 +16,9 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.project.facet.IProductConstants;
import org.eclipse.wst.project.facet.ProductManager;
-import org.eclipse.wst.project.facet.SimpleWebFacetProjectCreationDataModelProvider;
import org.eclipse.wst.web.ui.internal.WSTWebUIPlugin;
-import org.jboss.tools.esb.projects.wizards.pages.ESBProjectTemplateWizardPage;
+import org.jboss.tools.esb.projects.wizards.pages.AbstractESBWizardPage;
import org.jboss.tools.esb.projects.wizards.pages.NewESBProjectWizardPage;
-import org.jboss.tools.esb.projects.wizards.pages.TemplagePackageNameWizardPage;
public class ESBProjectCreationWizard extends AbstractESBProjectCreationWizard{
@@ -37,7 +35,7 @@
}
protected IWizardPage createFirstPage() {
- return new NewESBProjectWizardPage(model, "first.page"); //$NON-NLS-1$
+ return new AbstractESBWizardPage(model, "first.page"); //$NON-NLS-1$
}
protected String getFinalPerspectiveID() {
@@ -45,8 +43,8 @@
}
protected IWizardPage[] createBeginingPages() {
- return new IWizardPage[]{createFirstPage(), new ESBProjectTemplateWizardPage(this.model, "Templates"),
- new TemplagePackageNameWizardPage(this.model, "Set Package Name")};
+ return new IWizardPage[]{createFirstPage()/*, new ESBProjectTemplateWizardPage(this.model, "Templates"),
+ new TemplatePackageNameWizardPage(this.model, "Set Package Name")*/};
}
Modified: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/JBossESBFacetProjectCreationDataModelProvider.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/JBossESBFacetProjectCreationDataModelProvider.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/JBossESBFacetProjectCreationDataModelProvider.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -3,6 +3,8 @@
import java.util.ArrayList;
import java.util.Collection;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.jst.common.project.facet.IJavaFacetInstallDataModelProperties;
import org.eclipse.jst.common.project.facet.JavaFacetUtils;
import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
@@ -11,6 +13,8 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.project.facet.ProductManager;
+import org.jboss.tools.esb.project.facet.IJBossESBFacetDataModelProperties;
+import org.jboss.tools.esb.utils.ResourceUtils;
public class JBossESBFacetProjectCreationDataModelProvider extends
FacetProjectCreationDataModelProvider {
@@ -34,10 +38,27 @@
}
public Object getDefaultProperty(String propertyName) {
- if (IFacetDataModelProperties.FACET_ID.equals(propertyName)) {
-
+ if (IFacetDataModelProperties.FACET_ID.equals(propertyName)) {
return "jboss.esb";
}
+ else if (IJBossESBFacetDataModelProperties.DEFAULT_LOCATION.equals(propertyName)){
+ return ResourcesPlugin.getWorkspace().getRoot().getFullPath();
+ }
+ else if(IJBossESBFacetDataModelProperties.USER_DEFINED_LOCATION.equals(propertyName)){
+ return true;
+ }
+ else if(IJBossESBFacetDataModelProperties.FACET_PROJECT_NAME.equals(propertyName)){
+ return "";
+ }
return super.getDefaultProperty(propertyName);
}
+
+ @Override
+ public IStatus validate(String propertyName) {
+ if(FACET_PROJECT_NAME.equals(propertyName)){
+ String projectName = model.getStringProperty(FACET_PROJECT_NAME);
+ return ResourceUtils.validateName(projectName);
+ }
+ return super.validate(propertyName);
+ }
}
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/actions/IInstallTemplateDelegate.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/actions/IInstallTemplateDelegate.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/actions/IInstallTemplateDelegate.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,7 @@
+package org.jboss.tools.esb.projects.wizards.actions;
+
+public interface IInstallTemplateDelegate {
+
+ void execute();
+
+}
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/AbstractESBWizardPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/AbstractESBWizardPage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/AbstractESBWizardPage.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,558 @@
+package org.jboss.tools.esb.projects.wizards.pages;
+
+
+import java.awt.Dialog;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+
+import org.eclipse.core.internal.resources.Resource;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
+import org.eclipse.wst.common.frameworks.internal.WTPPlugin;
+import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
+import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonMessages;
+import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
+import org.eclipse.wst.common.project.facet.core.events.IProjectFacetsChangedEvent;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
+import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
+import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.ui.ServerUIUtil;
+import org.eclipse.wst.server.ui.internal.wizard.NewRuntimeWizard;
+import org.eclipse.wst.web.internal.facet.RuntimePresetMappingRegistry;
+import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage.Messages;
+import org.jboss.tools.esb.project.facet.IJBossESBFacetDataModelProperties;
+
+import com.sun.org.apache.xpath.internal.axes.HasPositionalPredChecker;
+
+import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
+
+
+public class AbstractESBWizardPage extends WizardPage implements Listener, IDataModelListener, IJBossESBFacetDataModelProperties{
+
+
+ protected Combo serverTargetCombo;
+ private final IFacetedProjectWorkingCopy fpjwc;
+ private final IFacetedProjectListener fpjwcListener;
+ protected IProjectFacet primaryProjectFacet = null;
+ protected Combo primaryVersionCombo = null;
+ IDataModel model;
+ private Text projectNameField;
+ private Text locationPathField;
+ private Button browseButton;
+ private boolean isValidating = false;
+ private boolean hasValidPrjLocation = true;
+ private boolean hasValidPrjName = false;
+
+ public AbstractESBWizardPage(IDataModel model,String pageName) {
+ super( pageName);
+ this.model = model;
+ setTitle("JBoss ESB Project");
+ setDescription("Create a new JBoss ESB project.");
+ this.fpjwc = (IFacetedProjectWorkingCopy) this.model.getProperty( FACETED_PROJECT_WORKING_COPY );
+
+ this.fpjwcListener = new IFacetedProjectListener()
+ {
+ public void handleEvent( final IFacetedProjectEvent event )
+ {
+ validatePage();
+ }
+ };
+
+ this.fpjwc.addListener( this.fpjwcListener, IFacetedProjectEvent.Type.VALIDATION_PROBLEMS_CHANGED );
+
+ this.model.addListener(this);
+ }
+
+ protected void validatePage() {
+ }
+
+
+ public void handleEvent(Event event) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void propertyChanged(DataModelEvent event) {
+ setPageErrorMesage();
+ }
+
+ private void setPageErrorMesage(){
+ IStatus status = model.validateProperty(FACET_PROJECT_NAME);
+ boolean useDefault = model.getBooleanProperty(USE_DEFAULT_LOCATION);
+ String prjLocation = model.getStringProperty(PROJECT_LOCATION);
+ File locationPath = new File(prjLocation);
+ if(status.getSeverity() == IStatus.ERROR){
+ setErrorMessage(status.getMessage());
+ hasValidPrjName = false;
+ setPageComplete(isPageComplete());
+ }
+ else if(!useDefault && !locationPath.exists()){
+ setErrorMessage("Project location is not a valid path.");
+ hasValidPrjLocation = false;
+ setPageComplete(isPageComplete());
+
+ }
+ else{
+ setErrorMessage(null);
+ hasValidPrjLocation = true;
+ hasValidPrjName = true;
+ setPageComplete(isPageComplete());
+ }
+
+
+ }
+
+ public void createControl(Composite parent) {
+
+ Composite top = new Composite(parent, SWT.NONE);
+ //PlatformUI.getWorkbench().getHelpSystem().setHelp(top, getInfopopID());
+ top.setLayout(new GridLayout());
+ top.setLayoutData(new GridData(GridData.FILL_BOTH));
+ createProjectGroup(top);
+ createServerTargetComposite(top);
+ createPrimaryFacetComposite(top);
+
+ setControl(top);
+ }
+
+ protected static GridData gdhfill() {
+ return new GridData(GridData.FILL_HORIZONTAL);
+ }
+
+ protected void createServerTargetComposite(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setText("Tartget JBoss Server");
+ group.setLayoutData(gdhfill());
+ group.setLayout(new GridLayout(2, false));
+ serverTargetCombo = new Combo(group, SWT.BORDER | SWT.READ_ONLY);
+ serverTargetCombo.setLayoutData(gdhfill());
+ serverTargetCombo.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ saveRuntimeToProject();
+ }
+ });
+
+ Button newServerTargetButton = new Button(group, SWT.NONE);
+ newServerTargetButton.setText("N&ew...");
+ newServerTargetButton.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ NewRuntimeWizard wizard = new NewRuntimeWizard();
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(),wizard);
+
+ boolean isOK = dialog.open() == WizardDialog.OK;//ServerUIUtil.showNewRuntimeWizard(Display.getCurrent().getActiveShell(), null, null);
+ if(isOK){
+ Object obj = wizard.getTaskModel().getObject("runtime");
+ if(obj instanceof IRuntime){
+ IRuntime newRuntime = (IRuntime)obj;
+ refreshRuntimeCombo(FACET_RUNTIME, DataModelEvent.VALUE_CHG, serverTargetCombo, newRuntime);
+ }
+ }
+ }
+
+ });
+ //Control[] deps = new Control[]{newServerTargetButton};
+ //synchHelper.synchCombo(serverTargetCombo, FACET_RUNTIME, deps);
+ refreshRuntimeCombo(FACET_RUNTIME, DataModelEvent.VALUE_CHG, serverTargetCombo, null);
+ if (serverTargetCombo.getSelectionIndex() == -1 && serverTargetCombo.getVisibleItemCount() != 0)
+ serverTargetCombo.select(0);
+ }
+
+ protected void createPrimaryFacetComposite(Composite top) {
+ primaryProjectFacet = ProjectFacetsManager.getProjectFacet( getModuleTypeID() );
+ if (primaryProjectFacet.getVersions().size() <= 1){
+ //there is no need to create this section if there is only one
+ //facet version to choose from (e.g. utility and static web)
+ return;
+ }
+
+ final Group group = new Group( top, SWT.NONE );
+ group.setLayoutData( gdhfill() );
+ group.setLayout( new GridLayout( 1, false ) );
+ group.setText( Messages.bind( Messages.FACET_VERSION, new Object [] {primaryProjectFacet.getLabel()}));
+
+ primaryVersionCombo = new Combo( group, SWT.BORDER | SWT.READ_ONLY );
+ primaryVersionCombo.setLayoutData( gdhfill() );
+ updatePrimaryVersions();
+
+ primaryVersionCombo.addSelectionListener
+ (
+ new SelectionAdapter()
+ {
+ @Override
+ public void widgetSelected( final SelectionEvent e )
+ {
+ handlePrimaryFacetVersionSelectedEvent();
+ }
+ }
+ );
+
+ fpjwc.addListener(new IFacetedProjectListener() {
+ public void handleEvent(IFacetedProjectEvent event) {
+ if(event.getType() == IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED){
+ //this block is to update the combo when the underlying facet version changes
+ IProjectFacetsChangedEvent actionEvent = (IProjectFacetsChangedEvent)event;
+ Set<IProjectFacetVersion> changedVersions = actionEvent.getFacetsWithChangedVersions();
+
+ boolean foundComboVersion = false;
+ for(Iterator <IProjectFacetVersion> iterator = changedVersions.iterator(); iterator.hasNext() && !foundComboVersion;){
+ IProjectFacetVersion next = iterator.next();
+ if(next.getProjectFacet().equals(primaryProjectFacet)){
+ foundComboVersion = true;
+ final IProjectFacetVersion selectedVersion = next;
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run() {
+ String selectedText = primaryVersionCombo.getItem(primaryVersionCombo.getSelectionIndex());
+ if(!selectedText.equals(selectedVersion.getVersionString())){
+ String [] items = primaryVersionCombo.getItems();
+ int selectedVersionIndex = -1;
+ for(int i=0;i<items.length && selectedVersionIndex == -1; i++){
+ if(items[i].equals(selectedVersion.getVersionString())){
+ selectedVersionIndex = i;
+ primaryVersionCombo.select(selectedVersionIndex);
+ }
+ }
+ }
+ }
+ });
+ }
+ }
+ } else if(event.getType() == IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED){
+ //this block updates the items in the combo when the runtime changes
+ Display.getDefault().asyncExec(new Runnable(){
+ public void run() {
+ updatePrimaryVersions();
+ }
+ });
+ }
+ }
+
+ }, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED, IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
+ }
+
+ protected void createProjectGroup(Composite parent) {
+/* IDataModel nestedProjectDM = model.getNestedModel(NESTED_PROJECT_DM);
+ nestedProjectDM.addListener(this);
+ projectNameGroup = new NewProjectGroup(parent, nestedProjectDM);*/
+
+ Font font = parent.getFont();
+ // project specification group
+ Composite projectCom = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ projectCom.setLayout(layout);
+ projectCom.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ // new project label
+ Label projectLabel = new Label(projectCom, SWT.NONE);
+ projectLabel.setFont(font);
+ projectLabel.setText("Project Name:");
+
+ // new project name entry field
+ projectNameField = new Text(projectCom, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ projectNameField.setLayoutData(data);
+ projectNameField.setFont(font);
+ projectNameField.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e){
+ model.setStringProperty(FACET_PROJECT_NAME, projectNameField.getText());
+ }
+ });
+
+
+
+ // project specification group
+ Group projectGroup = new Group(parent, SWT.NONE);
+ layout = new GridLayout();
+ layout.numColumns = 3;
+ projectGroup.setLayout(layout);
+ projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ projectGroup.setFont(font);
+ projectGroup.setText("Project contents:");
+
+ final Button useDefaultsButton = new Button(projectGroup, SWT.CHECK | SWT.RIGHT);
+ useDefaultsButton.setText("Use &default");
+ useDefaultsButton.setFont(font);
+
+ GridData buttonData = new GridData();
+ buttonData.horizontalSpan = 3;
+ useDefaultsButton.setLayoutData(buttonData);
+ useDefaultsButton.setSelection(model.getBooleanProperty(USE_DEFAULT_LOCATION));
+ useDefaultsButton.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ model.setBooleanProperty(USE_DEFAULT_LOCATION, useDefaultsButton.getSelection());
+ //model.setStringProperty(FACET_PROJECT_NAME, projectNameField.getText());
+ }
+
+ });
+
+ createUserSpecifiedProjectLocationGroup(projectGroup);
+
+ }
+
+
+ private void createUserSpecifiedProjectLocationGroup(Composite projectGroup) {
+ Font font = projectGroup.getFont();
+ // location label
+ final Label locationLabel = new Label(projectGroup, SWT.NONE);
+ locationLabel.setFont(font);
+ locationLabel.setText("Director&y:");
+
+ // project location entry field
+ locationPathField = new Text(projectGroup, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ locationPathField.setLayoutData(data);
+ locationPathField.setFont(font);
+
+ // browse button
+ browseButton = new Button(projectGroup, SWT.PUSH);
+ browseButton.setFont(font);
+ browseButton.setText("Browse...");
+ browseButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ handleLocationBrowseButtonPressed();
+ }
+ });
+
+ final IDataModel localModel = model;
+
+ class LocationListener implements ModifyListener, IDataModelListener {
+ private boolean typing = false;
+
+ public void modifyText(ModifyEvent e) {
+ if (!localModel.getBooleanProperty(USE_DEFAULT_LOCATION)) {
+ try {
+ typing = true;
+ localModel.setProperty(USER_DEFINED_LOCATION, locationPathField.getText());
+ } finally {
+ typing = false;
+ }
+ }
+ }
+
+ public void propertyChanged(DataModelEvent event) {
+ boolean useDefault = localModel.getBooleanProperty(USE_DEFAULT_LOCATION);
+ if (USE_DEFAULT_LOCATION.equals(event.getPropertyName())) {
+ locationLabel.setEnabled(!useDefault);
+ locationPathField.setEnabled(!useDefault);
+ browseButton.setEnabled(!useDefault);
+ if (useDefault) {
+ locationPathField.setText(localModel.getStringProperty(DEFAULT_LOCATION));
+ } else {
+ locationPathField.setText(localModel.getStringProperty(USER_DEFINED_LOCATION));
+ }
+ } else if (!typing) {
+ if ((useDefault && DEFAULT_LOCATION.equals(event.getPropertyName())) || (!useDefault && USER_DEFINED_LOCATION.equals(event.getPropertyName()))) {
+ locationPathField.setText((String) event.getProperty());
+ }
+ }
+ }
+ }
+
+ LocationListener listener = new LocationListener();
+
+ listener.propertyChanged(new DataModelEvent(model, USE_DEFAULT_LOCATION, IDataModel.VALUE_CHG));
+
+ locationPathField.addModifyListener(listener);
+ model.addListener(listener);
+ }
+
+ protected void handleLocationBrowseButtonPressed() {
+ DirectoryDialog dialog = new DirectoryDialog(locationPathField.getShell());
+ dialog.setMessage("Directory");
+ String dirName = model.getStringProperty(USER_DEFINED_LOCATION);
+ if (dirName.trim().length() == 0) {
+ dirName = new Path(model.getStringProperty(DEFAULT_LOCATION)).removeLastSegments(1).toOSString();
+ }
+
+ if ((dirName != null) && (dirName.length() != 0)) {
+ File path = new File(dirName);
+ if (path.exists()) {
+ dialog.setFilterPath(dirName);
+ }
+ }
+ String selectedDirectory = dialog.open();
+ if (selectedDirectory != null) {
+ model.setProperty(USER_DEFINED_LOCATION, selectedDirectory);
+ }
+ }
+
+ public String getModuleTypeID(){
+ return "jboss.esb";
+ }
+
+ protected void updatePrimaryVersions(){
+ IProjectFacetVersion selectedVersion = fpjwc.getProjectFacetVersion(primaryProjectFacet);
+ SortedSet<IProjectFacetVersion> initialVersions = fpjwc.getAvailableVersions(primaryProjectFacet);
+ String [] items = new String[initialVersions.size()];
+ int i=0;
+ int selectedVersionIndex = -1;
+ for(Iterator <IProjectFacetVersion> iterator = initialVersions.iterator(); iterator.hasNext(); i++){
+ items[i] = iterator.next().getVersionString();
+ if(selectedVersionIndex == -1 && items[i].equals(selectedVersion.getVersionString())){
+ selectedVersionIndex = i;
+ }
+ }
+ primaryVersionCombo.clearSelection();
+ primaryVersionCombo.setItems(items);
+ primaryVersionCombo.select(selectedVersionIndex);
+ }
+
+ @Override
+ public boolean isPageComplete() {
+
+ if(hasValidPrjLocation && hasValidPrjName){
+ return true;
+ }
+ return false;
+ }
+
+
+ protected void refreshRuntimeCombo(String propertyName, int flag, Combo combo, IRuntime newRuntime) {
+ int index = -1;
+
+ for(IRuntime runtime:RuntimeManager.getRuntimes()){
+ index++;
+ combo.add(runtime.getName());
+ combo.setData(Integer.toString(index), runtime);
+ if(newRuntime != null && runtime.getName().equals(newRuntime.getName())){
+ combo.select(index);
+ }
+
+ }
+ combo.add("<None>");
+ if(combo.getSelectionIndex() < 0){
+ combo.select(combo.getItemCount() - 1);
+
+ }
+ }
+
+ private void saveRuntimeToProject(){
+ String selectedRuntime = Integer.toString(serverTargetCombo.getSelectionIndex());
+ Object obj = serverTargetCombo.getData(selectedRuntime);
+
+ model.setProperty(FACET_RUNTIME, obj);
+ }
+
+
+
+
+
+ protected void handlePrimaryFacetVersionSelectedEvent()
+ {
+ final IProjectFacetVersion fv = getPrimaryFacetVersion();
+ if( fv != null )
+ {
+ String presetID = null;
+ org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime = (org.eclipse.wst.common.project.facet.core.runtime.IRuntime)model.getProperty(IFacetProjectCreationDataModelProperties.FACET_RUNTIME);
+ if(runtime != null){
+ if(runtime.getRuntimeComponents().size() > 0){
+ IRuntimeComponent runtimeComponent = runtime.getRuntimeComponents().get(0);
+ String facetRuntimeTypeID = runtimeComponent.getRuntimeComponentType().getId();
+ String facetRuntimeVersion = runtimeComponent.getRuntimeComponentVersion().getVersionString();
+ String facetID = fv.getProjectFacet().getId();
+ String facetVersion = fv.getVersionString();
+ presetID = RuntimePresetMappingRegistry.INSTANCE.getPresetID(facetRuntimeTypeID, facetRuntimeVersion, facetID, facetVersion);
+ }
+ }
+
+ if( presetID == null )
+ {
+ final Set<IProjectFacetVersion> facets = getFacetConfiguration( fv );
+ this.fpjwc.setProjectFacets( facets );
+ }
+ else
+ { // setting the facets prior to setting the preset is to let the dynamic presets adjust
+ final Set<IProjectFacetVersion> facets = getFacetConfiguration( fv );
+ this.fpjwc.setProjectFacets( facets );
+ this.fpjwc.setSelectedPreset(presetID);
+
+ }
+ }
+ }
+
+ public IProjectFacetVersion getPrimaryFacetVersion()
+ {
+ IProjectFacetVersion fv = null;
+
+ if( this.primaryProjectFacet.getVersions().size() > 1 )
+ {
+ final int selectedIndex = this.primaryVersionCombo.getSelectionIndex();
+
+ if( selectedIndex != -1 )
+ {
+ final String fvstr = this.primaryVersionCombo.getItem( selectedIndex );
+ fv = this.primaryProjectFacet.getVersion( fvstr );
+ }
+ }
+ else
+ {
+ fv = this.primaryProjectFacet.getDefaultVersion();
+ }
+
+ return fv;
+ }
+
+
+ protected Set<IProjectFacetVersion> getFacetConfiguration( final IProjectFacetVersion primaryFacetVersion )
+ {
+ final Set<IProjectFacetVersion> config = new HashSet<IProjectFacetVersion>();
+
+ for( IProjectFacet fixedFacet : this.fpjwc.getFixedProjectFacets() )
+ {
+ if( fixedFacet == primaryFacetVersion.getProjectFacet() )
+ {
+ config.add( primaryFacetVersion );
+ }
+ else
+ {
+ config.add( this.fpjwc.getHighestAvailableVersion( fixedFacet ) );
+ }
+ }
+
+ return config;
+ }
+}
Modified: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBFacetInstallationPage.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBFacetInstallationPage.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -20,7 +20,7 @@
import org.eclipse.wst.web.internal.ResourceHandler;
import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage;
import org.eclipse.wst.web.ui.internal.wizards.IWstWebUIContextIds;
-import org.jboss.tools.esb.IJBossESBFacetDataModelProperties;
+import org.jboss.tools.esb.project.facet.IJBossESBFacetDataModelProperties;
public class ESBFacetInstallationPage extends AbstractFacetWizardPage implements IFacetWizardPage, IJBossESBFacetDataModelProperties {
@@ -116,6 +116,7 @@
}
+
private void fillMessageGroup(Composite parent){
Group messageGroup = new Group(parent, SWT.BORDER);
messageGroup.setText("Target Message Product");
@@ -124,11 +125,12 @@
}
+
public void setConfig(Object config) {
this.model = (IDataModel)config;
}
-
+
public void createControl(Composite parent) {
setControl(createTopLevelComposite(parent));
Modified: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBProjectTemplateWizardPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBProjectTemplateWizardPage.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/ESBProjectTemplateWizardPage.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -17,6 +17,8 @@
public ESBProjectTemplateWizardPage(IDataModel model, String pageName) {
super(model, pageName);
+ setTitle("JBoss ESB Templates");
+ setDescription("Select one of the available templates to generate a JBoss ESB project");
}
@Override
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/IESBTemplatePage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/IESBTemplatePage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/IESBTemplatePage.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,9 @@
+package org.jboss.tools.esb.projects.wizards.pages;
+
+import org.eclipse.jface.wizard.IWizardPage;
+
+public interface IESBTemplatePage extends IWizardPage {
+
+ void setModel(Object modle);
+
+}
Modified: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/NewESBProjectWizardPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/NewESBProjectWizardPage.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/NewESBProjectWizardPage.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,15 +1,11 @@
package org.jboss.tools.esb.projects.wizards.pages;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.SortedSet;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -21,37 +17,19 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationPropertiesNew;
import org.eclipse.wst.common.frameworks.internal.ui.NewProjectGroup;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IPreset;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.events.IProjectFacetsChangedEvent;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntimeComponent;
-import org.eclipse.wst.common.project.facet.core.runtime.RuntimeManager;
-import org.eclipse.wst.common.project.facet.core.util.AbstractFilter;
-import org.eclipse.wst.common.project.facet.core.util.FilterEvent;
-import org.eclipse.wst.common.project.facet.core.util.IFilter;
-import org.eclipse.wst.common.project.facet.core.util.IFilter.IFilterEvent;
-import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
-import org.eclipse.wst.common.project.facet.ui.PresetSelectionPanel;
-import org.eclipse.wst.project.facet.ProductManager;
-import org.eclipse.wst.server.ui.ServerUIUtil;
import org.eclipse.wst.web.internal.ResourceHandler;
-import org.eclipse.wst.web.internal.facet.RuntimePresetMappingRegistry;
import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage.Messages;
public class NewESBProjectWizardPage extends DataModelWizardPage implements IFacetProjectCreationDataModelProperties {
@@ -67,7 +45,8 @@
public NewESBProjectWizardPage(IDataModel model, String pageName) {
super(model, pageName);
-
+ setTitle("JBoss ESB Project");
+ setDescription("Create a new JBoss ESB project.");
this.fpjwc = (IFacetedProjectWorkingCopy) this.model.getProperty( FACETED_PROJECT_WORKING_COPY );
this.fpjwcListener = new IFacetedProjectListener()
@@ -95,41 +74,6 @@
return top;
}
- protected void createPresetPanel(Composite top) {
- final IFacetedProjectWorkingCopy fpjwc
- = ( (ModifyFacetedProjectWizard) getWizard() ).getFacetedProjectWorkingCopy();
-
- final IFilter<IPreset> filter = new AbstractFilter<IPreset>()
- {
- {
- fpjwc.addListener
- (
- new IFacetedProjectListener()
- {
- public void handleEvent( final IFacetedProjectEvent event )
- {
- handleProjectFacetsChangedEvent( (IProjectFacetsChangedEvent) event );
- }
- },
- IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED
- );
- }
-
- public boolean check( final IPreset preset )
- {
- return true;
- }
-
- private void handleProjectFacetsChangedEvent( final IProjectFacetsChangedEvent event )
- {
-
- }
- };
-
- final PresetSelectionPanel ppanel = new PresetSelectionPanel( top, fpjwc, filter );
-
- ppanel.setLayoutData( gdhfill() );
- }
protected static GridData gdhfill() {
return new GridData(GridData.FILL_HORIZONTAL);
@@ -231,8 +175,9 @@
@Override
protected String[] getValidationPropertyNames() {
- // TODO Auto-generated method stub
- return null;
+ List<String> propertyNames = new ArrayList<String>();
+ propertyNames.add(IFacetDataModelProperties.FACET_PROJECT_NAME);
+ return propertyNames.toArray(new String[]{});
}
public String getModuleTypeID(){
Deleted: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplagePackageNameWizardPage.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplagePackageNameWizardPage.java 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplagePackageNameWizardPage.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,44 +0,0 @@
-package org.jboss.tools.esb.projects.wizards.pages;
-
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-
-public class TemplagePackageNameWizardPage extends DataModelWizardPage implements IFacetProjectCreationDataModelProperties {
-
- public TemplagePackageNameWizardPage(IDataModel model, String pageName) {
- super(model, pageName);
- }
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite top = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- top.setLayout(layout);
-
- Label lblPackage = new Label(top, SWT.NONE);
- lblPackage.setText("Java Package Name:");
-
- Text txtPkg = new Text(top, SWT.BORDER);
- txtPkg.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- return top;
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return null;
- }
-
-
-}
-
Copied: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplatePackageNameWizardPage.java (from rev 9461, workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplagePackageNameWizardPage.java)
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplatePackageNameWizardPage.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/projects/wizards/pages/TemplatePackageNameWizardPage.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,45 @@
+package org.jboss.tools.esb.projects.wizards.pages;
+
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
+
+public class TemplatePackageNameWizardPage extends DataModelWizardPage implements IFacetProjectCreationDataModelProperties {
+
+ public TemplatePackageNameWizardPage(IDataModel model, String pageName) {
+ super(model, pageName);
+
+ }
+
+ @Override
+ protected Composite createTopLevelComposite(Composite parent) {
+ Composite top = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ top.setLayout(layout);
+
+ Label lblPackage = new Label(top, SWT.NONE);
+ lblPackage.setText("Java Package Name:");
+
+ Text txtPkg = new Text(top, SWT.BORDER);
+ txtPkg.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ return top;
+ }
+
+ @Override
+ protected String[] getValidationPropertyNames() {
+ return null;
+ }
+
+
+}
+
Added: workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/utils/ResourceUtils.java
===================================================================
--- workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/utils/ResourceUtils.java (rev 0)
+++ workspace/Denny/org.jboss.tools.esb/src/org/jboss/tools/esb/utils/ResourceUtils.java 2008-08-18 10:24:07 UTC (rev 9764)
@@ -0,0 +1,54 @@
+package org.jboss.tools.esb.utils;
+
+import org.eclipse.core.internal.resources.Resource;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
+import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonMessages;
+import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
+
+public class ResourceUtils {
+
+ public static IStatus validateName(String name) {
+ IStatus status = validateProjectName(name);
+ if (!status.isOK())
+ return status;
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
+ if (project.exists()) {
+ return createErrorStatus("A project already exists with this name.");
+ }
+ if (!isPlatformCaseSensitive()) {
+ // now look for a matching case variant in the tree
+ IResource variant = ((Resource) project).findExistingResourceVariant(project.getFullPath());
+ if (variant != null) {
+ return createErrorStatus("A project already exists with this name.");
+ }
+ }
+ return Status.OK_STATUS;
+ }
+
+ public static IStatus validateProjectName(String projectName) {
+ IWorkspace workspace = ResourcesPlugin.getWorkspace();
+ IStatus status = workspace.validateName(projectName, IResource.PROJECT);
+ if (!status.isOK())
+ return status;
+ if (projectName.endsWith(" ")) //$NON-NLS-1$
+ return createErrorStatus("Project names cannot end with white space.");
+ return Status.OK_STATUS;
+ }
+
+ public static boolean isPlatformCaseSensitive() {
+ return Platform.OS_MACOSX.equals(Platform.getOS()) ? false : new
+ java.io.File("a").compareTo(new java.io.File("A")) != 0; //$NON-NLS-1$//$NON-NLS-2$
+ }
+
+ public static IStatus createErrorStatus(String msg){
+ IStatus status = new Status(IStatus.ERROR, "org.jboss.tools.esb.project.ui", msg);
+ return status;
+ }
+}
Modified: workspace/Denny/org.jboss.tools.esb.editor/.project
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/.project 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb.editor/.project 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.jboss.tools.esb.editor</name>
+ <name>org.jboss.tools.esb.project.editor</name>
<comment></comment>
<projects>
</projects>
Modified: workspace/Denny/org.jboss.tools.esb.editor/META-INF/MANIFEST.MF
===================================================================
--- workspace/Denny/org.jboss.tools.esb.editor/META-INF/MANIFEST.MF 2008-08-18 09:59:55 UTC (rev 9763)
+++ workspace/Denny/org.jboss.tools.esb.editor/META-INF/MANIFEST.MF 2008-08-18 10:24:07 UTC (rev 9764)
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Editor Plug-in
-Bundle-SymbolicName: org.jboss.tools.esb.editor; singleton:=true
+Bundle-SymbolicName: org.jboss.tools.esb.project.editor;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.jboss.tools.esb.editor.Activator
Require-Bundle: org.eclipse.ui,
@@ -10,7 +10,6 @@
org.eclipse.core.resources,
org.eclipse.ui.editors,
org.eclipse.ui.ide,
- org.jboss.tools.esb.ui;bundle-version="2.0.0",
org.jboss.tools.jst.web.ui;bundle-version="2.0.0",
org.jboss.tools.common.text.ext;bundle-version="2.0.0",
org.jboss.tools.common.model;bundle-version="2.0.0",
17 years, 8 months
JBoss Tools SVN: r9763 - in workspace/dart/plugins: org.jboss.tools.smooks.ui/META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-08-18 05:59:55 -0400 (Mon, 18 Aug 2008)
New Revision: 9763
Added:
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IAnalyzer.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java
workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
Log:
Extended the Analyzer;
the Analyzer is a generator of Smooks config file
Modified: workspace/dart/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-08-18 09:31:37 UTC (rev 9762)
+++ workspace/dart/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-08-18 09:59:55 UTC (rev 9763)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.smooks.javabean.analyzer;
+import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -25,12 +26,14 @@
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
import org.jboss.tools.smooks.analyzer.IAnalyzer;
+import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
-import org.jboss.tools.smooks.ui.gef.model.RootModel;
import org.jboss.tools.smooks.ui.gef.model.StructuredDataModel;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
import org.milyn.xsd.smooks.ParamType;
import org.milyn.xsd.smooks.ResourceConfigType;
import org.milyn.xsd.smooks.ResourceType;
@@ -72,7 +75,8 @@
return new BasicCommandStack();
}
- public SmooksResourceListType analyzeGraphicalModel(RootModel root) {
+ public SmooksResourceListType analyzeGraphicalModel(
+ AbstractStructuredDataModel root) {
SmooksResourceListType resourceList = SmooksFactory.eINSTANCE
.createSmooksResourceListType();
@@ -108,7 +112,8 @@
* @param beanId
*/
protected void analyzeStructuredDataModel(
- SmooksResourceListType resourceList, RootModel root,
+ SmooksResourceListType resourceList,
+ AbstractStructuredDataModel root,
AbstractStructuredDataModel dataModel,
ResourceConfigType parentResourceConfigType, String beanId) {
if (dataModel instanceof IConnectableModel) {
@@ -151,8 +156,9 @@
.getSmooksResourceListType_AbstractResourceConfig(),
resourceConfig);
addResourceConfigCommand.execute();
-// resouceConfig.
- resourceConfig.setSelector(getSourceBeanSelectorString((AbstractStructuredDataModel)source));
+ // resouceConfig.
+ resourceConfig
+ .setSelector(getSourceBeanSelectorString((AbstractStructuredDataModel) source));
setConnectionUsed(connection);
ResourceType resource = SmooksFactory.eINSTANCE
@@ -165,8 +171,8 @@
beanIdParam.setName("beanId");
if (beanId == null)
beanId = targetJavaBean.getName();
- if(beanId.startsWith("${")){
- beanId= beanId.substring(2,beanId.indexOf("}"));
+ if (beanId.startsWith("${")) {
+ beanId = beanId.substring(2, beanId.indexOf("}"));
}
SmooksModelUtils
.appendTextToSmooksType(beanIdParam, beanId);
@@ -236,7 +242,7 @@
AbstractStructuredDataModel source,
AbstractStructuredDataModel currentRootModel) {
JavaBeanModel sourcebean = (JavaBeanModel) source
- .getReferenceEntityModel();
+ .getReferenceEntityModel();
JavaBeanModel rootbean = (JavaBeanModel) currentRootModel
.getReferenceEntityModel();
JavaBeanModel currentbean = (JavaBeanModel) target
@@ -254,10 +260,10 @@
while (parent != currentRootModel && parent != null) {
returnString = ((JavaBeanModel) parent
.getReferenceEntityModel()).getName()
- + " " +returnString;
+ + " " + returnString;
parent = parent.getParent();
}
- // if no property
+ // if no property
if (returnString.equals(sourcebean.getName())) {
returnString = ((JavaBeanModel) parent
.getReferenceEntityModel()).getBeanClassString()
@@ -266,13 +272,23 @@
return returnString;
}
}
-
- protected String getSourceBeanSelectorString(AbstractStructuredDataModel sourceModel){
- JavaBeanModel source = (JavaBeanModel) sourceModel.getReferenceEntityModel();
- if(Collection.class.isAssignableFrom(source.getBeanClass())){
+
+ protected String getSourceBeanSelectorString(
+ AbstractStructuredDataModel sourceModel) {
+ JavaBeanModel source = (JavaBeanModel) sourceModel
+ .getReferenceEntityModel();
+ if (Collection.class.isAssignableFrom(source.getBeanClass())) {
return source.getName();
}
return source.getBeanClassString();
-
+
}
+
+ public SmooksResourceListType analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException {
+ GraphRootModel root = context.getDataMappingRootModel();
+ SmooksResourceListType listType = this.analyzeGraphicalModel(root);
+ return listType;
+ }
}
Modified: workspace/dart/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-08-18 09:31:37 UTC (rev 9762)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-08-18 09:59:55 UTC (rev 9763)
@@ -15,7 +15,8 @@
org.eclipse.jdt.core,
org.eclipse.jdt.ui,
org.eclipse.xsd,
- org.eclipse.ui.forms
+ org.eclipse.ui.forms,
+ org.jboss.tools.smooks.model
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .
Added: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java (rev 0)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java 2008-08-18 09:59:55 UTC (rev 9763)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.analyzer;
+
+/**
+ * @author Dart Peng
+ * @Date Aug 19, 2008
+ */
+public class AnalyzerFactory {
+ protected static AnalyzerFactory instance = null;
+
+ protected AnalyzerFactory() {
+
+ }
+
+ /**
+ * @return the instance
+ */
+ public synchronized static AnalyzerFactory getInstance() {
+ if (instance == null) {
+ instance = new AnalyzerFactory();
+ }
+ return instance;
+ }
+
+ public IAnalyzer getAnalyzer(String sourceDataTypeID,String targetDataTypeID){
+ return null;
+ }
+}
Property changes on: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/AnalyzerFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IAnalyzer.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IAnalyzer.java 2008-08-18 09:31:37 UTC (rev 9762)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/IAnalyzer.java 2008-08-18 09:59:55 UTC (rev 9763)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2008 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,10 +10,15 @@
******************************************************************************/
package org.jboss.tools.smooks.analyzer;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+import org.milyn.xsd.smooks.SmooksResourceListType;
+
/**
* @author Dart Peng
- *
+ *
*/
public interface IAnalyzer {
-
+ public SmooksResourceListType analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException;
}
Added: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java (rev 0)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java 2008-08-18 09:59:55 UTC (rev 9763)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.analyzer;
+
+/**
+ * @author Dart Peng
+ * @Date Aug 19, 2008
+ */
+public class SmooksAnalyzerException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7107932620709349894L;
+
+
+ public SmooksAnalyzerException(String errorMessage){
+ super(errorMessage);
+ }
+}
Property changes on: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksAnalyzerException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java (rev 0)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java 2008-08-18 09:59:55 UTC (rev 9763)
@@ -0,0 +1,42 @@
+package org.jboss.tools.smooks.analyzer;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+import org.milyn.xsd.smooks.DocumentRoot;
+import org.milyn.xsd.smooks.SmooksFactory;
+import org.milyn.xsd.smooks.SmooksResourceListType;
+import org.milyn.xsd.smooks.util.SmooksResourceFactoryImpl;
+
+public class SmooksFileBuilder {
+
+ public InputStream generateSmooksFile(
+ SmooksConfigurationFileGenerateContext context,
+ IProgressMonitor monitor) throws SmooksAnalyzerException, IOException {
+ AnalyzerFactory factory = AnalyzerFactory.getInstance();
+ IAnalyzer analyzer = factory.getAnalyzer(context.getSourceDataTypeID(),
+ context.getTargetDataTypeID());
+ if (analyzer == null)
+ throw new SmooksAnalyzerException(
+ "can't find the Analyzer for sourceID : "
+ + context.getSourceDataTypeID()
+ + " and the targetID : "
+ + context.getTargetDataTypeID());
+ SmooksResourceListType listType = analyzer
+ .analyzeMappingGraphModel(context);
+ Resource resource = new SmooksResourceFactoryImpl()
+ .createResource(null);
+ DocumentRoot dr = SmooksFactory.eINSTANCE.createDocumentRoot();
+ dr.setSmooksResourceList(listType);
+ resource.getContents().add(dr);
+ ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+ resource.save(outputStream, Collections.EMPTY_MAP);
+ return new ByteArrayInputStream(outputStream.toByteArray());
+ }
+}
Property changes on: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/analyzer/SmooksFileBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-08-18 09:31:37 UTC (rev 9762)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-08-18 09:59:55 UTC (rev 9763)
@@ -10,6 +10,12 @@
******************************************************************************/
package org.jboss.tools.smooks.ui.editors;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.ConnectionLayer;
@@ -30,14 +36,13 @@
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.TreeEvent;
-import org.eclipse.swt.events.TreeListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
@@ -47,6 +52,8 @@
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
+import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
+import org.jboss.tools.smooks.analyzer.SmooksFileBuilder;
import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
import org.jboss.tools.smooks.ui.IViewerInitor;
import org.jboss.tools.smooks.ui.StructuredDataCreationWizardDailog;
@@ -60,6 +67,7 @@
import org.jboss.tools.smooks.ui.gef.tools.MappingPanelDropTargetListener;
import org.jboss.tools.smooks.ui.gef.tools.TargetTreeDropTargetListener;
import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
import org.jboss.tools.smooks.ui.wizards.TransformDataSelectionWizard;
import org.jboss.tools.smooks.utils.UIUtils;
@@ -67,7 +75,7 @@
* @author Dart Peng
* @Date Jul 28, 2008
*/
-public class SmooksGraphicalFormPage extends FormPage implements TreeListener {
+public class SmooksGraphicalFormPage extends FormPage {
protected IViewerInitor sourceViewerInitor;
protected IViewerInitor targetViewerInitor;
protected TreeViewer targetViewer;
@@ -81,22 +89,25 @@
protected int itemY = 0;
protected String sourceDataTypeID = null;
protected String targetDataTypeID = null;
+ protected SmooksFileBuilder smooksFileBuilder = null;
public SmooksGraphicalFormPage(FormEditor editor, String id, String title) {
super(editor, id, title);
editDomain = new DefaultEditDomain(this);
+ smooksFileBuilder = this.createSmooksFileBulder();
}
public SmooksGraphicalFormPage(String id, String title) {
super(id, title);
editDomain = new DefaultEditDomain(this);
+ smooksFileBuilder = this.createSmooksFileBulder();
}
@Override
protected void createFormContent(IManagedForm managedForm) {
final ScrolledForm form = managedForm.getForm();
FormToolkit toolkit = managedForm.getToolkit();
-
+
toolkit.decorateFormHeading(form.getForm());
GridLayout gridLayout = UIUtils.createGeneralFormEditorLayout(1);
gridLayout.horizontalSpacing = 0;
@@ -247,6 +258,10 @@
this.initGraphicalViewer();
}
+ protected SmooksFileBuilder createSmooksFileBulder() {
+ return new SmooksFileBuilder();
+ }
+
protected void initTargetTreeViewer() {
targetViewer.expandAll();
}
@@ -344,17 +359,52 @@
viewer.createControl(parent);
return viewer;
}
-
-
/* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormPage#isDirty()
+ */
+ @Override
+ public boolean isDirty() {
+ // TODO Test
+ if(true) return true;
+ return super.isDirty();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.ui.forms.editor.FormPage#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
public void doSave(IProgressMonitor monitor) {
+ SmooksFileBuilder builder = this.getSmooksFileBuilder();
+ SmooksConfigurationFileGenerateContext context = createContext();
+ try {
+ InputStream stream = builder.generateSmooksFile(context, monitor);
+ IFile file = ((IFileEditorInput) this.getEditorInput()).getFile();
+ if (file.exists()) {
+ file.setContents(stream, IResource.FORCE, monitor);
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ } catch (SmooksAnalyzerException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
super.doSave(monitor);
}
+ protected SmooksConfigurationFileGenerateContext createContext() {
+ SmooksConfigurationFileGenerateContext context = new SmooksConfigurationFileGenerateContext();
+ return context;
+ }
+
+ protected void initSmooksConfigurationFileGenerateContext(
+ SmooksConfigurationFileGenerateContext context) {
+ context.setDataMappingRootModel(this.rootModel);
+ }
+
protected Composite createUISectionContainer(Composite parent, int columns) {
Composite container = getManagedForm().getToolkit().createComposite(
parent);
@@ -420,16 +470,16 @@
this.getEditDomain().addViewer(graphicalViewer);
}
- public void treeCollapsed(TreeEvent e) {
- rootModel.firePropertyChange(RootModel.P_REFRESH_PANEL, null,
- new Object());
- }
+ // public void treeCollapsed(TreeEvent e) {
+ // rootModel.firePropertyChange(RootModel.P_REFRESH_PANEL, null,
+ // new Object());
+ // }
+ //
+ // public void treeExpanded(TreeEvent e) {
+ // rootModel.firePropertyChange(RootModel.P_REFRESH_PANEL, null,
+ // new Object());
+ // }
- public void treeExpanded(TreeEvent e) {
- rootModel.firePropertyChange(RootModel.P_REFRESH_PANEL, null,
- new Object());
- }
-
public IViewerInitor getSourceViewerInitor() {
return sourceViewerInitor;
}
@@ -486,6 +536,7 @@
private class DataSelectLinkListener implements IHyperlinkListener {
TreeViewer viewer = null;
+
public DataSelectLinkListener(TreeViewer viewer) {
this.viewer = viewer;
}
@@ -519,4 +570,19 @@
}
+ /**
+ * @return the smooksFileBuilder
+ */
+ protected SmooksFileBuilder getSmooksFileBuilder() {
+ return smooksFileBuilder;
+ }
+
+ /**
+ * @param smooksFileBuilder
+ * the smooksFileBuilder to set
+ */
+ protected void setSmooksFileBuilder(SmooksFileBuilder smooksFileBuilder) {
+ this.smooksFileBuilder = smooksFileBuilder;
+ }
+
}
Modified: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java 2008-08-18 09:31:37 UTC (rev 9762)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java 2008-08-18 09:59:55 UTC (rev 9763)
@@ -30,20 +30,16 @@
*/
public EditPart createEditPart(EditPart context, Object model) {
EditPart part = getPartForElement(model);
+ if (part != null)
+ part.setModel(model);
- // l����������
- //
- part.setModel(model);
-
return part;
}
/**
- * ���ģ�ʹ���EditPart
*
* @param modelElement
- * �
- * @return EditPart
+ * @return
*/
private EditPart getPartForElement(Object modelElement) {
Modified: workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-08-18 09:31:37 UTC (rev 9762)
+++ workspace/dart/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/modelparser/SmooksConfigurationFileGenerateContext.java 2008-08-18 09:59:55 UTC (rev 9763)
@@ -10,16 +10,23 @@
******************************************************************************/
package org.jboss.tools.smooks.ui.modelparser;
-import org.jboss.tools.smooks.ui.gef.model.RootModel;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
/**
* @author Dart Peng
* @Date Aug 18, 2008
*/
public class SmooksConfigurationFileGenerateContext {
+
+ public static final String TYPE_SAX = "sax";
+
+ public static final String TYPE_DOM = "sax";
+
protected String sourceDataTypeID = null;
protected String targetDataTypeID = null;
- protected RootModel dataMappingRootModel;
+ protected GraphRootModel dataMappingRootModel;
+
+ protected String smooksType = null;
/**
* @return the sourceDataTypeID
*/
@@ -47,15 +54,27 @@
/**
* @return the dataMappingRootModel
*/
- public RootModel getDataMappingRootModel() {
+ public GraphRootModel getDataMappingRootModel() {
return dataMappingRootModel;
}
/**
* @param dataMappingRootModel the dataMappingRootModel to set
*/
- public void setDataMappingRootModel(RootModel dataMappingRootModel) {
+ public void setDataMappingRootModel(GraphRootModel dataMappingRootModel) {
this.dataMappingRootModel = dataMappingRootModel;
}
+ /**
+ * @return the smooksType
+ */
+ public String getSmooksType() {
+ return smooksType;
+ }
+ /**
+ * @param smooksType the smooksType to set
+ */
+ public void setSmooksType(String smooksType) {
+ this.smooksType = smooksType;
+ }
}
17 years, 8 months
JBoss Tools SVN: r9762 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor: figures and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-08-18 05:31:37 -0400 (Mon, 18 Aug 2008)
New Revision: 9762
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2645
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-08-18 07:29:09 UTC (rev 9761)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-08-18 09:31:37 UTC (rev 9762)
@@ -179,7 +179,7 @@
protected IFigure createFigure() {
fig = new PageFigure(getPageModel());
- ((PageFigure) fig).setGroupEditPart(this);
+ ((PageFigure) fig).setPageEditPart(this);
return fig;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-08-18 07:29:09 UTC (rev 9761)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-08-18 09:31:37 UTC (rev 9762)
@@ -37,12 +37,11 @@
public Page page;
-
String path;
PageEditPart editPart;
- public void setGroupEditPart(PageEditPart part) {
+ public void setPageEditPart(PageEditPart part) {
editPart = part;
}
@@ -55,20 +54,20 @@
}
- public PageFigure(Page group) {
- this.page = group;
+ public PageFigure(Page page) {
+ this.page = page;
- if (group != null && group.getData() != null) {
- setIcon(group.getImage());
- initConnectionAnchors(group.getOutputLinks().size());
+ if (page != null && page.getData() != null) {
+ setIcon(page.getImage());
+ initConnectionAnchors(page.getOutputLinks().size());
}
setOpaque(false);
setLayoutManager(new XYLayout());
- setBorder(new GroupBorder(blackColor));
+ setBorder(new PageBorder(blackColor));
- if (group != null) {
+ if (page != null) {
FixedConnectionAnchor c;
c = new FixedConnectionAnchor(this);
c.offsetV = 10;
@@ -127,7 +126,7 @@
}
//color the page
- if (page != null /*&& group.isConfirmed()*/) {
+ if (page != null) {
g.setBackgroundColor(new Color(null, 0xff, 0xff, 0xc2));
} else {
g.setBackgroundColor(lightGrayColor);
@@ -222,8 +221,8 @@
}
/** the one drawing the "bend corner rectangle" **/
- class GroupBorder extends LineBorder {
- public GroupBorder(Color color) {
+ class PageBorder extends LineBorder {
+ public PageBorder(Color color) {
super(color);
}
@@ -233,12 +232,13 @@
int width = r.width - 1;
int height = r.height - 1;
+ // if page has not page element
if(page != null && page.getData() != null && page.getData() instanceof ReferenceObject && ((ReferenceObject)page.getData()).getReference() == null){
graphics.setLineDash(new int[]{3,3});
graphics.setLineStyle(SWT.LINE_CUSTOM);
}
- if (page != null /*&& group.isConfirmed()*/)
+ if (page != null)
graphics.setForegroundColor(blackColor);
else
graphics.setForegroundColor(darkGrayColor);
17 years, 8 months