JBoss Tools SVN: r11322 - trunk/ws/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-30 05:42:53 -0400 (Thu, 30 Oct 2008)
New Revision: 11322
Modified:
trunk/ws/docs/reference/en/modules/overview.xml
trunk/ws/docs/reference/en/modules/topdown.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-463 - correcting validation errors;
Modified: trunk/ws/docs/reference/en/modules/overview.xml
===================================================================
--- trunk/ws/docs/reference/en/modules/overview.xml 2008-10-30 09:35:07 UTC (rev 11321)
+++ trunk/ws/docs/reference/en/modules/overview.xml 2008-10-30 09:42:53 UTC (rev 11322)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<chapter id="overview" revisionflag="overview">
+<chapter id="overview">
<title>JBossWS Runtime Overview</title>
<para>JBossWS is a web service framework developed as a part of the JBoss Application Server. It implements the JAX-WS specification that defines a programming model and run-time architecture for implementing web services in Java, targeted at the Java Platform, Enterprise Edition 5 (Java EE 5).</para>
Modified: trunk/ws/docs/reference/en/modules/topdown.xml
===================================================================
--- trunk/ws/docs/reference/en/modules/topdown.xml 2008-10-30 09:35:07 UTC (rev 11321)
+++ trunk/ws/docs/reference/en/modules/topdown.xml 2008-10-30 09:42:53 UTC (rev 11322)
@@ -1,306 +1,383 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<chapter id="create_ws_topdown" >
- <?dbhtml filename="topdown.html"?>
- <chapterinfo>
- <keywordset>
- <keyword>JBoss Tools</keyword>
- <keyword>Web Service</keyword>
- <keyword>JBossWS Web Service runtime</keyword>
- </keywordset>
- </chapterinfo>
-
- <title>Creating a Web Service using JBossWS runtime</title>
- <para>In this chapter we provide you with the necessary steps to create a Web Service using JBossWS runtime.</para>
-
+<chapter id="create_ws_topdown">
+ <?dbhtml filename="topdown.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Web Service</keyword>
+ <keyword>JBossWS Web Service runtime</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Creating a Web Service using JBossWS runtime</title>
+ <para>In this chapter we provide you with the necessary steps to create a Web Service using
+ JBossWS runtime.</para>
+
<section id="createproject">
- <title>Creating a Dynamic Web project</title>
+ <title>Creating a Dynamic Web project</title>
- <para>Before creating a web service, you should have a Dynamic Web Project created:</para>
- <figure>
- <title>Dynamic Web Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_webproject_1.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Create a Web project by selecting
- <emphasis><property>New > Project... > Dynamic Web project</property></emphasis>. Enter the following information: </para>
- <itemizedlist>
- <listitem>
- <para>Project Name: enter a project name</para>
- </listitem>
- <listitem>
- <para>Target runtime: any server depending on your installation. If it is not listed, click New and browse to the location where it is installed to. You may set <emphasis><property>Target Runtime</property></emphasis> to <emphasis><property>None</property></emphasis>,
- in this case, you should add <link linkend="addfacet">JBoss Web Service facet to the project</link>.</para>
- <figure>
- <title>Dynamic Web Project Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_webproject_2.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>Configure Web Module values:</para>
- <figure>
- <title>Web Module Settings Configuration</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_webproject_3.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- <para>Click on the <property>Finish</property> button.</para>
+ <para>Before creating a web service, you should have a Dynamic Web Project created:</para>
+ <figure>
+ <title>Dynamic Web Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_webproject_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Create a Web project by selecting <emphasis>
+ <property>New > Project... > Dynamic Web project</property>
+ </emphasis>. Enter the following information: </para>
+ <itemizedlist>
+ <listitem>
+ <para>Project Name: enter a project name</para>
+ </listitem>
+ <listitem>
+ <para>Target runtime: any server depending on your installation. If it is not listed,
+ click New and browse to the location where it is installed to. You may set <emphasis>
+ <property>Target Runtime</property>
+ </emphasis> to <emphasis>
+ <property>None</property>
+ </emphasis>, in this case, you should add <link linkend="addfacet">JBoss Web Service
+ facet to the project</link>.</para>
+ <figure>
+ <title>Dynamic Web Project Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_webproject_2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Configure Web Module values:</para>
+ <figure>
+ <title>Web Module Settings Configuration</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_webproject_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ <para>Click on the <property>Finish</property> button.</para>
</section>
-
+
<section id="addfacet">
- <title>Configure JBoss Web Service facet settings</title>
- <para>If you have already created a new Dynamic Web project, the next step is to add JBoss Web Service facet to the project:</para>
+ <title>Configure JBoss Web Service facet settings</title>
+ <para>If you have already created a new Dynamic Web project, the next step is to add JBoss Web
+ Service facet to the project:</para>
<figure id="figure_addfacet">
- <title>Configure JBoss Web Service Facet</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_facet.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Server Supplied JBossWS Runtime: If you have already set a JBoss runtime to the project's target runtime, you may choose <emphasis><property>Server Supplied JBossWS Runtime</property></emphasis>
- and then click <emphasis><property>Ok</property></emphasis> to finish the configuration of JBoss Web Service facet.
- </para>
- <para>If the project has no <emphasis><property>Target Runtime</property></emphasis> settings, you should check the second radio button and specify a JBossWS runtime from the list.
- You also can create a new JBossWS runtime, click on the <emphasis><property>New...</property></emphasis> button will bring you to another dialog to configure new JBossWS runtime.</para>
- <figure id="figure_addfacet1">
- <title>Configure JBossWS Runtime</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_newruntime.png"/>
- </imageobject>
- </mediaobject>
+ <title>Configure JBoss Web Service Facet</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_facet.png"/>
+ </imageobject>
+ </mediaobject>
</figure>
+ <para>Server Supplied JBossWS Runtime: If you have already set a JBoss runtime to the
+ project's target runtime, you may choose <emphasis>
+ <property>Server Supplied JBossWS Runtime</property>
+ </emphasis> and then click <emphasis>
+ <property>Ok</property>
+ </emphasis> to finish the configuration of JBoss Web Service facet. </para>
+ <para>If the project has no <emphasis>
+ <property>Target Runtime</property>
+ </emphasis> settings, you should check the second radio button and specify a JBossWS
+ runtime from the list. You also can create a new JBossWS runtime, click on the <emphasis>
+ <property>New...</property>
+ </emphasis> button will bring you to another dialog to configure new JBossWS runtime.</para>
+ <figure id="figure_addfacet1">
+ <title>Configure JBossWS Runtime</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_newruntime.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
<para>See how to configure a new JBossWS runtime <link linkend="preference">here</link>:</para>
-
+
</section>
-
-
- <section id="topdownwebservice">
- <title>Creating a Web Service from a WSDL document using JBossWS runtime</title>
- <para>In this chapter we provide you with the necessary steps to create a Web Service from a WSDL document using JBossWS runtime.</para>
- <para>At first, please make sure that you have already created a dynamic Web project with JBoss Web Service facet installed. </para>
- <para>See how to make it <link linkend="createproject">here</link>> and <link linkend="addfacet">here</link>.</para>
-
- <para>To create a Web Service using JBossWS runtime select<emphasis>
- <property>File > New > Other > Web Services > Web Service</property></emphasis> to run Web Service creation wizard.
- </para>
- <para>Let's get through the wizard step-by-step:</para>
- <figure id="figure_create_ws_topdown">
- <title>New Web Service Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_ws_creation1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>First, please select <property>Top down Java bean Web Service</property> from the Web Service type list,
- and select a WSDL document from workspace, click on the Server name lilnk on the page will bring you to
- another dialog. Here you can specify the server to a JBoss Server and Web Service runtime to JBossWS runtime:</para>
- <figure id="figure_create_ws_topdown_setserver">
- <title>Select Server and Web Service runtime</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_ws_creation1_1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Click on the <emphasis>
- <property>Finish</property>
- </emphasis> button to see the next wizard view opened:</para>
-
- <figure id="figure_create_ws_topdown1">
- <title>New Web Service Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_ws_creation1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Click on the <emphasis><property>Next</property></emphasis> button to proceed:</para>
- <figure id="figure_create_ws_topdown_codegen">
- <title>New Web Service Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_ws_creation2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>On this page, the default package name comes from the namespace of the WSDL document, you also can change it to any valid package name you want.
- JAX-WS specification should be set to 2.0 if your JBossWS runtime in JBoss Server is JBossWS native runtime.
- You can specify a catalog file and binding files if you have them. If you want the wizard to generate empty implementation classes for the
- Web Service, check the <emphasis> <property>Generate default Web Service implementation classes</property> </emphasis> check box.
- If you want to update the default Web.xml file with the Web Service servlets configured, check the <emphasis> <property>Update the default Web.xml</property> </emphasis>
- check box. Click on the <emphasis><property>Next</property> </emphasis> or on the <emphasis><property>Finish</property> </emphasis> button to generate code.</para>
-
- <para>Once the Web Service code is generated, you can view the implementation class and add business logic to each method.</para>
- <figure id="figure_impl_code">
- <title>The generated implementation Java code</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_ws_Impl_code_view.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>View the Web.xml file:</para>
- <figure id="figure_webxml">
- <title>Web.xml</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_ws_webxml.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- </section>
-
- <section id="bottomupws">
- <title>Creating a Web service from a Java bean using JBossWS runtime</title>
- <para>The Web Service wizard assists you in creating a new Web service, configuring it for deployment, and then deploying it to the server.</para>
- <para>To create a Web service from a bean using JBoss WS:</para>
- <para>Setup <link linkend="preference">JBoss WS and development environment</link>.</para>
- <para>Create <link linkend="createproject">a Dynamic Web project</link>.</para>
- <para>Add <link linkend="addfacet">JBossWS Facet</link> to Web project.</para>
- <para>Create a Web Service from a java bean: </para>
- <itemizedlist>
- <listitem>
- <para>Switch to the Java EE perspective <emphasis><property>Window > Open Perspective > Java EE</property></emphasis>.</para>
- </listitem>
- <listitem>
- <para>In the Project Explorer view, select the bean that you created or imported into the source folder of your Web project.</para>
- <figure>
- <title>Create a new Bean Class</title>
- <mediaobject>
- <imageobject>
- <imagedata scale="80" fileref="images/jbossws_bottomup.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>Click <emphasis><property>File > New > Other</property></emphasis>. Select Web Services in order to display various Web service wizards. Select the Web Service wizard. Click on the <property>Next</property> button.</para>
- <figure>
- <title>New Web Service</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_bottomup_1.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>On the first Web Service wizard page: select <property>Bottom up Java bean Web service</property> as your Web service type, and select the Java bean from which the service will be created:</para>
- <figure>
- <title>Set Web Service Common values</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_bottomup_2.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <itemizedlist>
- <listitem>
- <para>Select the stages of Web service development that you want to complete using the slider: </para>
- <itemizedlist>
- <listitem>
- <para>Develop: this will develop the WSDL definition and implementation of the Web service. This includes such tasks as creating modules that will contain generated code, WSDL files, deployment descriptors, and Java files when appropriate.</para>>
- </listitem>
- <listitem>
- <para>Assemble: this ensures the project that will host the Web service or client gets associated to an EAR when required by the target application server.</para>>
- </listitem>
- <listitem>
- <para>Deploy: this will create the deployment code for the service.</para>>
- </listitem>
- <listitem>
- <para>Install: this will install and configure the Web module and EARs on the target server.</para>>
- </listitem>
- <listitem>
- <para>Start: this will start the server once the service has been installed on it. The server-config.wsdd file will be generated.</para>>
- </listitem>
- <listitem>
- <para>Test: this will provide various options for testing the service, such as using the Web Service Explorer or sample JSPs.</para>>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>Select your server: the default server is displayed. If you want to deploy your service to a different server click the link to specify a different server.</listitem>
- <listitem>Select your runtime: ensure the JBoss WS runtime is selected.</listitem>
- <listitem>Select the service project: the project selected in your workspace is displayed. To select a different project click on the project link. If you are deploying to JBoss Application Server you will also be asked to select the EAR associated with the project. Ensure that the project selected as the Client Web Project is different from the Service Web Project, or the service will be overwritten by the client's generated artifacts.</listitem>
- <listitem>If you want to create a client, select the type of proxy to be generated and repeat the above steps for the client. The better way is to create a web service client project separately.</listitem>
- </itemizedlist>
- <para>Click on the <property>Next</property> button.</para>
- </listitem>
- <listitem>
- <para>On the JBoss Web Service Code Generation Configuration page, set the following values:</para>
- <figure>
- <title>Set Web Service values for Code Generation</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_bottomup_3.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <itemizedlist>
- <listitem>
- <para>Generate WSDL file: select it, you will get a generated WSDL file in your project. But this wsdl's services' address location values are not a real address. </para>
- </listitem>
- <listitem>After the Web service has been created, the following option can become available depending on the options you selected:
- <para>Update the default web.xm file: if selected, you may test the web service by Explorer.</para>
- </listitem>
- </itemizedlist>
- <para>Click on the <property>Next</property> button.</para>
- </listitem>
- <listitem>
- <para>On this page, the project is deployed to the server. You can start the server and test the web service. If you want to publish the web service to a UDDI registry, you may click the <property>Next</property> button to publish it. If not, you may click the <property>Finish</property> button.</para>
- <figure>
- <title>Start a Server</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/jbossws_bottomup_4.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- <para>After the Web Service has been created, the following options may become available depending on the options selected:</para>
- <itemizedlist>
- <listitem>
- <para>the generated web services code</para>
- </listitem>
- <listitem>
- <para>If you selected to generate a WSDL file, you will get the file in your project's WebContent > wsdl folder.</para>
- <figure>
- <title>The generated WSDL file</title>
- <mediaobject>
- <imageobject>
- <imagedata scale="80" fileref="images/jbossws_bottomup_6.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>If you selected to update the default web.xml, you will test the web service in the browser. Open the Explorer, input the url for the web service according to web.xml plus <property>?wsdl.</property>, you will get the WSDL file from Explorer. </para>
- <figure>
- <title>The Updated web.xml file</title>
- <mediaobject>
- <imageobject>
- <imagedata scale="80" fileref="images/jbossws_bottomup_5.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- </section>
+
+ <section id="topdownwebservice">
+ <title>Creating a Web Service from a WSDL document using JBossWS runtime</title>
+ <para>In this chapter we provide you with the necessary steps to create a Web Service from a
+ WSDL document using JBossWS runtime.</para>
+ <para>At first, please make sure that you have already created a dynamic Web project with
+ JBoss Web Service facet installed. </para>
+ <para>See how to make it <link linkend="createproject">here</link>> and <link
+ linkend="addfacet">here</link>.</para>
+
+ <para>To create a Web Service using JBossWS runtime select<emphasis>
+ <property>File > New > Other > Web Services > Web Service</property>
+ </emphasis> to run Web Service creation wizard. </para>
+ <para>Let's get through the wizard step-by-step:</para>
+ <figure id="figure_create_ws_topdown">
+ <title>New Web Service Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_ws_creation1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>First, please select <property>Top down Java bean Web Service</property> from the Web
+ Service type list, and select a WSDL document from workspace, click on the Server name
+ lilnk on the page will bring you to another dialog. Here you can specify the server to a
+ JBoss Server and Web Service runtime to JBossWS runtime:</para>
+ <figure id="figure_create_ws_topdown_setserver">
+ <title>Select Server and Web Service runtime</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_ws_creation1_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Click on the <emphasis>
+ <property>Finish</property>
+ </emphasis> button to see the next wizard view opened:</para>
+
+ <figure id="figure_create_ws_topdown1">
+ <title>New Web Service Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_ws_creation1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Click on the <emphasis>
+ <property>Next</property>
+ </emphasis> button to proceed:</para>
+ <figure id="figure_create_ws_topdown_codegen">
+ <title>New Web Service Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_ws_creation2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On this page, the default package name comes from the namespace of the WSDL document,
+ you also can change it to any valid package name you want. JAX-WS specification should be
+ set to 2.0 if your JBossWS runtime in JBoss Server is JBossWS native runtime. You can
+ specify a catalog file and binding files if you have them. If you want the wizard to
+ generate empty implementation classes for the Web Service, check the <emphasis>
+ <property>Generate default Web Service implementation classes</property>
+ </emphasis> check box. If you want to update the default Web.xml file with the Web Service
+ servlets configured, check the <emphasis>
+ <property>Update the default Web.xml</property>
+ </emphasis> check box. Click on the <emphasis>
+ <property>Next</property>
+ </emphasis> or on the <emphasis>
+ <property>Finish</property>
+ </emphasis> button to generate code.</para>
+
+ <para>Once the Web Service code is generated, you can view the implementation class and add
+ business logic to each method.</para>
+ <figure id="figure_impl_code">
+ <title>The generated implementation Java code</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_ws_Impl_code_view.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>View the Web.xml file:</para>
+ <figure id="figure_webxml">
+ <title>Web.xml</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_ws_webxml.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+ <section id="bottomupws">
+ <title>Creating a Web service from a Java bean using JBossWS runtime</title>
+ <para>The Web Service wizard assists you in creating a new Web service, configuring it for
+ deployment, and then deploying it to the server.</para>
+ <para>To create a Web service from a bean using JBoss WS:</para>
+ <para>Setup <link linkend="preference">JBoss WS and development environment</link>.</para>
+ <para>Create <link linkend="createproject">a Dynamic Web project</link>.</para>
+ <para>Add <link linkend="addfacet">JBossWS Facet</link> to Web project.</para>
+ <para>Create a Web Service from a java bean: </para>
+ <itemizedlist>
+ <listitem>
+ <para>Switch to the Java EE perspective <emphasis>
+ <property>Window > Open Perspective > Java EE</property>
+ </emphasis>.</para>
+ </listitem>
+ <listitem>
+ <para>In the Project Explorer view, select the bean that you created or imported into
+ the source folder of your Web project.</para>
+ <figure>
+ <title>Create a new Bean Class</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="80" fileref="images/jbossws_bottomup.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Click <emphasis>
+ <property>File > New > Other</property>
+ </emphasis>. Select Web Services in order to display various Web service wizards.
+ Select the Web Service wizard. Click on the <property>Next</property> button.</para>
+ <figure>
+ <title>New Web Service</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_bottomup_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>On the first Web Service wizard page: select <property>Bottom up Java bean Web
+ service</property> as your Web service type, and select the Java bean from which
+ the service will be created:</para>
+ <figure>
+ <title>Set Web Service Common values</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_bottomup_2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>Select the stages of Web service development that you want to complete using
+ the slider: </para>
+ <itemizedlist>
+ <listitem>
+ <para>Develop: this will develop the WSDL definition and implementation of
+ the Web service. This includes such tasks as creating modules that will
+ contain generated code, WSDL files, deployment descriptors, and Java
+ files when appropriate.</para>
+ </listitem>
+ <listitem>
+ <para>Assemble: this ensures the project that will host the Web service or
+ client gets associated to an EAR when required by the target application
+ server.</para>
+ </listitem>
+ <listitem>
+ <para>Deploy: this will create the deployment code for the service.</para>
+ </listitem>
+ <listitem>
+ <para>Install: this will install and configure the Web module and EARs on
+ the target server.</para>
+ </listitem>
+ <listitem>
+ <para>Start: this will start the server once the service has been installed
+ on it. The server-config.wsdd file will be generated.</para>
+ </listitem>
+ <listitem>
+ <para>Test: this will provide various options for testing the service, such
+ as using the Web Service Explorer or sample JSPs.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>Select your server: the default server is displayed. If you want to deploy
+ your service to a different server click the link to specify a different server.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Select your runtime: ensure the JBoss WS runtime is selected.</para>
+ </listitem>
+ <listitem>
+ <para>Select the service project: the project selected in your workspace is
+ displayed. To select a different project click on the project link. If you are
+ deploying to JBoss Application Server you will also be asked to select the EAR
+ associated with the project. Ensure that the project selected as the Client Web
+ Project is different from the Service Web Project, or the service will be
+ overwritten by the client's generated artifacts.</para>
+ </listitem>
+ <listitem>
+ <para>If you want to create a client, select the type of proxy to be generated
+ and repeat the above steps for the client. The better way is to create a web
+ service client project separately.</para>
+ </listitem>
+ </itemizedlist>
+ <para>Click on the <property>Next</property> button.</para>
+ </listitem>
+ <listitem>
+ <para>On the JBoss Web Service Code Generation Configuration page, set the following
+ values:</para>
+ <figure>
+ <title>Set Web Service values for Code Generation</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_bottomup_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <itemizedlist>
+ <listitem>
+ <para>Generate WSDL file: select it, you will get a generated WSDL file in your
+ project. But this wsdl's services' address location values are not a real
+ address. </para>
+ </listitem>
+ <listitem>
+ <para>After the Web service has been created, the following option can become
+ available depending on the options you selected: Update the default web.xm
+ file. If selected, you may test the web service by Explorer.</para>
+ </listitem>
+ </itemizedlist>
+ <para>Click on the <property>Next</property> button.</para>
+ </listitem>
+ <listitem>
+ <para>On this page, the project is deployed to the server. You can start the server and
+ test the web service. If you want to publish the web service to a UDDI registry, you
+ may click the <property>Next</property> button to publish it. If not, you may click
+ the <property>Finish</property> button.</para>
+ <figure>
+ <title>Start a Server</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jbossws_bottomup_4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ <para>After the Web Service has been created, the following options may become available
+ depending on the options selected:</para>
+ <itemizedlist>
+ <listitem>
+ <para>the generated web services code</para>
+ </listitem>
+ <listitem>
+ <para>If you selected to generate a WSDL file, you will get the file in your project's
+ WebContent > wsdl folder.</para>
+ <figure>
+ <title>The generated WSDL file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="80" fileref="images/jbossws_bottomup_6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>If you selected to update the default web.xml, you will test the web service in
+ the browser. Open the Explorer, input the url for the web service according to
+ web.xml plus <property>?wsdl.</property>, you will get the WSDL file from Explorer. </para>
+ <figure>
+ <title>The Updated web.xml file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata scale="80" fileref="images/jbossws_bottomup_5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ </section>
+
</chapter>
16 years, 2 months
JBoss Tools SVN: r11321 - trunk/esb/docs/esb_ref_guide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-30 05:35:07 -0400 (Thu, 30 Oct 2008)
New Revision: 11321
Modified:
trunk/esb/docs/esb_ref_guide/en/modules/esb_editor.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-463 - correcting validation errors;
Modified: trunk/esb/docs/esb_ref_guide/en/modules/esb_editor.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en/modules/esb_editor.xml 2008-10-30 09:34:42 UTC (rev 11320)
+++ trunk/esb/docs/esb_ref_guide/en/modules/esb_editor.xml 2008-10-30 09:35:07 UTC (rev 11321)
@@ -275,12 +275,10 @@
</imageobject>
</mediaobject>
</figure>
-
+ <para>The last chapter covers capabilities on how you can use ESB editor.</para>
+
+ <para>In summary, this reference supplies you with all necessary information on the
+ functionality that JBoss ESB Editor provides for work with JBoss ESB.</para>
</section>
-
- <para>The last chapter covers capabilities on how you can use ESB editor.</para>
-
- <para>In summary, this reference supplies you with all necessary information on the
- functionality that JBoss ESB Editor provides for work with JBoss ESB.</para>
</section>
</chapter>
16 years, 2 months
JBoss Tools SVN: r11320 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-30 05:34:42 -0400 (Thu, 30 Oct 2008)
New Revision: 11320
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml
trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-463 - correcting validation errors;
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2008-10-30 09:34:07 UTC (rev 11319)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2008-10-30 09:34:42 UTC (rev 11320)
@@ -52,8 +52,7 @@
is recommended to use the SysV service scripts for production servers.</para>
</listitem>
<listitem>
- <para>Download and install the appropriate -compat RPM from JPackage <ulink
- url="ftp://jpackage.hmdc.harvard.edu/JPackage/1.7/generic/RPMS.non-free/">here</ulink>.
+ <para>Download and install the appropriate -compat RPM from JPackage <ulink url="ftp://jpackage.hmdc.harvard.edu/JPackage/1.7/generic/RPMS.non-free/">here</ulink>.
Please ensure you choose a matching version of the -compat package to the JDK you've
installed.</para>
</listitem>
@@ -74,9 +73,9 @@
<para>If you have JDK already installed and added in your system path, you should add
<emphasis>$JAVA_HOME/bin</emphasis> before the old <emphasis>$PATH</emphasis> (not after it)
- so that the new version of JDK can be found first, i. e. <para>
+ so that the new version of JDK can be found first, i. e. <emphasis>
<emphasis>export PATH=$JAVA_HOME/bin:$PATH</emphasis>
- </para> This way, the machine will pick up the new JVM first. You only need to run
+ </emphasis> This way, the machine will pick up the new JVM first. You only need to run
"alternative" as a safe guard for the right JVM. </para>
</note>
@@ -200,8 +199,8 @@
<itemizedlist>
<listitem>
- <para>First of all you need the appropriate installation file for your platform from <ulink
- url="https://www.redhat.com/apps/store/developers/jboss_developer_studio.html">Red Hat
+ <para>First of all you need the appropriate installation file for your platform from
+ <ulink url="https://www.redhat.com/apps/store/developers/jboss_developer_studio.html">Red Hat
website</ulink>.</para>
</listitem>
<listitem>
@@ -261,8 +260,7 @@
<itemizedlist>
<listitem>
- <para>Installation process includes <ulink
- url="http://www.jboss.com/products/platforms/application">JBoss Enterprise Application
+ <para>Installation process includes <ulink url="http://www.jboss.com/products/platforms/application">JBoss Enterprise Application
Platform</ulink>. Select <emphasis>
<property>Yes</property>
</emphasis> to use it in JBoss Developer Studio.</para>
@@ -392,12 +390,10 @@
<tip>
<title>Tip:</title>
<para>We recommend you do not use Eclipse.org update site to go from Eclipse 3.3 to Eclipse 3.4.
- Instead we suggest that you download the full binary from <ulink
- url="http://www.eclipse.org/downloads/">here</ulink>.</para>
+ Instead we suggest that you download the full binary from <ulink url="http://www.eclipse.org/downloads/">here</ulink>.</para>
</tip>
- <para>If you can only use Eclipse 3.3 use <ulink
- url="http://www.jboss.org/tools/download/index.html#stable">JBoss Tools 2.1.2</ulink>, but
+ <para>If you can only use Eclipse 3.3 use <ulink url="http://www.jboss.org/tools/download/index.html#stable">JBoss Tools 2.1.2</ulink>, but
JBoss Tools 2.x will not have any of the new features.</para>
<note>
@@ -422,8 +418,7 @@
>http://download.jboss.org/jbosstools/updates/stable</ulink></para>
</listitem>
<listitem>
- <para> Development Updates: <ulink
- url="http://download.jboss.org/jbosstools/updates/development"
+ <para> Development Updates: <ulink url="http://download.jboss.org/jbosstools/updates/development"
>http://download.jboss.org/jbosstools/updates/development</ulink></para>
</listitem>
</itemizedlist>
@@ -440,8 +435,7 @@
</emphasis> directory and it will be readily available. It might be necessary to start Eclipse
with eclipse -clean to make sure it starts clean and rereads the new list of plugins.</para>
- <para>If you need to install any standalone plug-in from JBoss Tools visit a <ulink
- url="http://labs.jboss.com/wiki/InstallingJBossTools">JBoss Tools Wiki</ulink> page to read
+ <para>If you need to install any standalone plug-in from JBoss Tools visit a <ulink url="http://labs.jboss.com/wiki/InstallingJBossTools">JBoss Tools Wiki</ulink> page to read
about dependencies between standalone plug-ins.</para>
</section>
@@ -556,8 +550,7 @@
<section id="Support">
<?dbhtml filename="Support.html"?>
<title>Support</title>
- <para>If you have comments or questions, you can discuss them at our <ulink
- url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=258">JBoss
+ <para>If you have comments or questions, you can discuss them at our <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=258">JBoss
Developer Studio Forum</ulink>.</para>
<para>When writing to the forum for questions, please include the following information:</para>
<orderedlist>
@@ -572,8 +565,7 @@
</listitem>
</orderedlist>
- <para><property>JBDS</property> subscribers can get necessary support on our <ulink
- url="https://network.jboss.com/jbossnetwork/login.html">Support Portal</ulink>.</para>
+ <para><property>JBDS</property> subscribers can get necessary support on our <ulink url="https://network.jboss.com/jbossnetwork/login.html">Support Portal</ulink>.</para>
</section>
@@ -582,15 +574,12 @@
<title>Other relevant resources on the topic</title>
<para>JBDS on JBoss: <ulink url="http://labs.jboss.com/rhdevstudio/">JBoss Developer
Studio</ulink></para>
- <para>Forum: <ulink
- url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=258">JBoss
+ <para>Forum: <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=258">JBoss
Forum</ulink></para>
- <para>Subscription: <ulink
- url="https://www.redhat.com/apps/store/developers/jboss_developer_studio.html">JBDS
+ <para>Subscription: <ulink url="https://www.redhat.com/apps/store/developers/jboss_developer_studio.html">JBDS
Subscription</ulink></para>
- <para>The latest documentation builds are available <ulink
- url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
+ <para>The latest documentation builds are available <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
</section>
</chapter>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml 2008-10-30 09:34:07 UTC (rev 11319)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml 2008-10-30 09:34:42 UTC (rev 11320)
@@ -121,9 +121,9 @@
</imageobject>
</mediaobject>
</figure>
- <para>Our <emphasis>
- <property>hello.jsp</property>
- </emphasis> page will now appear in <property>Project Explorer</property>.</para>
+ <para>Our <emphasis><property>hello.jsp</property></emphasis> page will now appear in
+ <property>Project Explorer</property>.
+ </para>
<section id="EditingJSPPage">
<?dbhtml filename="EditingJSPPage.html"?>
<title>Editing a JSP Page</title>
@@ -415,12 +415,13 @@
<imagedata fileref="images/jsp_application/jsp_application_17.png"/>
</imageobject>
</mediaobject>
- </figure>
+ </figure>
+ <para>Thus with the help of this chapter you've learnt how to organize a Dynamic
+ Web Project with a minimal configuration, add any staff to it (in our case it's
+ just one jsp page) and deploy and run it on the <property>JBoss Server</property>
+ shipped with <property>JBDS</property>.
+ </para>
</section>
- <para>Thus with the help of this chapter you've learnt how to organize a Dynamic
- Web Project with a minimal configuration, add any staff to it (in our case it's
- just one jsp page) and deploy and run it on the <property>JBoss Server</property>
- shipped with <property>JBDS</property>.</para>
- </section>
+ </section>
</chapter>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml 2008-10-30 09:34:07 UTC (rev 11319)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/manage.xml 2008-10-30 09:34:42 UTC (rev 11320)
@@ -350,8 +350,8 @@
</imageobject>
</mediaobject>
</figure>
-
- </section>
+ <para>Now, we are ready to create the first web application.</para>
+ </section>
+
</section>
- <para>Now, we are ready to create the first web application.</para>
</chapter>
16 years, 2 months
JBoss Tools SVN: r11319 - trunk/documentation/guides/Exadel-migration/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-30 05:34:07 -0400 (Thu, 30 Oct 2008)
New Revision: 11319
Modified:
trunk/documentation/guides/Exadel-migration/en/modules/jsf_struts.xml
trunk/documentation/guides/Exadel-migration/en/modules/jsf_struts_war.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-463 - correcting validation errors;
Modified: trunk/documentation/guides/Exadel-migration/en/modules/jsf_struts.xml
===================================================================
--- trunk/documentation/guides/Exadel-migration/en/modules/jsf_struts.xml 2008-10-30 09:33:28 UTC (rev 11318)
+++ trunk/documentation/guides/Exadel-migration/en/modules/jsf_struts.xml 2008-10-30 09:34:07 UTC (rev 11319)
@@ -38,7 +38,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem><para>In the first screen of the wizard, select the <emphasis><property>Change...</property></emphasis> button next to the <emphasis><property>web.xml Location</property></emphasis> field. Browse to the location of the web.xml file for the application you
want to import as a <property>JSF project</property>. Once you select it, you'll be returned to the dialog box to see a project name derived from the web.xml file you selected.
You can edit this project name, if you wish.</para></listitem>
@@ -53,7 +53,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues" id="import_jsf_screen">
+ <itemizedlist id="import_jsf_screen">
<listitem><para>In the <emphasis><property>Project Folders</property></emphasis> screen, you can configure the rest of your project. Afterwards click on the <emphasis><property>Finish</property></emphasis> button.</para></listitem>
</itemizedlist>
<para>On this step JBoss Developer Studio will try to determine your project
@@ -76,7 +76,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem><para>Once the project is imported, it will appear in the Package Explorer view.</para></listitem>
</itemizedlist>
@@ -114,7 +114,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem><para>In the Project Location screen of the wizard, select the <emphasis><property>Change... </property></emphasis>button next to the <emphasis><property>web.xml Location</property></emphasis> field. Browse the location of the web.xml file for the application you
want to import as a <property>Struts project</property>. Once you select it, you'll be returned to the dialog box to see a project name derived from the web.xml file you selected.
You can edit this project name, if you wish.</para></listitem>
@@ -129,7 +129,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem><para>In the next screen, JBoss Developer Studio will try to determine your project structure. The upper pane shows the modules in this project.
The lower pane allows you to edit the details of the select module. If the project structure is non-standard, some values might be left blank.
You can edit any values by hand or by using the <emphasis><property>Change...</property></emphasis> button.</para></listitem>
@@ -144,7 +144,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem><para>In the <emphasis><property>Project Folders</property></emphasis> screen, you can configure the rest of your project. Afterwards click on the <emphasis><property>Finish</property></emphasis> button.</para>
</listitem>
</itemizedlist>
@@ -166,7 +166,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem><para>Once the project is imported, it will appear in the Package Explorer view.</para></listitem>
</itemizedlist>
Modified: trunk/documentation/guides/Exadel-migration/en/modules/jsf_struts_war.xml
===================================================================
--- trunk/documentation/guides/Exadel-migration/en/modules/jsf_struts_war.xml 2008-10-30 09:33:28 UTC (rev 11318)
+++ trunk/documentation/guides/Exadel-migration/en/modules/jsf_struts_war.xml 2008-10-30 09:34:07 UTC (rev 11319)
@@ -45,7 +45,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>In the wizard screen, select the <emphasis><property>Change...</property></emphasis> button next to
the <emphasis><property>*.war Location</property></emphasis> field. Browse to the location of the *.war file for
@@ -84,7 +84,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click on the <emphasis><property>Finish</property></emphasis> button.</para>
</listitem>
@@ -121,7 +121,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Follow the same steps as with the JSF Project From <property>*.war</property> import
wizard.</para>
@@ -138,7 +138,7 @@
</mediaobject>
</figure>
- <itemizedlist continuation="continues">
+ <itemizedlist>
<listitem>
<para>Click on the <emphasis><property>Finish</property></emphasis> button.</para>
</listitem>
16 years, 2 months
JBoss Tools SVN: r11318 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-30 05:33:28 -0400 (Thu, 30 Oct 2008)
New Revision: 11318
Modified:
trunk/as/docs/reference/en/modules/modules.xml
trunk/as/docs/reference/en/modules/tptp_support.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-463 - correcting validation errors;
Modified: trunk/as/docs/reference/en/modules/modules.xml
===================================================================
--- trunk/as/docs/reference/en/modules/modules.xml 2008-10-30 09:02:02 UTC (rev 11317)
+++ trunk/as/docs/reference/en/modules/modules.xml 2008-10-30 09:33:28 UTC (rev 11318)
@@ -176,9 +176,8 @@
<property>.class</property>
</emphasis> file, is to enable the builder for that project. This is done by either
changing the global preferences for the <property>Archives View</property>, or by
- enabling project-specific preferences and ensuring the builder is on.</para>
- </section>
-
+ enabling project-specific preferences and ensuring the builder is on.</para>
<para>The last chapter covers a variety of methods on how you can deploy needed modules onto a
- server.</para>
+ server.</para>
+ </section>
</chapter>
Modified: trunk/as/docs/reference/en/modules/tptp_support.xml
===================================================================
--- trunk/as/docs/reference/en/modules/tptp_support.xml 2008-10-30 09:02:02 UTC (rev 11317)
+++ trunk/as/docs/reference/en/modules/tptp_support.xml 2008-10-30 09:33:28 UTC (rev 11318)
@@ -52,10 +52,9 @@
<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
+ >eclipse documentation</ulink>.</para>
+ <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>
+ for work with it.</para>
+ </section>
</chapter>
16 years, 2 months
JBoss Tools SVN: r11317 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-30 05:02:02 -0400 (Thu, 30 Oct 2008)
New Revision: 11317
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3051
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2008-10-30 06:58:14 UTC (rev 11316)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2008-10-30 09:02:02 UTC (rev 11317)
@@ -42,7 +42,6 @@
private LocationValidator validator = new LocationValidator((Workspace) ResourcesPlugin.getWorkspace());
-
protected GenerateDdlWizardPage(JpaProject jpaProject) {
super(jpaProject);
}
@@ -68,6 +67,7 @@
}
}
});
+ outputdir.setText(getDefaultOutput());
outputdir.setDialogFieldListener(fieldlistener);
outputdir.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_output_dir);
outputdir.setButtonLabel(HibernateConsoleMessages.CodeGenerationSettingsTab_browse);
@@ -86,6 +86,7 @@
}
protected void dialogChanged() {
+ setErrorMessage(null);
String msg = PathHelper.checkDirectory(getOutputDir(), HibernateConsoleMessages.CodeGenerationSettingsTab_output_directory, false);
if (msg!=null) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java 2008-10-30 06:58:14 UTC (rev 11316)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateEntitiesWizardPage.java 2008-10-30 09:02:02 UTC (rev 11317)
@@ -12,7 +12,14 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaConventions;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.PackageFragmentRoot;
+import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil;
+import org.eclipse.jdt.internal.corext.util.Messages;
+import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
@@ -26,6 +33,7 @@
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.launch.PathHelper;
import org.hibernate.util.StringHelper;
+import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
/**
* @author Dmitry Geraskov
@@ -65,10 +73,11 @@
}
}
});
+ outputdir.setText(getDefaultOutput());
outputdir.setDialogFieldListener(fieldlistener);
outputdir.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_output_dir);
- outputdir.setButtonLabel(HibernateConsoleMessages.CodeGenerationSettingsTab_browse);
-
+ outputdir.setButtonLabel(HibernateConsoleMessages.CodeGenerationSettingsTab_browse);
+
Control[] controls = outputdir.doFillIntoGrid(container, numColumns);
// Hack to tell the text field to stretch!
( (GridData)controls[1].getLayoutData() ).grabExcessHorizontalSpace = true;
@@ -77,31 +86,46 @@
packageName.setDialogFieldListener(fieldlistener);
packageName.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_package);
packageName.doFillIntoGrid(container, numColumns);
-
+
setPageComplete( false );
}
protected void dialogChanged() {
+ setMessage("");
+ /*validate package name*/
+ String packName= getPackageName();
+ if (packName.length() > 0) {
+ IStatus val= validatePackageName(packName, getJpaProject());
+ if (val.getSeverity() == IStatus.ERROR) {
+ setErrorMessage(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidPackageName, val.getMessage()));
+ setPageComplete( false );
+ return;
+ } else if (val.getSeverity() == IStatus.WARNING) {
+ setWarningMessage(Messages.format(NewWizardMessages.NewTypeWizardPage_warning_DiscouragedPackageName, val.getMessage()));
+ }
+ } else {
+ setWarningMessage(NewWizardMessages.NewTypeWizardPage_warning_DefaultPackageDiscouraged);
+ }
+
String msg = PathHelper.checkDirectory(getOutputDir(), HibernateConsoleMessages.CodeGenerationSettingsTab_output_directory, false);
-
+
if (msg!=null) {
setErrorMessage( msg );
setPageComplete( false );
return;
}
-
- if (StringHelper.isNotEmpty(getPackageName())){
- IStatus status= JavaConventions.validatePackageName(getPackageName() );
- if (status.getSeverity() == IStatus.ERROR || status.getSeverity() == IStatus.WARNING) {
- setErrorMessage( status.getMessage() );
- return;
- }
- }
super.dialogChanged();
}
+ private static IStatus validatePackageName(String text, JpaProject project) {
+ if (project == null || !project.getJavaProject().exists()) {
+ return JavaConventions.validatePackageName(text, JavaCore.VERSION_1_3, JavaCore.VERSION_1_3);
+ }
+ return JavaConventionsUtil.validatePackageName(text, project.getJavaProject());
+ }
+
public String getPackageName(){
return packageName.getText();
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-10-30 06:58:14 UTC (rev 11316)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-10-30 09:02:02 UTC (rev 11317)
@@ -24,6 +24,10 @@
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.PackageFragmentRoot;
+import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ComboDialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener;
@@ -201,8 +205,8 @@
setErrorMessage("Please, select connection profile");
return;
}
+
setPageComplete(true);
- setErrorMessage(null);
}
private String[] dtpConnectionProfileNames() {
@@ -305,4 +309,31 @@
public boolean isTemporaryConfiguration(){
return !selectMethod.getSelection();
}
+
+ public JpaProject getJpaProject(){
+ return jpaProject;
+ }
+
+ public void setWarningMessage(String warning){
+ setMessage(warning, WARNING);
+ }
+
+ protected String getDefaultOutput(){
+ try{
+ if (getJpaProject() == null) return "";
+ if (getJpaProject().getJavaProject() == null) return "";
+ if (!getJpaProject().getJavaProject().exists()) return "";
+ IPackageFragmentRoot[] roots = getJpaProject().getJavaProject().getPackageFragmentRoots();
+ for (int i = 0; i < roots.length; i++) {
+ IPackageFragmentRoot root = roots[i];
+ if (root.getClass() == PackageFragmentRoot.class) {
+ if (root.exists()) return root.getResource().getFullPath().toOSString();
+ }
+ }
+ return getJpaProject().getJavaProject().getResource().getFullPath().toOSString();
+ } catch(JavaModelException e){
+ HibernateJptUIPlugin.logException(e);
+ return "";
+ }
+ }
}
16 years, 2 months
JBoss Tools SVN: r11316 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: javabean/ui and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-30 02:58:14 -0400 (Thu, 30 Oct 2008)
New Revision: 11316
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
Log:
JBIDE-2992
Add type/connections problem check function to Xml2Java analyzer
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-30 02:21:00 UTC (rev 11315)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-30 06:58:14 UTC (rev 11316)
@@ -786,10 +786,11 @@
} else {
rootModel = new JavaBeanModel(null, rootClassName);
}
+ rootModel.setBeanClassString(SmooksModelUtils.getParmaText("beanClass", current));
setSelectorIsUsed(rootClassName);
buildChildrenOfTargetInputModel(listType, rootModel, false,
rootIsError, current, loader);
- List list = new ArrayList();
+ List<JavaBeanModel> list = new ArrayList<JavaBeanModel>();
list.add(rootModel);
return list;
}
@@ -834,6 +835,7 @@
selector = selector.substring(2, selector.length() - 1);
ResourceConfigType resourceConfig = findResourceConfigTypeWithSelector(
selector, listType);
+ model.setBeanClassString(SmooksModelUtils.getParmaText("beanClass", resourceConfig));
if (resourceConfig != null) {
this.buildChildrenOfTargetInputModel(listType, model, false,
false, resourceConfig, classLoader);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java 2008-10-30 02:21:00 UTC (rev 11315)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSection.java 2008-10-30 06:58:14 UTC (rev 11316)
@@ -11,6 +11,7 @@
package org.jboss.tools.smooks.javabean.ui;
import org.eclipse.gef.EditPart;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -89,19 +90,21 @@
}
private JavaBeanModel getJavaBeanModel() {
- IStructuredSelection selection = (IStructuredSelection) this
- .getSelection();
- Object obj = selection.getFirstElement();
- if (obj == null)
- return null;
- if (obj instanceof EditPart) {
- Object model = ((EditPart) obj).getModel();
- if (model instanceof LineConnectionModel) {
- AbstractStructuredDataModel target = (AbstractStructuredDataModel) ((LineConnectionModel) model)
- .getTarget();
- Object referenceObj = target.getReferenceEntityModel();
- if (referenceObj instanceof JavaBeanModel) {
- return (JavaBeanModel) referenceObj;
+ ISelection s = (ISelection) this.getSelection();
+ if (s instanceof IStructuredSelection) {
+ IStructuredSelection selection = (IStructuredSelection)s;
+ Object obj = selection.getFirstElement();
+ if (obj == null)
+ return null;
+ if (obj instanceof EditPart) {
+ Object model = ((EditPart) obj).getModel();
+ if (model instanceof LineConnectionModel) {
+ AbstractStructuredDataModel target = (AbstractStructuredDataModel) ((LineConnectionModel) model)
+ .getTarget();
+ Object referenceObj = target.getReferenceEntityModel();
+ if (referenceObj instanceof JavaBeanModel) {
+ return (JavaBeanModel) referenceObj;
+ }
}
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-30 02:21:00 UTC (rev 11315)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-30 06:58:14 UTC (rev 11316)
@@ -135,6 +135,7 @@
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.SmooksConfigFileNewWizard;
import org.jboss.tools.smooks.ui.wizards.TransformDataSelectionWizard;
import org.jboss.tools.smooks.utils.SmooksGraphConstants;
import org.jboss.tools.smooks.utils.UIUtils;
@@ -271,8 +272,8 @@
SashForm sashForm = new SashForm(mainComposite, SWT.VERTICAL);
GridData sashFormLd = new GridData(GridData.FILL_BOTH);
sashForm.setLayoutData(sashFormLd);
-// sashForm.
-// sashForm.setSashWidth(1);
+ // sashForm.
+ // sashForm.setSashWidth(1);
designTimeAnalyzeResultRegion = toolkit.createComposite(sashForm);
GridLayout ngl = new GridLayout();
@@ -282,7 +283,7 @@
SashForm mappingMainComposite = new SashForm(sashForm, SWT.NONE);
// under the eclipse3.3
-// mappingMainComposite.setSashWidth(1);
+ // mappingMainComposite.setSashWidth(1);
GridData sgd = new GridData(GridData.FILL_BOTH);
section.setLayoutData(sgd);
{
@@ -649,9 +650,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.ui.forms.editor.FormPage#doSave(org.eclipse.core.runtime.
- * IProgressMonitor)
+ * @see org.eclipse.ui.forms.editor.FormPage#doSave(org.eclipse.core.runtime.
+ * IProgressMonitor)
*/
@Override
public void doSave(IProgressMonitor monitor) {
@@ -714,13 +714,19 @@
context.setDataMappingRootModel(this.rootModel);
context.setSmooksConfigFile(((IFileEditorInput) getEditorInput())
.getFile());
-
- context.setSourceViewerLabelProvider((LabelProvider)sourceViewer.getLabelProvider());
- context.setSourceViewerContentProvider((ITreeContentProvider)sourceViewer.getContentProvider());
-
- context.setTargetViewerLabelProvider((LabelProvider)targetViewer.getLabelProvider());
- context.setTargetViewerContentProvider((ITreeContentProvider)targetViewer.getContentProvider());
-
+
+ context.setSourceViewerLabelProvider((LabelProvider) sourceViewer
+ .getLabelProvider());
+ context
+ .setSourceViewerContentProvider((ITreeContentProvider) sourceViewer
+ .getContentProvider());
+
+ context.setTargetViewerLabelProvider((LabelProvider) targetViewer
+ .getLabelProvider());
+ context
+ .setTargetViewerContentProvider((ITreeContentProvider) targetViewer
+ .getContentProvider());
+
context.setShell(getSite().getShell());
}
@@ -967,9 +973,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.ui.forms.editor.FormPage#init(org.eclipse.ui.IEditorSite,
- * org.eclipse.ui.IEditorInput)
+ * @see org.eclipse.ui.forms.editor.FormPage#init(org.eclipse.ui.IEditorSite,
+ * org.eclipse.ui.IEditorInput)
*/
public void init(IEditorSite site, IEditorInput input) {
super.init(site, input);
@@ -1001,7 +1006,8 @@
throwable = e;
}
if (throwable != null) {
- ((SmooksFormEditor) getEditor()).setOnlyShowTextEditor(true,throwable);
+ ((SmooksFormEditor) getEditor()).setOnlyShowTextEditor(true,
+ throwable);
}
}
@@ -1053,12 +1059,24 @@
try {
if (viewer == this.sourceViewer) {
this.createSourceGraphModels();
+ this.getSmooksConfigurationFileGenerateContext()
+ .getProperties()
+ .setProperty(
+ SmooksConfigFileNewWizard.PRO_SOURCE_DATA_PATH,
+ cw.getStructuredDataSourcePath());
sourceDataTypeID = typeID;
}
if (viewer == this.targetViewer) {
this.createTargetGraphModels();
targetDataTypeID = typeID;
+ this.getSmooksConfigurationFileGenerateContext()
+ .getProperties()
+ .setProperty(
+ SmooksConfigFileNewWizard.PRO_TARGET_DATA_PATH,
+ cw.getStructuredDataSourcePath());
}
+ commandStackChanged = true;
+ firePropertyChange(PROP_DIRTY);
} catch (Exception e) {
MessageDialog.openError(getSite().getShell(), "Error",
"a error occurs during filling Data into the viewer:\n"
@@ -1103,9 +1121,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.ui.forms.events.IHyperlinkListener#linkActivated(org.
- * eclipse.ui.forms.events.HyperlinkEvent)
+ * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkActivated(org.
+ * eclipse.ui.forms.events.HyperlinkEvent)
*/
public void linkActivated(HyperlinkEvent e) {
showCreationWizard(viewer);
@@ -1114,9 +1131,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.ui.forms.events.IHyperlinkListener#linkEntered(org.eclipse
- * .ui.forms.events.HyperlinkEvent)
+ * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkEntered(org.eclipse
+ * .ui.forms.events.HyperlinkEvent)
*/
public void linkEntered(HyperlinkEvent e) {
@@ -1125,9 +1141,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.ui.forms.events.IHyperlinkListener#linkExited(org.eclipse
- * .ui.forms.events.HyperlinkEvent)
+ * @see org.eclipse.ui.forms.events.IHyperlinkListener#linkExited(org.eclipse
+ * .ui.forms.events.HyperlinkEvent)
*/
public void linkExited(HyperlinkEvent e) {
@@ -1159,9 +1174,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets
- * .Event)
+ * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets
+ * .Event)
*/
public void handleEvent(Event event) {
TreeItem item = (TreeItem) event.item;
@@ -1194,9 +1208,8 @@
/*
* (non-Javadoc)
*
- * @see
- * org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt
- * .events.PaintEvent)
+ * @see org.eclipse.swt.events.PaintListener#paintControl(org.eclipse.swt
+ * .events.PaintEvent)
*/
public void paintControl(PaintEvent e) {
Tree tree = (Tree) e.getSource();
@@ -1289,7 +1302,8 @@
SWT.NONE);
Menu menu = new Menu(getSite().getShell(), SWT.POP_UP);
List<ResolveCommand> list = result.getResolveProblem();
- for (Iterator<ResolveCommand> iterator2 = list.iterator(); iterator2.hasNext();) {
+ for (Iterator<ResolveCommand> iterator2 = list.iterator(); iterator2
+ .hasNext();) {
final ResolveCommand resolveCommand = (ResolveCommand) iterator2
.next();
MenuItem item = new MenuItem(menu, SWT.NONE);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-30 02:21:00 UTC (rev 11315)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-30 06:58:14 UTC (rev 11316)
@@ -10,9 +10,6 @@
import org.eclipse.emf.common.ui.dialogs.WorkspaceResourceDialog;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardNode;
-import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -28,7 +25,6 @@
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.INewWizard;
/**
*
@@ -44,6 +40,7 @@
protected Button fileSystemBrowseButton;
protected boolean reasourceLoaded = false;
private Button workspaceBrowseButton;
+ private String filePath = null;
public AbstractFileSelectionWizardPage(String pageName) {
super(pageName);
@@ -52,7 +49,7 @@
public Object getReturnValue() {
try {
- returnObject = this.loadedTheObject(fileText.getText());
+ returnObject = this.loadedTheObject(filePath);
} catch (Exception e) {
e.printStackTrace();
}
@@ -60,7 +57,7 @@
}
public String getFilePath(){
- return fileText.getText();
+ return filePath;
}
/*
* (non-Javadoc)
@@ -109,6 +106,7 @@
protected void hookFileTextModifyListener() {
final ModifyListener modifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
+ filePath = fileText.getText();
changeWizardPageStatus();
}
};
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-30 02:21:00 UTC (rev 11315)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/xml2java/analyzer/XML2JavaAnalyzer.java 2008-10-30 06:58:14 UTC (rev 11316)
@@ -17,6 +17,8 @@
import javax.swing.text.html.HTMLDocument.HTMLReader.TagAction;
import org.eclipse.emf.ecore.xml.type.AnyType;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
import org.jboss.tools.smooks.analyzer.DesignTimeAnalyzeResult;
import org.jboss.tools.smooks.analyzer.MappingModel;
@@ -395,9 +397,89 @@
}
return null;
}
+
+ private void checkRootNodeConnected(
+ SmooksConfigurationFileGenerateContext context) {
+ GraphRootModel root = context.getGraphicalRootModel();
+ List sourceList = root.loadSourceModelList();
+ List targetList = root.loadTargetModelList();
+ AbstractXMLObject rootSource = null;
+ JavaBeanModel rootTarget = null;
+ boolean needCheck = false;
+
+ for (Iterator iterator = sourceList.iterator(); iterator.hasNext();) {
+ AbstractStructuredDataModel sourcegm = (AbstractStructuredDataModel) iterator
+ .next();
+ if (sourcegm instanceof IConnectableModel) {
+ if (!((IConnectableModel) sourcegm).getModelSourceConnections()
+ .isEmpty()
+ || !((IConnectableModel) sourcegm)
+ .getModelTargetConnections().isEmpty()) {
+ needCheck = true;
+ break;
+ }
+ }
+ }
+
+ if (needCheck) {
+ for (Iterator iterator = sourceList.iterator(); iterator.hasNext();) {
+ AbstractStructuredDataModel sourceGraphModel = (AbstractStructuredDataModel) iterator
+ .next();
+ AbstractXMLObject source = (AbstractXMLObject) sourceGraphModel
+ .getReferenceEntityModel();
+ if (source.getParent().getClass() == DocumentObject.class ) {
+ rootSource = source;
+ break;
+ }
+ }
+
+ for (Iterator iterator = targetList.iterator(); iterator.hasNext();) {
+ AbstractStructuredDataModel targetGraphModel = (AbstractStructuredDataModel) iterator
+ .next();
+ JavaBeanModel target = (JavaBeanModel) targetGraphModel
+ .getReferenceEntityModel();
+ if (target.isRoot()) {
+ rootTarget = target;
+ break;
+ }
+ }
+ if (rootSource != null && rootTarget != null) {
+ AbstractStructuredDataModel rootSourceGraphModel = UIUtils
+ .findGraphModel(root, rootSource);
+ AbstractStructuredDataModel rootTargetGraphModel = UIUtils
+ .findGraphModel(root, rootTarget);
+ if (rootSourceGraphModel instanceof IConnectableModel
+ && rootTargetGraphModel instanceof IConnectableModel) {
+ if (((IConnectableModel) rootSourceGraphModel)
+ .isSourceConnectWith((IConnectableModel) rootTargetGraphModel)) {
+ // do nothing
+ } else {
+ // ask user if they want to connect the root model
+ Shell displayParent = context.getShell();
+ boolean connectAuto = MessageDialog
+ .openQuestion(
+ displayParent,
+ "Connection Question",
+ "The root models don't be connected , it will make some errors with the generation config file contents.\nDo you wan to connect them?");
+ if (connectAuto) {
+ // connect root model
+ LineConnectionModel connectionModel = new LineConnectionModel();
+ connectionModel
+ .setSource((IConnectableModel) rootSourceGraphModel);
+ connectionModel
+ .setTarget((IConnectableModel) rootTargetGraphModel);
+ connectionModel.connect();
+ }
+ }
+ }
+ }
+ }
+ }
+
public DesignTimeAnalyzeResult[] analyzeGraphModel(
SmooksConfigurationFileGenerateContext context) {
+ checkRootNodeConnected(context);
List<DesignTimeAnalyzeResult> typeCheckResults = UIUtils
.checkTargetJavaModelType(context);
List<DesignTimeAnalyzeResult> connectionCheckResults = UIUtils
16 years, 2 months
JBoss Tools SVN: r11315 - in workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui: jbossui/org/jboss/ide/eclipse/as/ui/actions and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-29 22:21:00 -0400 (Wed, 29 Oct 2008)
New Revision: 11315
Added:
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/AbstractServerActionDelegate.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ChangeTimeStampActionDelegate.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/DebugServerActionDelegate.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/RunServerActionDelegate.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerActionMessages.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerManager.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerManagerListener.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/StopServerActionDelegate.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/messages.properties
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogActionProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogContentProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogLabelProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathChangeValueAction.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathDecorator.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathTreeContentProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathTreeLabelProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerActionProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerContentProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerDecorator.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerLabelProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersView.java
Removed:
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerViewProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/InactiveExtensionViewProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/jmx/
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ExtensionManager.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ToolsServerUICore.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/action/
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ExtensionTableViewer.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/JBossServerView.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerExtensionFrame.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerFrame.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerTableViewer.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/preferencepages/
Modified:
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/PropertySheetFactory.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/SimplePropertiesViewExtension.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/DescriptorXPathPropertySheetPage.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyContentProvider.java
workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
Log:
incremental update of moving stuff around, and renaming packages. This was necessary because the last release had package names in the org.eclipse namespace, which was clearly wrong. Also, deleted JBoss Servers View to replace it with the new beta view and made sure the extensions worked with it.
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/AbstractServerActionDelegate.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/AbstractServerActionDelegate.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/AbstractServerActionDelegate.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.actions;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+public abstract class AbstractServerActionDelegate implements IWorkbenchWindowActionDelegate, ServerManagerListener {
+
+ static Map<String, AbstractServerActionDelegate> delegates = new HashMap<String,AbstractServerActionDelegate>();
+
+ protected IWorkbenchWindow window;
+ protected IAction action;
+ protected boolean isInitialised = false;
+
+ public AbstractServerActionDelegate() {
+ delegates.put(getClass().getName(), this);
+ }
+
+ public static void updateAll() {
+ AbstractServerActionDelegate[] ds = delegates.values().toArray(new AbstractServerActionDelegate[0]);
+ for (int i = 0; i < ds.length; i++) {
+ try {
+ ds[i].update();
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ initModel();
+ }
+ });
+ }
+
+ private void initModel() {
+ ServerManager.getInstance().addListener(this);
+ update();
+ isInitialised = true;
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(this.action == action) return;
+ this.action = action;
+ serverManagerChanged();
+ }
+
+ public void run(IAction action) {
+ if(!isInitialised) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ if(isActionEnabled()) {
+ _run();
+ }
+ }
+ });
+ } else {
+ _run();
+ }
+ }
+
+ private void _run() {
+ try {
+ doRun();
+ } catch (Exception e) {
+ }
+ }
+
+ public void dispose() {}
+ protected void doRun() {}
+
+ protected boolean isActionEnabled() {
+ return true;
+ }
+
+ protected void update() {
+ if(action != null) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ action.setEnabled(isActionEnabled());
+ setToolTip();
+ }
+ });
+ }
+ }
+
+ public void serverManagerChanged() {
+ update();
+ }
+
+ protected void setToolTip() {
+ if(action != null) {
+ String tooltip = computeToolTip();
+ if(tooltip != null) action.setToolTipText(tooltip);
+ }
+ }
+
+ protected String computeToolTip() {
+ return null;
+ }
+
+
+ // a stub that can be used by subclasses
+ protected static ISelectionProvider getSelectionProvider() {
+ return new ISelectionProvider() {
+ public void addSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ }
+ public ISelection getSelection() {
+ return null;
+ }
+ public void removeSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ }
+ public void setSelection(ISelection selection) {
+ }
+ };
+ }
+
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ChangeTimeStampActionDelegate.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ChangeTimeStampActionDelegate.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ChangeTimeStampActionDelegate.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.actions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+
+public class ChangeTimeStampActionDelegate implements IWorkbenchWindowActionDelegate {
+
+ protected IWorkbenchWindow window;
+ String tooltip = null;
+ IProject project = null;
+ public void init(IWorkbenchWindow window) {
+ this.window = window;
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(project == null && action.isEnabled()) action.setEnabled(false);
+ if(tooltip != null && (selection instanceof IStructuredSelection)) {
+ Object o = ((IStructuredSelection)selection).getFirstElement();
+ IProject p = getProject(o);
+ if(p != null) {
+ project = p;
+ action.setEnabled(computeEnabled());
+ action.setToolTipText(NLS.bind(ServerActionMessages.CHANGE_TIME_STAMP,project.getName()));
+ return;
+ }
+ }
+ tooltip = ServerActionMessages.CHANGE_TIME_STAMP_DEFAULT;
+ action.setToolTipText(tooltip);
+ }
+
+ IProject getProject(Object selection) {
+ if(selection instanceof IResource) {
+ return ((IResource)selection).getProject();
+ } else if(selection instanceof IAdaptable) {
+ Object r = ((IAdaptable)selection).getAdapter(IResource.class);
+ return r instanceof IResource ? ((IResource)r).getProject() : null;
+ }
+ return null;
+ }
+
+ protected boolean computeEnabled() {
+ if(project == null || !project.isAccessible()) return false;
+ boolean isWar = J2EEProjectUtilities.isDynamicWebProject(project);
+ boolean isEar = J2EEProjectUtilities.isEARProject(project);
+ boolean isEJB = J2EEProjectUtilities.isEJBProject(project);
+ return isEar || isEJB || isWar;
+ }
+
+ public void run(IAction action) {
+ try {
+ changeTimeStamp(project);
+ } catch (Exception e) {
+
+ }
+ }
+
+ public void dispose() {
+ window = null;
+ }
+
+ public static void changeTimeStamp(IProject project) throws CoreException {
+ if(project == null || !project.isAccessible()) return;
+ List<IFile> fs = getFilesToTouch(project);
+ for (int i = 0; i < fs.size(); i++) {
+ IFile f = (IFile)fs.get(i);
+ f.setLocalTimeStamp(System.currentTimeMillis());
+ f.touch(new NullProgressMonitor()); // done so deployers/listeners can detect the actual change.
+ }
+ }
+
+ private static List<IFile> getFilesToTouch(IProject project) {
+ List<IFile> fs = new ArrayList<IFile>();
+ if(project == null || !project.isAccessible()) return fs;
+ boolean isWar = J2EEProjectUtilities.isDynamicWebProject(project);
+ boolean isEar = J2EEProjectUtilities.isEARProject(project);
+
+ boolean isReferencedByEar = false;
+ if(!isEar) {
+ IProject[] ps = J2EEProjectUtilities.getReferencingEARProjects(project);
+ for (int i = 0; i < ps.length; i++) {
+ fs.addAll(getFilesToTouch(ps[i]));
+ isReferencedByEar = true;
+ }
+ }
+ if(isEar) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IPath path = component.getRootFolder().getProjectRelativePath();
+ IFile f = project.getFile(path.append("META-INF").append("application.xml"));
+ if(f != null && f.exists()) {
+ fs.add(f);
+ }
+ }
+ if(isWar && !isReferencedByEar) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IPath path = component.getRootFolder().getProjectRelativePath();
+ IFile f = project.getFile(path.append("WEB-INF").append("web.xml"));
+ if(f != null && f.exists()) {
+ fs.add(f);
+ }
+ }
+ return fs;
+ }
+}
\ No newline at end of file
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/DebugServerActionDelegate.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/DebugServerActionDelegate.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/DebugServerActionDelegate.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.actions;
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IServer;
+
+public class DebugServerActionDelegate extends RunServerActionDelegate {
+
+ protected String getLaunchMode() {
+ return ILaunchManager.DEBUG_MODE;
+ }
+
+
+ protected String computeToolTip() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ String name = selected == null ? "" : selected.getName(); //$NON-NLS-1$
+ if( selected != null && selected.getServerState() == IServer.STATE_STARTED)
+ return NLS.bind(ServerActionMessages.RESTART_IN_DEBUG_MODE, name);
+ return NLS.bind(ServerActionMessages.START_IN_DEBUG_MODE, name); //$NON-NLS-2$
+ }
+
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/RunServerActionDelegate.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/RunServerActionDelegate.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/RunServerActionDelegate.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.actions;
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.StartAction;
+
+public class RunServerActionDelegate extends AbstractServerActionDelegate {
+
+ private StartAction delegate;
+ public void init(IWorkbenchWindow window) {
+ super.init(window);
+ update();
+ }
+
+ protected void doRun() {
+ IServer server = ServerManager.getInstance().getSelectedServer();
+ if(server == null)
+ return;
+ delegate = new StartAction(window.getShell(), getSelectionProvider(), getLaunchMode());
+ if( delegate.accept(server))
+ delegate.perform(server);
+ updateAll();
+ }
+
+ protected String getLaunchMode() {
+ return ILaunchManager.RUN_MODE;
+ }
+
+ protected boolean isActionEnabled() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ return (selected != null
+ && selected.getServerState() != IServer.STATE_STARTING);
+ }
+
+ protected String computeToolTip() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ String name = selected == null ? "" : selected.getName(); //$NON-NLS-1$
+ if( selected != null && selected.getServerState() == IServer.STATE_STARTED)
+ return NLS.bind(ServerActionMessages.RESTART_IN_RUN_MODE, name);
+ return NLS.bind(ServerActionMessages.START_IN_RUN_MODE, name);
+ }
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/SelectServerActionDelegate.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.actions;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.TaskModel;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+import org.eclipse.wst.server.ui.internal.wizard.NewServerWizard;
+import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
+
+
+public class SelectServerActionDelegate extends AbstractServerActionDelegate
+ implements IWorkbenchWindowPulldownDelegate {
+
+ private ArrayList images = new ArrayList();
+
+ protected void safeSelectionChanged(IAction action, ISelection selection) {
+ this.action = action;
+ update();
+ }
+
+ protected void update() {
+ if (action == null) return;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ update0();
+ }
+ });
+ }
+
+ private void update0() {
+ if(action == null) return;
+ IServer server = ServerManager.getInstance().getSelectedServer();
+ if( server != null ) {
+ ImageDescriptor id = ImageResource.getImageDescriptor(server.getServerType().getId());
+ action.setImageDescriptor(id);
+ }
+ action.setText(null);
+ action.setToolTipText(ServerActionMessages.SELECT_A_SERVER);
+ }
+
+ protected void doRun() {
+ getMenu(window.getShell()).setVisible(true);
+ }
+
+ public void dispose() {
+ action = null;
+ }
+
+ public Menu getMenu(Control parent) {
+ cleanImages();
+
+ Menu menu = new Menu(parent);
+ IServer[] servers = ServerManager.getInstance().getServers();
+ for (int i = 0; i < servers.length; i++) {
+ createServerItem(menu, servers[i]);
+ }
+ new MenuItem(menu, SWT.SEPARATOR);
+ createNewServerItem(menu);
+ return menu;
+ }
+
+ // prevent memory leaks
+ protected void cleanImages() {
+ Iterator<Image> i = images.iterator();
+ while(i.hasNext())
+ ((Image)i.next()).dispose();
+ images.clear();
+ }
+
+ private void createServerItem(Menu menu, final IServer server) {
+ MenuItem item = new MenuItem(menu, SWT.RADIO);
+ if(server == ServerManager.getInstance().getSelectedServer()) {
+ item.setSelection(true);
+ }
+
+ item.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ ServerManager.getInstance().setSelectedServer(server.getId());
+ update();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ item.setText(server.getName());
+ ImageDescriptor id = ImageResource.getImageDescriptor(server.getServerType().getId());
+ Image i = id.createImage();
+ images.add(i);
+ item.setImage(i);
+ }
+
+ private void createNewServerItem(Menu menu) {
+ MenuItem item = new MenuItem(menu, SWT.PUSH);
+ item.setText("New server...");
+ item.setImage(JBossServerUISharedImages.getImage(JBossServerUISharedImages.GENERIC_SERVER_IMAGE));
+ item.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ newServer();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ newServer();
+ widgetSelected(e);
+ }
+ });
+ }
+
+ private void newServer() {
+ NewServerWizard wizard = new NewServerWizard();
+ WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
+ if (dialog.open() != Window.CANCEL) {
+ IServer server = (IServer)wizard.getRootFragment().getTaskModel().getObject(TaskModel.TASK_SERVER);
+ if(server != null) {
+ ServerManager.getInstance().setSelectedServer(server.getId());
+ update();
+ }
+ }
+ }
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerActionMessages.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerActionMessages.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerActionMessages.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,20 @@
+package org.jboss.ide.eclipse.as.ui.actions;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ServerActionMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.as.wst.server.ui.action.messages";
+
+ static {
+ // load message values from bundle file
+ NLS.initializeMessages(BUNDLE_NAME, ServerActionMessages.class);
+ }
+ public static String START_IN_DEBUG_MODE;
+ public static String RESTART_IN_DEBUG_MODE;
+ public static String START_IN_RUN_MODE;
+ public static String RESTART_IN_RUN_MODE;
+ public static String SELECT_A_SERVER;
+ public static String STOP_SERVER;
+ public static String CHANGE_TIME_STAMP;
+ public static String CHANGE_TIME_STAMP_DEFAULT;
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerManager.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerManager.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerManager.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.actions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeLifecycleListener;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
+import org.eclipse.wst.server.core.IServerListener;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerEvent;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+
+public class ServerManager {
+ private static ServerManager instance;
+
+ public static synchronized ServerManager getInstance() {
+ if(instance == null) {
+ instance = new ServerManager();
+ }
+ return instance;
+ }
+
+ private List<ServerManagerListener> listeners = new ArrayList<ServerManagerListener>();
+ private IServerListener serverListener;
+ protected IServer[] servers = new IServer[0];
+
+ IServer selected = null;
+
+ public ServerManager() {
+ serverListener = new ServerListenerImpl();
+ load();
+ }
+
+ void load() {
+ servers = (IServer[])ServerCore.getServers().clone();
+ loadSelectedServer();
+ ServerResourceListenerImpl listener = new ServerResourceListenerImpl();
+ ServerCore.addRuntimeLifecycleListener(listener);
+ ServerCore.addServerLifecycleListener(listener);
+ }
+
+ private void loadSelectedServer() {
+ if(servers == null || servers.length == 0) return;
+ String ds = getDefaultWebServer();
+ IServer s = getServer(ds);
+ if(s == null && servers.length > 0) {
+ s = servers[0];
+ setDefaultWebServer(servers[0].getId());
+ }
+ setSelectedServerInternal(s);
+ }
+
+ public IServer[] getServers() {
+ return servers;
+ }
+
+ public IServer getServer(String serverId) {
+ for (int i = 0; i < servers.length; i++) {
+ if(servers[i].getId().equals(serverId)) {
+ return servers[i];
+ }
+ }
+ return null;
+ }
+
+ public void addListener(ServerManagerListener listener) {
+ if(!listeners.contains(listener)) listeners.add(listener);
+ }
+
+ public void removeListener(ServerManagerListener listener) {
+ listeners.remove(listener);
+ }
+
+ void fire() {
+ ServerManagerListener[] ls = (ServerManagerListener[])listeners.toArray(new ServerManagerListener[0]);
+ for (int i = 0; i < ls.length; i++) {
+ ls[i].serverManagerChanged();
+ }
+ }
+
+ public void setSelectedServer(String id) {
+ IServer server = getServer(id);
+ if(server == selected) return;
+ setSelectedServerInternal(server);
+ setDefaultWebServer(id);
+ fire();
+ }
+
+ private void setSelectedServerInternal(IServer server) {
+ if(selected == server) return;
+ if(selected != null) selected.removeServerListener(serverListener);
+ selected = server;
+ if(selected != null) selected.addServerListener(serverListener);
+ }
+
+ public String getSelectedServerId() {
+ String result = getDefaultWebServer();
+ return result == null ? "" : result;
+ }
+
+ public IServer getSelectedServer() {
+ return selected;
+ }
+
+ class ServerResourceListenerImpl implements IRuntimeLifecycleListener, IServerLifecycleListener {
+ public void serverAdded(IServer server) {
+ IServer[] ss = new IServer[servers.length + 1];
+ System.arraycopy(servers, 0, ss, 0, servers.length);
+ ss[servers.length] = server;
+ servers = ss;
+ loadSelectedServer();
+ fire();
+ }
+ public void serverChanged(IServer server) {
+ fire();
+ }
+ public void serverRemoved(IServer server) {
+ List<IServer> l = new ArrayList<IServer>();
+ for (int i = 0; i < servers.length; i++) {
+ if(servers[i] != server) l.add(servers[i]);
+ }
+ if(l.size() == servers.length) return;
+ servers = l.toArray(new IServer[0]);
+ loadSelectedServer();
+ fire();
+ }
+ public void runtimeAdded(IRuntime runtime) {
+ fire();
+ }
+ public void runtimeChanged(IRuntime runtime) {
+ fire();
+ }
+ public void runtimeRemoved(IRuntime runtime) {
+ fire();
+ }
+ }
+
+ class ServerListenerImpl implements IServerListener {
+ public void serverChanged(ServerEvent arg0) {
+ fire();
+ }
+ }
+
+ static String DEFAULT_WEB_SERVER = JBossServerUIPlugin.PLUGIN_ID + ".defaultWebServer";
+
+ static String getDefaultWebServer() {
+ String result = getInstancePreference(DEFAULT_WEB_SERVER);
+ return result;
+ }
+
+ static void setDefaultWebServer(String value) {
+ getInstancePreferences().put(DEFAULT_WEB_SERVER, value);
+ }
+
+ static IEclipsePreferences getInstancePreferences() {
+ return new InstanceScope().getNode(JBossServerUIPlugin.PLUGIN_ID);
+ }
+
+ static IEclipsePreferences getDefaultPreferences() {
+ return new DefaultScope().getNode(JBossServerUIPlugin.PLUGIN_ID);
+ }
+
+ static String getInstancePreference(String key) {
+ IEclipsePreferences p = getInstancePreferences();
+ String value = p == null ? null : p.get(key, null);
+ return value != null ? value : getDefaultPreference(key);
+ }
+
+ static String getDefaultPreference(String key) {
+ IEclipsePreferences p = getDefaultPreferences();
+ return p == null ? null : p.get(key, null);
+ }
+
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerManagerListener.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerManagerListener.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ServerManagerListener.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.actions;
+
+public interface ServerManagerListener {
+ public void serverManagerChanged();
+
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/StopServerActionDelegate.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/StopServerActionDelegate.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/StopServerActionDelegate.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.actions;
+
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.view.servers.StopAction;
+
+public class StopServerActionDelegate extends AbstractServerActionDelegate {
+ protected StopAction delegate;
+
+ public void init(IWorkbenchWindow window) {
+ super.init(window);
+ update();
+ delegate = new StopAction(window.getShell(), getSelectionProvider());
+ }
+
+ protected void doRun() {
+ IServer server = ServerManager.getInstance().getSelectedServer();
+ if(server == null) return;
+ if( delegate.accept(server))
+ delegate.perform(server);
+ }
+
+ protected boolean isActionEnabled() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ return (selected != null &&
+ (selected.getServerState() == IServer.STATE_STARTED
+ || selected.getServerState() == IServer.STATE_STARTING));
+ }
+
+ protected String computeToolTip() {
+ IServer selected = ServerManager.getInstance().getSelectedServer();
+ String name = selected == null ? "" : selected.getName(); //$NON-NLS-1$
+ return NLS.bind(ServerActionMessages.STOP_SERVER, name);
+ }
+
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/messages.properties
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/messages.properties (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/messages.properties 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,8 @@
+START_IN_DEBUG_MODE=Start {0} in debug mode
+RESTART_IN_DEBUG_MODE=Restart {0} in debug mode
+START_IN_RUN_MODE=Start {0}
+RESTART_IN_RUN_MODE=Restart {0}
+SELECT_A_SERVER=Select a default server
+STOP_SERVER=Shutdown {0}
+CHANGE_TIME_STAMP=Change Timestamp of {0}
+CHANGE_TIME_STAMP_DEFAULT=Touch descriptors
\ No newline at end of file
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogActionProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogActionProvider.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogActionProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,72 @@
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.ServerEventModel;
+import org.jboss.ide.eclipse.as.ui.dialogs.ShowStackTraceDialog;
+
+public class EventLogActionProvider extends CommonActionProvider {
+ private Action clearLogAction;
+ private Action showStackTraceAction;
+ private ICommonActionExtensionSite actionSite;
+ public EventLogActionProvider() {
+ super();
+ }
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ createActions();
+ }
+ public void fillContextMenu(IMenuManager menu) {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider().getSelection();
+ Object first = selection.getFirstElement();
+ if( first != null && first instanceof ServerEventModel) {
+ menu.add(clearLogAction);
+ }
+ if( first != null && first instanceof EventLogTreeItem &&
+ (((EventLogTreeItem)first).getEventClass().equals(EventLogModel.EVENT_TYPE_EXCEPTION) ||
+ ((EventLogTreeItem)first).getSpecificType().equals(EventLogModel.EVENT_TYPE_EXCEPTION))) {
+ menu.add(showStackTraceAction);
+ }
+ }
+ }
+
+
+ protected void createActions() {
+ clearLogAction = new Action() {
+ public void run() {
+ IStructuredSelection selection = (IStructuredSelection)actionSite.getStructuredViewer().getSelection();
+ if(selection.getFirstElement() != null && selection.getFirstElement() instanceof ServerEventModel) {
+ ((ServerEventModel)selection.getFirstElement()).clearEvents();
+ actionSite.getStructuredViewer().refresh(((ServerEventModel)selection.getFirstElement()));
+ }
+ }
+ };
+ clearLogAction.setText("Clear Event Log");
+
+ showStackTraceAction = new Action() {
+ public void run() {
+ IStructuredSelection selection = (IStructuredSelection)actionSite.getStructuredViewer().getSelection();
+ if( selection.getFirstElement() != null && selection.getFirstElement() instanceof EventLogTreeItem ) {
+ EventLogTreeItem item = (EventLogTreeItem)selection.getFirstElement();
+ ShowStackTraceDialog dialog = new ShowStackTraceDialog(new Shell(), item);
+ dialog.open();
+ }
+ }
+ };
+ showStackTraceAction.setText("See Exception Details");
+ }
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogContentProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogContentProvider.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogContentProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,165 @@
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogRoot;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.IEventLogListener;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.ServerEventModel;
+import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+
+public class EventLogContentProvider implements ITreeContentProvider {
+ public static final String SHOW_TIMESTAMP = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.showTimestamp";
+ public static final String GROUP_BY_CATEGORY = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.groupByCategory";
+ public static final String EVENT_ON_TOP = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.eventOnTop";
+ public static final int NEWEST_ON_TOP = 1;
+ public static final int OLDEST_ON_TOP = 2;
+ public static final int _TRUE_ = 1;
+ public static final int _FALSE_ = 2;
+
+ private Viewer viewer;
+
+ public EventLogContentProvider() {
+ EventLogModel.enableLogging();
+ EventLogModel.getDefault().addListener(new IEventLogListener() {
+ public void eventModelChanged(String serverId,
+ EventLogTreeItem changed) {
+ if( viewer instanceof StructuredViewer ) {
+ final Object o = changed.getEventRoot();
+ if( o instanceof EventLogRoot) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ ((StructuredViewer)viewer).refresh(((EventLogRoot)o).getModel());
+ }
+ });
+ }
+ }
+ }
+ });
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement instanceof IServer && parentElement != null ) {
+ return new Object[] { EventLogModel.getModel((IServer)parentElement)};
+ }
+ if( parentElement instanceof ServerEventModel) {
+ ServerEventModel s = ((ServerEventModel)parentElement);
+ boolean categorize = getCategorize();
+ if( categorize )
+ return getRootCategories(s);
+ Object[] ret = s.getRoot().getChildren();
+ if( getSortOrder()) {
+ List<Object> l = Arrays.asList(ret);
+ Collections.reverse(l);
+ return l.toArray();
+ }
+ return ret;
+ }
+
+ if( parentElement instanceof MajorEventType ) {
+ // get children only of this type
+ String serverId = ((MajorEventType)parentElement).getServer();
+ SimpleTreeItem[] children = EventLogModel.getModel(serverId).getRoot().getChildren();
+ ArrayList<SimpleTreeItem> items = new ArrayList<SimpleTreeItem>();
+ for( int i = 0; i < children.length; i++ ) {
+ if( children[i] instanceof EventLogTreeItem ) {
+ String type = ((EventLogTreeItem)children[i]).getEventClass();
+ if( type != null && type.equals(((MajorEventType)parentElement).getId()))
+ items.add(children[i]);
+ }
+ }
+
+ if( getSortOrder() ) Collections.reverse(items);
+
+ return items.toArray(new Object[items.size()]);
+ }
+
+ // just return the object's kids
+ if( parentElement instanceof EventLogTreeItem ) {
+ return ((EventLogTreeItem)parentElement).getChildren();
+ }
+ return new Object[0];
+ }
+
+ public static class MajorEventType {
+ private String id;
+ private String serverId;
+ public MajorEventType(String serverId, String id) {
+ this.id = id;
+ this.serverId = serverId;
+ }
+ public String getId() {
+ return id;
+ }
+ public String getServer() { return serverId; }
+ public String toString() { return id; }
+ public boolean equals(Object o) {
+ return o instanceof MajorEventType &&
+ ((MajorEventType)o).getId().equals(id) &&
+ ((MajorEventType)o).getServer().equals(serverId);
+ }
+ }
+
+ protected Object[] getRootCategories(ServerEventModel model) {
+ EventLogRoot root = model.getRoot();
+ ArrayList<String> list = new ArrayList<String>();
+ ArrayList<MajorEventType> majorTypes = new ArrayList<MajorEventType>();
+ SimpleTreeItem[] children = root.getChildren();
+ for( int i = 0; i < children.length; i++ ) {
+ if( children[i] instanceof EventLogTreeItem ) {
+ String type = ((EventLogTreeItem)children[i]).getEventClass();
+ if( !list.contains(type)) {
+ list.add(type);
+ majorTypes.add(new MajorEventType(model.getId(), type));
+ }
+ }
+ }
+ return majorTypes.toArray(new MajorEventType[majorTypes.size()]);
+ }
+
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0 ? true : false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return null;
+ }
+
+ public void dispose() {
+ EventLogModel.disableLogging();
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ this.viewer = viewer;
+ }
+
+ protected boolean getSortOrder() {
+ Preferences store = JBossServerUIPlugin.getDefault().getPluginPreferences();
+ int showTimestamp = store.getInt(EVENT_ON_TOP);
+ if( showTimestamp == OLDEST_ON_TOP) return false;
+ return true;
+ }
+ protected boolean getCategorize() {
+ Preferences store = JBossServerUIPlugin.getDefault().getPluginPreferences();
+ int showTimestamp = store.getInt(GROUP_BY_CATEGORY);
+ if( showTimestamp == _TRUE_ ) return true;
+ if( showTimestamp == _FALSE_) return false;
+ return false; // default
+ }
+}
\ No newline at end of file
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogLabelProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogLabelProvider.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/EventLogLabelProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,142 @@
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import java.util.Date;
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.ServerEventModel;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.EventLogContentProvider.MajorEventType;
+
+public class EventLogLabelProvider extends LabelProvider {
+
+ public static final String SHOW_TIMESTAMP = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.showTimestamp";
+ public static final int _TRUE_ = 1;
+ public static final int _FALSE_ = 2;
+ private static HashMap<String, String> majorTypeToName = new HashMap<String, String>();
+
+ static {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(JBossServerUIPlugin.PLUGIN_ID, "EventLogMajorType");
+ for( int i = 0; i < cf.length; i++ ) {
+ String type = cf[i].getAttribute("typeId");
+ String name = cf[i].getAttribute("name");
+ majorTypeToName.put(type, name);
+ }
+ }
+
+ private Image rootImage;
+ public EventLogLabelProvider() {
+ super();
+ ImageDescriptor des = ImageDescriptor.createFromURL(JBossServerUIPlugin.getDefault().getBundle().getEntry("icons/info_obj.gif"));
+ rootImage = des.createImage();
+ }
+ public void dispose() {
+ super.dispose();
+ rootImage.dispose();
+ }
+
+ private IEventLogLabelProvider[] labelProviderDelegates = null;
+ public Image getImage(Object element) {
+ if( labelProviderDelegates == null )
+ loadLabelProviderDelegates();
+
+ if( element instanceof ServerEventModel ) {
+ return rootImage;
+ }
+
+ if( !(element instanceof EventLogTreeItem))
+ return null;
+
+ EventLogTreeItem item = (EventLogTreeItem)element;
+ for( int i = 0; i < labelProviderDelegates.length; i++ ) {
+ if( labelProviderDelegates[i] != null
+ && labelProviderDelegates[i].supports(item.getSpecificType())) {
+ Image image = labelProviderDelegates[i].getImage((EventLogTreeItem)element);
+ if( image != null ) return image;
+ }
+ }
+
+ return null;
+ }
+
+ public String getText(Object element) {
+ if( element == null ) return "ERROR: Unknown String type";
+
+ if( element instanceof ServerEventModel ) {
+ return "Event Log";
+ }
+
+
+ String suffix = getShowTimestamp() ? createTimestamp(element) : "";
+ if( labelProviderDelegates == null )
+ loadLabelProviderDelegates();
+
+
+ if( !(element instanceof EventLogTreeItem)) {
+ if( element instanceof MajorEventType ) {
+ String val = majorTypeToName.get(((MajorEventType)element).getId());
+ if( val != null ) return val;
+ }
+ return element.toString();
+ }
+ EventLogTreeItem item = (EventLogTreeItem)element;
+
+ for( int i = 0; i < labelProviderDelegates.length; i++ ) {
+ if( labelProviderDelegates[i] != null
+ && labelProviderDelegates[i].supports(item.getSpecificType())) {
+ String text = labelProviderDelegates[i].getText((EventLogTreeItem)element);
+ if( text != null ) return text + suffix;
+ }
+ }
+
+ return element == null ? "" : element.toString() + suffix;
+ }
+
+ public void loadLabelProviderDelegates() {
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] elements = registry.getConfigurationElementsFor(JBossServerUIPlugin.PLUGIN_ID, "EventLogLabelProvider");
+ labelProviderDelegates = new IEventLogLabelProvider[elements.length];
+ for( int i = 0; i < elements.length; i++ ) {
+ try {
+ labelProviderDelegates[i] = (IEventLogLabelProvider)elements[i].createExecutableExtension("class");
+ } catch( CoreException ce ) {
+ JBossServerUIPlugin.log("Error loading Event Log Label Provider Delegate", ce);
+ }
+ }
+ }
+ protected boolean getShowTimestamp() {
+ Preferences store = JBossServerUIPlugin.getDefault().getPluginPreferences();
+ int showTimestamp = store.getInt(SHOW_TIMESTAMP);
+ if( showTimestamp == _TRUE_ ) return true;
+ if( showTimestamp == _FALSE_) return false;
+ return false; // default
+ }
+
+ protected String createTimestamp(Object element) {
+ if( element instanceof EventLogTreeItem ) {
+ Long v = (Long) ((EventLogTreeItem)element).getProperty(EventLogTreeItem.DATE);
+ if( v == null ) return "";
+
+ double date = v.doubleValue();
+ double now = new Date().getTime();
+ int seconds = (int) (( now - date) / 1000);
+ int minutes = seconds / 60;
+ int hours = minutes / 60;
+ minutes -= (hours * 60);
+ String minString = minutes + "m ago";
+ if( hours == 0 )
+ return " (" + minString + ")";
+ return " (" + hours + "h " + minString + ")";
+ }
+ return "";
+ }
+}
\ No newline at end of file
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,167 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.ui.views.server.extensions;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.tools.as.wst.server.ui.views.server.ExtensionTableViewer;
-import org.jboss.tools.as.wst.server.ui.views.server.JBossServerView;
-import org.jboss.tools.as.wst.server.ui.views.server.ExtensionTableViewer.ContentWrapper;
-import org.jboss.tools.as.wst.server.ui.views.server.preferencepages.ViewProviderPreferenceComposite;
-
-/**
- *
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public abstract class JBossServerViewExtension {
- protected ServerViewProvider provider;
-
- /**
- * Which extension point is mine.
- * @param provider
- */
- public void setViewProvider(ServerViewProvider provider) {
- this.provider = provider;
- }
-
- /**
- * Should query preferencestore to see if I'm enabled or not
- * @return
- */
- public boolean isEnabled() {
- return provider.isEnabled();
- }
-
-
- public void init() {
- }
- public void enable() {
- }
- public void disable() {
- }
- public void dispose() {
- if( getPropertySheetPage() != null )
- getPropertySheetPage().dispose();
- }
-
-
- public void fillContextMenu(Shell shell, IMenuManager menu, Object[] selected) {
- }
-
- public ITreeContentProvider getContentProvider() {
- return null;
- }
- public LabelProvider getLabelProvider() {
- return null;
- }
-
- public IPropertySheetPage getPropertySheetPage() {
- return null;
- }
-
- public ViewProviderPreferenceComposite createPreferenceComposite(Composite parent) {
- return null;
- }
-
- public Image createIcon() {
- return null;
- }
-
- public void refreshModel(Object object) {
- // override me
- }
-
- protected void suppressingRefresh(Runnable runnable) {
- JBossServerView.getDefault().getExtensionFrame().getViewer().suppressingRefresh(runnable);
- }
-
- protected void refreshViewer() {
- refreshViewer(null);
- }
- protected void refreshViewer(final Object o) {
- Runnable r = new Runnable() {
- public void run() {
- if( isEnabled() ) {
- if( o == null || o == provider ) {
- JBossServerView.getDefault().getExtensionFrame().getViewer().refresh(provider);
- } else {
- ExtensionTableViewer viewer = JBossServerView.getDefault().getExtensionFrame().getViewer();
- ContentWrapper wrapped = new ContentWrapper(o, provider);
- if( viewer.elementInTree(wrapped))
- viewer.refresh(new ContentWrapper(o, provider));
- else
- viewer.refresh(provider);
- }
- }
- }
- };
-
- if( JBossServerView.getDefault() == null )
- return;
-
- if( Display.getCurrent() == null )
- Display.getDefault().asyncExec(r);
- else
- r.run();
- }
- protected void removeElement(Object o) {
- JBossServerView.getDefault().getServerFrame().getViewer().remove(new ContentWrapper(o, provider));
- }
- protected void addElement(Object parent, Object child) {
- JBossServerView.getDefault().getServerFrame().getViewer().add(new ContentWrapper(parent, provider), new ContentWrapper(child, provider));
- }
-
- // what servers should i show for?
- protected boolean supports(IServer server) {
- if( server == null ) return false;
- return isJBossDeployable(server);
- }
-
- // show for anything that's jboss deployable
- protected boolean isJBossDeployable(IServer server) {
- return (IDeployableServer)server.loadAdapter(IDeployableServer.class, new NullProgressMonitor()) != null;
- }
-
- // show only for full jboss servers
- protected boolean isJBossServer(IServer server) {
- return (JBossServer)server.loadAdapter(JBossServer.class, new NullProgressMonitor()) != null;
- }
-
- protected boolean allAre(Object[] list, Class clazz) {
- for( int i = 0; i < list.length; i++ )
- if( list[i].getClass() != clazz )
- return false;
- return true;
- }
-}
Modified: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/PropertySheetFactory.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/PropertySheetFactory.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/PropertySheetFactory.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -45,7 +45,6 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.tools.as.wst.server.ui.views.server.ExtensionTableViewer.ContentWrapper;
/**
*
@@ -161,9 +160,6 @@
}
public Object[] getElements(Object inputElement) {
- if( inputElement instanceof ContentWrapper ) {
- inputElement = ((ContentWrapper)inputElement).getElement();
- }
if( properties != null )
return properties.keySet().toArray();
@@ -174,9 +170,6 @@
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if( newInput instanceof ContentWrapper )
- newInput = ((ContentWrapper)newInput).getElement();
-
input = newInput;
properties = holder.getProperties(newInput);
}
@@ -198,9 +191,6 @@
}
public String getColumnText(Object element, int columnIndex) {
- if( element instanceof ContentWrapper )
- element = ((ContentWrapper)element).getElement();
-
if( columnIndex == 0 ) return element.toString();
if( columnIndex == 1 && element instanceof String && properties != null ) {
return properties.getProperty((String)element);
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerViewProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerViewProvider.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerViewProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,141 +0,0 @@
-package org.jboss.ide.eclipse.as.ui.views.server.extensions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.osgi.framework.Bundle;
-
-/**
- *
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public class ServerViewProvider {
- public static final String EXTENSION_ENABLED = "EXTENSION_ENABLED_";
- public static final String EXTENSION_WEIGHT = "EXTENSION_WEIGHT_";
-
- public static final String ID_LABEL = "id";
- public static final String NAME_LABEL = "name";
- public static final String DESCRIPTION_LABEL = "description";
- public static final String PROVIDER_LABEL = "providerClass";
- public static final String ICON_LABEL = "icon";
-
-
- private IConfigurationElement element;
- private JBossServerViewExtension extension;
-
- private ImageDescriptor iconDescriptor;
- private Image icon;
-
- private boolean enabled;
- private int weight;
- private boolean loadFailed = false;
-
- public ServerViewProvider(IConfigurationElement element) {
- this.element = element;
-
- // Am I enabled?
- Preferences prefs = JBossServerUIPlugin.getDefault().getPluginPreferences();
-
-
- String enabledKey = EXTENSION_ENABLED + getId();
- setEnabled( prefs.contains(enabledKey) ? prefs.getBoolean(enabledKey) : true );
-
- String weightKey = EXTENSION_WEIGHT + getId();
- setWeight( prefs.contains(weightKey) ? prefs.getInt(weightKey) : 0 );
-
- Bundle pluginBundle = JBossServerUIPlugin.getDefault().getBundle();
- String iconLoc = getIconLocation();
- if( iconLoc != null ) {
- iconDescriptor =
- ImageDescriptor.createFromURL(pluginBundle.getEntry(iconLoc));
- }
- }
-
- public String getId() {
- return element.getAttribute(ID_LABEL);
- }
-
- public String getName() {
- return element.getAttribute(NAME_LABEL);
- }
-
- public String getDescription() {
- return element.getAttribute(DESCRIPTION_LABEL);
- }
-
- public String getIconLocation() {
- return element.getAttribute(ICON_LABEL);
- }
-
- public Image getImage() {
- if( icon == null && iconDescriptor != null ) {
- icon = iconDescriptor.createImage();
- } else if( icon == null && iconDescriptor == null ){
- icon = getDelegate().createIcon();
- } else if( icon != null && icon.isDisposed()) {
- icon = iconDescriptor == null ? getDelegate().createIcon() : iconDescriptor.createImage();
- }
- return icon;
- }
-
- public JBossServerViewExtension getDelegate() {
- try {
- if( extension == null && !loadFailed) {
- extension = (JBossServerViewExtension)element.createExecutableExtension(PROVIDER_LABEL);
- extension.setViewProvider(this);
- }
- } catch( CoreException ce ) {
- loadFailed = true;
- ce.printStackTrace();
- }
- return extension;
- }
-
- public String getDelegateName() {
- return element.getAttribute(PROVIDER_LABEL);
- }
-
- public boolean isEnabled() {
- return enabled;
- }
-
- public void setEnabled(boolean enable) {
- if( enable && !enabled ) {
- enabled = true;
- if(getDelegate() != null ) getDelegate().enable();
- } else if( !enable && enabled ) {
- enabled = false;
- if(getDelegate() != null ) getDelegate().disable();
- }
- }
-
- public boolean supports(IServer server) {
- return getDelegate() == null ? false : getDelegate().supports(server);
- }
-
- public int getWeight() {
- return weight;
- }
-
- public void setWeight(int weight) {
- this.weight = weight;
- }
-
- public void dispose() {
- if( getDelegate() != null )
- getDelegate().dispose();
- if( icon != null && iconDescriptor != null )
- icon.dispose();
-
- Preferences prefs = JBossServerUIPlugin.getDefault().getPluginPreferences();
-
- prefs.setValue(EXTENSION_ENABLED + getId(), enabled);
- prefs.setValue(EXTENSION_WEIGHT + getId(), weight);
- JBossServerUIPlugin.getDefault().savePluginPreferences();
- }
-}
Modified: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/SimplePropertiesViewExtension.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/SimplePropertiesViewExtension.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/SimplePropertiesViewExtension.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -36,7 +36,7 @@
* @author Rob Stryker <rob.stryker(a)redhat.com>
*
*/
-public abstract class SimplePropertiesViewExtension
+public abstract class SimplePropertiesViewExtension { /*
extends JBossServerViewExtension implements ISimplePropertiesHolder {
private SimplePropertiesPropertySheetPage propertiesSheet;
@@ -60,5 +60,5 @@
public abstract String[] getPropertyKeys(Object selected);
public abstract Properties getProperties(Object selected);
-
+*/
}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathActionProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,271 @@
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathCategoryDialog;
+import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathTreeContentProvider.ServerWrapper;
+
+public class XPathActionProvider extends CommonActionProvider {
+
+ private ICommonActionExtensionSite actionSite;
+ public Action newXPathCategoryAction, deleteXPathCategoryAction,
+ newXPathAction, editXPathAction, deleteXPathAction, editFileAction;
+ private XPathChangeValueAction xpathChangeValueAction;
+ private Object selectedNode;
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ ICommonViewerSite site = aSite.getViewSite();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ StructuredViewer v = aSite.getStructuredViewer();
+ if( v instanceof CommonViewer ) {
+ CommonViewer cv = (CommonViewer)v;
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ createActions(cv, wsSite.getSelectionProvider());
+ }
+ }
+ }
+
+ public void createActions(CommonViewer tableViewer, ISelectionProvider provider) {
+ Shell shell = tableViewer.getTree().getShell();
+ newXPathCategoryAction = new Action() {
+ public void run() {
+ XPathCategoryDialog d = new XPathCategoryDialog(Display
+ .getCurrent().getActiveShell(), getServer());
+ if (d.open() == Window.OK) {
+ XPathModel.getDefault().addCategory(getServer(),
+ d.getText());
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
+ }
+ };
+ newXPathCategoryAction.setText("New Category");
+
+ deleteXPathCategoryAction = new Action() {
+ public void run() {
+ int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO;
+ MessageBox messageBox = new MessageBox(Display.getCurrent()
+ .getActiveShell(), style);
+ messageBox
+ .setText(Messages.DescriptorXPathRemoveCategory + "?");
+ messageBox
+ .setMessage(Messages.DescriptorXPathRemoveCategoryDesc);
+ if (messageBox.open() == SWT.YES) {
+ XPathModel.getDefault().removeCategory(getServer(),
+ ((XPathCategory) selectedNode).getName());
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
+ }
+ };
+ deleteXPathCategoryAction
+ .setText(Messages.DescriptorXPathRemoveCategory);
+
+ newXPathAction = new Action() {
+ public void run() {
+ XPathCategory category = (XPathCategory) selectedNode;
+ if (category != null) {
+ String categoryName = category.getName();
+ XPathDialog d = new XPathDialog(Display.getCurrent()
+ .getActiveShell(), getServer(), categoryName);
+ if (d.open() == Window.OK) {
+ XPathCategory[] categoryList = XPathModel.getDefault()
+ .getCategories(getServer());
+ XPathCategory categoryItem = null;
+ for (int i = 0; i < categoryList.length; i++) {
+ if (categoryList[i].getName().equals(
+ category.getName()))
+ categoryItem = categoryList[i];
+ }
+ if (categoryItem != null) {
+ XPathQuery query = new XPathQuery(d.getName(),
+ XPathDialogs.getConfigFolder(getServer()),
+ null, d.getXpath(), d.getAttribute());
+ categoryItem.addQuery(query);
+ XPathModel.getDefault().save(getServer());
+ refreshViewer();
+ }
+ }
+ }
+ }
+ };
+ newXPathAction.setText(Messages.DescriptorXPathNewXPath);
+
+ editXPathAction = new Action() {
+ public void run() {
+ Object o = selectedNode;
+ if (o != null && o instanceof XPathQuery) {
+ XPathQuery original = (XPathQuery) o;
+ XPathCategory category = original.getCategory();
+
+ XPathDialog d = new XPathDialog(Display.getCurrent()
+ .getActiveShell(), getServer(), category.getName(),
+ original.getName());
+ d.setAttribute(original.getAttribute());
+ d.setXpath(original.getXpathPattern());
+
+ if (d.open() == Window.OK) {
+ original.setAttribute(d.getAttribute());
+ original.setXpathPattern(d.getXpath());
+ original.setName(d.getName());
+ category.save();
+ refreshViewer();
+ }
+ }
+ }
+ };
+ editXPathAction.setText(Messages.DescriptorXPathEditXPath);
+
+ deleteXPathAction = new Action() {
+ public void run() {
+ Object o = selectedNode;
+ if (o instanceof XPathQuery) {
+ XPathCategory cat = ((XPathQuery) o).getCategory();
+ cat.removeQuery((XPathQuery) o);
+ cat.save();
+ refreshViewer();
+ }
+ }
+ };
+ deleteXPathAction.setText(Messages.DescriptorXPathDeleteXPath);
+
+ editFileAction = new Action() {
+ public void run() {
+ try {
+ Object o = selectedNode;
+ Path p = null;
+ if (o instanceof XPathQuery
+ && ((XPathQuery) o).getResults().length == 1) {
+ o = (XPathFileResult) ((XPathQuery) o).getResults()[0];
+ }
+ if (o instanceof XPathFileResult) {
+ p = new Path(((XPathFileResult) o).getFileLocation());
+ } else if (o instanceof XPathResultNode) {
+ p = new Path(((XPathResultNode) o).getFileLocation());
+ }
+ if (p != null) {
+
+ IFileStore fileStore = EFS.getLocalFileSystem()
+ .getStore(p.removeLastSegments(1));
+ fileStore = fileStore.getChild(p.lastSegment());
+ IWorkbench wb = PlatformUI.getWorkbench();
+ IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
+ IWorkbenchPage page = win.getActivePage();
+
+ if (!fileStore.fetchInfo().isDirectory()
+ && fileStore.fetchInfo().exists()) {
+ try {
+ IDE.openEditorOnFileStore(page, fileStore);
+ } catch (PartInitException e) {
+ }
+ }
+ }
+ } catch (Exception exc) {
+ JBossServerUIPlugin.log("Error running edit file action",
+ exc);
+ }
+ }
+ };
+ editFileAction.setText("Edit File");
+
+ xpathChangeValueAction = new XPathChangeValueAction(shell, tableViewer, provider);
+ }
+
+ public void fillContextMenu(IMenuManager menu) {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ if (site instanceof ICommonViewerWorkbenchSite) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite) site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider()
+ .getSelection();
+ Object first = selection.getFirstElement();
+ if (first == null)
+ return;
+
+ if (first instanceof ServerWrapper) {
+ menu.add(newXPathCategoryAction);
+ menu.add(new Separator());
+ return;
+ }
+
+ if (first instanceof XPathCategory) {
+ menu.add(newXPathAction);
+ menu.add(deleteXPathCategoryAction);
+ menu.add(new Separator());
+ return;
+ }
+
+ if (first instanceof XPathQuery) {
+ selectedNode = first;
+ menu.add(newXPathAction);
+ menu.add(editXPathAction);
+ menu.add(deleteXPathAction);
+ }
+
+ if( xpathChangeValueAction.shouldRun())
+ menu.add(xpathChangeValueAction);
+
+ if ((first instanceof XPathResultNode || first instanceof XPathFileResult)
+ || (first instanceof XPathQuery && ((XPathQuery) first)
+ .getResults().length == 1)) {
+ menu.add(editFileAction);
+ }
+ }
+ }
+
+ protected void refreshViewer() {
+ actionSite.getStructuredViewer().refresh();
+ }
+
+ protected IServer getServer() {
+ Object o = selectedNode;
+ if (o instanceof ServerWrapper)
+ return ((ServerWrapper) o).server;
+ if (o instanceof XPathCategory)
+ return ((XPathCategory) o).getServer();
+ if (o instanceof XPathQuery)
+ return ((XPathQuery) o).getCategory().getServer();
+ if (o instanceof XPathFileResult)
+ return ((XPathFileResult) o).getQuery().getCategory().getServer();
+ if (o instanceof XPathResultNode)
+ return ((XPathResultNode) o).getFile().getQuery().getCategory()
+ .getServer();
+ return null;
+ }
+
+}
\ No newline at end of file
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathChangeValueAction.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathChangeValueAction.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathChangeValueAction.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,364 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.TreeEditor;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.actions.SelectionProviderAction;
+import org.eclipse.ui.actions.TextActionHandler;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+/**
+ * Action to rename a server.
+ */
+public class XPathChangeValueAction extends SelectionProviderAction {
+ protected CustomTreeEditor treeEditor;
+ protected Tree tree;
+ protected TreeViewer viewer;
+ protected Text textEditor;
+ protected Composite textEditorParent;
+ private TextActionHandler textActionHandler;
+ protected Shell shell;
+ protected int width = -1;
+ protected Rectangle newParentBounds;
+
+ protected boolean saving = false;
+
+ public XPathChangeValueAction(Shell shell, TreeViewer viewer, ISelectionProvider selectionProvider) {
+ super(selectionProvider, "Change Value");
+ this.shell = shell;
+ this.viewer = viewer;
+ this.tree = viewer.getTree();
+ this.treeEditor = new CustomTreeEditor(tree);
+ }
+
+ public boolean shouldRun() {
+ if( getStructuredSelection().toArray().length > 1)
+ return false;
+
+ Object o = getStructuredSelection().getFirstElement();
+ if( XPathDecorator.getDecoration(o) != null )
+ return true;
+ return false;
+ }
+
+ public void run() {
+ queryNewValueInline(getStructuredSelection().getFirstElement());
+ }
+
+ /**
+ * On Mac the text widget already provides a border when it has focus, so
+ * there is no need to draw another one. The value of returned by this
+ * method is usd to control the inset we apply to the text field bound's in
+ * order to get space for drawing a border. A value of 1 means a one-pixel
+ * wide border around the text field. A negative value supresses the border.
+ * However, in M9 the system property
+ * "org.eclipse.swt.internal.carbon.noFocusRing" has been introduced as a
+ * temporary workaround for bug #28842. The existence of the property turns
+ * the native focus ring off if the widget is contained in a main window
+ * (not dialog). The check for the property should be removed after a final
+ * fix for #28842 has been provided.
+ */
+ private static int getCellEditorInset(Control c) {
+ // special case for MacOS X
+ if ("carbon".equals(SWT.getPlatform())) { //$NON-NLS-1$
+ if (System
+ .getProperty("org.eclipse.swt.internal.carbon.noFocusRing") == null || c.getShell().getParent() != null) { //$NON-NLS-1$
+ return -2; // native border
+ }
+ }
+ return 1; // one pixel wide black border
+ }
+
+ /**
+ * Get the Tree being edited.
+ *
+ * @returnTree
+ */
+ private Tree getTree() {
+ return tree;
+ }
+
+ private Composite createParent() {
+ Tree tree2 = getTree();
+ Composite result = new Composite(tree2, SWT.NONE);
+ TreeItem[] selectedItems = tree2.getSelection();
+ treeEditor.horizontalAlignment = SWT.LEFT;
+ treeEditor.grabHorizontal = true;
+ treeEditor.setEditor(result, selectedItems[0]);
+ return result;
+ }
+
+ /**
+ * Return the new name to be given to the target resource or
+ * <code>null<code>
+ * if the query was canceled. Rename the currently selected server using the table editor.
+ * Continue the action when the user is done.
+ *
+ * @param server the server to rename
+ */
+ private void queryNewValueInline(final Object node) {
+
+ // Make sure text editor is created only once. Simply reset text
+ // editor when action is executed more than once. Fixes bug 22269
+ if (textEditorParent == null) {
+ createTextEditor(node);
+ }
+ textEditor.setText(XPathModel.getResultNode(node).getText());
+ // Open text editor with initial size
+ Point textSize = textEditor.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ textSize.x += textSize.y; // Add extra space for new characters
+ Point parentSize = textEditorParent.getSize();
+ int inset = getCellEditorInset(textEditorParent);
+ textEditor.setBounds(2, inset, Math.min(textSize.x, parentSize.x - 4),
+ parentSize.y - 2 * inset);
+ textEditor.setText(new XPathTreeLabelProvider().getText(node));
+ width = textEditor.getSize().x - 10;
+ textEditor.setText(XPathModel.getResultNode(node).getText());
+ treeEditor.layout();
+ textEditorParent.setVisible(true);
+ textEditor.setVisible(true);
+ textEditorParent.redraw();
+ textEditor.selectAll();
+ textEditor.setFocus();
+ }
+
+ /**
+ * Create the text editor widget.
+ *
+ * @param server the server to rename
+ */
+ private void createTextEditor(final Object node) {
+ // Create text editor parent. This draws a nice bounding rect
+ textEditorParent = createParent();
+ textEditorParent.setVisible(false);
+ final int inset = getCellEditorInset(textEditorParent);
+ if (inset > 0) {
+ textEditorParent.addListener(SWT.Paint, new Listener() {
+ public void handleEvent(Event e) {
+ Point textSize = textEditor.getSize();
+ Point parentSize = textEditorParent.getSize();
+ e.gc.drawRectangle(0, 0, Math.min(textSize.x + 4,
+ parentSize.x - 1), parentSize.y - 1);
+ }
+ });
+ }
+ // Create inner text editor
+ textEditor = new Text(textEditorParent, SWT.NONE);
+ textEditor.setFont(tree.getFont());
+ textEditorParent.setBackground(textEditor.getBackground());
+ textEditor.addListener(SWT.Modify, new Listener() {
+ public void handleEvent(Event e) {
+ Point textSize = textEditor.computeSize(SWT.DEFAULT,
+ SWT.DEFAULT);
+ textSize.x += textSize.y; // Add extra space for new
+ // characters.
+ Point parentSize = textEditorParent.getSize();
+
+ textEditor.setBounds(2, inset, Math.min(textSize.x,
+ parentSize.x - 4), parentSize.y - 2 * inset);
+ textEditorParent.redraw();
+ }
+ });
+ textEditor.addListener(SWT.Traverse, new Listener() {
+ public void handleEvent(Event event) {
+
+ // Workaround for Bug 20214 due to extra
+ // traverse events
+ switch (event.detail) {
+ case SWT.TRAVERSE_ESCAPE:
+ // Do nothing in this case
+ disposeTextWidget();
+ event.doit = true;
+ event.detail = SWT.TRAVERSE_NONE;
+ break;
+ case SWT.TRAVERSE_RETURN:
+ saveChangesAndDispose(node);
+ event.doit = true;
+ event.detail = SWT.TRAVERSE_NONE;
+ break;
+ }
+ }
+ });
+ textEditor.addFocusListener(new FocusAdapter() {
+ public void focusLost(FocusEvent fe) {
+ saveChangesAndDispose(node);
+ }
+ });
+
+ if (textActionHandler != null) {
+ textActionHandler.addText(textEditor);
+ }
+ textEditor.setVisible(false);
+ }
+
+ /**
+ * Close the text widget and reset the editorText field.
+ */
+ protected void disposeTextWidget() {
+ width = -1;
+ if (textActionHandler != null)
+ textActionHandler.removeText(textEditor);
+
+ if (textEditorParent != null) {
+ textEditorParent.dispose();
+ textEditorParent = null;
+ textEditor = null;
+ treeEditor.setEditor(null, null);
+ }
+ }
+
+ /**
+ * Save the changes and dispose of the text widget.
+ *
+ * @param server the server to rename
+ */
+ protected void saveChangesAndDispose(Object node) {
+ if (saving == true)
+ return;
+ saving = true;
+
+ // Cache the resource to avoid selection loss since a selection of
+ // another item can trigger this method
+ final String newVal = textEditor.getText();
+ XPathResultNode itemToChange = XPathModel.getResultNode(node);
+ // if its unchanged do nothing
+ if( !itemToChange.getText().equals(newVal)) {
+ // set the text and add the document to the list of dirty ones
+ itemToChange.setText(newVal);
+ if( itemToChange.getDocument() != null ) {
+ itemToChange.saveDescriptor();
+ }
+ }
+
+ // Run this in an async to make sure that the operation that triggered
+ // this action is completed. Otherwise this leads to problems when the
+ // icon of the item being renamed is clicked (i.e., which causes the
+ // rename text widget to lose focus and trigger this method)
+ getTree().getShell().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ // Dispose the text widget regardless
+ disposeTextWidget();
+ // Ensure the Navigator tree has focus, which it may not if
+ // the text widget previously had focus
+ if (tree != null && !tree.isDisposed()) {
+ tree.setFocus();
+ viewer.refresh(getStructuredSelection().getFirstElement());
+ }
+ } finally {
+ saving = false;
+ }
+ }
+ });
+ }
+
+
+ protected class CustomTreeEditor extends TreeEditor {
+ public CustomTreeEditor(Tree tree) {
+ super(tree);
+ }
+
+ public void setItem (TreeItem item) {
+ super.setItem(item);
+ }
+
+ private boolean hadFocus = false;
+ public void layout () {
+ if (tree == null || tree.isDisposed()) return;
+ if (getItem() == null || getItem().isDisposed()) return;
+ int columnCount = tree.getColumnCount();
+ if (columnCount == 0 && getColumn() != 0) return;
+ if (columnCount > 0 && (getColumn() < 0 || getColumn() >= columnCount)) return;
+
+ if (getEditor() == null || getEditor().isDisposed()) return;
+ if (getEditor().getVisible ()) {
+ hadFocus = getEditor().isFocusControl();
+ } // this doesn't work because
+ // resizing the column takes the focus away
+ // before we get here
+ getEditor().setBounds (customComputeBounds (superComputeBounds()));
+ if (hadFocus) {
+ if (getEditor() == null || getEditor().isDisposed()) return;
+ getEditor().setFocus ();
+ }
+ }
+
+ Rectangle customComputeBounds (Rectangle rect) {
+ Rectangle r = new Rectangle(rect.x + (width == -1 ? 0 : width), rect.y, rect.width, rect.height);
+ return r;
+ }
+
+ Rectangle superComputeBounds() {
+ if (getItem() == null || getColumn() == -1 || getItem().isDisposed() ) return new Rectangle(0, 0, 0, 0);
+ Rectangle cell = getItem().getBounds(getColumn());
+ Rectangle rect = getItem().getImageBounds(getColumn());
+ cell.x = rect.x + rect.width;
+ cell.width -= rect.width;
+ Rectangle area = tree.getClientArea();
+ if (cell.x < area.x + area.width) {
+ if (cell.x + cell.width > area.x + area.width) {
+ cell.width = area.x + area.width - cell.x;
+ }
+ }
+ Rectangle editorRect = new Rectangle(cell.x, cell.y, minimumWidth, minimumHeight);
+
+ if (grabHorizontal) {
+ if (tree.getColumnCount() == 0) {
+ // Bounds of tree item only include the text area - stretch out to include
+ // entire client area
+ cell.width = area.x + area.width - cell.x;
+ }
+ editorRect.width = Math.max(cell.width, minimumWidth);
+ }
+
+ if (grabVertical) {
+ editorRect.height = Math.max(cell.height, minimumHeight);
+ }
+
+ if (horizontalAlignment == SWT.RIGHT) {
+ editorRect.x += cell.width - editorRect.width;
+ } else if (horizontalAlignment == SWT.LEFT) {
+ // do nothing - cell.x is the right answer
+ } else { // default is CENTER
+ editorRect.x += (cell.width - editorRect.width)/2;
+ }
+ // don't let the editor overlap with the +/- of the tree
+ editorRect.x = Math.max(cell.x, editorRect.x);
+
+ if (verticalAlignment == SWT.BOTTOM) {
+ editorRect.y += cell.height - editorRect.height;
+ } else if (verticalAlignment == SWT.TOP) {
+ // do nothing - cell.y is the right answer
+ } else { // default is CENTER
+ editorRect.y += (cell.height - editorRect.height)/2;
+ }
+ return editorRect;
+ }
+
+ }
+
+}
\ No newline at end of file
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathDecorator.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathDecorator.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathDecorator.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,38 @@
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+
+public class XPathDecorator extends LabelProvider implements ILightweightLabelDecorator {
+ public void decorate(Object element, IDecoration decoration) {
+ String decoration2 = getDecoration(element);
+ if( decoration2 != null ) {
+ decoration.addSuffix(decoration2);
+ }
+ }
+
+ public static String getDecoration(Object element) {
+ if( element instanceof XPathQuery) {
+ XPathResultNode[] nodes = XPathModel.getResultNodes((XPathQuery)element);
+ if(nodes.length == 1 ) {
+ return " " + nodes[0].getText();
+ }
+ }
+
+ if( element instanceof XPathFileResult ) {
+ XPathResultNode[] nodes = ((XPathFileResult)element).getChildren();
+ if( nodes.length == 1 )
+ return " " + nodes[0].getText();
+ }
+
+ if( element instanceof XPathResultNode ) {
+ return ((XPathResultNode)element).getText();
+ }
+ return null;
+ }
+}
\ No newline at end of file
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathTreeContentProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathTreeContentProvider.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathTreeContentProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,135 @@
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+
+public class XPathTreeContentProvider implements ITreeContentProvider {
+
+ public static class DelayProxy {
+ }
+
+ public static final DelayProxy LOADING = new DelayProxy();
+
+ private Viewer viewer;
+ private ArrayList<XPathCategory> loading = new ArrayList<XPathCategory>();
+
+ public class ServerWrapper {
+ public IServer server;
+
+ public ServerWrapper(IServer server) {
+ this.server = server;
+ }
+
+ public int hashCode() {
+ return server.getId().hashCode();
+ }
+
+ public boolean equals(Object other) {
+ return other instanceof ServerWrapper
+ && ((ServerWrapper) other).server.getId().equals(
+ server.getId());
+ }
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement == null)
+ return new Object[] {};
+ if (parentElement instanceof IServer) {
+ return new Object[] { new ServerWrapper((IServer) parentElement) };
+ }
+
+ if (parentElement instanceof ServerWrapper) {
+ return XPathModel.getDefault().getCategories(
+ ((ServerWrapper) parentElement).server);
+ }
+
+ if (parentElement instanceof XPathCategory) {
+ if (((XPathCategory) parentElement).isLoaded())
+ return ((XPathCategory) parentElement).getQueries();
+
+ if (!loading.contains((XPathCategory) parentElement))
+ launchLoad((XPathCategory) parentElement);
+
+ return new Object[] { LOADING };
+ }
+
+ // we're the named element (JNDI)
+ if (parentElement instanceof XPathQuery) {
+ if (XPathModel.getResultNodes((XPathQuery) parentElement).length == 1) {
+ return new Object[0];
+ } else {
+ return ((XPathQuery) parentElement).getResults();
+ }
+ }
+
+ // we're a file node (blah.xml)
+ if (parentElement instanceof XPathFileResult) {
+ if (((XPathFileResult) parentElement).getChildren().length == 1)
+ return new Object[0];
+ return ((XPathFileResult) parentElement).getChildren();
+ }
+
+ if (parentElement instanceof XPathResultNode) {
+ return new Object[0];
+ }
+
+ return new Object[0];
+ }
+
+ protected void launchLoad(final XPathCategory cat) {
+ new Job("Loading XPaths") {
+ protected IStatus run(IProgressMonitor monitor) {
+ loading.add(cat);
+ XPathQuery[] queries = cat.getQueries();
+ XPathFileResult[] results;
+ for (int i = 0; i < queries.length; i++) {
+ results = queries[i].getResults();
+ for (int j = 0; j < results.length; j++) {
+ results[j].getChildren();
+ }
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ loading.remove(cat);
+ ((StructuredViewer) viewer).refresh(cat.getServer());
+ }
+ });
+ return Status.OK_STATUS;
+ }
+ }.schedule(200);
+ }
+
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0 ? true : false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return new Object[0];
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ this.viewer = viewer;
+ }
+}
\ No newline at end of file
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathTreeLabelProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathTreeLabelProvider.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/XPathTreeLabelProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,63 @@
+package org.jboss.ide.eclipse.as.ui.views.server.extensions;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
+import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathTreeContentProvider.ServerWrapper;
+
+public class XPathTreeLabelProvider extends LabelProvider {
+ private Image rootImage;
+ public XPathTreeLabelProvider() {
+ super();
+ ImageDescriptor des = ImageDescriptor.createFromURL(JBossServerUIPlugin.getDefault().getBundle().getEntry("icons/XMLFile.gif"));
+ rootImage = des.createImage();
+ }
+
+ public Image getImage(Object element) {
+ if( element instanceof ServerWrapper )
+ return rootImage;
+
+ if (element instanceof XPathCategory)
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_OBJ_FOLDER);
+
+ return null;
+ }
+
+ public String getText(Object element) {
+ if( element instanceof ServerWrapper )
+ return "XML Configuration";
+ if( element == XPathTreeContentProvider.LOADING )
+ return "Loading...";
+
+ if (element instanceof XPathCategory)
+ return ((XPathCategory) element).getName();
+
+ if( element instanceof XPathQuery )
+ return ((XPathQuery)element).getName();
+
+ if( element instanceof XPathFileResult )
+ return ((XPathFileResult)element).getFileLocation();
+
+ return "";
+ }
+
+ public XPathResultNode[] getResultNodes(XPathQuery query) {
+ ArrayList<XPathResultNode> l = new ArrayList<XPathResultNode>();
+ XPathFileResult[] files = query.getResults();
+ for( int i = 0; i < files.length; i++ ) {
+ l.addAll(Arrays.asList(files[i].getChildren()));
+ }
+ return l.toArray(new XPathResultNode[l.size()]);
+ }
+}
Modified: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -21,50 +21,14 @@
*/
package org.jboss.ide.eclipse.as.ui.views.server.providers;
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathModel;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
-import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs;
-import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathCategoryDialog;
-import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.JBossServerViewExtension;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
-import org.jboss.ide.eclipse.as.ui.views.server.providers.descriptors.DescriptorXPathPropertySheetPage;
/**
*
* @author Rob Stryker <rob.stryker(a)redhat.com>
*
*/
-public class DescriptorXPathViewProvider extends JBossServerViewExtension {
+public class DescriptorXPathViewProvider { /*
+extends JBossServerViewExtension {
private XPathTreeContentProvider contentProvider;
private XPathTreeLabelProvider labelProvider;
@@ -323,5 +287,6 @@
}
}
}
+ */
}
Modified: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -21,57 +21,15 @@
*/
package org.jboss.ide.eclipse.as.ui.views.server.providers;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Properties;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
-import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogRoot;
-import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
-import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.IEventLogListener;
-import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.dialogs.ShowStackTraceDialog;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.IEventLogLabelProvider;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.JBossServerViewExtension;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory.ISimplePropertiesHolder;
-import org.jboss.tools.as.wst.server.ui.views.server.preferencepages.ViewProviderPreferenceComposite;
-
/**
*
* @author Rob Stryker <rob.stryker(a)redhat.com>
*
*/
-public class EventLogViewProvider extends JBossServerViewExtension implements IEventLogListener, ISimplePropertiesHolder {
+public class EventLogViewProvider {
+ /*
+ extends JBossServerViewExtension implements IEventLogListener, ISimplePropertiesHolder {
public static final String SHOW_TIMESTAMP = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.showTimestamp";
public static final String GROUP_BY_CATEGORY = "org.jboss.ide.eclipse.as.ui.views.server.providers.EventLogViewProvider.groupByCategory";
@@ -323,11 +281,11 @@
return new Properties();
}
- public ViewProviderPreferenceComposite createPreferenceComposite(Composite parent) {
+ public EventLogPreferenceComposite createPreferenceComposite(Composite parent) {
return new EventLogPreferenceComposite(parent);
}
- protected class EventLogPreferenceComposite extends ViewProviderPreferenceComposite {
+ protected class EventLogPreferenceComposite extends Composite {
private Button newestFirst, oldestFirst, showTime, sort;
private Group firstGroup;
public EventLogPreferenceComposite(Composite parent) {
@@ -451,5 +409,5 @@
EventLogModel.disableLogging();
}
-
+*/
}
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/InactiveExtensionViewProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/InactiveExtensionViewProvider.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/InactiveExtensionViewProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,157 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.ui.views.server.providers;
-
-import java.util.ArrayList;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.JBossServerViewExtension;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
-import org.jboss.tools.as.wst.server.ui.ToolsServerUICore;
-import org.jboss.tools.as.wst.server.ui.views.server.JBossServerView;
-
-/**
- *
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public class InactiveExtensionViewProvider extends JBossServerViewExtension {
-
- private ITreeContentProvider contentProvider;
- private LabelProvider labelProvider;
- public InactiveExtensionViewProvider() {
- contentProvider = new InactiveContentProvider();
- labelProvider = new InactiveLabelProvider();
- }
-
-
- public class InactiveContentProvider implements ITreeContentProvider {
-
- public Object[] getChildren(Object parentElement) {
- if( parentElement == provider ) {
- ServerViewProvider[] allExtensions = ToolsServerUICore.getAllServerViewProviders();
- ArrayList<ServerViewProvider> list = new ArrayList<ServerViewProvider>();
- for( int i = 0; i < allExtensions.length; i++ ) {
- if( !allExtensions[i].isEnabled()) {
- list.add(allExtensions[i]);
- }
- }
- ServerViewProvider[] retval = new ServerViewProvider[list.size()];
- list.toArray(retval);
- return retval;
- }
- return new Object[0];
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0 ? true : false;
- }
-
- public Object[] getElements(Object inputElement) {
- // Unused
- return null;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // Do nothing... don't care about which server is selected
- }
-
- }
-
- public class InactiveLabelProvider extends LabelProvider {
- public Image getImage(Object element) {
- if( element instanceof ServerViewProvider ) {
- return ((ServerViewProvider)element).getImage();
- }
- return null;
- }
-
- public String getText(Object element) {
- if( element instanceof ServerViewProvider ) {
- return ((ServerViewProvider)element).getName();
- }
- return element == null ? "" : element.toString();
- }
-
- }
-
- public void fillContextMenu(Shell shell, IMenuManager menu, Object[] selection) {
- final Object[] selected = selection;
- boolean allProviders = true;
- for( int i = 0; i < selected.length; i++ )
- allProviders = allProviders && selected[i] instanceof ServerViewProvider
- && selected[i] != this.provider;
-
- if( allProviders) {
- Action act = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- for( int i = 0; i < selected.length; i++ ) {
- ((ServerViewProvider)selected[i]).setEnabled(true);
- ((ServerViewProvider)selected[i]).getDelegate().getContentProvider().
- inputChanged(JBossServerView.getDefault().getServerFrame().getViewer(), null, JBossServerView.getDefault().getSelectedServer());
- }
- JBossServerView.getDefault().getExtensionFrame().getViewer().refresh();
- }
- } );
- }
- };
- act.setText(Messages.InactiveCategoriesReEnable);
- menu.add(act);
- }
- }
-
- public void fillContextMenu(Shell shell, IMenuManager menu, Object selection) {
- fillContextMenu(shell, menu, new Object[] { selection });
- }
-
- public ITreeContentProvider getContentProvider() {
- return contentProvider;
- }
-
- public LabelProvider getLabelProvider() {
- return labelProvider;
- }
-
- public IPropertySheetPage getPropertySheetPage() {
- return null;
- }
-
-}
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,295 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.ui.views.server.providers;
-
-import java.util.ArrayList;
-import java.util.Properties;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerLifecycleListener;
-import org.eclipse.wst.server.core.IServerListener;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerEvent;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.internal.PublishServerJob;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
-import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
-import org.jboss.ide.eclipse.as.core.util.ModuleUtil;
-import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
-import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.SimplePropertiesViewExtension;
-
-/**
- *
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public class ModuleViewProvider extends SimplePropertiesViewExtension {
-
- private ModuleContentProvider contentProvider;
- private ModuleLabelProvider labelProvider;
- private Action deleteModuleAction, fullPublishModuleAction, incrementalPublishModuleAction;
- private ModuleServer[] selection;
- private IServerLifecycleListener serverResourceListener;
- private IServerListener serverListener;
-
- public ModuleViewProvider() {
- contentProvider = new ModuleContentProvider();
- labelProvider = new ModuleLabelProvider();
- createActions();
- addListeners();
- }
-
- private void createActions() {
- deleteModuleAction = new Action() {
- public void run() {
- if (MessageDialog.openConfirm(new Shell(), Messages.ServerDialogHeading, Messages.DeleteModuleConfirm)) {
- Thread t = new Thread() { public void run() {
- try {
- if( selection.length > 0 && selection[0].server != null ) {
- IServer server = selection[0].server;
- ArrayList topModsToRemove = new ArrayList();
- IModule topModTmp;
- for( int i = 0; i < selection.length; i++ ) {
- if( !topModsToRemove.contains(selection[i].module[0]))
- topModsToRemove.add(selection[i].module[0]);
- }
- IServerWorkingCopy serverWC = server.createWorkingCopy();
- IModule[] modsToRemove =
- (IModule[]) topModsToRemove.toArray(new IModule[topModsToRemove.size()]);
- ServerUtil.modifyModules(serverWC, new IModule[0], modsToRemove, new NullProgressMonitor());
- IServer server2 = serverWC.save(true, null);
- new PublishServerJob(server2, IServer.PUBLISH_INCREMENTAL, true).schedule();
- }
- } catch (CoreException e) {
- // ignore
- }
- }};
- t.start();
- }
- }
- };
- deleteModuleAction.setText(Messages.DeleteModuleText);
- deleteModuleAction.setDescription(Messages.DeleteModuleDescription);
- deleteModuleAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.UNPUBLISH_IMAGE));
-
- fullPublishModuleAction = new Action() {
- public void run() {
- actionPublish(IServer.PUBLISH_STATE_FULL);
- }
- };
- fullPublishModuleAction.setText(Messages.FullPublishModuleText);
- fullPublishModuleAction.setDescription(Messages.PublishModuleDescription);
- fullPublishModuleAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.PUBLISH_IMAGE));
-
-
- incrementalPublishModuleAction = new Action() {
- public void run() {
- actionPublish(IServer.PUBLISH_STATE_INCREMENTAL);
- }
- };
- incrementalPublishModuleAction.setText(Messages.IncrementalPublishModuleText);
- incrementalPublishModuleAction.setDescription(Messages.PublishModuleDescription);
- incrementalPublishModuleAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.PUBLISH_IMAGE));
-}
-
- protected void actionPublish(int type) {
- // Assumption: Anything selected is already on the server, or it wouldnt be in the view.
- if( selection != null && selection.length > 0 ) {
- Server s = ((Server)selection[0].server);
- for( int i = 0; i < selection.length; i++ ) {
- IModule[] mod = selection[i].module;
- s.setModulePublishState(mod, type);
- ArrayList<IModule[]> allChildren = ModuleUtil.getDeepChildren(s, mod);
- for( int j = 0; j < allChildren.size(); j++ ) {
- s.setModulePublishState((IModule[])allChildren.get(j), type);
- }
- }
- new PublishServerJob(s, IServer.PUBLISH_INCREMENTAL, true).schedule();
- }
- }
-
-
- public void fillContextMenu(Shell shell, IMenuManager menu, Object[] selection) {
- if( allAre(selection, ModuleServer.class)) {
- ModuleServer[] ms = new ModuleServer[selection.length];
- for( int i = 0; i < selection.length; i++ )
- ms[i] = (ModuleServer)selection[i];
- this.selection = ms;
- menu.add(deleteModuleAction);
- menu.add(fullPublishModuleAction);
- menu.add(incrementalPublishModuleAction);
- }
- }
-
- public ITreeContentProvider getContentProvider() {
- return contentProvider;
- }
-
- public LabelProvider getLabelProvider() {
- return labelProvider;
- }
-
- public boolean supports(IServer server) {
- return true;
- }
-
-
- class ModuleContentProvider implements ITreeContentProvider {
-
- private IServer input;
-
- public Object[] getChildren(Object parentElement) {
-
- if (parentElement instanceof ModuleServer) {
- ModuleServer ms = (ModuleServer) parentElement;
- try {
- IModule[] children = ms.server.getChildModules(ms.module, null);
- int size = children.length;
- ModuleServer[] ms2 = new ModuleServer[size];
- for (int i = 0; i < size; i++) {
- int size2 = ms.module.length;
- IModule[] module = new IModule[size2 + 1];
- System.arraycopy(ms.module, 0, module, 0, size2);
- module[size2] = children[i];
- ms2[i] = new ModuleServer(ms.server, module);
- }
- return ms2;
- } catch (Exception e) {
- return new Object[]{};
- }
- }
-
-
-
- if( parentElement instanceof ServerViewProvider && input != null ) {
- IModule[] modules = input.getModules();
- int size = modules.length;
- ModuleServer[] ms = new ModuleServer[size];
- for (int i = 0; i < size; i++) {
- ms[i] = new ModuleServer(input, new IModule[] { modules[i] });
- }
- return ms;
- }
- return new Object[] {};
- }
-
- public Object getParent(Object element) {
- if( element instanceof ModuleServer ) {
- return provider;
- }
-
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0 ? true : false;
- }
-
- // unused
- public Object[] getElements(Object inputElement) {
- return null;
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- input = (IServer)newInput;
- }
-
- public IServer getServer() {
- return input;
- }
- }
-
- class ModuleLabelProvider extends LabelProvider {
- public String getText(Object obj) {
- if( obj instanceof ModuleServer ) {
- ModuleServer ms = (ModuleServer)obj;
- int size = ms.module.length;
- return ms.module[size - 1].getName();
- }
-
- return "unknown";
- }
- public Image getImage(Object obj) {
- if( obj instanceof ModuleServer ) {
- ModuleServer ms = (ModuleServer)obj;
- int size = ms.module.length;
- return ServerUICore.getLabelProvider().getImage(ms.module[ms.module.length - 1]);
- }
- return null;
- }
-
- }
-
-
- public String[] getPropertyKeys(Object selected) {
- return new String[] { Messages.ModulePropertyType, Messages.ModulePropertyProject, Messages.ModulePropertyName };
- }
-
- public Properties getProperties(Object selected) {
- Properties props = new Properties();
- if( selected != null && selected instanceof ModuleServer) {
- ModuleServer moduleServer = ((ModuleServer)selected);
- IModule mod = moduleServer.module[moduleServer.module.length-1];
- if( mod != null && mod.getProject() != null ) {
- props.setProperty(Messages.ModulePropertyType, mod.getModuleType().getId());
- props.setProperty(Messages.ModulePropertyProject, mod.getProject().getName());
- props.setProperty(Messages.ModulePropertyProject, mod.getName());
- }
- }
- return props;
- }
-
- private void addListeners() {
- UnitedServerListenerManager.getDefault().addListener(new UnitedServerListener() {
- public void serverChanged(ServerEvent event) {
- int eventKind = event.getKind();
- if ((eventKind & ServerEvent.MODULE_CHANGE) != 0) {
- // module change event
- if ((eventKind & ServerEvent.STATE_CHANGE) != 0 || (eventKind & ServerEvent.PUBLISH_STATE_CHANGE) != 0) {
- refreshViewer();
- }
- }
- }
- });
- }
-}
Modified: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/DescriptorXPathPropertySheetPage.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/DescriptorXPathPropertySheetPage.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/DescriptorXPathPropertySheetPage.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -38,7 +38,6 @@
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
@@ -61,14 +60,13 @@
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
import org.jboss.ide.eclipse.as.ui.Messages;
import org.jboss.ide.eclipse.as.ui.views.server.providers.DescriptorXPathViewProvider;
-import org.jboss.tools.as.wst.server.ui.views.server.ExtensionTableViewer.ContentWrapper;
/**
*
* @author Rob Stryker <rob.stryker(a)redhat.com>
*
*/
-public class DescriptorXPathPropertySheetPage implements IPropertySheetPage {
+public class DescriptorXPathPropertySheetPage { /*implements IPropertySheetPage {
private TreeViewer xpathTreeViewer;
private TreeColumn column, column2;//, column3;
private Tree xpathTree;
@@ -141,9 +139,6 @@
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
//input = null;
Object element = ((IStructuredSelection)selection).getFirstElement();
- if( element instanceof ContentWrapper ) {
- element = ((ContentWrapper)element).getElement();
- }
if( element != null //)&& element != provider.getActiveCategory()
&& element instanceof XPathCategory) {
// show loading
@@ -426,5 +421,5 @@
}
return null;
}
-
+*/
}
Modified: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyContentProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyContentProvider.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyContentProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -27,7 +27,6 @@
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathQuery;
import org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathFileResult.XPathResultNode;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
/**
*
@@ -57,10 +56,6 @@
return ((XPathQuery)parentElement).getResults();
}
}
-
- // re-creates it from scratch... hrmm
- if( parentElement instanceof ServerViewProvider )
- return new Object[] {"ERROR"}; //XPathModel.getDefault().getCategories()
return new Object[0];
}
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ExtensionManager.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ExtensionManager.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ExtensionManager.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,79 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.tools.as.wst.server.ui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
-
-/**
- *
- * @author rob.stryker(a)jboss.com
- */
-public class ExtensionManager {
- private static ExtensionManager instance;
- public static ExtensionManager getDefault() {
- if( instance == null )
- instance = new ExtensionManager();
- return instance;
- }
-
- private ServerViewProvider[] serverViewExtensions;
- public ServerViewProvider[] getAllServerViewProviders() {
- if( serverViewExtensions == null )
- loadAllServerViewProviders();
- Arrays.sort(serverViewExtensions, new Comparator() {
- public int compare(Object arg0, Object arg1) {
- if( arg0 instanceof ServerViewProvider && arg1 instanceof ServerViewProvider) {
- return ((ServerViewProvider)arg0).getWeight() - ((ServerViewProvider)arg1).getWeight();
- }
- return 0;
- }
- });
- return serverViewExtensions;
- }
- private void loadAllServerViewProviders() {
- // Create the extensions from the registry
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IConfigurationElement[] elements = registry.getConfigurationElementsFor(JBossServerUIPlugin.PLUGIN_ID, "ServerViewExtension");
- ArrayList list = new ArrayList();
- for( int i = 0; i < elements.length; i++ ) {
- try {
- list.add(new ServerViewProvider(elements[i]));
- } catch(Exception e) {
- String msg = "Server View Provider (" + elements[i].getAttribute(ServerViewProvider.ID_LABEL) + ") failed to load";
- IStatus status = new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID, msg, e);
- JBossServerUIPlugin.getDefault().getLog().log(status);
- }
- }
- serverViewExtensions = (ServerViewProvider[]) list.toArray(new ServerViewProvider[list.size()]);
- }
-
-}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerActionProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerActionProvider.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerActionProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,297 @@
+package org.jboss.tools.as.wst.server.ui;
+
+import java.util.Iterator;
+
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.bindings.TriggerSequence;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.keys.IBindingService;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.CommonViewer;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerPort;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.Trace;
+import org.eclipse.wst.server.ui.internal.actions.NewServerWizardAction;
+import org.eclipse.wst.server.ui.internal.view.servers.CopyAction;
+import org.eclipse.wst.server.ui.internal.view.servers.DeleteAction;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleSloshAction;
+import org.eclipse.wst.server.ui.internal.view.servers.MonitorServerPortAction;
+import org.eclipse.wst.server.ui.internal.view.servers.OpenAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PasteAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PropertiesAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PublishAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PublishCleanAction;
+import org.eclipse.wst.server.ui.internal.view.servers.RemoveModuleAction;
+import org.eclipse.wst.server.ui.internal.view.servers.RenameAction;
+import org.eclipse.wst.server.ui.internal.view.servers.RestartModuleAction;
+import org.eclipse.wst.server.ui.internal.view.servers.ShowInConsoleAction;
+import org.eclipse.wst.server.ui.internal.view.servers.ShowInDebugAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StartAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StartModuleAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StopAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StopModuleAction;
+
+public class ServerActionProvider extends CommonActionProvider {
+ private ICommonActionExtensionSite actionSite;
+ private Clipboard clipboard;
+ public ServerActionProvider() {
+ super();
+ }
+
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+ this.actionSite = aSite;
+ ICommonViewerSite site = aSite.getViewSite();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ StructuredViewer v = aSite.getStructuredViewer();
+ if( v instanceof CommonViewer ) {
+ CommonViewer cv = (CommonViewer)v;
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ addListeners(cv);
+ makeServerActions(cv, wsSite.getSelectionProvider());
+ }
+ }
+ }
+
+
+ // actions on a server
+ protected Action[] actions;
+ protected Action actionModifyModules;
+ protected Action openAction, showInConsoleAction, showInDebugAction, propertiesAction, monitorPropertiesAction;
+ protected Action copyAction, pasteAction, deleteAction, renameAction;
+ protected Action noneAction = new Action(Messages.dialogMonitorNone) {
+ // dummy action
+ };
+
+ private void addListeners(CommonViewer tableViewer) {
+ tableViewer.addOpenListener(new IOpenListener() {
+ public void open(OpenEvent event) {
+ try {
+ IStructuredSelection sel = (IStructuredSelection) event.getSelection();
+ Object data = sel.getFirstElement();
+ if (!(data instanceof IServer))
+ return;
+ IServer server = (IServer) data;
+ ServerUIPlugin.editServer(server);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Could not open server", e);
+ }
+ }
+ });
+ }
+
+ private void makeServerActions(CommonViewer tableViewer, ISelectionProvider provider) {
+ clipboard = new Clipboard(tableViewer.getTree().getDisplay());
+ Shell shell = tableViewer.getTree().getShell();
+
+ actions = new Action[6];
+ // create the start actions
+ actions[0] = new StartAction(shell, provider, ILaunchManager.DEBUG_MODE);
+ actions[1] = new StartAction(shell, provider, ILaunchManager.RUN_MODE);
+ actions[2] = new StartAction(shell, provider, ILaunchManager.PROFILE_MODE);
+
+ // create the stop action
+ actions[3] = new StopAction(shell, provider);
+
+ // create the publish actions
+ actions[4] = new PublishAction(shell, provider);
+ actions[5] = new PublishCleanAction(shell, provider);
+
+ // create the open action
+ openAction = new OpenAction(provider);
+
+// // create copy, paste, and delete actions
+ pasteAction = new PasteAction(shell, provider, clipboard);
+ copyAction = new CopyAction(provider, clipboard, pasteAction);
+ deleteAction = new DeleteAction(shell, provider);
+ renameAction = new RenameAction(shell, tableViewer, provider);
+
+ // create the other actions
+ actionModifyModules = new ModuleSloshAction(shell, provider);
+ showInConsoleAction = new ShowInConsoleAction(provider);
+ showInDebugAction = new ShowInDebugAction(provider);
+
+ // create the properties action
+ propertiesAction = new PropertiesAction(shell, provider);
+ monitorPropertiesAction = new PropertiesAction(shell, "org.eclipse.wst.server.ui.properties.monitor", provider);
+ }
+
+ public void fillActionBars(IActionBars actionBars) {
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.debug", actions[0]);
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.run", actions[1]);
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.stop", actions[3]);
+ actionBars.setGlobalActionHandler("org.eclipse.wst.server.publish", actions[4]);
+ actionBars.setGlobalActionHandler("org.eclipse.ui.navigator.Open", openAction);
+ actionBars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), propertiesAction);
+ actionBars.updateActionBars();
+ actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
+ actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
+ actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
+ actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(), renameAction);
+
+ IContributionManager cm = actionBars.getToolBarManager();
+ cm.removeAll();
+
+ for (int i = 0; i < actions.length - 1; i++)
+ cm.add(actions[i]);
+ }
+
+ private static void fillNewContextMenu(Shell shell, ISelection selection, IMenuManager menu) {
+ IAction newServerAction = new NewServerWizardAction();
+ newServerAction.setText(Messages.actionNewServer);
+ menu.add(newServerAction);
+ }
+
+ public void fillContextMenu(IMenuManager menu) {
+ ICommonViewerSite site = actionSite.getViewSite();
+ IStructuredSelection selection = null;
+ Shell shell = actionSite.getViewSite().getShell();
+ if( site instanceof ICommonViewerWorkbenchSite ) {
+ ICommonViewerWorkbenchSite wsSite = (ICommonViewerWorkbenchSite)site;
+ selection = (IStructuredSelection) wsSite.getSelectionProvider().getSelection();
+ }
+
+ IServer server = null;
+ IModule[] module = null;
+ if (selection != null && !selection.isEmpty()) {
+ Iterator iterator = selection.iterator();
+ Object obj = iterator.next();
+ if (obj instanceof IServer)
+ server = (IServer) obj;
+ if (obj instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) obj;
+ server = ms.server;
+ module = ms.module;
+ }
+ if (iterator.hasNext()) {
+ server = null;
+ module = null;
+ }
+ }
+
+ // new action
+ MenuManager newMenu = new MenuManager(Messages.actionNew);
+ fillNewContextMenu(null, selection, newMenu);
+ menu.add(newMenu);
+
+ // open action
+ if (server != null && module == null) {
+ menu.add(openAction);
+
+ String text = Messages.actionShowIn;
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ final IBindingService bindingService = (IBindingService) workbench
+ .getAdapter(IBindingService.class);
+ final TriggerSequence[] activeBindings = bindingService
+ .getActiveBindingsFor("org.eclipse.ui.navigate.showInQuickMenu");
+ if (activeBindings.length > 0) {
+ text += "\t" + activeBindings[0].format();
+ }
+
+ MenuManager showInMenu = new MenuManager(text);
+ showInMenu.add(showInConsoleAction);
+ showInMenu.add(showInDebugAction);
+ //IActionBars actionBars = getViewSite().getActionBars();
+ //actionBars.setGlobalActionHandler("group.show", showInMenu);
+ menu.add(showInMenu);
+ menu.add(new Separator());
+ } else
+ menu.add(new Separator());
+
+ if (server != null) {
+ if (module == null) {
+ menu.add(copyAction);
+ menu.add(pasteAction);
+ menu.add(deleteAction);
+ menu.add(renameAction);
+ } else if (module.length == 1)
+ menu.add(new RemoveModuleAction(shell, server, module[0]));
+ menu.add(new Separator());
+ }
+
+ if (server != null && module == null) {
+ // server actions
+ for (int i = 0; i < actions.length; i++)
+ menu.add(actions[i]);
+
+ menu.add(new Separator());
+ menu.add(actionModifyModules);
+
+ // monitor
+ if (server.getServerType() != null) {
+ final MenuManager menuManager = new MenuManager(Messages.actionMonitor);
+
+ final IServer server2 = server;
+ final Shell shell2 = shell;
+ menuManager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ menuManager.removeAll();
+ if (server2.getAdapter(ServerDelegate.class) != null) {
+ ServerPort[] ports = server2.getServerPorts(null);
+ if (ports != null) {
+ int size = ports.length;
+ for (int i = 0; i < size; i++) {
+ if (!ports[i].isAdvanced())
+ menuManager.add(new MonitorServerPortAction(shell2, server2, ports[i]));
+ }
+ }
+ }
+
+ if (menuManager.isEmpty())
+ menuManager.add(noneAction);
+
+ menuManager.add(new Separator());
+ menuManager.add(monitorPropertiesAction);
+ }
+ });
+
+ // add an initial menu item so that the menu appears correctly
+ noneAction.setEnabled(false);
+ menuManager.add(noneAction);
+ menu.add(menuManager);
+ }
+ }
+
+ if (server != null && module != null) {
+ menu.add(new Separator());
+ menu.add(new StartModuleAction(server, module));
+ menu.add(new StopModuleAction(server, module));
+ menu.add(new RestartModuleAction(server, module));
+ }
+
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS+"-end"));
+
+ if (server != null) {
+ menu.add(new Separator());
+ menu.add(propertiesAction);
+ }
+ }
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerContentProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerContentProvider.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerContentProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,331 @@
+package org.jboss.tools.as.wst.server.ui;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IPublishListener;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
+import org.eclipse.wst.server.core.IServerListener;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerEvent;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.UpdateServerJob;
+import org.eclipse.wst.server.core.util.PublishAdapter;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.Trace;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.eclipse.wst.server.ui.internal.viewers.BaseContentProvider;
+
+public class ServerContentProvider extends BaseContentProvider implements ITreeContentProvider {
+ public static Object INITIALIZING = new Object();
+ protected IServerLifecycleListener serverResourceListener;
+ protected IPublishListener publishListener;
+ protected IServerListener serverListener;
+
+ // servers that are currently publishing and starting
+ protected static Set<String> publishing = new HashSet<String>(4);
+ protected static Set<String> starting = new HashSet<String>(4);
+ protected boolean animationActive = false;
+ protected boolean stopAnimation = false;
+ protected boolean initialized = false;
+
+
+ private StructuredViewer viewer;
+
+ public ServerContentProvider() {
+ addListeners();
+ }
+
+ public Object[] getElements(Object element) {
+ if( !initialized ) {
+ deferInitialization();
+ return new Object[] {INITIALIZING};
+ }
+
+ List<IServer> list = new ArrayList<IServer>();
+ IServer[] servers = ServerCore.getServers();
+ if (servers != null) {
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ if (!((Server)servers[i]).isPrivate())
+ list.add(servers[i]);
+ }
+ }
+ return list.toArray();
+ }
+
+ public Object[] getChildren(Object element) {
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ try {
+ IModule[] children = ms.server.getChildModules(ms.module, null);
+ int size = children.length;
+ ModuleServer[] ms2 = new ModuleServer[size];
+ for (int i = 0; i < size; i++) {
+ int size2 = ms.module.length;
+ IModule[] module = new IModule[size2 + 1];
+ System.arraycopy(ms.module, 0, module, 0, size2);
+ module[size2] = children[i];
+ ms2[i] = new ModuleServer(ms.server, module);
+ }
+ return ms2;
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ IServer server = (IServer) element;
+ IModule[] modules = server.getModules();
+ int size = modules.length;
+ ModuleServer[] ms = new ModuleServer[size];
+ for (int i = 0; i < size; i++) {
+ ms[i] = new ModuleServer(server, new IModule[] { modules[i] });
+ }
+ return ms;
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ return ms.server;
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if (element instanceof ModuleServer) {
+ // Check if the module server has child modules.
+ ModuleServer curModuleServer = (ModuleServer)element;
+ IServer curServer = curModuleServer.server;
+ IModule[] curModule = curModuleServer.module;
+ if (curServer != null && curModule != null) {
+ IModule[] curChildModule = curServer.getChildModules(curModule, null);
+ if (curChildModule != null && curChildModule.length > 0)
+ return true;
+
+ return false;
+ }
+
+ return false;
+ }
+ if( element instanceof IServer ) {
+ return ((IServer) element).getModules().length > 0;
+ }
+ return false;
+ }
+
+ public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) {
+ viewer = (StructuredViewer) aViewer;
+ }
+
+ public void dispose() {
+ // do nothing
+ }
+
+
+
+ // Listeners and refreshing the viewer
+ protected void addListeners() {
+ serverResourceListener = new IServerLifecycleListener() {
+ public void serverAdded(IServer server) {
+ refreshServer(null);
+ server.addServerListener(serverListener);
+ ((Server) server).addPublishListener(publishListener);
+ }
+ public void serverChanged(IServer server) {
+ refreshServer(server);
+ }
+ public void serverRemoved(IServer server) {
+ refreshServer(null);
+ server.removeServerListener(serverListener);
+ ((Server) server).removePublishListener(publishListener);
+ }
+ };
+ ServerCore.addServerLifecycleListener(serverResourceListener);
+
+ publishListener = new PublishAdapter() {
+ public void publishStarted(IServer server) {
+ handlePublishChange(server, true);
+ }
+
+ public void publishFinished(IServer server, IStatus status) {
+ handlePublishChange(server, false);
+ }
+ };
+
+ serverListener = new IServerListener() {
+ public void serverChanged(ServerEvent event) {
+ if (event == null)
+ return;
+
+ int eventKind = event.getKind();
+ IServer server = event.getServer();
+ if ((eventKind & ServerEvent.SERVER_CHANGE) != 0) {
+ // server change event
+ if ((eventKind & ServerEvent.STATE_CHANGE) != 0) {
+ refreshServer(server, true);
+ int state = event.getState();
+ String id = server.getId();
+ if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING) {
+ boolean startThread = false;
+ synchronized (starting) {
+ if (!starting.contains(id)) {
+ if (starting.isEmpty())
+ startThread = true;
+ starting.add(id);
+ }
+ }
+ if (startThread)
+ startThread();
+ } else {
+ boolean stopThread = false;
+ synchronized (starting) {
+ if (starting.contains(id)) {
+ starting.remove(id);
+ if (starting.isEmpty())
+ stopThread = true;
+ }
+ }
+ if (stopThread)
+ stopThread();
+ }
+ } else
+ refreshServer(server);
+ } else if ((eventKind & ServerEvent.MODULE_CHANGE) != 0) {
+ // module change event
+ if ((eventKind & ServerEvent.STATE_CHANGE) != 0 || (eventKind & ServerEvent.PUBLISH_STATE_CHANGE) != 0) {
+ refreshServer(server);
+ }
+ }
+ }
+ };
+
+ // add listeners to servers
+ IServer[] servers = ServerCore.getServers();
+ if (servers != null) {
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ servers[i].addServerListener(serverListener);
+ ((Server) servers[i]).addPublishListener(publishListener);
+ }
+ }
+ }
+
+ protected void deferInitialization() {
+ Job job = new Job(Messages.jobInitializingServersView) {
+ public IStatus run(IProgressMonitor monitor) {
+ IServer[] servers = ServerCore.getServers();
+ int size = servers.length;
+ for (int i = 0; i < size; i++) {
+ ((Server)servers[i]).getAllModules().iterator();
+ }
+
+ for (int i = 0; i < size; i++) {
+ IServer server = servers[i];
+ if (server.getServerType() != null && server.getServerState() == IServer.STATE_UNKNOWN) {
+ UpdateServerJob job2 = new UpdateServerJob(server);
+ job2.schedule();
+ }
+ }
+ initialized = true;
+ refreshServer(null);
+ return Status.OK_STATUS;
+ }
+ };
+
+ job.setSystem(true);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+ }
+
+ protected void refreshServer(final IServer server) {
+ refreshServer(server, false);
+ }
+ protected void refreshServer(final IServer server, final boolean resetSelection) {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ if( viewer != null && !viewer.getControl().isDisposed()) {
+ viewer.refresh(server);
+ if( resetSelection ) {
+ ISelection sel = viewer.getSelection();
+ viewer.setSelection(sel);
+ }
+ ServerDecorator.getDefault().redecorate(server);
+ }
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ });
+ }
+
+ protected void handlePublishChange(IServer server, boolean isPublishing) {
+ String serverId = server.getId();
+ if (isPublishing)
+ publishing.add(serverId);
+ else
+ publishing.remove(serverId);
+
+ refreshServer(server);
+ }
+
+
+ protected void startThread() {
+ if (animationActive)
+ return;
+
+ stopAnimation = false;
+
+ final Display display = viewer == null ? Display.getDefault() : viewer.getControl().getDisplay();
+ final int SLEEP = 200;
+ final Runnable[] animator = new Runnable[1];
+ animator[0] = new Runnable() {
+ public void run() {
+ if (!stopAnimation) {
+ try {
+ int size = 0;
+ String[] servers;
+ synchronized (starting) {
+ size = starting.size();
+ servers = new String[size];
+ starting.toArray(servers);
+ }
+
+ for (int i = 0; i < size; i++) {
+ IServer server = ServerCore.findServer(servers[i]);
+ if (server != null ) {
+ ServerDecorator.animate();
+ refreshServer(server);
+ }
+ }
+ } catch (Exception e) {
+ Trace.trace(Trace.FINEST, "Error in Servers view animation", e);
+ }
+ display.timerExec(SLEEP, animator[0]);
+ }
+ }
+ };
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ display.timerExec(SLEEP, animator[0]);
+ }
+ });
+ }
+
+ protected void stopThread() {
+ stopAnimation = true;
+ }}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerDecorator.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerDecorator.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerDecorator.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,196 @@
+package org.jboss.tools.as.wst.server.ui;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.ui.ServerUICore;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.provisional.UIDecoratorManager;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+
+public class ServerDecorator extends LabelProvider implements ILightweightLabelDecorator {
+
+ public static final String[] syncState = new String[] {
+ Messages.viewSyncOkay,
+ Messages.viewSyncRestart,
+ Messages.viewSyncPublish,
+ Messages.viewSyncRestartPublish,
+ Messages.viewSyncPublishing};
+
+ public static final String[] syncStateUnmanaged = new String[] {
+ Messages.viewSyncOkay2,
+ Messages.viewSyncRestart2,
+ Messages.viewSyncPublish2,
+ Messages.viewSyncRestartPublish2,
+ Messages.viewSyncPublishing2};
+
+ public static final String[] modulePublishState = new String[] {
+ "",
+ Messages.viewSyncOkay,
+ Messages.viewSyncPublish,
+ Messages.viewSyncPublish};
+
+ private static ServerDecorator instance;
+ public static ServerDecorator getDefault() {
+ return instance;
+ }
+
+ private static int count = 0;
+ public static void animate() {
+ count = (count + 1)%3;
+ }
+ public static int getCount() {
+ return count;
+ }
+
+ public ServerDecorator() {
+ instance = this;
+ }
+
+ public void decorate(Object element, IDecoration decoration) {
+ if( element instanceof IServer ) {
+ String state = getServerStateLabel((IServer)element);
+ String status = getServerStatusLabel((IServer)element);
+ decoration.addSuffix(combine(state, status));
+ } else if( element instanceof ModuleServer ) {
+ String state = getModuleStateText((ModuleServer)element);
+ String status = getModuleStatusText((ModuleServer)element);
+ decoration.addSuffix(combine(state, status));
+ }
+ }
+
+ protected String combine(String state, String status) {
+ if(isEmpty(state) && isEmpty(status))
+ return "";
+ if( isEmpty(state))
+ return " [" + status + "]";
+ if( isEmpty(status))
+ return " [" + state + "]";
+ return " [" + state + ", " + status + "]";
+ }
+
+ protected boolean isEmpty(String s) {
+ return (s == null || "".equals(s));
+ }
+
+ public void redecorate(IServer server) {
+ fireLabelProviderChanged(new LabelProviderChangedEvent(this));
+ }
+
+
+
+ /*
+ * Utility methods
+ */
+ public static Image getServerImage(IServer server) {
+ return server == null ? null :
+ server.getServerType() == null ? null :
+ ImageResource.getImage(server.getServerType().getId());
+ }
+
+ public static String getServerStateLabel(IServer server) {
+ return server == null ? null :
+ server.getServerType() == null ? null :
+ getStateLabel(server.getServerType(), server.getServerState(), server.getMode());
+ }
+
+ public static String getStateLabel(IServerType serverType, int state, String mode) {
+ return serverType == null ? null :
+ UIDecoratorManager.getUIDecorator(serverType).getStateLabel(state, mode, count);
+ }
+
+ public static String getServerStatusLabel(IServer server) {
+ IStatus status = ((Server) server).getServerStatus();
+ if (status != null)
+ return status.getMessage();
+
+ if (server.getServerType() == null)
+ return "";
+
+ if (server.getServerState() == IServer.STATE_UNKNOWN)
+ return "";
+
+ String serverId = server.getId();
+ if (ServerContentProvider.publishing.contains(serverId))
+ return ServerDecorator.syncState[4];
+
+ // republish
+ int i = 0;
+ if (server.shouldPublish()) {
+ if (((Server)server).isPublishUnknown())
+ return "";
+ i += 2;
+ }
+
+ if (server.shouldRestart())
+ i = 1;
+
+ return syncState[i];
+ }
+
+ public static Image getServerStateImage(IServer server) {
+ return server == null ? null :
+ getStateImage(server.getServerType(), server.getServerState(), server.getMode());
+ }
+
+ public static Image getStateImage(IServerType serverType, int state, String mode) {
+ return serverType == null ? null :
+ UIDecoratorManager.getUIDecorator(serverType).getStateImage(state, mode, getCount());
+ }
+
+ public static String getModuleText(ModuleServer ms ) {
+ if (ms == null || ms.module == null)
+ return "";
+ int size = ms.module.length;
+ return ms.module[size - 1].getName();
+ }
+
+ public static Image getModuleImage(ModuleServer ms) {
+ if( ms != null ) {
+ ILabelProvider labelProvider = ServerUICore.getLabelProvider();
+ Image image = labelProvider.getImage(ms.module[ms.module.length - 1]);
+ labelProvider.dispose();
+ return image;
+ }
+ return null;
+ }
+
+ public static String getModuleStateText(ModuleServer ms) {
+ return "";
+ }
+
+ public static String getModuleStatusText(ModuleServer ms) {
+ if( ms != null && ms.server != null && ms.module != null ) {
+ IStatus status = ((Server) ms.server).getModuleStatus(ms.module);
+ if (status != null)
+ return status.getMessage();
+
+ return modulePublishState[ms.server.getModulePublishState(ms.module)];
+ }
+ return "";
+ }
+
+ public static Image getModuleStatusImage(ModuleServer ms) {
+ IStatus status = ((Server) ms.server).getModuleStatus(ms.module);
+ if (status != null) {
+ ISharedImages sharedImages = ServerUIPlugin.getInstance().getWorkbench().getSharedImages();
+ if (status.getSeverity() == IStatus.ERROR)
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ else if (status.getSeverity() == IStatus.WARNING)
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+ else if (status.getSeverity() == IStatus.INFO)
+ return sharedImages.getImage(ISharedImages.IMG_OBJS_INFO_TSK);
+ }
+ return null;
+ }
+}
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerLabelProvider.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerLabelProvider.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServerLabelProvider.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.as.wst.server.ui;
+
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.ServerUICore;
+import org.eclipse.wst.server.ui.internal.ImageResource;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+/**
+ * Server table label provider.
+ */
+public class ServerLabelProvider extends LabelProvider {
+
+ /**
+ * ServerTableLabelProvider constructor comment.
+ */
+ public ServerLabelProvider() {
+ super();
+ }
+
+ public String getText(Object element) {
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ if (ms.module == null)
+ return "";
+ int size = ms.module.length;
+ String name = ms.module[size - 1].getName();
+ return name;
+ }
+
+ if( element instanceof IServer ) {
+ IServer server = (IServer) element;
+ return notNull(server.getName());
+ }
+
+ if( element == ServerContentProvider.INITIALIZING)
+ return Messages.viewInitializing;
+
+ return "-";
+ }
+ public Image getImage(Object element) {
+ Image image = null;
+ if (element instanceof ModuleServer) {
+ ModuleServer ms = (ModuleServer) element;
+ ILabelProvider labelProvider = ServerUICore.getLabelProvider();
+ image = labelProvider.getImage(ms.module[ms.module.length - 1]);
+ labelProvider.dispose();
+ } else if( element instanceof IServer ) {
+ IServer server = (IServer) element;
+ if (server.getServerType() != null) {
+ image = ImageResource.getImage(server.getServerType().getId());
+ }
+ }
+ return image;
+ }
+
+ protected String notNull(String s) {
+ if (s == null)
+ return "";
+ return s;
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+}
\ No newline at end of file
Added: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersView.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersView.java (rev 0)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ServersView.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.as.wst.server.ui;
+
+import org.eclipse.ui.navigator.CommonNavigator;
+/**
+ * A view of servers, their modules, and status.
+ */
+public class ServersView extends CommonNavigator {
+ /**
+ * ServersView constructor comment.
+ */
+ public ServersView() {
+ super();
+ }
+}
\ No newline at end of file
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ToolsServerUICore.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ToolsServerUICore.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/ToolsServerUICore.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,24 +0,0 @@
-package org.jboss.tools.as.wst.server.ui;
-
-import java.util.ArrayList;
-
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
-
-public class ToolsServerUICore {
-
- public static ServerViewProvider[] getEnabledViewProviders(IServer server) {
- ServerViewProvider[] serverViewExtensions = getAllServerViewProviders();
- ArrayList<ServerViewProvider> list = new ArrayList<ServerViewProvider>();
- for( int i = 0; i < serverViewExtensions.length; i++ ) {
- if( serverViewExtensions[i].isEnabled() && serverViewExtensions[i].supports(server)) {
- list.add(serverViewExtensions[i]);
- }
- }
- return list.toArray(new ServerViewProvider[list.size()]);
- }
-
- public static ServerViewProvider[] getAllServerViewProviders() {
- return ExtensionManager.getDefault().getAllServerViewProviders();
- }
-}
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ExtensionTableViewer.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ExtensionTableViewer.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ExtensionTableViewer.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,491 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.tools.as.wst.server.ui.views.server;
-
-import java.util.ArrayList;
-import java.util.Properties;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerLifecycleListener;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.jboss.ide.eclipse.as.core.server.UnitedServerListener;
-import org.jboss.ide.eclipse.as.core.server.UnitedServerListenerManager;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory.ISimplePropertiesHolder;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory.SimplePropertiesPropertySheetPage;
-import org.jboss.tools.as.wst.server.ui.ToolsServerUICore;
-
-/**
- *
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public class ExtensionTableViewer extends TreeViewer {
-
- protected TableViewerPropertySheet propertySheet;
- protected Action disableCategoryAction, refreshAction;
- protected boolean suppressingRefresh = false;
- public ExtensionTableViewer(Tree tree) {
- super(tree);
- setContentProvider(new ContentProviderDelegator());
- setLabelProvider(new LabelProviderDelegator());
- propertySheet = new TableViewerPropertySheet();
- createActions();
-
- UnitedServerListenerManager.getDefault().addListener(new UnitedServerListener() {
- public void serverRemoved(IServer server) {
- final IServer server2 = server;
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Object o = getInput();
- if( server2.equals(o)) {
- setInput(null);
- }
- }
- });
- }
- });
- }
-
- protected void createActions() {
- disableCategoryAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Object selected = getSelectedElement();
- if( selected instanceof ServerViewProvider) {
- ((ServerViewProvider)selected).setEnabled(false);
- refresh();
- }
- }
- } );
- }
- };
- disableCategoryAction.setText(Messages.DisableCategoryAction);
- refreshAction = new Action() {
- public void run() {
- Object o1 = ((IStructuredSelection)getSelection()).getFirstElement();
- if( o1 != null ) {
- // tell the delegate to refresh its model for the selected item, before we refresh the viewer
- ServerViewProvider provider = o1 instanceof ServerViewProvider ? (ServerViewProvider)o1 : ((ContentWrapper)o1).getProvider();
- if( provider != null )
- provider.getDelegate().refreshModel(o1);
- }
- Object el = getSelectedElement();
- if( el instanceof ServerViewProvider )
- refresh(el);
- else
- refresh(((IStructuredSelection)getSelection()).getFirstElement());
- }
- };
- refreshAction.setText("Refresh Item");
- }
-
- public static class ContentWrapper {
- private Object o;
- private ServerViewProvider provider;
-
- public ContentWrapper(Object o, ServerViewProvider provider) {
- this.o = o;
- this.provider = provider;
- }
-
- public Object getElement() {
- return o;
- }
-
- public ServerViewProvider getProvider() {
- return provider;
- }
-
- public boolean equals(Object other) {
- if( other == null ) return false;
-
- if( other instanceof ContentWrapper ) {
- if( ((ContentWrapper)other).getElement() == null )
- return o == null;
- return ((ContentWrapper)other).getElement().equals(o);
- }
- return false;
- }
-
- public int hashCode() {
- if( o == null ) return super.hashCode();
- return o.hashCode();
- }
- }
-
- protected class LabelProviderDelegator extends LabelProvider {
- public String getText(Object obj) {
- if( obj instanceof JBossServer) {
- JBossServer server = (JBossServer)obj;
- String ret = server.getServer().getName();
- return ret;
- }
- if( obj instanceof ServerViewProvider) {
- return ((ServerViewProvider)obj).getName();
- }
-
- if( obj instanceof ContentWrapper ) {
- ContentWrapper wrapper = (ContentWrapper)obj;
- return wrapper.getProvider().getDelegate().getLabelProvider().getText(wrapper.getElement());
- }
- return obj.toString();
- }
- public Image getImage(Object obj) {
- if( obj instanceof JBossServer ) {
- return ServerUICore.getLabelProvider().getImage(((JBossServer)obj).getServer());
- }
- if( obj instanceof ServerViewProvider ) {
- return ((ServerViewProvider)obj).getImage();
- }
-
- if( obj instanceof ContentWrapper ) {
- Object object2 = ((ContentWrapper)obj).getElement();
- return ((ContentWrapper)obj).getProvider().getDelegate().getLabelProvider().getImage(object2);
- }
-
- return null;
- }
- }
- protected class ContentProviderDelegator implements ITreeContentProvider {
-
- public ContentProviderDelegator() {
- }
-
- public ContentWrapper[] wrap( Object[] elements, ServerViewProvider provider ) {
- if( elements == null ) return new ContentWrapper[0];
-
- ContentWrapper[] wrappers = new ContentWrapper[elements.length];
- for( int i = 0; i < wrappers.length; i++ ) {
- wrappers[i] = new ContentWrapper(elements[i], provider);
- }
- return wrappers;
- }
-
- public Object[] getElements(Object inputElement) {
- if( inputElement == null ) return new Object[0];
- IServer tmp = (IServer)getInput();
- if( tmp == null )
- return new Object[0];
- return ToolsServerUICore.getEnabledViewProviders(tmp);
- }
-
- public Object[] getChildren(Object parentElement) {
- if( parentElement == null ) return new Object[0];
-
- if( parentElement instanceof ServerViewProvider) {
- Object[] ret = ((ServerViewProvider)parentElement).getDelegate().getContentProvider().getChildren(parentElement);
- return wrap(ret, ((ServerViewProvider)parentElement));
- }
-
- if( parentElement instanceof ContentWrapper ) {
- ContentWrapper parentWrapper = (ContentWrapper)parentElement;
- Object[] o = null;
- try {
- o = parentWrapper.getProvider().getDelegate().getContentProvider().getChildren(parentWrapper.getElement());
- } catch( Exception e) {
- JBossServerUIPlugin.log("Error finding children of " + parentElement, e);
- }
- if( o == null )
- return new Object[0];
- return wrap(o, parentWrapper.getProvider());
- }
- return new Object[0];
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if( element instanceof ServerViewProvider )
- return ((ServerViewProvider)element).getDelegate().getContentProvider().hasChildren(element);
- if( element instanceof ContentWrapper ) {
- ContentWrapper parentWrapper = (ContentWrapper)element;
- return parentWrapper.getProvider().getDelegate().getContentProvider().hasChildren(parentWrapper.getElement());
- }
- return getChildren(element).length > 0 ? true : false;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- ServerViewProvider[] providers = ToolsServerUICore.
- getEnabledViewProviders(newInput instanceof IServer ? (IServer)newInput : null);
- for( int i = 0; i < providers.length; i++ ) {
- try {
- providers[i].getDelegate().getContentProvider().inputChanged(viewer, oldInput, newInput);
- } catch( Exception e) {
- JBossServerUIPlugin.log("Error changing input to " + newInput, e);
- }
- }
- }
-
- }
-
- public Object getRawElement(Object o) {
- if( o instanceof ContentWrapper )
- return ((ContentWrapper)o).getElement();
- return o;
- }
-
- public Object[] getRawElements(IStructuredSelection selection) {
- ArrayList<Object> tmp = new ArrayList<Object>();
- Object[] obj = selection.toArray();
- Object tmp2;
- for( int i = 0; i < obj.length; i++ ) {
- tmp2 = getRawElement(obj[i]);
- if( tmp2 != null ) tmp.add(tmp2);
- }
- return (Object[]) tmp.toArray(new Object[tmp.size()]);
- }
-
- public ServerViewProvider getParentViewProvider(Object o) {
- if( o instanceof ContentWrapper )
- return ((ContentWrapper)o).getProvider();
- return null;
- }
-
- public Object getSelectedElement() {
- ISelection sel = getSelection();
- if( sel instanceof IStructuredSelection ) {
- Object o = ((IStructuredSelection)sel).getFirstElement();
- if( o != null && o instanceof ContentWrapper ) {
- o = ((ContentWrapper)o).getElement();
- }
- return o;
- }
- return null;
- }
-
- protected void fillSelectedContextMenu(Shell shell, IMenuManager mgr) {
- ISelection sel = getSelection();
- if (sel instanceof IStructuredSelection) {
- ServerViewProvider provider = findProvider((IStructuredSelection)sel);
- if (provider != null) {
- Object[] selected = getRawElements((IStructuredSelection)sel);
- provider.getDelegate().fillContextMenu(shell, mgr, selected);
- }
- }
- }
-
- protected ServerViewProvider findProvider(IStructuredSelection sel) {
- Object[] selected = sel.toArray();
- ServerViewProvider provider = null;
- ServerViewProvider tmpProvider;
- for( int i = 0; i < selected.length; i++ ) {
- if( selected[i] instanceof ServerViewProvider ) {
- tmpProvider = (ServerViewProvider)selected[i];
- } else {
- tmpProvider = getParentViewProvider(selected[i]);
- }
- if( provider == null )
- provider = tmpProvider;
- else if( tmpProvider != provider )
- return null;
- }
- return provider;
- }
-
- protected void fillJBContextMenu(Shell shell, IMenuManager menu) {
- Object selected = getSelectedElement();
- menu.add(refreshAction);
- if( selected instanceof ServerViewProvider ) {
- menu.add(disableCategoryAction);
- }
-
- menu.add(new Separator());
- }
-
- public IPropertySheetPage getPropertySheet() {
- return propertySheet;
- }
-
- public class TableViewerPropertySheet implements IPropertySheetPage {
-
- private PageBook book;
- private ArrayList<ServerViewProvider> addedControls = new ArrayList<ServerViewProvider>();
- private SimplePropertiesPropertySheetPage topLevelPropertiesPage;
-
- public void createControl(Composite parent) {
- topLevelPropertiesPage = PropertySheetFactory.createSimplePropertiesSheet(new TopLevelProperties());
- book = new PageBook(parent, SWT.NONE);
- addedControls.clear();
- topLevelPropertiesPage.createControl(book);
- book.showPage(topLevelPropertiesPage.getControl());
- }
-
- public void dispose() {
- }
-
- public Control getControl() {
- return book;
- }
-
- public void setActionBars(IActionBars actionBars) {
- }
-
- public void setFocus() {
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection sel) {
- Object selected = getSelectedObject(sel);
- if( selected != null ) {
-
- IPropertySheetPage page = null;
- if( selected instanceof ContentWrapper ) {
- page = getDelegatePage(((ContentWrapper)selected).getProvider());
- } else /*if( selected instanceof ServerViewProvider ) {
- page = getDelegatePage((ServerViewProvider)selected);
- } else if( page == null ) */ {
- page = topLevelPropertiesPage;
- }
- if( page != null ) {
- page.selectionChanged(part, sel);
- book.showPage(page.getControl());
- }
- }
- }
- private IPropertySheetPage getDelegatePage(ServerViewProvider provider) {
- IPropertySheetPage returnSheet = null;
- returnSheet = provider.getDelegate().getPropertySheetPage();
- if( !addedControls.contains(provider) && returnSheet != null) {
- returnSheet.createControl(book);
- addedControls.add(provider);
- }
- return returnSheet;
- }
-
- public Object getSelectedObject(ISelection sel) {
- if( sel instanceof IStructuredSelection ) {
- IStructuredSelection selection = (IStructuredSelection)sel;
- Object selected = selection.getFirstElement();
- return selected;
- }
- return null;
- }
-
- }
- /**
- * Properties for the top level elements
- * (a server or a category / extension point
- * @author rstryker
- *
- */
- class TopLevelProperties implements ISimplePropertiesHolder {
- public Properties getProperties(Object selected) {
- Properties ret = new Properties();
- if( selected instanceof ServerViewProvider ) {
- ServerViewProvider provider = (ServerViewProvider)selected;
- ret.setProperty(Messages.ExtensionID, provider.getId());
- ret.setProperty(Messages.ExtensionName, provider.getName());
- ret.setProperty(Messages.ExtensionDescription, provider.getDescription());
- ret.setProperty(Messages.ExtensionProviderClass, provider.getDelegateName());
- }
- return ret;
- }
-
-
- public String[] getPropertyKeys(Object selected) {
- if( selected instanceof ServerViewProvider) {
- return new String[] {
- Messages.ExtensionName, Messages.ExtensionDescription,
- Messages.ExtensionID, Messages.ExtensionProviderClass
- };
-
- }
- if( selected instanceof JBossServer ) {
- return new String[] {
- Messages.ServerRuntimeVersion, Messages.ServerHome,
- Messages.ServerConfigurationName, Messages.ServerDeployDir,
- };
- }
- return new String[] {};
- }
- }
-
- public void dispose() {
- // The Loner
- propertySheet.dispose();
-
- ServerViewProvider[] providers = ToolsServerUICore.getAllServerViewProviders();
- for( int i = 0; i < providers.length; i++ ) {
- providers[i].dispose();
- }
- }
-
-
- public void suppressingRefresh(Runnable runnable) {
- boolean currentVal = suppressingRefresh;
- suppressingRefresh = true;
- runnable.run();
- suppressingRefresh = currentVal;
- }
-
- public void refresh() {
- refresh(null);
- }
- public void refresh(final Object element) {
- if(!suppressingRefresh) {
- try {
- super.refresh(element);
- } catch( Exception e ) {
- JBossServerUIPlugin.log("Error refreshing view. ", e);
- }
- }
- }
-
- public boolean elementInTree(Object element) {
- Widget[] w = super.findItems(element);
- return w != null && w.length > 0;
- }
-
-
-}
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/JBossServerView.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/JBossServerView.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/JBossServerView.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,192 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.tools.as.wst.server.ui.views.server;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-
-/**
- *
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public class JBossServerView extends ViewPart {
-
- public static final String VIEW_ID = "org.jboss.ide.eclipse.as.ui.views.JBossServerView";
-
- private static final String TAG_SASHFORM_HEIGHT = "sashformHeight";
-
- public static JBossServerView instance;
- private static ArrayList<ISelectionChangedListener> serverFrameListeners = new ArrayList<ISelectionChangedListener>();
- private static ArrayList<ISelectionChangedListener> extensionFrameListeners = new ArrayList<ISelectionChangedListener>();
-
- public static JBossServerView getDefault() {
- return instance;
- }
-
- public static void addServerFrameListener(ISelectionChangedListener listener) {
- if( !serverFrameListeners.contains(listener))
- serverFrameListeners.add(listener);
- if( getDefault() != null )
- getDefault().getServerFrame().getViewer().addSelectionChangedListener(listener);
- }
- public static void addExtensionFrameListener(ISelectionChangedListener listener) {
- if( !extensionFrameListeners.contains(listener))
- extensionFrameListeners.add(listener);
- if( getDefault() != null )
- getDefault().getExtensionFrame().getViewer().addSelectionChangedListener(listener);
- }
-
- public static void removeServerFrameListener(ISelectionChangedListener listener) {
- if( serverFrameListeners.contains(listener))
- serverFrameListeners.remove(listener);
- if( getDefault() != null )
- getDefault().getServerFrame().getViewer().removeSelectionChangedListener(listener);
- }
- public static void removeExtensionFrameListener(ISelectionChangedListener listener) {
- if( extensionFrameListeners.contains(listener))
- extensionFrameListeners.remove(listener);
- if( getDefault() != null )
- getDefault().getExtensionFrame().getViewer().removeSelectionChangedListener(listener);
- }
-
- public static interface IServerViewFrame {
- public IAction[] getActionBarActions();
- public int getDefaultSize();
- public void refresh();
- }
-
- public JBossServerView() {
- super();
- instance = this;
- }
-
- private SashForm form;
- private int[] sashRows;
- private IMemento memento;
-
- private IServerViewFrame[] frames;
- private ServerFrame serverFrame;
- private ServerExtensionFrame extensionFrame;
-
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- ServerUIPlugin.getPreferences().setShowOnActivity(false);
- this.memento = memento;
- int sum = 0;
- sashRows = new int[2];
- for (int i = 0; i < sashRows.length; i++) {
- sashRows[i] = 50;
- if (memento != null) {
- Integer in = memento.getInteger(TAG_SASHFORM_HEIGHT + i);
- if (in != null && in.intValue() > 5)
- sashRows[i] = in.intValue();
- }
- sum += sashRows[i];
- }
- }
-
- public void saveState(IMemento memento) {
- super.saveState(memento);
- int[] weights = form.getWeights();
- for (int i = 0; i < weights.length; i++) {
- if (weights[i] != 0)
- memento.putInteger(TAG_SASHFORM_HEIGHT + i, weights[i]);
- }
- }
-
- public void createPartControl(Composite parent) {
- form = new SashForm(parent, SWT.VERTICAL);
- form.setBackground(new Color(parent.getDisplay(), 255, 255, 255));
- form.setLayout(new FillLayout());
-
-
- Composite topWrapper = new Composite(form, SWT.NONE);
- topWrapper.setLayout(new FillLayout());
- serverFrame = new ServerFrame(topWrapper, this);
-
- Composite bottomWrapper = new Composite(form, SWT.NONE);
- bottomWrapper.setLayout(new FillLayout());
- extensionFrame = new ServerExtensionFrame(bottomWrapper, this);
-
-
- frames = new IServerViewFrame[] { serverFrame, extensionFrame };
-
- // add toolbar buttons
- IContributionManager cm = getViewSite().getActionBars().getToolBarManager();
- for( int i = 0; i < frames.length; i++ ) {
- IAction[] actions = frames[i].getActionBarActions();
- for (int j = 0; j < actions.length - 1; j++)
- cm.add(actions[j]);
- }
-
- form.setWeights(sashRows);
-
-
- // if the extensions have already been created, add those listeners now.
- Iterator<ISelectionChangedListener> k;
- for(k = serverFrameListeners.iterator(); k.hasNext();)
- serverFrame.getViewer().addSelectionChangedListener(k.next());
- for(k = extensionFrameListeners.iterator(); k.hasNext();)
- extensionFrame.getViewer().addSelectionChangedListener(k.next());
- }
-
- public void refreshAll() {
- for( int i = 0; i < frames.length; i++ ) {
- frames[i].refresh();
- }
- }
-
- public ServerFrame getServerFrame() { return this.serverFrame; }
- public ServerExtensionFrame getExtensionFrame() { return this.extensionFrame; }
-
- public void setFocus() {
- getExtensionFrame().getViewer().getTree().setFocus();
- }
-
- public IServer getSelectedServer() {
- return serverFrame == null ? null : serverFrame.getSelectedServer();
- }
-
- public Object getAdapter(Class adaptor) {
- if( adaptor == IPropertySheetPage.class) {
- return extensionFrame.getViewer().getPropertySheet();
- }
- return super.getAdapter(adaptor);
- }
-}
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerExtensionFrame.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerExtensionFrame.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerExtensionFrame.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,122 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.tools.as.wst.server.ui.views.server;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-import org.jboss.tools.as.wst.server.ui.views.server.JBossServerView.IServerViewFrame;
-
-/**
- *
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public class ServerExtensionFrame extends Composite implements IServerViewFrame {
-
- private Tree jbTreeTable;
- private ExtensionTableViewer jbViewer;
- private JBossServerView view;
- public ServerExtensionFrame(Composite parent, JBossServerView view) {
- super(parent, SWT.NONE);
- this.view = view;
- setLayout(new FillLayout());
- jbTreeTable = new Tree(this, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- jbViewer = new ExtensionTableViewer(jbTreeTable);
- view.getSite().setSelectionProvider(jbViewer);
- addListeners();
- doMenuStuff(parent);
- }
-
- protected void doMenuStuff(Composite parent) {
- MenuManager menuManager = new MenuManager("#PopupMenu");
- menuManager.setRemoveAllWhenShown(true);
- final Shell shell = jbTreeTable.getShell();
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- jbViewer.fillSelectedContextMenu(shell, mgr);
- mgr.add(new Separator());
- jbViewer.fillJBContextMenu(shell, mgr);
- }
- });
- Menu menu = menuManager.createContextMenu(parent);
- jbTreeTable.setMenu(menu);
- }
-
- public ExtensionTableViewer getViewer() {
- return jbViewer;
- }
-
- public void refresh() {
- jbViewer.refresh();
- }
-
- public void addListeners() {
-
- /*
- * Handles the selection of the server viewer which is embedded in my sashform
- */
- view.getServerFrame().getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object selection = ((TreeSelection)event.getSelection()).getFirstElement();
- Object server = selection;
- if( selection instanceof ModuleServer ) {
- server = ((ModuleServer)selection).server;
- }
-
- if( selection == null ) return;
- if( server != jbViewer.getInput()) {
- // find the newest copy of the server
- IServer tmp = ServerCore.findServer(((IServer)server).getId());
- jbViewer.setInput(tmp);
- } else {
- jbViewer.refresh();
- }
- }
-
- });
- }
-
-
- public IAction[] getActionBarActions() {
- return new IAction[] {}; // none
- }
-
- public int getDefaultSize() {
- return 0;
- }
- }
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerFrame.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerFrame.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerFrame.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,345 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.tools.as.wst.server.ui.views.server;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.bindings.TriggerSequence;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPartSite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.keys.IBindingService;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.internal.Trace;
-import org.eclipse.wst.server.ui.internal.ContextIds;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.actions.NewServerWizardAction;
-import org.eclipse.wst.server.ui.internal.view.servers.CopyAction;
-import org.eclipse.wst.server.ui.internal.view.servers.DeleteAction;
-import org.eclipse.wst.server.ui.internal.view.servers.ModuleSloshAction;
-import org.eclipse.wst.server.ui.internal.view.servers.OpenAction;
-import org.eclipse.wst.server.ui.internal.view.servers.PasteAction;
-import org.eclipse.wst.server.ui.internal.view.servers.PropertiesAction;
-import org.eclipse.wst.server.ui.internal.view.servers.PublishAction;
-import org.eclipse.wst.server.ui.internal.view.servers.PublishCleanAction;
-import org.eclipse.wst.server.ui.internal.view.servers.RenameAction;
-import org.eclipse.wst.server.ui.internal.view.servers.ShowInConsoleAction;
-import org.eclipse.wst.server.ui.internal.view.servers.ShowInDebugAction;
-import org.eclipse.wst.server.ui.internal.view.servers.StartAction;
-import org.eclipse.wst.server.ui.internal.view.servers.StopAction;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
-import org.jboss.ide.eclipse.as.ui.dialogs.TwiddleDialog;
-import org.jboss.tools.as.wst.server.ui.views.server.JBossServerView.IServerViewFrame;
-
-/**
- *
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public class ServerFrame extends Composite implements IServerViewFrame {
-
- protected Action[] actions;
- protected IWorkbenchPartSite site;
- protected IViewSite viewSite;
- protected Tree treeTable;
- protected ServerTableViewer tableViewer;
-
- // custom
- protected Action editLaunchConfigAction, twiddleAction, newServerAction;
-
- // wtp
- protected Action actionModifyModules;
- protected Action openAction, showInConsoleAction, showInDebugAction, propertiesAction;
- protected Action copyAction, pasteAction, deleteAction, renameAction;
-
- public ServerFrame(Composite parent, JBossServerView view) {
- super(parent, SWT.BORDER);
- setLayout(new FillLayout());
- this.site = view.getSite();
- this.viewSite = view.getViewSite();
-
-
- int cols[] = new int[] {150, 100, 50};
-
- treeTable = new Tree(this, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
- treeTable.setHeaderVisible(true);
- treeTable.setLinesVisible(false);
- treeTable.setFont(parent.getFont());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(treeTable, ContextIds.VIEW_SERVERS);
-
- // add columns
- TreeColumn column = new TreeColumn(treeTable, SWT.SINGLE);
- column.setText(Messages.viewServer);
- column.setWidth(cols[0]);
-
- TreeColumn column2 = new TreeColumn(treeTable, SWT.SINGLE);
- column2.setText(Messages.viewState);
- column2.setWidth(cols[1]);
-
- TreeColumn column3 = new TreeColumn(treeTable, SWT.SINGLE);
- column3.setText(Messages.viewStatus);
- column3.setWidth(cols[2]);
-
- tableViewer = new ServerTableViewer(viewSite, treeTable);
- initializeActions(tableViewer);
-
- treeTable.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- try {
- } catch (Exception e) {
- viewSite.getActionBars().getStatusLineManager().setMessage(null, "");
- }
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- try {
- TreeItem item = treeTable.getSelection()[0];
- Object data = item.getData();
- if (!(data instanceof IServer))
- return;
- IServer server = (IServer) data;
- ServerUIPlugin.editServer(server);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not open server", e);
- }
- }
- });
-
- MenuManager menuManager = new MenuManager("#PopupMenu");
- menuManager.setRemoveAllWhenShown(true);
- final Shell shell = treeTable.getShell();
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(shell, mgr);
- }
- });
- Menu menu = menuManager.createContextMenu(parent);
- treeTable.setMenu(menu);
- site.registerContextMenu(menuManager, tableViewer);
- site.setSelectionProvider(tableViewer);
- }
-
- protected void fillContextMenu(Shell shell, IMenuManager menu) {
- if( getSelectedServer() != null ) {
- cloneFill(shell, menu);
- } else {
- menu.add(newServerAction);
- }
- }
-
- protected void cloneFill(Shell shell, IMenuManager menu) {
-
- /* Show in ... */
- String text = Messages.actionShowIn;
- final IWorkbench workbench = PlatformUI.getWorkbench();
- final IBindingService bindingService = (IBindingService) workbench
- .getAdapter(IBindingService.class);
- final TriggerSequence[] activeBindings = bindingService
- .getActiveBindingsFor("org.eclipse.ui.navigate.showInQuickMenu");
- if (activeBindings.length > 0) {
- text += "\t" + activeBindings[0].format();
- }
-
- menu.add(newServerAction);
- menu.add(openAction);
-
- MenuManager showInMenu = new MenuManager(text);
- showInMenu.add(showInConsoleAction);
- showInMenu.add(showInDebugAction);
- menu.add(showInMenu);
- menu.add(new Separator());
-
- menu.add(copyAction);
- menu.add(pasteAction);
- menu.add(deleteAction);
- menu.add(renameAction);
-
- menu.add(new Separator());
-
- // server actions
- for (int i = 0; i < actions.length; i++)
- menu.add(actions[i]);
-
- menu.add(new Separator());
-// menu.add(actionModifyModules);
-
- menu.add(twiddleAction);
- menu.add(editLaunchConfigAction);
- menu.add(actionModifyModules);
- twiddleAction.setEnabled(true);
- editLaunchConfigAction.setEnabled(true);
-
- }
-
- public IServer getSelectedServer() {
- Object o = ((IStructuredSelection)tableViewer.getSelection()).getFirstElement();
- return (IServer)o;
- }
-
- public void initializeActions(ISelectionProvider provider) {
- createWTPActions(provider);
- createCustomActions();
- }
-
- protected void createWTPActions(ISelectionProvider provider) {
- Shell shell = viewSite.getShell();
- IActionBars actionBars = viewSite.getActionBars();
-
- actions = new Action[6];
- // create the start actions
- actions[0] = new StartAction(shell, provider, ILaunchManager.DEBUG_MODE);
- actionBars.setGlobalActionHandler("org.eclipse.wst.server.debug", actions[0]);
- actions[1] = new StartAction(shell, provider, ILaunchManager.RUN_MODE);
- actionBars.setGlobalActionHandler("org.eclipse.wst.server.run", actions[1]);
- actions[2] = new StartAction(shell, provider, ILaunchManager.PROFILE_MODE);
-
- // create the stop action
- actions[3] = new StopAction(shell, provider);
- actionBars.setGlobalActionHandler("org.eclipse.wst.server.stop", actions[3]);
-
- // create the publish actions
- actions[4] = new PublishAction(shell, provider);
- actionBars.setGlobalActionHandler("org.eclipse.wst.server.publish", actions[4]);
- actions[5] = new PublishCleanAction(shell, provider);
-
- // create the open action
- openAction = new OpenAction(provider);
- actionBars.setGlobalActionHandler("org.eclipse.ui.navigator.Open", openAction);
-
- // create copy, paste, and delete actions
- pasteAction = new PasteAction(shell, provider, tableViewer.clipboard);
- copyAction = new CopyAction(provider, tableViewer.clipboard, pasteAction);
- deleteAction = new DeleteAction(shell, provider);
- renameAction = new RenameAction(shell, tableViewer, provider);
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), deleteAction);
- actionBars.setGlobalActionHandler(ActionFactory.RENAME.getId(), renameAction);
-
- // create the other actions
- actionModifyModules = new ModuleSloshAction(shell, provider);
- showInConsoleAction = new ShowInConsoleAction(provider);
- showInDebugAction = new ShowInDebugAction(provider);
-
- // create the properties action
- propertiesAction = new PropertiesAction(shell, provider);
- actionBars.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(), propertiesAction);
- }
-
- protected void createCustomActions() {
- newServerAction = new Action() {
- public void run() {
- IAction newServerAction = new NewServerWizardAction();
- newServerAction.run();
- }
- };
- newServerAction.setText("New Server");
- newServerAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.GENERIC_SERVER_IMAGE));
-
- editLaunchConfigAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- final Object selected = getSelectedServer();
- IServer s = null;
- if( selected instanceof JBossServer ) {
- s = ((JBossServer)selected).getServer();
- } else if( selected instanceof IServer ) {
- s = (IServer)selected;
- }
-
- if( s != null ) {
- ILaunchConfiguration launchConfig = ((Server) s).getLaunchConfiguration(true, null);
- // TODO: use correct launch group
- DebugUITools.openLaunchConfigurationPropertiesDialog(new Shell(), launchConfig, "org.eclipse.debug.ui.launchGroup.run");
- }
- } catch (CoreException ce) {
- }
- }
- });
- }
- };
- editLaunchConfigAction.setText(org.jboss.ide.eclipse.as.ui.Messages.EditLaunchConfigurationAction);
- editLaunchConfigAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.IMG_JBOSS_CONFIGURATION));
-
- twiddleAction = new Action() {
- public void run() {
- final IStructuredSelection selected = ((IStructuredSelection)tableViewer.getSelection());
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- TwiddleDialog dialog = new TwiddleDialog(tableViewer.getTree().getShell(), selected.getFirstElement());
- dialog.open();
- }
- } );
-
- }
- };
- twiddleAction.setText( org.jboss.ide.eclipse.as.ui.Messages.TwiddleServerAction);
- twiddleAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.TWIDDLE_IMAGE));
-
- }
-
- public ServerTableViewer getViewer() {
- return tableViewer;
- }
-
- public void refresh() {
- tableViewer.refresh();
- }
-
- public IAction[] getActionBarActions() {
- return actions;
- }
-
- public int getDefaultSize() {
- return 0;
- }
-}
Deleted: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerTableViewer.java
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerTableViewer.java 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/views/server/ServerTableViewer.java 2008-10-30 02:21:00 UTC (rev 11315)
@@ -1,389 +0,0 @@
-package org.jboss.tools.as.wst.server.ui.views.server;
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
-* This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.wst.server.core.IPublishListener;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerLifecycleListener;
-import org.eclipse.wst.server.core.IServerListener;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.core.ServerEvent;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.util.PublishAdapter;
-import org.eclipse.wst.server.ui.internal.Trace;
-import org.eclipse.wst.server.ui.internal.provisional.UIDecoratorManager;
-import org.eclipse.wst.server.ui.internal.view.servers.ServerTableLabelProvider;
-/**
- * Tree view showing servers and their associations.
- * This is for the TOP window
- * @author Rob Stryker <rob.stryker(a)redhat.com>
- *
- */
-public class ServerTableViewer extends TreeViewer {
- protected static final String ROOT = "root";
-
- protected IServerLifecycleListener serverResourceListener;
- protected IPublishListener publishListener;
- protected IServerListener serverListener;
-
- protected static Object deletedElement = null;
-
- // servers that are currently publishing and starting
- protected static List publishing = new ArrayList();
- protected static List starting = new ArrayList();
-
- protected ServerTableLabelProvider2 labelProvider;
- protected Clipboard clipboard;
-
- protected IViewSite viewSite;
-
- protected class ServerTableLabelProvider2 extends ServerTableLabelProvider {
- private int myCount = 0;
- protected Image getStateImage(IServerType serverType, int state, String mode) {
- return UIDecoratorManager.getUIDecorator(serverType).getStateImage(state, mode, myCount);
- }
- protected String getStateLabel(IServerType serverType, int state, String mode) {
- return UIDecoratorManager.getUIDecorator(serverType).getStateLabel(state, mode, myCount);
- }
- protected void animate2() {
- myCount ++;
- if (myCount > 2)
- myCount = 0;
- }
-
- }
-
- public class TrimmedServerContentProvider implements IStructuredContentProvider, ITreeContentProvider {
- public Object[] getElements(Object element) {
- return ServerCore.getServers();
- }
-
- public void inputChanged(Viewer theViewer, Object oldInput, Object newInput) {
- // do nothing
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getChildren(Object element) {
- return new Object[0];
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return false;
- }
- }
-
- protected Thread thread = null;
- protected boolean stopThread = false;
-
- protected void startThread() {
- stopThread = false;
- if (thread != null)
- return;
-
- thread = new Thread("Servers View Animator") {
- public void run() {
- while (!stopThread) {
- try {
- labelProvider.animate2();
- final Object[] rootElements = ((ITreeContentProvider)getContentProvider()).getElements(null);
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if (getTree() != null && !getTree().isDisposed())
- update(rootElements, null);
- }
- });
- Thread.sleep(250);
- } catch (Exception e) {
- Trace.trace(Trace.FINEST, "Error in animated server view", e);
- }
- thread = null;
- }
- }
- };
- thread.setDaemon(true);
- thread.start();
- }
-
- protected void stopThread() {
- stopThread = true;
- }
-
- /**
- * ServerTableViewer constructor comment.
- *
- * @param view the view
- * @param tree the tree
- */
- public ServerTableViewer(final IViewSite site, final Tree tree) {
- super(tree);
- this.viewSite = site;
- clipboard = new Clipboard(tree.getDisplay());
-
- setContentProvider(new TrimmedServerContentProvider());
- labelProvider = new ServerTableLabelProvider2();
- labelProvider.addListener(new ILabelProviderListener() {
- public void labelProviderChanged(LabelProviderChangedEvent event) {
- Object[] obj = event.getElements();
- if (obj == null)
- refresh(true);
- else {
- int size = obj.length;
- for (int i = 0; i < size; i++)
- refresh(obj[i], true);
- }
- }
- });
- setLabelProvider(labelProvider);
- setSorter(new ViewerSorter() {
- // empty
- });
-
- setInput(ROOT);
- addListeners();
- }
-
- protected void addListeners() {
- serverResourceListener = new IServerLifecycleListener() {
- public void serverAdded(IServer server) {
- addServer(server);
- server.addServerListener(serverListener);
- ((Server) server).addPublishListener(publishListener);
- }
- public void serverChanged(IServer server) {
- refreshServer(server);
- }
- public void serverRemoved(IServer server) {
- removeServer(server);
- server.removeServerListener(serverListener);
- ((Server) server).removePublishListener(publishListener);
- }
- };
- ServerCore.addServerLifecycleListener(serverResourceListener);
-
- publishListener = new PublishAdapter() {
- public void publishStarted(IServer server) {
- handlePublishChange(server, true);
- }
-
- public void publishFinished(IServer server, IStatus status) {
- handlePublishChange(server, false);
- }
- };
-
- serverListener = new IServerListener() {
- public void serverChanged(ServerEvent event) {
- if (event == null) {
- return;
- }
- int eventKind = event.getKind();
- IServer server = event.getServer();
- if ((eventKind & ServerEvent.SERVER_CHANGE) != 0) {
- // server change event
- if ((eventKind & ServerEvent.STATE_CHANGE) != 0) {
- refreshServer(server);
- int state = event.getState();
- String id = server.getId();
- if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING) {
- if (!starting.contains(id)) {
- if (starting.isEmpty())
- startThread();
- starting.add(id);
- }
- } else {
- if (starting.contains(id)) {
- starting.remove(id);
- if (starting.isEmpty())
- stopThread();
- }
- }
- } else
- refreshServer(server);
- } else if ((eventKind & ServerEvent.MODULE_CHANGE) != 0) {
- // module change event
- if ((eventKind & ServerEvent.STATE_CHANGE) != 0 || (eventKind & ServerEvent.PUBLISH_STATE_CHANGE) != 0) {
- refreshServer(server);
- }
- }
- }
- };
-
- // add listeners to servers
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- servers[i].addServerListener(serverListener);
- ((Server) servers[i]).addPublishListener(publishListener);
- }
- }
- }
-
- protected void refreshServer(final IServer server) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- refresh(server);
-
- // This ensures the icons are updated in case of a publish or state change
- ISelection sel = ServerTableViewer.this.getSelection();
- ServerTableViewer.this.setSelection(sel);
- } catch (Exception e) {
- // ignore
- }
- }
- });
- }
-
- protected void handleDispose(DisposeEvent event) {
- stopThread();
- //if (dsListener != null)
- // view.getViewSite().getPage().removeSelectionListener(dsListener);
-
- ServerCore.removeServerLifecycleListener(serverResourceListener);
-
- // remove listeners from server
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- servers[i].removeServerListener(serverListener);
- ((Server) servers[i]).removePublishListener(publishListener);
- }
- }
-
- clipboard.dispose();
- super.handleDispose(event);
- }
-
- /**
- * Called when the publish state changes.
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected void handlePublishChange(IServer server, boolean isPublishing) {
- String serverId = server.getId();
- if (isPublishing)
- publishing.add(serverId);
- else
- publishing.remove(serverId);
-
- refreshServer(server);
- }
-
- /**
- *
- */
- protected void handleServerModulesChanged(IServer server2) {
- if (server2 == null)
- return;
-
- IServer[] servers = ServerCore.getServers();
- if (servers != null) {
- int size = servers.length;
- for (int i = 0; i < size; i++) {
- if (server2.equals(servers[i]))
- refresh(servers[i]);
- }
- }
- }
-
- /**
- * Called when an element is added.
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected void handleServerResourceAdded(IServer server) {
- add(null, server);
- }
-
- /**
- * Called when an element is changed.
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected void handleServerResourceChanged(IServer server) {
- refresh(server);
- }
-
- /**
- * Called when an element is removed.
- * @param server org.eclipse.wst.server.core.IServer
- */
- protected void handleServerResourceRemoved(IServer server) {
- remove(server);
-
- String serverId = server.getId();
- publishing.remove(serverId);
-
- viewSite.getActionBars().getStatusLineManager().setMessage(null, null);
- }
-
- protected void addServer(final IServer server) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- add(ROOT, server);
- }
- });
- }
-
- protected void removeServer(final IServer server) {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- remove(server);
- }
- });
- }
-}
\ No newline at end of file
Modified: workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml
===================================================================
--- workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-10-30 00:31:00 UTC (rev 11314)
+++ workspace/rstryker/viewRefactor/plugins/org.jboss.ide.eclipse.as.ui/plugin.xml 2008-10-30 02:21:00 UTC (rev 11315)
@@ -112,6 +112,7 @@
</adapter>
</extension>
+<!--
<extension
point="org.eclipse.ui.views">
<view
@@ -122,10 +123,10 @@
id="org.jboss.ide.eclipse.as.ui.views.JBossServerView"
name="JBoss Server View"/>
</extension>
+-->
-
<extension
point="org.jboss.ide.eclipse.as.ui.ServerViewExtension">
<ViewProvider
@@ -301,15 +302,15 @@
<extension point="org.eclipse.ui.actionSets">
<actionSet description="%actionSets.serverActions.description" id="org.jboss.tools.jst.web.ui.server.actionSet" label="%actionSets.serverActions.label" visible="true">
- <action class="org.jboss.tools.as.wst.server.ui.action.SelectServerActionDelegate" icon="icons/actions/xpl/server.gif" id="org.jboss.tools.jst.web.ui.action.server.SelectServerActionDelegate" label="label1" style="pulldown" toolbarPath="Normal/SelectServer" tooltip="%actionSets.serverActions.selectServer.label">
+ <action class="org.jboss.ide.eclipse.as.ui.actions.SelectServerActionDelegate" icon="icons/actions/xpl/server.gif" id="org.jboss.tools.jst.web.ui.action.server.SelectServerActionDelegate" label="label1" style="pulldown" toolbarPath="Normal/SelectServer" tooltip="%actionSets.serverActions.selectServer.label">
</action>
- <action class="org.jboss.tools.as.wst.server.ui.action.ChangeTimeStampActionDelegate" icon="icons/actions/webxml.gif" id="org.jboss.tools.jst.web.ui.action.server.ChangeTimeStampActionDelegate" label="label2" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.changeWebXmlTimeStamp.label">
+ <action class="org.jboss.ide.eclipse.as.ui.actions.ChangeTimeStampActionDelegate" icon="icons/actions/webxml.gif" id="org.jboss.tools.jst.web.ui.action.server.ChangeTimeStampActionDelegate" label="label2" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.changeWebXmlTimeStamp.label">
</action>
- <action class="org.jboss.tools.as.wst.server.ui.action.StopServerActionDelegate" icon="icons/actions/stop.gif" id="org.jboss.tools.jst.web.ui.action.server.StopServerActionDelegate" label="label4" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.stopServer.label">
+ <action class="org.jboss.ide.eclipse.as.ui.actions.StopServerActionDelegate" icon="icons/actions/stop.gif" id="org.jboss.tools.jst.web.ui.action.server.StopServerActionDelegate" label="label4" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.stopServer.label">
</action>
- <action class="org.jboss.tools.as.wst.server.ui.action.DebugServerActionDelegate" icon="icons/actions/xpl/debug.gif" id="org.jboss.tools.jst.web.ui.action.server.DebugServerActionDelegate" label="label6" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.startServer.label">
+ <action class="org.jboss.ide.eclipse.as.ui.actions.DebugServerActionDelegate" icon="icons/actions/xpl/debug.gif" id="org.jboss.tools.jst.web.ui.action.server.DebugServerActionDelegate" label="label6" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.startServer.label">
</action>
- <action class="org.jboss.tools.as.wst.server.ui.action.RunServerActionDelegate" icon="icons/actions/start.gif" id="org.jboss.tools.jst.web.ui.action.server.RunServerActionDelegate" label="label7" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.startServer.label">
+ <action class="org.jboss.ide.eclipse.as.ui.actions.RunServerActionDelegate" icon="icons/actions/start.gif" id="org.jboss.tools.jst.web.ui.action.server.RunServerActionDelegate" label="label7" toolbarPath="Normal/server" tooltip="%actionSets.serverActions.startServer.label">
</action>
</actionSet>
</extension>
@@ -329,18 +330,18 @@
<extension point="org.eclipse.ui.views">
<view
- id="org.eclipse.wst.server.ui.ServersViewProvisional"
- name="JBoss Servers View 2 (beta)"
+ id="org.jboss.tools.as.wst.server.ui.ServersView"
+ name="JBoss Server View"
category="org.eclipse.wst.server.ui"
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServersView"
+ class="org.jboss.tools.as.wst.server.ui.ServersView"
icon="icons/jboss.gif"/>
</extension>
<extension point="org.eclipse.ui.decorators">
<decorator
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerDecorator"
- icon="icons/obj16/server.gif"
- id="org.eclipse.wst.server.ui.navigatorDecorator"
+ class="org.jboss.tools.as.wst.server.ui.ServerDecorator"
+ icon="icons/cview16/servers_view.gif"
+ id="org.jboss.tools.as.wst.server.ui.navigatorDecorator"
label="Server State Decorator"
lightweight="true"
location="BOTTOM_RIGHT">
@@ -361,10 +362,10 @@
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
activeByDefault="true"
- contentProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerContentProvider"
+ contentProvider="org.jboss.tools.as.wst.server.ui.ServerContentProvider"
icon="icons/cview16/servers_view.gif"
- id="org.eclipse.wst.server.ui.ServersView.content.root"
- labelProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerLabelProvider"
+ id="org.jboss.tools.as.wst.server.ui.ServersView.content.root"
+ labelProvider="org.jboss.tools.as.wst.server.ui.ServerLabelProvider"
name="Servers View Default Content"
priority="highest">
<triggerPoints>
@@ -382,8 +383,8 @@
</instanceof>
</or></possibleChildren>
<actionProvider
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerActionProvider"
- id="org.eclipse.wst.server.ui.internal.view.servers.provisional.ServerActionProvider"
+ class="org.jboss.tools.as.wst.server.ui.ServerActionProvider"
+ id="org.jboss.tools.as.wst.server.ui.ServersView.ServerActionProvider"
priority="highest">
</actionProvider>
</navigatorContent>
@@ -391,11 +392,11 @@
<extension
point="org.eclipse.ui.navigator.viewer">
<viewerContentBinding
- viewerId="org.eclipse.wst.server.ui.ServersViewProvisional">
+ viewerId="org.jboss.tools.as.wst.server.ui.ServersView">
<includes>
<contentExtension
isRoot="true"
- pattern="org.eclipse.wst.server.ui.ServersView.content.root">
+ pattern="org.jboss.tools.as.wst.server.ui.ServersView.content.root">
</contentExtension>
</includes>
</viewerContentBinding>
@@ -411,8 +412,8 @@
id="org.jboss.ide.eclipse.as.ui.extensions.eventLog"
activeByDefault="true"
icon="icons/info_obj.gif"
- contentProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.EventLogContentProvider"
- labelProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.EventLogLabelProvider"
+ contentProvider="org.jboss.ide.eclipse.as.ui.views.server.extensions.EventLogContentProvider"
+ labelProvider="org.jboss.ide.eclipse.as.ui.views.server.extensions.EventLogLabelProvider"
name="JBoss Server Event Log"
priority="normal">
<triggerPoints>
@@ -430,17 +431,17 @@
</instanceof>
</or></possibleChildren>
<actionProvider
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.EventLogActionProvider"
+ class="org.jboss.ide.eclipse.as.ui.views.server.extensions.EventLogActionProvider"
id="org.jboss.ide.eclipse.as.ui.extensions.eventLog.actions"
priority="highest">
</actionProvider>
</navigatorContent>
<navigatorContent
activeByDefault="true"
- contentProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathTreeContentProvider"
+ contentProvider="org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathTreeContentProvider"
icon="icons/XMLFile.gif"
id="org.jboss.ide.eclipse.as.ui.extensions.xml"
- labelProvider="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathTreeLabelProvider"
+ labelProvider="org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathTreeLabelProvider"
name="XML Configuration"
priority="normal">
<triggerPoints>
@@ -451,10 +452,10 @@
<possibleChildren>
<or>
<instanceof
- value="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XPathTreeContentProvider$ServerWrapper">
+ value="org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathTreeContentProvider$ServerWrapper">
</instanceof>
<instanceof
- value="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathProvider$XPathTreeContentProvider$DelayProxy">
+ value="org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathTreeContentProvider$DelayProxy">
</instanceof>
<instanceof
value="org.jboss.ide.eclipse.as.core.extensions.descriptors.XPathCategory">
@@ -470,8 +471,8 @@
</instanceof></or>
</possibleChildren>
<actionProvider
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathActionProvider"
- id="org.jboss.ide.eclipse.as.ui.extensions.eventLog.actions"
+ class="org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathActionProvider"
+ id="org.jboss.ide.eclipse.as.ui.extensions.xml.actions"
priority="highest">
</actionProvider>
</navigatorContent>
@@ -479,7 +480,7 @@
<extension
point="org.eclipse.ui.navigator.viewer">
<viewerContentBinding
- viewerId="org.eclipse.wst.server.ui.ServersViewProvisional">
+ viewerId="org.jboss.tools.as.wst.server.ui.ServersView">
<includes>
<contentExtension
isRoot="false"
@@ -498,7 +499,7 @@
<!-- Decorator for xpaths / xml-->
<extension point="org.eclipse.ui.decorators">
<decorator
- class="org.eclipse.wst.server.ui.internal.view.servers.provisional.extensions.XPathDecorator"
+ class="org.jboss.ide.eclipse.as.ui.views.server.extensions.XPathDecorator"
id="org.jboss.ide.eclipse.as.ui.extensions.xml.decorator"
label="JBoss Server XML Configuration Decorator"
lightweight="true"
16 years, 2 months
JBoss Tools SVN: r11314 - in trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects: jsfHyperlinkTests and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-29 20:31:00 -0400 (Wed, 29 Oct 2008)
New Revision: 11314
Added:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.classpath
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.project
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jdt.core.prefs
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jst.common.project.facet.core.prefs
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.wst.common.component
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean1.java
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean2.java
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean3.java
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean4.java
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean5.java
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/META-INF/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/faces-config.xml
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/lib/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/lib/jsf-impl.jar
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/web.xml
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page1.jsp
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page2.jsp
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page3.jsp
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page4.jsp
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page5.jsp
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.properties
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.xml
Log:
test project for JSF hyperlinks
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.classpath
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.classpath (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.classpath 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.project
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.project (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.project 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jsfHyperlinkTests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jdt.core.prefs 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,7 @@
+#Wed Oct 29 16:28:57 PDT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jst.common.project.facet.core.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jst.common.project.facet.core.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jst.common.project.facet.core.prefs 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,4 @@
+#Wed Oct 29 16:28:57 PDT 2008
+classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER\:\:org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\:\:java-1.5.0-sun-1.5.0.15/owners=jst.java\:5.0
+classpath.helper/org.eclipse.jst.server.core.container\:\:org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget\:\:JBoss\ 4.2\ Runtime/owners=jst.web\:2.4
+eclipse.preferences.version=1
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.jst.common.project.facet.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.wst.common.component 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="jsfHyperlinkTests">
+<wb-resource deploy-path="/" source-path="/WebContent"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/JavaSource"/>
+<property name="context-root" value="jsfHyperlinkTests"/>
+<property name="java-output-path"/>
+</wb-module>
+</project-modules>
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.wst.common.project.facet.core.xml 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="JBoss 4.2 Runtime"/>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.web" version="2.4"/>
+</faceted-project>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/.settings/org.eclipse.wst.common.project.facet.core.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean1.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean1.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean1.java 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,37 @@
+package org.jboss.jsf.tests;
+
+public class Bean1 {
+
+ private java.lang.String property1;
+ private org.jboss.jsf.tests.Bean5 property2;
+ private org.jboss.jsf.tests.Bean5 property3;
+
+ public Bean1() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public java.lang.String getProperty1() {
+ return property1;
+ }
+
+ public void setProperty1(java.lang.String property1) {
+ this.property1 = property1;
+ }
+
+ public org.jboss.jsf.tests.Bean5 getProperty2() {
+ return property2;
+ }
+
+ public void setProperty2(org.jboss.jsf.tests.Bean5 property2) {
+ this.property2 = property2;
+ }
+
+ public org.jboss.jsf.tests.Bean5 getProperty3() {
+ return property3;
+ }
+
+ public void setProperty3(org.jboss.jsf.tests.Bean5 property3) {
+ this.property3 = property3;
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean1.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean2.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean2.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean2.java 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,9 @@
+package org.jboss.jsf.tests;
+
+public class Bean2 {
+
+ public Bean2() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean2.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean3.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean3.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean3.java 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+package org.jboss.jsf.tests;
+
+/**
+ * @author eskimo
+ *
+ */
+public class Bean3 {
+
+ /**
+ *
+ */
+ public Bean3() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean3.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean4.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean4.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean4.java 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,9 @@
+package org.jboss.jsf.tests;
+
+public class Bean4 {
+
+ public Bean4() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean4.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean5.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean5.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean5.java 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+package org.jboss.jsf.tests;
+
+/**
+ * @author eskimo
+ *
+ */
+public class Bean5 {
+
+ /**
+ *
+ */
+ public Bean5() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/JavaSource/org/jboss/jsf/tests/Bean5.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/META-INF/MANIFEST.MF 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/faces-config.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/faces-config.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/faces-config.xml 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,120 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+<faces-config>
+ <managed-bean>
+ <managed-bean-name>bean1</managed-bean-name>
+ <managed-bean-class>org.jboss.jsf.tests.Bean1</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>property1</property-name>
+ <property-class>java.lang.String</property-class>
+ <value>"property1 value"</value>
+ </managed-property>
+ <!--Here is long comment for the property2-->
+ <managed-property id="bean1.property2">
+ <description>Here is the long description of the property2</description>
+ <display-name>Property2 of bean1</display-name>
+ <property-name>property2</property-name>
+ <property-class>org.jboss.jsf.tests.Bean5</property-class>
+ <null-value/>
+ </managed-property>
+ <managed-property>
+ <property-name>property3</property-name>
+ <property-class>org.jboss.jsf.tests.Bean5</property-class>
+ <value>#{bean5}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>bean2</managed-bean-name>
+ <managed-bean-class>org.jboss.jsf.tests.Bean2</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <list-entries>
+ <value-class>java.lang.String</value-class>
+ <value>testValue1</value>
+ <value>testValue2</value>
+ <value>testValue3</value>
+ </list-entries>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>bean3</managed-bean-name>
+ <managed-bean-class>org.jboss.jsf.tests.Bean3</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <map-entries>
+ <key-class>java.lang.String</key-class>
+ <value-class>java.lang.String</value-class>
+ <map-entry>
+ <key>key1</key>
+ <value>testValue1</value>
+ </map-entry>
+ <map-entry>
+ <key>key2</key>
+ <value>testValue2</value>
+ </map-entry>
+ <map-entry>
+ <key>key3</key>
+ <null-value/>
+ </map-entry>
+ </map-entries>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>bean4</managed-bean-name>
+ <managed-bean-class>org.jboss.jsf.tests.Bean4</managed-bean-class>
+ <managed-bean-scope>none</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>bean5</managed-bean-name>
+ <managed-bean-class>org.jboss.jsf.tests.Bean5</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <navigation-rule>
+ <from-view-id>/page1.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>page2</from-outcome>
+ <to-view-id>/page2.jsp</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>page3</from-outcome>
+ <to-view-id>/page3.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/page2.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>page3</from-outcome>
+ <to-view-id>/page3.jsp</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>page4</from-outcome>
+ <to-view-id>/page4.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/page3.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>page4</from-outcome>
+ <to-view-id>/page4.jsp</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>page5</from-outcome>
+ <to-view-id>/page5.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/page4.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>page5</from-outcome>
+ <to-view-id>/page5.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/page5.jsp</from-view-id>
+ <navigation-case>
+ <from-action>action5</from-action>
+ <to-view-id>/page1.jsp</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <to-view-id>/page3.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+</faces-config>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/lib/jsf-impl.jar
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/lib/jsf-impl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/web.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/web.xml 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>jsfHyperlinkTests</display-name>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page1.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page1.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page1.jsp 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,13 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page1.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page2.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page2.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page2.jsp 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,13 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page2.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page3.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page3.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page3.jsp 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,13 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page3.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page4.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page4.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page4.jsp 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,13 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page4.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page5.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page5.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page5.jsp 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,13 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/page5.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.properties (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.properties 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,3 @@
+#
+#Wed Oct 29 16:28:57 PDT 2008
+classpath.external=/home/eskimo/exadel-projects/jbds-ganymede/runtime-New_configuration/.metadata/.plugins/org.jboss.tools.common.projecttemplates/lib/servlet/2.4/jsp-api.jar;/home/eskimo/exadel-projects/jbds-ganymede/runtime-New_configuration/.metadata/.plugins/org.jboss.tools.common.projecttemplates/lib/servlet/2.4/servlet-api.jar;
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.xml 2008-10-30 00:31:00 UTC (rev 11314)
@@ -0,0 +1,87 @@
+<project name="jsfHyperlinkTests" basedir="../" default="deploy">
+
+ <!-- Project settings -->
+ <property name="project.distname" value="jsfHyperlinkTests"/>
+
+ <!-- Local system paths -->
+ <property file="${basedir}/ant/build.properties"/>
+ <property name="webroot.dir" value="${basedir}/WebContent"/>
+ <property name="webinf.dir" value="${webroot.dir}/WEB-INF"/>
+ <property name="build.dir" value="build"/>
+
+ <!-- classpath for JSF 1.1.01 -->
+ <path id="compile.classpath">
+ <pathelement path ="${webinf.dir}/lib/commons-beanutils.jar"/>
+ <pathelement path ="${webinf.dir}/lib/commons-collections.jar"/>
+ <pathelement path ="${webinf.dir}/lib/commons-digester.jar"/>
+ <pathelement path ="${webinf.dir}/lib/commons-logging.jar"/>
+ <pathelement path ="${webinf.dir}/lib/jsf-api.jar"/>
+ <pathelement path ="${webinf.dir}/lib/jsf-impl.jar"/>
+ <pathelement path ="${webinf.dir}/lib/jstl.jar"/>
+ <pathelement path ="${webinf.dir}/lib/standard.jar"/>
+ <pathelement path ="${webinf.dir}/classes"/>
+ <pathelement path ="${classpath.external}"/>
+ <pathelement path ="${classpath}"/>
+ </path>
+
+ <!-- define your folder for deployment -->
+ <property name="deploy.dir" value="deploy"/>
+
+
+ <!-- Check timestamp on files -->
+ <target name="prepare">
+ <tstamp/>
+ </target>
+
+ <!-- Copy any resource or configuration files -->
+ <target name="resources">
+ <copy todir="${webinf.dir}/classes" includeEmptyDirs="no">
+ <fileset dir="JavaSource">
+ <patternset>
+ <include name="**/*.conf"/>
+ <include name="**/*.properties"/>
+ <include name="**/*.xml"/>
+ </patternset>
+ </fileset>
+ </copy>
+ </target>
+
+ <!-- Normal build of application -->
+ <target name="compile" depends="prepare,resources">
+ <javac srcdir="JavaSource" destdir="${webinf.dir}/classes">
+ <classpath refid="compile.classpath"/>
+ </javac>
+ </target>
+
+ <!-- Remove classes directory for clean build -->
+ <target name="clean"
+ description="Prepare for clean build">
+ <delete dir="${webinf.dir}/classes"/>
+ <mkdir dir="${webinf.dir}/classes"/>
+ </target>
+
+ <!-- Build entire project -->
+ <target name="build" depends="prepare,compile"/>
+ <target name="rebuild" depends="clean,prepare,compile"/>
+
+ <!-- Create binary distribution -->
+ <target name="war" depends="build">
+ <mkdir dir="${build.dir}"/>
+ <war
+ basedir="${webroot.dir}"
+ warfile="${build.dir}/${project.distname}.war"
+ webxml="${webinf.dir}/web.xml">
+ <exclude name="WEB-INF/${build.dir}/**"/>
+ <exclude name="WEB-INF/src/**"/>
+ <exclude name="WEB-INF/web.xml"/>
+ </war>
+
+ </target>
+
+ <target name="deploy" depends="war">
+ <delete file="${deploy.dir}/${project.distname}.war"/>
+ <delete dir="${deploy.dir}/${project.distname}"/>
+ <copy file="${build.dir}/${project.distname}.war" todir="${deploy.dir}"/>
+ </target>
+
+</project>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/ant/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 2 months
JBoss Tools SVN: r11313 - trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-29 18:37:02 -0400 (Wed, 29 Oct 2008)
New Revision: 11313
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java
Log:
JBIDE-3031 Project examples (Seam Booking) don't start on server.
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java 2008-10-29 21:15:10 UTC (rev 11312)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassWizardPage.java 2008-10-29 22:37:02 UTC (rev 11313)
@@ -118,7 +118,6 @@
protected void handleClassButtonSelected() {
getControl().setCursor(new Cursor(getShell().getDisplay(), SWT.CURSOR_WAIT));
IProject project = (IProject) model.getProperty(PROJECT);
- IVirtualComponent component = ComponentCore.createComponent(project);
MultiSelectFilteredFileSelectionDialog ms = new MultiSelectFilteredFileSelectionDialog(
getShell(),
"New Portlet",
@@ -126,7 +125,13 @@
new String[0],
false,
project);
- IContainer root = component.getRootFolder().getUnderlyingFolder();
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IContainer root = null;
+ if (component != null) {
+ root = component.getRootFolder().getUnderlyingFolder();
+ } else {
+ root = project;
+ }
ms.setInput(root);
ms.open();
if (ms.getReturnCode() == Window.OK) {
16 years, 2 months