JBoss Tools SVN: r17230 - workspace/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-08-22 20:58:13 -0400 (Sat, 22 Aug 2009)
New Revision: 17230
Added:
workspace/examples/projectExamplesTest.xml
Modified:
workspace/examples/project-examples-3.0.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4594 Add Project Examples that will work with EAP 5.0
Modified: workspace/examples/project-examples-3.0.xml
===================================================================
--- workspace/examples/project-examples-3.0.xml 2009-08-23 00:45:28 UTC (rev 17229)
+++ workspace/examples/project-examples-3.0.xml 2009-08-23 00:58:13 UTC (rev 17230)
@@ -7,6 +7,7 @@
dvdstore,dvdstore-ear,dvdstore-ejb
</included-projects>
<shortDescription>Seam DVD Store Example - EAR</shortDescription>
+
<description>This example demonstrates the use of Seam with jBPM pageflow and business process management. It includes the dvdstore,dvdstore-ear and dvdstore-ejb projects.
</description>
<size>6926336</size>
@@ -17,6 +18,7 @@
<project>
<category>Seam</category>
+
<name>dvdstoreall2</name>
<included-projects>
dvdstore,dvdstore-ear,dvdstore-ejb,dvdstore-test
@@ -25,6 +27,7 @@
<description>This example demonstrates the use of Seam with jBPM pageflow and business process management. It includes the dvdstore,dvdstore-ear,dvdstore-test and dvdstore-ejb projects.
</description>
<size>30380032</size>
+
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
</url>
@@ -34,6 +37,7 @@
<category>Seam</category>
<name>booking</name>
<included-projects>
+
booking,booking-ear,booking-ejb
</included-projects>
<shortDescription>Seam Booking Example - EAR</shortDescription>
@@ -46,6 +50,7 @@
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
</url>
+
</project>
<project>
@@ -55,6 +60,7 @@
booking,booking-ear,booking-ejb,booking-test
</included-projects>
<shortDescription>Seam Booking Example - EAR (including a test project)</shortDescription>
+
<description>This example demonstrates the use of Seam in a Java EE 5 environment.
Transaction and persistence context management is handled by the EJB container.
This example can also run in Tomcat with JBoss Embedded.
@@ -68,6 +74,7 @@
<project>
<category>Seam</category>
+
<name>booking2</name>
<included-projects>
booking,booking-ear,booking-ejb,booking-parent,booking-test
@@ -79,6 +86,7 @@
Requires the m2eclipse and testng plugins
</description>
<size>203639</size>
+
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
</url>
@@ -88,6 +96,7 @@
<category>Seam</category>
<name>booking3</name>
<included-projects>
+
booking,booking-ear,booking-ejb,booking-parent,booking-test
</included-projects>
<shortDescription>Seam Booking Example - EAR mavenized - Seam 2.1.1.GA</shortDescription>
@@ -100,6 +109,7 @@
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
</url>
+
</project>
<project>
@@ -111,6 +121,7 @@
This example can also run in Tomcat with JBoss Embedded.
</description>
<size>5595136</size>
+
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
</url>
@@ -122,6 +133,7 @@
<included-projects>
jboss-seam-jpa,jboss-seam-jpa-test
</included-projects>
+
<shortDescription>Seam Booking Example - WAR Standalone (including a test project)</shortDescription>
<description>This example demonstrates the use of Seam in a Java EE 5 environment.
Transaction and persistence context management is handled by the EJB container.
@@ -135,103 +147,14 @@
</project>
<project>
- <category>Seam</category>
- <name>registration</name>
- <included-projects>
- registration,registration-ejb,registration-ear,registration-test
- </included-projects>
- <shortDescription>Seam Registration Example - EAR (including a test project)</shortDescription>
- <description>This is a trivial example for the Seam tutorial. It runs on both JBoss AS and Tomcat.
-It includes the registration,registration-ejb,registration-ear,registration-test projects.
-</description>
- <size>31657984</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
- </url>
- </project>
-
- <project>
- <category>Seam</category>
- <name>registration2</name>
- <included-projects>
- registration,registration-ejb,registration-ear
- </included-projects>
- <shortDescription>Seam Registration Example - EAR</shortDescription>
- <description>This is a trivial example for the Seam tutorial. It runs on both JBoss AS and Tomcat.
-The example creates the registration,registration-ejb,registration-ear projects.
-It includes a tutorial.
-</description>
- <size>8450048</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
- </url>
- <welcome type="cheatsheets" url="/registration/cheatsheets/registration.xml"/>
- </project>
-
- <project>
- <category>Seam</category>
- <name>messages</name>
- <included-projects>
- messages,messages-ejb,messages-ear
- </included-projects>
- <shortDescription>Seam Messages Example - EAR</shortDescription>
- <description>This is a simple example of the use of @DataModel for the Seam tutorial. It runs on JBoss AS as an EAR.
-The example creates the messages,messages-ejb and messages-ear projects.
-It includes a tutorial.
-</description>
- <size>7680000</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
- </url>
- <welcome type="cheatsheets" url="/messages/cheatsheets/messages.xml"/>
- </project>
-
- <project>
- <category>Seam</category>
- <name>todo</name>
- <included-projects>
- todo,todo-ejb,todo-ear
- </included-projects>
- <shortDescription>Seam and jBPM: the todo list example - EAR</shortDescription>
- <description>This is a simple example for the Seam tutorial, demonstrating the
-use of jBPM-based business process management.
-The example creates the todo,todo-ejb and todo-ear projects.
-It includes a tutorial.
-</description>
- <size>2183168</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
- </url>
- <welcome type="cheatsheets" url="/todo/cheatsheets/todo.xml"/>
- </project>
-
- <project>
- <category>Seam</category>
- <name>numberguess</name>
- <included-projects>
- numberguess,numberguess-ejb,numberguess-ear
- </included-projects>
- <shortDescription>Seam pageflow: the numberguess example - EAR</shortDescription>
- <description>This is a simple example for the Seam tutorial, demonstrating the use of
-jBPM-based page flow. It runs on both JBoss AS as an EAR and Tomcat with
-Embedded JBoss as an EAR.
-The example creates the numberguess,numberguess-ejb and numberguess-ear projects.
-It includes a tutorial.
-</description>
- <size>2203648</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
- </url>
- <welcome type="cheatsheets" url="/numberguess/cheatsheets/numberguess.xml"/>
- </project>
- <project>
<category>Portlet</category>
<name>testjavaportlet</name>
<shortDescription>JBoss Java Portlet Example</shortDescription>
<description>This example demonstrates the use of JBoss Java Portlet. It runs on JBoss Portal 2.7.0.</description>
<size>10000</size>
<url>
+
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...
</url>
<welcome type="cheatsheets" url="/testjavaportlet/javaportletcs.xml"/>
@@ -241,6 +164,7 @@
<category>Portlet</category>
<name>testjsfportlet</name>
<shortDescription>JBoss JSF Portlet Example</shortDescription>
+
<description>This example demonstrates the use of JBoss JSF Portlet. It runs on JBoss Portal 2.7.0.</description>
<size>4000000</size>
<url>
@@ -250,6 +174,7 @@
<project>
<category>Portlet</category>
+
<name>testseamportlet</name>
<shortDescription>JBoss Seam Portlet Example</shortDescription>
<description>This example demonstrates the use of JBoss Seam Portlet. It runs on JBoss Portal 2.7.0.</description>
@@ -257,6 +182,7 @@
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...
</url>
+
</project>
<project>
@@ -266,6 +192,7 @@
<description>This example is to prove that the ESB is is properly configured and happy.
As well as to demonstrate the needed minimal files to make a basic ESB component execute.</description>
<size>59000</size>
+
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/Denny/esb-example/hel...
</url>
@@ -275,6 +202,7 @@
<category>ESB</category>
<name>helloworld_testclient</name>
<shortDescription>JBoss ESB HelloWorld Example - Client</shortDescription>
+
<description>This example is to demonstrate how to invoke the deployed HelloWorld ESB. It requires the helloworld project.</description>
<size>1000000</size>
<url>
@@ -284,6 +212,7 @@
<project>
<category>ESB</category>
+
<name>helloworld_action</name>
<shortDescription>JBoss ESB HelloWorld Action Example - ESB</shortDescription>
<description>This sample is to demonstrate the use of multiple action invocations from a single configuration. You can use
@@ -293,6 +222,7 @@
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/Denny/esb-example/hel...
</url>
+
</project>
<project>
@@ -301,6 +231,7 @@
<shortDescription>JBoss ESB HelloWorld Action Example - Client</shortDescription>
<description>This sample is to test the deployed helloworld_action ESB. It requires the helloworld_action project</description>
<size>18694</size>
+
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/Denny/esb-example/hel...
</url>
@@ -310,6 +241,7 @@
<category>ESB</category>
<name>helloworld_file_action</name>
<shortDescription>JBoss ESB HelloWorld File Action Example - ESB</shortDescription>
+
<description>This is a basic example of using the File gateway feature of the JBoss ESB.
Files that are found in a particular directory with a particular extension
are sent to a JMS queue with actions for processing. Before deploy the project, please change some properties according to the readme.txt file.</description>
@@ -321,6 +253,7 @@
<project>
<category>ESB</category>
+
<name>helloworld_file_action_client</name>
<shortDescription>JBoss ESB HelloWorld File Action Example - Client</shortDescription>
<description>This sample is to test the deployed helloworld_file_action ESB. It requires the helloworld_file_action project.</description>
@@ -328,6 +261,7 @@
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/Denny/esb-example/hel...
</url>
+
</project>
<project>
<category>ESB</category>
@@ -338,6 +272,7 @@
The webservice will return a greeting response. The ESB simply dislays the response on the
console.</description>
<size>22500</size>
+
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/webs...
</url>
@@ -347,6 +282,7 @@
<category>ESB</category>
<name>webservice_consumer1_client</name>
<shortDescription>JBoss ESB Web Service consumer1 Example - Client</shortDescription>
+
<description>This sample is to test the deployed a comsumer web service.It requires the webservice_consumer1 project.</description>
<size>1000000</size>
<url>
@@ -356,6 +292,7 @@
<project>
<category>ESB</category>
+
<name>webservice_producer</name>
<shortDescription>JBoss ESB Web Service producer Example</shortDescription>
<description>This sample demonstrates how to deploy a JSR181 Webservice endpoint on
@@ -364,6 +301,7 @@
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/webs...
</url>
+
</project>
<project>
@@ -371,6 +309,7 @@
<name>webservice_producer_client</name>
<shortDescription>JBoss ESB Web Service producer Example - Client</shortDescription>
<description>This sample is to test the deployed a web service endpoint.It requires the webservice_producer project.</description>
+
<size>14200</size>
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/webs...
@@ -380,6 +319,7 @@
<project>
<category>ESB</category>
<name>transform_CSV2XML</name>
+
<shortDescription>JBoss ESB Smooks CSV->XML Example</shortDescription>
<description>This sample demonstrates how to transform a comma separated value (CSV) file to an xml.
The tranformation is done by configuring Smooks and performing two transformation, one
@@ -397,6 +337,7 @@
<shortDescription>JBoss ESB Smooks CSV->XML Example - Client</shortDescription>
<description>This sample is to test the JBoss ESB smooks CSV->XML transformation.It requires the transform_CSV2XML project.</description>
<size>16600</size>
+
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
</url>
@@ -406,6 +347,7 @@
<category>ESB</category>
<name>transform_XML2POJO</name>
<shortDescription>JBoss ESB Smooks XML->POJO Example</shortDescription>
+
<description>The purpose of the simple_transformation sample is to illustrate the
use of Smooks performing a simple transformation by converting a XML file into
Java POJOs.</description>
@@ -417,6 +359,7 @@
<project>
<category>ESB</category>
+
<name>transform_XML2POJO_client</name>
<shortDescription>JBoss ESB Smooks XML->POJO Example - Client</shortDescription>
<description>This sample is to test the JBoss ESB smooks XML->POJO transformation.It requires the transform_XML2POJO project.</description>
@@ -424,6 +367,7 @@
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
</url>
+
</project>
<project>
@@ -440,6 +384,7 @@
SampleOrder date field (see OrderDate.java) and use XSLT for what it's good at
i.e. Templating. Again, the transformed SampleOrder.xml message is just
printed to the Java console (message before and after).</description>
+
<size>13600</size>
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
@@ -449,6 +394,7 @@
<project>
<category>ESB</category>
<name>transform_XML2XML_date_manipulation_client</name>
+
<shortDescription>JBoss ESB Smooks XML->XML date-manipulation Example - Client</shortDescription>
<description>This sample is to test the JBoss ESB XML->XML date-manipulation transformation.It requires the transform_XML2XML_date_manipulation project.</description>
<size>18600</size>
@@ -465,6 +411,7 @@
Transformation within JBoss ESB. It applies a very simple XSLT to a
SampleOrder.xml message and prints the before and after XML to the console.</description>
<size>6700</size>
+
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/grid/esb-example/tran...
</url>
@@ -474,6 +421,7 @@
<category>ESB</category>
<name>transform_XML2XML_simple_client</name>
<shortDescription>JBoss ESB Smooks XML->XML Example - Client</shortDescription>
+
<description>This sample is to test the JBoss ESB XML->XML transformation.It requires the transform_XML2XML_simple project.</description>
<size>17800</size>
<url>
@@ -482,12 +430,14 @@
</project>
<project>
<category>RichFaces</category>
+
<name>RichFaces 3.2.2.SP1 Demo Application for JBoss AS 4.2.X</name>
<included-projects>richfaces-demo</included-projects>
<shortDescription>RichFaces 3.2.2.SP1 Demo Application - WAR</shortDescription>
<description>This example contains RichFaces 3.2.2.SP1 Demo Application</description>
<size>10640749</size>
<url>
+
http://anonsvn.jboss.org/repos/jbosstools/workspace/dgolovin/examples/rf/...
</url>
</project>
@@ -498,6 +448,7 @@
<included-projects>
simple
</included-projects>
+
<shortDescription>RESTEasy Simple Example</shortDescription>
<description>This project is a simple example showing usage of @Path, @GET, PUT, POST, and @PathParam. It uses pure streaming output and includes the 'simple' project.
Requires m2eclipse >= 0.9.7.20081001-2217. You can install it using the following update site: http://m2eclipse.sonatype.org/update-dev/
@@ -508,3 +459,4 @@
</url>
</project>
</projects>
+
Added: workspace/examples/projectExamplesTest.xml
===================================================================
--- workspace/examples/projectExamplesTest.xml (rev 0)
+++ workspace/examples/projectExamplesTest.xml 2009-08-23 00:58:13 UTC (rev 17230)
@@ -0,0 +1,312 @@
+<projects>
+
+ <project>
+ <category>Seam</category>
+ <name>dvdstoreall</name>
+ <included-projects>
+ dvdstore,dvdstore-ear,dvdstore-ejb
+ </included-projects>
+ <shortDescription>Seam DVD Store Example - EAR</shortDescription>
+ <description>This example demonstrates the use of Seam with jBPM pageflow and business process management. It includes the dvdstore,dvdstore-ear and dvdstore-ejb projects.
+ </description>
+ <size>7071000</size>
+ <url>
+ file:///e:/aliaksey/dvdstoreall.zip
+ </url>
+ <site>Test</site>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>dvdstoreall2</name>
+ <included-projects>
+ dvdstore,dvdstore-ear,dvdstore-ejb,dvdstore-test
+ </included-projects>
+ <shortDescription>Seam DVD Store Example - EAR (including a test project)</shortDescription>
+ <description>This example demonstrates the use of Seam with jBPM pageflow and business process management. It includes the dvdstore,dvdstore-ear,dvdstore-test and dvdstore-ejb projects.
+ </description>
+ <size>30380032</size>
+ <url>
+ file:///e:/aliaksey/dvdstoreall2.zip
+ </url>
+ <site>Test</site>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>jboss-seam-jpa</name>
+ <shortDescription>Seam Booking Example - WAR Standalone</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+This example can also run in Tomcat with JBoss Embedded.
+</description>
+ <size>5491000</size>
+ <url>
+ file:///e:/aliaksey/jboss-seam-jpa.zip
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>booking</name>
+ <included-projects>
+ booking,booking-ear,booking-ejb
+ </included-projects>
+ <shortDescription>Seam Booking Example - EAR</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+This example can also run in Tomcat with JBoss Embedded.
+It includes the booking, booking-ear and booking-ejb projects.
+</description>
+ <size>8127000</size>
+ <url>
+ file:///e:/aliaksey/bookingall.zip
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>booking2</name>
+ <included-projects>
+ booking,booking-ear,booking-ejb,booking-test
+ </included-projects>
+ <shortDescription>Seam Booking Example - EAR (including a test project)</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+This example can also run in Tomcat with JBoss Embedded.
+It includes the booking, booking-ear,booking-test and booking-ejb projects.
+</description>
+ <size>36036608</size>
+ <url>
+ file:///e:/aliaksey/bookingall2.zip
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>booking2</name>
+ <included-projects>
+ booking,booking-ear,booking-ejb,booking-parent
+ </included-projects>
+ <shortDescription>Seam Booking Example - EAR mavenized</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+It includes the booking, booking-ear, booking-ejb and booking-parent projects.
+Requires the m2eclipse and testng plugins.
+</description>
+ <size>196608</size>
+ <url>
+ file:///e:/aliaksey/booking-mavenized.zip
+ </url>
+ </project>
+ <project>
+ <category>Seam</category>
+ <name>booking-2.1.1-mavenized</name>
+ <included-projects>
+ booking,booking-ear,booking-ejb,booking-parent,booking-test
+ </included-projects>
+ <shortDescription>Seam Booking Example 2.1.1 - EAR mavenized with test</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+It includes the booking, booking-ear, booking-ejb, booking-test and booking-parent projects.
+Requires m2eclipse dev and testng plugins
+</description>
+ <size>196608</size>
+ <url>
+ file:///e:/aliaksey/booking-mavenized-2.1.1.zip
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>registration</name>
+ <included-projects>
+ registration,registration-ejb,registration-ear,registration-test
+ </included-projects>
+ <shortDescription>Seam Registration Example - EAR (including a test project)</shortDescription>
+ <description>This is a trivial example for the Seam tutorial. It runs on both JBoss AS and Tomcat.
+It includes the registration,registration-ejb,registration-ear,registration-test projects.
+</description>
+ <size>31657984</size>
+ <url>
+ file:///e:/aliaksey/registration.zip
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>registration2</name>
+ <included-projects>
+ registration,registration-ejb,registration-ear
+ </included-projects>
+ <shortDescription>Seam Registration Example - EAR</shortDescription>
+ <description>This is a trivial example for the Seam tutorial. It runs on both JBoss AS and Tomcat.
+The example creates the registration,registration-ejb,registration-ear projects.
+It includes a tutorial.
+</description>
+ <size>8450048</size>
+ <url>
+ file:///e:/aliaksey/registration2.zip
+ </url>
+ <welcome type="cheatsheets" url="/registration/cheatsheets/registration.xml"/>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>messages</name>
+ <included-projects>
+ messages,messages-ejb,messages-ear
+ </included-projects>
+ <shortDescription>Seam Messages Example - EAR</shortDescription>
+ <description>This is a simple example of the use of @DataModel for the Seam tutorial. It runs on JBoss AS as an EAR.
+The example creates the messages,messages-ejb,messages-ear projects.
+It includes a tutorial.
+</description>
+ <size>7680000</size>
+ <url>
+ file:///e:/aliaksey/messages.zip
+ </url>
+ <welcome type="cheatsheets" url="/messages/cheatsheets/messages.xml"/>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>todo</name>
+ <included-projects>
+ todo,todo-ejb,todo-ear
+ </included-projects>
+ <shortDescription>Seam and jBPM: the todo list example - EAR</shortDescription>
+ <description>This is a simple example for the Seam tutorial, demonstrating the
+use of jBPM-based business process management.
+The example creates the todo,todo-ejb,todo-ear projects.
+It includes a tutorial.
+</description>
+ <size>2183168</size>
+ <url>
+ file:///e:/aliaksey/todo.zip
+ </url>
+ <welcome type="cheatsheets" url="/todo/cheatsheets/todo.xml"/>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>numberguess</name>
+ <included-projects>
+ numberguess,numberguess-ejb,numberguess-ear
+ </included-projects>
+ <shortDescription>Seam pageflow: the numberguess example - EAR</shortDescription>
+ <description>This is a simple example for the Seam tutorial, demonstrating the use of
+jBPM-based page flow. It runs on both JBoss AS as an EAR and Tomcat with
+Embedded JBoss as an EAR.
+The example creates the numberguess,numberguess-ejb and numberguess-ear projects.
+It includes a tutorial.
+</description>
+ <size>2203648</size>
+ <url>
+ file:///e:/aliaksey/numberguess.zip
+ </url>
+ <welcome type="cheatsheets" url="/numberguess/cheatsheets/numberguess.xml"/>
+ </project>
+
+ <project>
+ <category>Portlet</category>
+ <name>testjavaportlet</name>
+ <shortDescription>JBoss Java Portlet Example CHEATSHEETS</shortDescription>
+ <description>This example demonstrates the use of JBoss Java Portlet. It runs on JBoss Portal 2.7.0.</description>
+ <size>10000</size>
+ <url>
+ file:///e:/aliaksey/testjavaportlet.zip
+ </url>
+ <welcome type="cheatsheets" url="/testjavaportlet/javaportletcs.xml"/>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>jboss-seam-jpa</name>
+ <shortDescription>Seam Booking Example - WAR Standalone</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+This example can also run in Tomcat with JBoss Embedded.
+</description>
+ <size>5491000</size>
+ <url>
+ file:///e:/aliaksey/jboss-seam-jpa.zip
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>jboss-seam-jpa2</name>
+ <included-projects>
+ jboss-seam-jpa,jboss-seam-jpa-test
+ </included-projects>
+ <shortDescription>Seam Booking Example - WAR Standalone (including a test project)</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+This example can also run in Tomcat with JBoss Embedded.
+It includes the jboss-seam-jpa and jboss-seam-jpa-test projects.
+</description>
+ <size>33357824</size>
+ <url>
+ file:///e:/aliaksey/jboss-seam-jpa2.zip
+ </url>
+ </project>
+
+ <project>
+ <category>Portlet</category>
+ <name>TestJSFPortlet</name>
+ <shortDescription>JBoss JSF Portlet Example</shortDescription>
+ <description>This example demonstrates the use of JBoss JSF Portlet. It runs on JBoss Portal 2.7.0.</description>
+ <size>4000000</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...
+ </url>
+ </project>
+
+ <project>
+ <category>Portlet</category>
+ <name>TestSeamPortlet</name>
+ <shortDescription>JBoss Seam Portlet Example</shortDescription>
+ <description>This example demonstrates the use of JBoss Seam Portlet. It runs on JBoss Portal 2.7.0.</description>
+ <size>10000000</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/portlet-exampl...
+ </url>
+ </project>
+
+ <project>
+ <category>RESTEasy</category>
+ <name>simple</name>
+ <included-projects>
+ simple
+ </included-projects>
+ <shortDescription>RESTEasy Simple Example</shortDescription>
+ <description>This project is a simple example showing usage of @Path, @GET, PUT, POST, and @PathParam. It uses pure streaming output and includes the 'simple' project.
+Requires m2eclipse >= 0.9.7.20081001-2217. You can install it using the following update site: http://m2eclipse.sonatype.org/update-dev/
+ </description>
+ <size>16939</size>
+ <url>
+ file:///e:/aliaksey/resteasySimple.zip
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>booking3</name>
+ <included-projects>
+ booking,booking-ear,booking-ejb,booking-test
+ </included-projects>
+ <shortDescription>Seam Booking Example - EAR (including a tutorial)</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+This example can also run in Tomcat with JBoss Embedded.
+It includes the booking, booking-ear,booking-test and booking-ejb projects.
+</description>
+ <size>36036608</size>
+ <url>
+ file:///e:/aliaksey/bookingall3.zip
+ </url>
+ <welcome type="cheatsheets" url="/booking/cheatsheets/booking.xml"/>
+ </project>
+
+</projects>
\ No newline at end of file
16 years, 8 months
JBoss Tools SVN: r17229 - workspace/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-08-22 20:45:28 -0400 (Sat, 22 Aug 2009)
New Revision: 17229
Modified:
workspace/examples/project-examples-3.0.xml
workspace/examples/project-examples-3.1.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4594 Add Project Examples that will work with EAP 5.0
Modified: workspace/examples/project-examples-3.0.xml
===================================================================
--- workspace/examples/project-examples-3.0.xml 2009-08-22 18:07:26 UTC (rev 17228)
+++ workspace/examples/project-examples-3.0.xml 2009-08-23 00:45:28 UTC (rev 17229)
@@ -224,21 +224,6 @@
</url>
<welcome type="cheatsheets" url="/numberguess/cheatsheets/numberguess.xml"/>
</project>
-
- <project>
- <category>Seam</category>
- <name>photoalbum</name>
- <included-projects>
- photoalbum,photoalbum-ear,photoalbum-ejb
- </included-projects>
- <shortDescription>PhotoAlbum - EAR (RichFaces 3.3.1.GA, Seam 2.2.0.CR1)</shortDescription>
- <description>This example demonstrates the use of RichFaces components. It includes the photoalbum,photoalbum-ear and photoalbum-ejb projects.
- </description>
- <size>25833472</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
- </url>
- </project>
<project>
<category>Portlet</category>
Modified: workspace/examples/project-examples-3.1.xml
===================================================================
--- workspace/examples/project-examples-3.1.xml 2009-08-22 18:07:26 UTC (rev 17228)
+++ workspace/examples/project-examples-3.1.xml 2009-08-23 00:45:28 UTC (rev 17229)
@@ -123,4 +123,19 @@
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
</url>
</project>
+
+ <project>
+ <category>Seam</category>
+ <name>photoalbum</name>
+ <included-projects>
+ photoalbum,photoalbum-ear,photoalbum-ejb
+ </included-projects>
+ <shortDescription>PhotoAlbum - EAR (RichFaces 3.3.1.GA, Seam 2.2.0.CR1)</shortDescription>
+ <description>This example demonstrates the use of RichFaces components. It includes the photoalbum,photoalbum-ear and photoalbum-ejb projects.
+ </description>
+ <size>25833472</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
+ </url>
+ </project>
</projects>
16 years, 8 months
JBoss Tools SVN: r17228 - trunk/maven/plugins/org.jboss.tools.maven.seam/poms and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-08-22 14:07:26 -0400 (Sat, 22 Aug 2009)
New Revision: 17228
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
trunk/maven/plugins/org.jboss.tools.maven.seam/poms/parent-pom.xml
trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java
workspace/snjeza/seam-examples/booking-mavenized-2.1.1.zip
Log:
https://jira.jboss.org/jira/browse/JBIDE-4655 Mavenized Project Examples and Seam Web Project wizard with JBoss Maven Integration facet don't work when using WTP 3.1
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2009-08-21 20:24:00 UTC (rev 17227)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2009-08-22 18:07:26 UTC (rev 17228)
@@ -136,9 +136,15 @@
}
if (!project.exists()) {
if (location != null) {
- IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName());
- desc.setLocation(location);
- project.create(desc, monitor);
+ IPath workspacePath = project.getWorkspace().getRoot().getLocation();
+ location = location.makeRelativeTo(workspacePath);
+ if (projectName.equals(location.toString())) {
+ project.create(monitor);
+ } else {
+ IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName());
+ desc.setLocation(location);
+ project.create(desc, monitor);
+ }
} else {
project.create(monitor);
}
@@ -381,22 +387,25 @@
Xpp3Dom modules = new Xpp3Dom("modules"); //$NON-NLS-1$
configuration.addChild(modules);
+ String ejbModuleName = m2FacetModel.getStringProperty(IJBossMavenConstants.ARTIFACT_ID) + "-ejb.jar"; //$NON-NLS-1$
Xpp3Dom ejbProject = getEarModule(
"ejbModule", //$NON-NLS-1$
m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID),
m2FacetModel.getStringProperty(IJBossMavenConstants.ARTIFACT_ID)
- + "-ejb", "/"); //$NON-NLS-1$ //$NON-NLS-2$
+ + "-ejb", "/", ejbModuleName ); //$NON-NLS-1$ //$NON-NLS-2$
modules.addChild(ejbProject);
Xpp3Dom seamModule = getEarModule("ejbModule", "org.jboss.seam", //$NON-NLS-1$ //$NON-NLS-2$
- "jboss-seam", "/"); //$NON-NLS-1$ //$NON-NLS-2$
+ "jboss-seam", "/", null); //$NON-NLS-1$ //$NON-NLS-2$
modules.addChild(seamModule);
+ String webModuleName = m2FacetModel.getStringProperty(IJBossMavenConstants.ARTIFACT_ID) + ".war"; //$NON-NLS-1$
+
Xpp3Dom webProject = getEarModule(
"webModule", //$NON-NLS-1$
m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID),
m2FacetModel.getStringProperty(IJBossMavenConstants.ARTIFACT_ID),
- "/"); //$NON-NLS-1$
+ "/", webModuleName); //$NON-NLS-1$
Xpp3Dom contextRoot = new Xpp3Dom("contextRoot"); //$NON-NLS-1$
contextRoot.setValue(m2FacetModel
.getStringProperty(IJBossMavenConstants.ARTIFACT_ID));
@@ -404,11 +413,11 @@
modules.addChild(webProject);
Xpp3Dom richFacesApi = getEarModule("jarModule", //$NON-NLS-1$
- "org.richfaces.framework", "richfaces-api", "/lib"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "org.richfaces.framework", "richfaces-api", "/lib", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
modules.addChild(richFacesApi);
Xpp3Dom commonDigester = getEarModule("jarModule", //$NON-NLS-1$
- "commons-digester", "commons-digester", "/lib"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "commons-digester", "commons-digester", "/lib", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
modules.addChild(commonDigester);
}
plugin.setConfiguration(configuration);
@@ -419,7 +428,7 @@
}
private static Xpp3Dom getEarModule(String module,
- String groupIdString,String artifactIdString, String bundleDirString) {
+ String groupIdString,String artifactIdString, String bundleDirString, String bundleFileNameString) {
Xpp3Dom earModule = new Xpp3Dom(module);
//modules.addChild(earModule);
Xpp3Dom groupId = new Xpp3Dom("groupId"); //$NON-NLS-1$
@@ -431,6 +440,12 @@
Xpp3Dom bundleDir = new Xpp3Dom("bundleDir"); //$NON-NLS-1$
bundleDir.setValue(bundleDirString);
earModule.addChild(bundleDir);
+ if (bundleFileNameString != null) {
+ Xpp3Dom bundleFileName = new Xpp3Dom("bundleFileName"); //$NON-NLS-1$
+ bundleFileName.setValue(bundleFileNameString);
+ earModule.addChild(bundleFileName);
+
+ }
return earModule;
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/poms/parent-pom.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/poms/parent-pom.xml 2009-08-21 20:24:00 UTC (rev 17227)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/poms/parent-pom.xml 2009-08-22 18:07:26 UTC (rev 17228)
@@ -433,6 +433,7 @@
</configuration>
</plugin>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
</plugin>
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java 2009-08-21 20:24:00 UTC (rev 17227)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/src/org/jboss/tools/maven/seam/MavenSeamActivator.java 2009-08-22 18:07:26 UTC (rev 17228)
@@ -286,7 +286,7 @@
dependency.setArtifactId(ejbProjectName);
dependency.setVersion(m2FacetModel.getStringProperty(IJBossMavenConstants.VERSION));
dependency.setType("ejb");
- dependency.setScope("compile");
+ dependency.setScope("runtime");
dependencies.add(dependency);
dependency = new Dependency();
@@ -294,7 +294,7 @@
dependency.setArtifactId(webProjectName);
dependency.setVersion(m2FacetModel.getStringProperty(IJBossMavenConstants.VERSION));
dependency.setType("war");
- dependency.setScope("compile");
+ dependency.setScope("runtime");
dependencies.add(dependency);
dependency = getSeamDependency();
@@ -373,7 +373,7 @@
model.setBuild(build);
MavenCoreActivator.createMavenProject(earProjectName, null, model, true);
removeWTPContainers(m2FacetModel, project);
- configureApplicationXml(project, m2FacetModel, null);
+ // configureApplicationXml(project, m2FacetModel, null);
//removeRuntime(project);
//IProject ejbProject = ResourcesPlugin.getWorkspace().getRoot().getProject(ejbProjectName);
//removeRuntime(ejbProject);
@@ -558,6 +558,8 @@
dependency = new Dependency();
dependency.setGroupId("org.jboss.seam");
dependency.setArtifactId("jboss-seam-debug");
+ // FIXME
+ dependency.setVersion("${seam.version}");
modelManager.addDependency(pomFile,dependency);
Modified: workspace/snjeza/seam-examples/booking-mavenized-2.1.1.zip
===================================================================
(Binary files differ)
16 years, 8 months
JBoss Tools SVN: r17227 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-08-21 16:24:00 -0400 (Fri, 21 Aug 2009)
New Revision: 17227
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/Facelets.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4776
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/Facelets.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/Facelets.xml 2009-08-21 20:00:09 UTC (rev 17226)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/taglibs/Facelets.xml 2009-08-21 20:24:00 UTC (rev 17227)
@@ -172,10 +172,10 @@
The remove tag is often used in conjunction with the jsfc feature.</description>
</component>
<component name="repeat" extended="false">
- <attribute name="value" required="true">
+ <attribute extended="false" name="value" required="true">
<description>Expression for the list of items</description>
</attribute>
- <attribute name="var" required="true">
+ <attribute extended="false" name="var" required="true">
<description>The name of the variable to put the current item.</description>
</attribute>
<attribute extended="false" name="offset">
16 years, 8 months
JBoss Tools SVN: r17226 - in trunk/jst/plugins: org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-08-21 16:00:09 -0400 (Fri, 21 Aug 2009)
New Revision: 17226
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4776
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2009-08-21 16:05:00 UTC (rev 17225)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2009-08-21 20:00:09 UTC (rev 17226)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.jsp.contentassist;
+import java.util.List;
import java.util.Map;
import org.eclipse.jface.text.IRegion;
@@ -80,9 +81,12 @@
.getExistingModelForRead(getDocument());
if (superContext != null) {
IRegion region = new Region (0, getDocument().getLength());
- Map<String, INameSpace> nameSpaces = superContext.getNameSpaces(getOffset());
- for (String prefix : nameSpaces.keySet()) {
- context.addNameSpace(region, nameSpaces.get(prefix));
+ Map<String, List<INameSpace>> nameSpaces = superContext.getNameSpaces(getOffset());
+ for (String uri : nameSpaces.keySet()) {
+ List<INameSpace> ns = nameSpaces.get(uri);
+ for (INameSpace n : ns) {
+ context.addNameSpace(region, n);
+ }
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2009-08-21 16:05:00 UTC (rev 17225)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2009-08-21 20:00:09 UTC (rev 17226)
@@ -139,7 +139,7 @@
* @return
*/
public ITagLibrary[] getTagLibraries(IPageContext context) {
- Map<String, INameSpace> nameSpaces = context.getNameSpaces(getOffset());
+ Map<String, List<INameSpace>> nameSpaces = context.getNameSpaces(getOffset());
if (nameSpaces == null || nameSpaces.isEmpty())
return EMPTY_LIBRARIES;
@@ -148,11 +148,13 @@
return EMPTY_LIBRARIES;
List<ITagLibrary> tagLibraries = new ArrayList<ITagLibrary>();
- for (INameSpace nameSpace : nameSpaces.values()) {
- ITagLibrary[] libs = TagLibriryManager.getLibraries(project, nameSpace.getURI());
- if (libs != null && libs.length > 0) {
- for (ITagLibrary lib : libs) {
- tagLibraries.add(lib);
+ for (List<INameSpace> nameSpace : nameSpaces.values()) {
+ for (INameSpace n : nameSpace) {
+ ITagLibrary[] libs = TagLibriryManager.getLibraries(project, n.getURI());
+ if (libs != null && libs.length > 0) {
+ for (ITagLibrary lib : libs) {
+ tagLibraries.add(lib);
+ }
}
}
}
@@ -210,7 +212,7 @@
if (name.indexOf(':') == -1) return;
String prefix = name.substring(0, name.indexOf(':'));
- Map<String, INameSpace> ns = context.getNameSpaces(node.getStartOffset());
+ Map<String, List<INameSpace>> ns = context.getNameSpaces(node.getStartOffset());
if (!containsPrefix(ns, prefix)) return;
NamedNodeMap attributes = node.getAttributes();
@@ -222,15 +224,15 @@
list.add(new ResourceBundle(basename, var));
}
- private boolean containsPrefix(Map<String, INameSpace> ns, String prefix) {
- for (INameSpace n: ns.values()) {
- if(prefix.equals(n.getPrefix())) return true;
+ private boolean containsPrefix(Map<String, List<INameSpace>> ns, String prefix) {
+ for (List<INameSpace> n: ns.values()) {
+ for (INameSpace nameSpace : n) {
+ if(prefix.equals(nameSpace.getPrefix())) return true;
+ }
}
return false;
}
-
-
/**
* Returns the <code>org.jboss.tools.common.el.core.resolver.ELContext</code> instance
*
@@ -254,13 +256,15 @@
if (prefix == null || prefix.length() == 0)
return null;
- Map<String, INameSpace> nameSpaces = getContext().getNameSpaces(getOffset());
+ Map<String, List<INameSpace>> nameSpaces = getContext().getNameSpaces(getOffset());
if (nameSpaces == null || nameSpaces.isEmpty())
return null;
- for (INameSpace nameSpace : nameSpaces.values()) {
- if (prefix.equals(nameSpace.getPrefix())) {
- return nameSpace.getURI();
+ for (List<INameSpace> nameSpace : nameSpaces.values()) {
+ for (INameSpace n : nameSpace) {
+ if (prefix.equals(n.getPrefix())) {
+ return n.getURI();
+ }
}
}
return null;
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-08-21 16:05:00 UTC (rev 17225)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-08-21 20:00:09 UTC (rev 17226)
@@ -770,8 +770,8 @@
ValueHelper valueHelper = new ValueHelper();
processor = valueHelper.createContentAssistProcessor();
pageContext = valueHelper.createPageContext(processor, query.getOffset());
- Map<String,INameSpace> ns = pageContext.getNameSpaces(query.getOffset());
- INameSpace n = ns.get(query.getUri());
+ Map<String, List<INameSpace>> ns = pageContext.getNameSpaces(query.getOffset());
+ List<INameSpace> n = ns.get(query.getUri());
if(n == null && pageContext instanceof JspContextImpl) {
IRegion r = new Region(query.getOffset(), 0);
((JspContextImpl)pageContext).addNameSpace(r, new NameSpace(query.getUri(), query.getPrefix()));
@@ -796,7 +796,7 @@
if(prefix == null || prefix.length() == 0) return c.getName();
return prefix + ":" + c.getName(); //$NON-NLS-1$
}
-
+
public boolean canHaveBody() {
IComponent c = findComponent(query);
return c != null && c.canHaveBody();
@@ -837,9 +837,9 @@
}
public String getPrefix(KbQuery query) {
- Map<String,INameSpace> ns = pageContext.getNameSpaces(query.getOffset());
- INameSpace n = ns.get(query.getUri());
- return n == null ? null : n.getPrefix();
+ Map<String,List<INameSpace>> ns = pageContext.getNameSpaces(query.getOffset());
+ List<INameSpace> n = ns.get(query.getUri());
+ return n == null || n.isEmpty() ? null : n.get(0).getPrefix();
}
public TagAttributesComposite.AttributeDescriptorValue[] createDescriptors(KbQuery query) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java 2009-08-21 16:05:00 UTC (rev 17225)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java 2009-08-21 20:00:09 UTC (rev 17226)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb;
+import java.util.List;
import java.util.Map;
import org.eclipse.jface.text.IDocument;
@@ -54,5 +55,5 @@
* Key is URI of name space.
* @return
*/
- Map<String, INameSpace> getNameSpaces(int offset);
+ Map<String, List<INameSpace>> getNameSpaces(int offset);
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-08-21 16:05:00 UTC (rev 17225)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-08-21 20:00:09 UTC (rev 17226)
@@ -10,7 +10,9 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -78,10 +80,10 @@
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.IPageContext#getNameSpaces(int)
*/
- public Map<String, INameSpace> getNameSpaces(int offset) {
- Map<String, INameSpace> result = new HashMap<String, INameSpace>();
+ public Map<String, List<INameSpace>> getNameSpaces(int offset) {
+ Map<String, List<INameSpace>> result = new HashMap<String, List<INameSpace>>();
Map<INameSpace, IRegion> namespaceToRegions = new HashMap<INameSpace, IRegion>();
-
+
for (IRegion region : nameSpaces.keySet()) {
if(offset>=region.getOffset() && offset<=region.getOffset() + region.getLength()) {
Map<String, INameSpace> namespaces = nameSpaces.get(region);
@@ -105,12 +107,17 @@
}
for (INameSpace ns : namespaceToRegions.keySet()) {
- result.put(ns.getURI(), ns);
+ List<INameSpace> list = result.get(ns.getURI());
+ if(list==null) {
+ list = new ArrayList<INameSpace>();
+ }
+ list.add(ns);
+ result.put(ns.getURI(), list);
}
-
+
return result;
}
-
+
private INameSpace findNameSpaceByPrefix(Set<INameSpace> namespaces, String prefix) {
if (namespaces != null && prefix != null) {
for (INameSpace ns : namespaces) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-08-21 16:05:00 UTC (rev 17225)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-08-21 20:00:09 UTC (rev 17226)
@@ -102,27 +102,82 @@
* @see org.jboss.tools.jst.web.kb.taglib.ITagLibrary#getComponents(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.PageContext)
*/
public IComponent[] getComponents(KbQuery query, IPageContext context) {
- String prefix = getPrefix(query, context);
- return getComponents(query, prefix, context);
+ List<String> prefixes = getPrefixes(query, context);
+ return getComponentsByPrefixes(query, prefixes, context);
}
- protected String getPrefix(KbQuery query, IPageContext context) {
- String prefix = null;
- Map<String, INameSpace> nameSpaces = context.getNameSpaces(query.getOffset());
+ protected List<String> getPrefixes(KbQuery query, IPageContext context) {
+ List<String> prefixes = new ArrayList<String>();
+ Map<String, List<INameSpace>> nameSpaces = context.getNameSpaces(query.getOffset());
if(nameSpaces!=null) {
- INameSpace nameSpace = nameSpaces.get(getURI());
+ List<INameSpace> nameSpace = nameSpaces.get(getURI());
if(nameSpace!=null) {
- prefix = nameSpace.getPrefix();
- if(prefix!=null && prefix.length()==0) {
- prefix = null;
+ for (INameSpace n : nameSpace) {
+ String sPrefix = n.getPrefix();
+ if(sPrefix!=null && sPrefix.length()>0) {
+ String fullTagName = null;
+ boolean mask = false;
+ if(query.getType()==KbQuery.Type.TAG_NAME || query.getType()==KbQuery.Type.TEXT) {
+ fullTagName = query.getValue();
+ mask = query.isMask();
+ } else {
+ fullTagName = query.getLastParentTag();
+ }
+ if(fullTagName == null) {
+ prefixes.add(sPrefix);
+ continue;
+ }
+ String tagName = fullTagName;
+ int prefixIndex = fullTagName.indexOf(':');
+ String queryPrefix = null;
+ if(prefixIndex>-1) {
+ queryPrefix = fullTagName.substring(0, prefixIndex);
+ if(prefixIndex<fullTagName.length()-1) {
+ tagName = fullTagName.substring(prefixIndex+1);
+ } else {
+ tagName = null;
+ }
+ }
+ if(mask && prefixIndex<0) {
+ if(ignoreCase) {
+ if(sPrefix.toLowerCase().startsWith(tagName.toLowerCase())) {
+ prefixes.add(sPrefix);
+ }
+ } else if(sPrefix.startsWith(tagName)) {
+ prefixes.add(sPrefix);
+ }
+ } else if(sPrefix.equals(queryPrefix)) {
+ prefixes.add(sPrefix);
+ }
+ }
}
}
}
- return prefix;
+ return prefixes;
}
private static final IComponent[] EMPTY_ARRAY = new IComponent[0];
+ protected IComponent[] getComponentsByPrefixes(KbQuery query, List<String> prefixes, IPageContext context) {
+ if(prefixes==null) {
+ return getComponents(query, null, context);
+ }
+ if(prefixes.size()==0) {
+ return EMPTY_ARRAY;
+ }
+ if(prefixes.size()==1) {
+ return getComponents(query, prefixes.get(0), context);
+ }
+ List<IComponent> components = new ArrayList<IComponent>();
+ for (String prefix : prefixes) {
+ IComponent[] cps = getComponents(query, prefix, context);
+ for (IComponent c : cps) {
+ components.add(c);
+ }
+ }
+ return components.toArray(new IComponent[0]);
+ }
+
protected IComponent[] getComponents(KbQuery query, String prefix, IPageContext context) {
String fullTagName = null;
boolean mask = false;
@@ -334,13 +389,19 @@
* @see org.jboss.tools.jst.web.kb.ProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.PageContext)
*/
public TextProposal[] getProposals(KbQuery query, IPageContext context) {
- String prefix = getPrefix(query, context);
+ List<String> prefixes = getPrefixes(query, context);
List<TextProposal> proposals = new ArrayList<TextProposal>();
- IComponent[] components = getComponents(query, prefix, context);
+ IComponent[] components = getComponentsByPrefixes(query, prefixes, context);
if(query.getType() == KbQuery.Type.TAG_NAME || query.getType() == KbQuery.Type.TEXT) {
for (int i = 0; i < components.length; i++) {
if(!(components[i] instanceof CustomComponentExtension)) {
- proposals.add(getProposal(prefix, components[i]));
+ if(prefixes==null) {
+ proposals.add(getProposal(null, components[i]));
+ } else {
+ for (String prefix : prefixes) {
+ proposals.add(getProposal(prefix, components[i]));
+ }
+ }
}
}
} else {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java 2009-08-21 16:05:00 UTC (rev 17225)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java 2009-08-21 20:00:09 UTC (rev 17226)
@@ -39,7 +39,7 @@
List<TextProposal> proposals = new ArrayList<TextProposal>();
for (int i = 0; i < params.length; i++) {
String text = params[i].getValue();
- if(text.startsWith(query.getValue())) {
+ if(text.startsWith(query.getValue())) {
TextProposal proposal = new TextProposal();
proposal.setLabel(text);
proposal.setReplacementString(text);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java 2009-08-21 16:05:00 UTC (rev 17225)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java 2009-08-21 20:00:09 UTC (rev 17226)
@@ -56,19 +56,21 @@
return EMPTY_PROPOSAL_LIST;
}
proposals = new ArrayList<TextProposal>();
- Map<String, String> prefixes = new HashMap<String, String>();
+ Map<String, List<String>> prefixes = new HashMap<String, List<String>>();
for (int i = 0; i < components.length; i++) {
ITagLibrary lib = components[i].getTagLib();
if(ignoreTagLib(lib)) {
continue;
}
- String prefix = prefixes.get(lib.getURI());
- if(prefix==null) {
- prefix = getPrefix(context, components[i], kbQuery);
- prefixes.put(lib.getURI(), prefix);
+ List<String> pfx = prefixes.get(lib.getURI());
+ if(pfx==null) {
+ pfx = getPrefixes(context, components[i], kbQuery);
+ prefixes.put(lib.getURI(), pfx);
}
- TextProposal proposal = getProposal(prefix, components[i]);
- proposals.add(proposal);
+ for (String prefix : pfx) {
+ TextProposal proposal = getProposal(prefix, components[i]);
+ proposals.add(proposal);
+ }
}
return proposals.toArray(new TextProposal[0]);
}
@@ -91,16 +93,18 @@
return proposal;
}
- private String getPrefix(IPageContext context, IComponent component, KbQuery query) {
- String prefix = null;
- Map<String, INameSpace> nameSpaces = context.getNameSpaces(query.getOffset());
+ private List<String> getPrefixes(IPageContext context, IComponent component, KbQuery query) {
+ List<String> prefixes = new ArrayList<String>();
+ Map<String, List<INameSpace>> nameSpaces = context.getNameSpaces(query.getOffset());
if(nameSpaces!=null) {
- INameSpace nameSpace = nameSpaces.get(component.getTagLib().getURI());
+ List<INameSpace> nameSpace = nameSpaces.get(component.getTagLib().getURI());
if(nameSpace!=null) {
- prefix = nameSpace.getPrefix();
+ for (INameSpace n : nameSpace) {
+ prefixes.add(n.getPrefix());
+ }
}
}
- return prefix;
+ return prefixes;
}
/* (non-Javadoc)
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java 2009-08-21 16:05:00 UTC (rev 17225)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/HTMLTagLibrary.java 2009-08-21 20:00:09 UTC (rev 17226)
@@ -67,6 +67,15 @@
/*
* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.AbstractTagLib#getPrefixes(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ @Override
+ protected List<String> getPrefixes(KbQuery query, IPageContext context) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.internal.taglib.CustomTagLibrary#parseComponent(org.w3c.dom.Element)
*/
@Override
16 years, 8 months
JBoss Tools SVN: r17225 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template: messages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-08-21 12:05:00 -0400 (Fri, 21 Aug 2009)
New Revision: 17225
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeCompositionTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/messages/Messages.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/messages/messages.properties
Log:
FIXED - issue JBIDE-4800: template for s:decorate is broken after changing ui:composition
https://jira.jboss.org/jira/browse/JBIDE-4800
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeCompositionTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeCompositionTemplate.java 2009-08-21 15:10:28 UTC (rev 17224)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/VpeCompositionTemplate.java 2009-08-21 16:05:00 UTC (rev 17225)
@@ -45,18 +45,15 @@
protected VpeCreationData createStub(String fileName, Node sourceElement, nsIDOMDocument visualDocument) {
nsIDOMElement container = visualDocument.createElement(HTML.TAG_DIV);
- container.setAttribute(HTML.ATTR_STYLE, "border: 1px dashed #2A7F00"); //$NON-NLS-1$
VpeVisualDomBuilder.markIncludeElement(container);
- final String message;
- if (fileName == null) {
- message = Messages.TEMPLATE_NOT_SPECIFIED;
- } else {
- message = NLS.bind(Messages.TEMPLATE_NOT_FOUND, fileName);
+ if (fileName != null) {
+ container.setAttribute(HTML.ATTR_STYLE, "border: 1px dashed #2A7F00"); //$NON-NLS-1$
+ String message = NLS.bind(Messages.TEMPLATE_NOT_FOUND, fileName);
+ container.appendChild(FaceletsUtil.createErrorMessageElement(
+ visualDocument, sourceElement.getNodeName(), message));
}
- container.appendChild(FaceletsUtil.createErrorMessageElement(
- visualDocument, sourceElement.getNodeName(), message));
return new VpeCreationData(container);
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/messages/Messages.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/messages/Messages.java 2009-08-21 15:10:28 UTC (rev 17224)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/messages/Messages.java 2009-08-21 16:05:00 UTC (rev 17225)
@@ -25,7 +25,6 @@
}
private Messages(){}
- public static String TEMPLATE_NOT_SPECIFIED;
public static String TEMPLATE_NOT_FOUND;
public static String UNKNOWN_NAME;
public static String NAME_NOT_SPECIFIED;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/messages/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/messages/messages.properties 2009-08-21 15:10:28 UTC (rev 17224)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.facelets/src/org/jboss/tools/jsf/vpe/facelets/template/messages/messages.properties 2009-08-21 16:05:00 UTC (rev 17225)
@@ -1,4 +1,3 @@
-TEMPLATE_NOT_SPECIFIED=Template file is not specified.
TEMPLATE_NOT_FOUND=Template file is not found: "{0}"
UNKNOWN_NAME=Unknown name: "{0}"
NAME_NOT_SPECIFIED=Name is not specified.
16 years, 8 months
JBoss Tools SVN: r17224 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: configuration/validate and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-08-21 11:10:28 -0400 (Fri, 21 Aug 2009)
New Revision: 17224
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/TreeNodeGraphicalNodeEditPolicy.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactory.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/JavaBeanChildNodeEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksGraphUtil.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/JavaBeanChildGraphModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/JavaBeanGraphModel.java
Log:
JBIDE-4648
Create "Bean ID" connections
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -124,6 +124,7 @@
import org.jboss.tools.smooks.configuration.editors.OpenFileHyperLinkListener;
import org.jboss.tools.smooks.configuration.editors.SelectorAttributes;
import org.jboss.tools.smooks.configuration.editors.SelectorCreationDialog;
+import org.jboss.tools.smooks.configuration.editors.groovy.GroovyUICreator;
import org.jboss.tools.smooks.configuration.editors.javabean.JavaBeanModel;
import org.jboss.tools.smooks.configuration.editors.javabean.JavaMethodsSelectionDialog;
import org.jboss.tools.smooks.configuration.editors.javabean.JavaPropertiesSelectionDialog;
@@ -133,9 +134,17 @@
import org.jboss.tools.smooks.core.SmooksCoreActivator;
import org.jboss.tools.smooks.gef.tree.editparts.TreeNodeEditPart;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
+import org.jboss.tools.smooks.model.calc.CalcPackage;
+import org.jboss.tools.smooks.model.calc.Counter;
+import org.jboss.tools.smooks.model.datasource.DatasourcePackage;
+import org.jboss.tools.smooks.model.datasource.Direct;
+import org.jboss.tools.smooks.model.esbrouting.EsbroutingPackage;
+import org.jboss.tools.smooks.model.esbrouting.RouteBean;
+import org.jboss.tools.smooks.model.fileRouting.FileRoutingPackage;
+import org.jboss.tools.smooks.model.fileRouting.OutputStream;
import org.jboss.tools.smooks.model.freemarker.BindTo;
import org.jboss.tools.smooks.model.freemarker.Freemarker;
-import org.jboss.tools.smooks.model.freemarker.Use;
+import org.jboss.tools.smooks.model.freemarker.FreemarkerPackage;
import org.jboss.tools.smooks.model.graphics.ext.GraphFactory;
import org.jboss.tools.smooks.model.graphics.ext.ISmooksGraphChangeListener;
import org.jboss.tools.smooks.model.graphics.ext.InputType;
@@ -143,14 +152,26 @@
import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphExtensionDocumentRoot;
import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphicsExtType;
import org.jboss.tools.smooks.model.graphics.ext.util.GraphResourceFactoryImpl;
+import org.jboss.tools.smooks.model.groovy.GroovyPackage;
import org.jboss.tools.smooks.model.javabean.BindingsType;
+import org.jboss.tools.smooks.model.javabean.ExpressionType;
import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
+import org.jboss.tools.smooks.model.javabean.ValueType;
+import org.jboss.tools.smooks.model.javabean.WiringType;
+import org.jboss.tools.smooks.model.javabean12.BeanType;
import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
+import org.jboss.tools.smooks.model.jmsrouting.JmsRouter;
+import org.jboss.tools.smooks.model.jmsrouting.JmsroutingPackage;
+import org.jboss.tools.smooks.model.jmsrouting12.JMS12Router;
+import org.jboss.tools.smooks.model.jmsrouting12.Jmsrouting12Package;
import org.jboss.tools.smooks.model.smooks.AbstractReader;
import org.jboss.tools.smooks.model.smooks.AbstractResourceConfig;
import org.jboss.tools.smooks.model.smooks.ConditionType;
+import org.jboss.tools.smooks.model.smooks.ResourceConfigType;
+import org.jboss.tools.smooks.model.smooks.SmooksPackage;
import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
import org.jboss.tools.smooks.model.xsl.Xsl;
+import org.jboss.tools.smooks.model.xsl.XslPackage;
import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
/**
@@ -183,50 +204,118 @@
public static final String[] SELECTOR_SPERATORS = new String[] { " ", "/" };
+ private static void fillBeanIdStringList(EObject model, final Collection<String> beanIdList) {
+ EStructuralFeature beanIDFeature = getBeanIDFeature(model);
+ if (beanIDFeature != null) {
+ Object data = model.eGet(beanIDFeature);
+ if (data != null) {
+ String beanId = data.toString();
+ if (!beanIdList.contains(beanId))
+ beanIdList.add(beanId);
+ }
+ }
+ List<EObject> children = model.eContents();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ EObject eObject = (EObject) iterator.next();
+ fillBeanIdStringList(eObject, beanIdList);
+ }
+ }
+
+ public static Collection<EObject> getBeanIdModelList(EObject model) {
+ List<EObject> beanIdModelList = new ArrayList<EObject>();
+ fillBeanIdModelList(model, beanIdModelList);
+ return beanIdModelList;
+ }
+
+ public static void fillBeanIdModelList(EObject model, final List<EObject> list) {
+ EStructuralFeature beanIDFeature = getBeanIDFeature(model);
+ if (beanIDFeature != null) {
+ list.add(model);
+ }
+ List<EObject> children = model.eContents();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ EObject eObject = (EObject) iterator.next();
+ fillBeanIdModelList(eObject, list);
+ }
+ }
+
+ public static Collection<EObject> getBeanIdRefModelList(EObject model) {
+ List<EObject> beanIdRefModelList = new ArrayList<EObject>();
+ fillBeanIdRefModelList(model, beanIdRefModelList);
+ return beanIdRefModelList;
+ }
+
+ private static void fillBeanIdRefModelList(EObject model, List<EObject> beanIdRefModelList) {
+ EStructuralFeature beanIDRefFeature = getBeanIDRefFeature(model);
+ if (beanIDRefFeature != null) {
+ beanIdRefModelList.add(model);
+ }
+ List<EObject> children = model.eContents();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ EObject eObject = (EObject) iterator.next();
+ fillBeanIdRefModelList(eObject, beanIdRefModelList);
+ }
+ }
+
public static List<String> getBeanIdStringList(SmooksResourceListType resourceList) {
if (resourceList == null) {
return null;
}
- List<AbstractResourceConfig> rlist = resourceList.getAbstractResourceConfig();
List<String> beanIdList = new ArrayList<String>();
- for (Iterator<?> iterator = rlist.iterator(); iterator.hasNext();) {
- AbstractResourceConfig abstractResourceConfig = (AbstractResourceConfig) iterator.next();
- if (abstractResourceConfig instanceof BindingsType) {
- String beanId = ((BindingsType) abstractResourceConfig).getBeanId();
- if (beanId == null)
- continue;
- if (!beanIdList.contains(beanId))
- beanIdList.add(beanId);
- }
- if (abstractResourceConfig instanceof Freemarker) {
- Use use = ((Freemarker) abstractResourceConfig).getUse();
- if (use != null) {
- BindTo bindTo = use.getBindTo();
- if (bindTo != null) {
- String beanId = ((BindTo) bindTo).getId();
- if (beanId == null)
- continue;
- if (!beanIdList.contains(beanId))
- beanIdList.add(beanId);
- }
- }
- }
- if (abstractResourceConfig instanceof Xsl) {
- org.jboss.tools.smooks.model.xsl.Use use = ((Xsl) abstractResourceConfig).getUse();
- if (use != null) {
- org.jboss.tools.smooks.model.xsl.BindTo bindTo = use.getBindTo();
- if (bindTo != null) {
- String beanId = ((org.jboss.tools.smooks.model.xsl.BindTo) bindTo).getId();
- if (beanId == null)
- continue;
- if (!beanIdList.contains(beanId))
- beanIdList.add(beanId);
- }
- }
+ fillBeanIdStringList(resourceList, beanIdList);
- }
- }
+ // for (Iterator<?> iterator = rlist.iterator(); iterator.hasNext();) {
+ // AbstractResourceConfig abstractResourceConfig =
+ // (AbstractResourceConfig) iterator.next();
+ // EStructuralFeature beanIDFeature =
+ // getBeanIDFeature(abstractResourceConfig);
+ // if (beanIDFeature != null) {
+ // Object data = abstractResourceConfig.eGet(beanIDFeature);
+ // if (data != null) {
+ // String beanId = data.toString();
+ // if (!beanIdList.contains(beanId))
+ // beanIdList.add(beanId);
+ // }
+ // }
+ // if (abstractResourceConfig instanceof BindingsType) {
+ // String beanId = ((BindingsType) abstractResourceConfig).getBeanId();
+ // if (beanId == null)
+ // continue;
+ // if (!beanIdList.contains(beanId))
+ // beanIdList.add(beanId);
+ // }
+ // if (abstractResourceConfig instanceof Freemarker) {
+ // Use use = ((Freemarker) abstractResourceConfig).getUse();
+ // if (use != null) {
+ // BindTo bindTo = use.getBindTo();
+ // if (bindTo != null) {
+ // String beanId = ((BindTo) bindTo).getId();
+ // if (beanId == null)
+ // continue;
+ // if (!beanIdList.contains(beanId))
+ // beanIdList.add(beanId);
+ // }
+ // }
+ //
+ // }
+ // if (abstractResourceConfig instanceof Xsl) {
+ // org.jboss.tools.smooks.model.xsl.Use use = ((Xsl)
+ // abstractResourceConfig).getUse();
+ // if (use != null) {
+ // org.jboss.tools.smooks.model.xsl.BindTo bindTo = use.getBindTo();
+ // if (bindTo != null) {
+ // String beanId = ((org.jboss.tools.smooks.model.xsl.BindTo)
+ // bindTo).getId();
+ // if (beanId == null)
+ // continue;
+ // if (!beanIdList.contains(beanId))
+ // beanIdList.add(beanId);
+ // }
+ // }
+ //
+ // }
+ // }
return beanIdList;
}
@@ -867,8 +956,7 @@
AttributeFieldEditPart fieldEditPart = createDialogFieldEditor(labelText, parent, toolkit, propertyDescriptor,
"Browse", new IFieldDialog() {
public Object open(Shell shell) {
- SelectorCreationDialog dialog = new SelectorCreationDialog(shell, extType,
- currentEditorPart);
+ SelectorCreationDialog dialog = new SelectorCreationDialog(shell, extType, currentEditorPart);
if (dialog.open() == Dialog.OK) {
Object currentSelection = dialog.getCurrentSelection();
SelectorAttributes sa = dialog.getSelectorAttributes();
@@ -2083,7 +2171,7 @@
}
private static IXMLStructuredObject localXMLNodeWithNodeName(String name, IXMLStructuredObject contextNode,
- Map<Object , Object> usedNodeMap) {
+ Map<Object, Object> usedNodeMap) {
if (name == null || contextNode == null)
return null;
String nodeName = contextNode.getNodeName();
@@ -2138,7 +2226,7 @@
}
public static IXMLStructuredObject localXMLNodeWithNodeName(String name, IXMLStructuredObject contextNode) {
- HashMap<Object,Object> map = new HashMap<Object,Object>();
+ HashMap<Object, Object> map = new HashMap<Object, Object>();
IXMLStructuredObject node = localXMLNodeWithNodeName(name, contextNode, map);
map.clear();
map = null;
@@ -2387,37 +2475,96 @@
}
return actions;
}
-
- public static boolean isRelatedConnectionFeature(EStructuralFeature feature){
- if(feature == JavabeanPackage.Literals.BINDINGS_TYPE__CREATE_ON_ELEMENT){
+
+ public static boolean isRelatedConnectionFeature(EStructuralFeature feature) {
+ // for Bean ID
+ if (FreemarkerPackage.Literals.BIND_TO__ID == feature){
return true;
}
- if(feature == JavabeanPackage.Literals.VALUE_TYPE__DATA){
+ if (feature == XslPackage.Literals.BIND_TO__ID) {
return true;
}
- if(feature == JavabeanPackage.Literals.WIRING_TYPE__WIRE_ON_ELEMENT){
+
+ if (feature == JavabeanPackage.Literals.BINDINGS_TYPE__BEAN_ID) {
return true;
}
- if(feature == JavabeanPackage.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT){
+
+ if (feature == Javabean12Package.Literals.BEAN_TYPE__BEAN_ID) {
return true;
}
- if(feature == Javabean12Package.Literals.BEAN_TYPE__CREATE_ON_ELEMENT){
+ // for bean ref id :
+ if (JmsroutingPackage.Literals.JMS_ROUTER__BEAN_ID == feature){
return true;
}
- if(feature == Javabean12Package.Literals.VALUE_TYPE__DATA){
+ if (Jmsrouting12Package.Literals.JMS12_ROUTER__BEAN_ID == feature){
return true;
}
- if(feature == Javabean12Package.Literals.WIRING_TYPE__WIRE_ON_ELEMENT){
+ if (JavabeanPackage.Literals.WIRING_TYPE__BEAN_ID_REF == feature){
return true;
}
- if(feature == Javabean12Package.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT){
+ if (Javabean12Package.Literals.WIRING_TYPE__BEAN_ID_REF == feature){
return true;
}
+ // for selector :
+ if (JavabeanPackage.Literals.BINDINGS_TYPE__CREATE_ON_ELEMENT == feature){
+ return true;
+ }
+ if (CalcPackage.Literals.COUNTER__COUNT_ON_ELEMENT == feature){
+ return true;
+ }
+ if (DatasourcePackage.Literals.DIRECT__BIND_ON_ELEMENT == feature){
+ return true;
+ }
+ if (EsbroutingPackage.Literals.ROUTE_BEAN__ROUTE_ON_ELEMENT == feature){
+ return true;
+ }
+ if (FileRoutingPackage.Literals.OUTPUT_STREAM__OPEN_ON_ELEMENT == feature){
+ return true;
+ }
+ if (FreemarkerPackage.Literals.FREEMARKER__APPLY_ON_ELEMENT == feature){
+ return true;
+ }
+ if (XslPackage.Literals.XSL__APPLY_ON_ELEMENT == feature){
+ return true;
+ }
+ if (GroovyPackage.Literals.GROOVY__EXECUTE_ON_ELEMENT == feature){
+ return true;
+ }
+ if (JmsroutingPackage.Literals.JMS_ROUTER__ROUTE_ON_ELEMENT == feature){
+ return true;
+ }
+ if (SmooksPackage.Literals.RESOURCE_CONFIG_TYPE__SELECTOR == feature){
+ return true;
+ }
+ if (SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__DEFAULT_SELECTOR == feature){
+ return true;
+ }
+ if (JavabeanPackage.Literals.WIRING_TYPE__WIRE_ON_ELEMENT == feature){
+ return true;
+ }
+ if (JavabeanPackage.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT == feature){
+ return true;
+ }
+ if (JavabeanPackage.Literals.VALUE_TYPE__DATA == feature){
+ return true;
+ }
+ if (Javabean12Package.Literals.BEAN_TYPE__CREATE_ON_ELEMENT == feature){
+ return true;
+ }
+ if (Javabean12Package.Literals.WIRING_TYPE__WIRE_ON_ELEMENT == feature){
+ return true;
+ }
+ if (Javabean12Package.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT == feature){
+ return true;
+ }
+ if (Javabean12Package.Literals.VALUE_TYPE__DATA == feature){
+ return true;
+ }
return false;
}
-
+
public static IJavaSearchScope getSearchScope(IJavaProject project) {
return SearchEngine.createJavaSearchScope(getNonJRERoots(project));
}
@@ -2451,5 +2598,110 @@
return false;
}
+ public static EStructuralFeature getBeanIDFeature(EObject model) {
+ if (model == null) {
+ return null;
+ }
+ if (model instanceof BindTo) {
+ return FreemarkerPackage.Literals.BIND_TO__ID;
+ }
+ if (model instanceof org.jboss.tools.smooks.model.xsl.BindTo) {
+ return XslPackage.Literals.BIND_TO__ID;
+ }
+ if (model instanceof BindingsType) {
+ return JavabeanPackage.Literals.BINDINGS_TYPE__BEAN_ID;
+ }
+
+ if (model instanceof BeanType) {
+ return Javabean12Package.Literals.BEAN_TYPE__BEAN_ID;
+ }
+
+ return null;
+ }
+
+ public static EStructuralFeature getBeanIDRefFeature(EObject model) {
+ if (model == null) {
+ return null;
+ }
+ if (model instanceof JmsRouter) {
+ return JmsroutingPackage.Literals.JMS_ROUTER__BEAN_ID;
+ }
+ if (model instanceof JMS12Router) {
+ return Jmsrouting12Package.Literals.JMS12_ROUTER__BEAN_ID;
+ }
+ if (model instanceof WiringType) {
+ return JavabeanPackage.Literals.WIRING_TYPE__BEAN_ID_REF;
+ }
+
+ if (model instanceof org.jboss.tools.smooks.model.javabean12.WiringType) {
+ return Javabean12Package.Literals.WIRING_TYPE__BEAN_ID_REF;
+ }
+ return null;
+ }
+
+ public static EStructuralFeature getSelectorFeature(EObject model) {
+ if (model == null)
+ return null;
+ if (model instanceof BindingsType) {
+ return JavabeanPackage.Literals.BINDINGS_TYPE__CREATE_ON_ELEMENT;
+ }
+ if (model instanceof Counter) {
+ return CalcPackage.Literals.COUNTER__COUNT_ON_ELEMENT;
+ }
+ if (model instanceof Direct) {
+ return DatasourcePackage.Literals.DIRECT__BIND_ON_ELEMENT;
+ }
+ if (model instanceof RouteBean) {
+ return EsbroutingPackage.Literals.ROUTE_BEAN__ROUTE_ON_ELEMENT;
+ }
+ if (model instanceof OutputStream) {
+ return FileRoutingPackage.Literals.OUTPUT_STREAM__OPEN_ON_ELEMENT;
+ }
+ if (model instanceof Freemarker) {
+ return FreemarkerPackage.Literals.FREEMARKER__APPLY_ON_ELEMENT;
+ }
+ if (model instanceof Xsl) {
+ return XslPackage.Literals.XSL__APPLY_ON_ELEMENT;
+ }
+ if (model instanceof GroovyUICreator) {
+ return GroovyPackage.Literals.GROOVY__EXECUTE_ON_ELEMENT;
+ }
+ if (model instanceof JmsRouter) {
+ return JmsroutingPackage.Literals.JMS_ROUTER__ROUTE_ON_ELEMENT;
+ }
+
+ if (model instanceof ResourceConfigType) {
+ return SmooksPackage.Literals.RESOURCE_CONFIG_TYPE__SELECTOR;
+ }
+
+ if (model instanceof SmooksResourceListType) {
+ return SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__DEFAULT_SELECTOR;
+ }
+
+ if (model instanceof WiringType) {
+ return JavabeanPackage.Literals.WIRING_TYPE__WIRE_ON_ELEMENT;
+ }
+ if (model instanceof ExpressionType) {
+ return JavabeanPackage.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT;
+ }
+ if (model instanceof ValueType) {
+ return JavabeanPackage.Literals.VALUE_TYPE__DATA;
+ }
+
+ if (model instanceof BeanType) {
+ return Javabean12Package.Literals.BEAN_TYPE__CREATE_ON_ELEMENT;
+ }
+ if (model instanceof org.jboss.tools.smooks.model.javabean12.WiringType) {
+ return Javabean12Package.Literals.WIRING_TYPE__WIRE_ON_ELEMENT;
+ }
+ if (model instanceof org.jboss.tools.smooks.model.javabean12.ExpressionType) {
+ return Javabean12Package.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT;
+ }
+ if (model instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
+ return Javabean12Package.Literals.VALUE_TYPE__DATA;
+ }
+ return null;
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/BeanIdRefValidator.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -15,13 +15,12 @@
import java.util.List;
import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
-import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
-import org.jboss.tools.smooks.model.javabean.WiringType;
-import org.jboss.tools.smooks.model.jmsrouting.JmsRouter;
-import org.jboss.tools.smooks.model.jmsrouting.JmsroutingPackage;
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
@@ -65,21 +64,40 @@
*/
@Override
protected Diagnostic validateModel(Object model, EditingDomain editingDomain) {
- if (model instanceof WiringType) {
- String idRef = ((WiringType) model).getBeanIdRef();
- if (!idList.contains(idRef)) {
- return newWaringDiagnostic("Reference BeanId '" + idRef + "' dosen't exist.", model,
- JavabeanPackage.Literals.WIRING_TYPE__BEAN_ID_REF);
+ String idRef = null;
+ EStructuralFeature beanIDRefFeature = null;
+ if (model instanceof EObject) {
+ beanIDRefFeature = SmooksUIUtils.getBeanIDRefFeature((EObject) model);
+ if (beanIDRefFeature != null) {
+ Object data = ((EObject) model).eGet(beanIDRefFeature);
+ if (data != null) {
+ idRef = data.toString();
+ }
}
}
- if (model instanceof JmsRouter) {
- String idRef = ((JmsRouter) model).getBeanId();
- if (!idList.contains(idRef)) {
+ if (idRef != null) {
+ if (!idList.contains(idRef) && beanIDRefFeature != null && beanIDRefFeature instanceof EAttribute) {
return newWaringDiagnostic("Reference BeanId '" + idRef + "' dosen't exist.", model,
- JmsroutingPackage.Literals.JMS_ROUTER__BEAN_ID);
+ (EAttribute) beanIDRefFeature);
}
}
+
+// if (model instanceof WiringType) {
+// String idRef = ((WiringType) model).getBeanIdRef();
+// if (!idList.contains(idRef)) {
+// return newWaringDiagnostic("Reference BeanId '" + idRef + "' dosen't exist.", model,
+// JavabeanPackage.Literals.WIRING_TYPE__BEAN_ID_REF);
+// }
+// }
+//
+// if (model instanceof JmsRouter) {
+// String idRef = ((JmsRouter) model).getBeanId();
+// if (!idList.contains(idRef)) {
+// return newWaringDiagnostic("Reference BeanId '" + idRef + "' dosen't exist.", model,
+// JmsroutingPackage.Literals.JMS_ROUTER__BEAN_ID);
+// }
+// }
return super.validateModel(model, editingDomain);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SelectorValidator.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -22,41 +22,16 @@
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
import org.jboss.tools.smooks.configuration.editors.SelectorCreationDialog;
-import org.jboss.tools.smooks.configuration.editors.groovy.GroovyUICreator;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
-import org.jboss.tools.smooks.model.calc.CalcPackage;
-import org.jboss.tools.smooks.model.calc.Counter;
-import org.jboss.tools.smooks.model.datasource.DatasourcePackage;
-import org.jboss.tools.smooks.model.datasource.Direct;
-import org.jboss.tools.smooks.model.esbrouting.EsbroutingPackage;
-import org.jboss.tools.smooks.model.esbrouting.RouteBean;
-import org.jboss.tools.smooks.model.fileRouting.FileRoutingPackage;
-import org.jboss.tools.smooks.model.fileRouting.OutputStream;
-import org.jboss.tools.smooks.model.freemarker.Freemarker;
-import org.jboss.tools.smooks.model.freemarker.FreemarkerPackage;
import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphicsExtType;
-import org.jboss.tools.smooks.model.groovy.Groovy;
-import org.jboss.tools.smooks.model.groovy.GroovyPackage;
-import org.jboss.tools.smooks.model.javabean.BindingsType;
-import org.jboss.tools.smooks.model.javabean.ExpressionType;
-import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
-import org.jboss.tools.smooks.model.javabean.ValueType;
-import org.jboss.tools.smooks.model.javabean.WiringType;
-import org.jboss.tools.smooks.model.javabean12.BeanType;
-import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
-import org.jboss.tools.smooks.model.jmsrouting.JmsRouter;
-import org.jboss.tools.smooks.model.jmsrouting.JmsroutingPackage;
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
-import org.jboss.tools.smooks.model.smooks.ResourceConfigType;
-import org.jboss.tools.smooks.model.smooks.SmooksPackage;
import org.jboss.tools.smooks.model.smooks.SmooksResourceListType;
-import org.jboss.tools.smooks.model.xsl.Xsl;
-import org.jboss.tools.smooks.model.xsl.XslPackage;
/**
* @author Dart (dpeng(a)redhat.com)
@@ -90,15 +65,16 @@
@Override
protected Diagnostic validateModel(Object model, EditingDomain editingDomain) {
if (model instanceof EObject) {
- EAttribute feature = getAttribute(model);
- Object data = ((EObject)model).eGet(feature);
- if(data == null){
+ EStructuralFeature feature = getAttribute(model);
+ if(feature == null) return null;
+ Object data = ((EObject) model).eGet(feature);
+ if (data == null) {
return null;
}
String path = data.toString();
-// if (path == null) {
-// return null;
-// }
+ // if (path == null) {
+ // return null;
+ // }
// if(feature != null && path == null){
// return newWaringDiagnostic("Selector '" +path+
// "' isn't available",
@@ -126,127 +102,18 @@
}
}
}
- if (node == null) {
- return newWaringDiagnostic("Selector '" + path + "' isn't available", model, feature);
+ if (node == null && feature instanceof EAttribute) {
+ return newWaringDiagnostic("Selector '" + path + "' isn't available", model, (EAttribute) feature);
}
}
}
return super.validateModel(model, editingDomain);
}
- private EAttribute getAttribute(Object model) {
- if (model instanceof BindingsType) {
- return JavabeanPackage.Literals.BINDINGS_TYPE__CREATE_ON_ELEMENT;
- }
- if (model instanceof Counter) {
- return CalcPackage.Literals.COUNTER__COUNT_ON_ELEMENT;
- }
- if (model instanceof Direct) {
- return DatasourcePackage.Literals.DIRECT__BIND_ON_ELEMENT;
- }
- if (model instanceof RouteBean) {
- return EsbroutingPackage.Literals.ROUTE_BEAN__ROUTE_ON_ELEMENT;
- }
- if (model instanceof OutputStream) {
- return FileRoutingPackage.Literals.OUTPUT_STREAM__OPEN_ON_ELEMENT;
- }
- if (model instanceof Freemarker) {
- return FreemarkerPackage.Literals.FREEMARKER__APPLY_ON_ELEMENT;
- }
- if (model instanceof Xsl) {
- return XslPackage.Literals.XSL__APPLY_ON_ELEMENT;
- }
- if (model instanceof GroovyUICreator) {
- return GroovyPackage.Literals.GROOVY__EXECUTE_ON_ELEMENT;
- }
- if (model instanceof JmsRouter) {
- return JmsroutingPackage.Literals.JMS_ROUTER__ROUTE_ON_ELEMENT;
- }
-
- if (model instanceof ResourceConfigType) {
- return SmooksPackage.Literals.RESOURCE_CONFIG_TYPE__SELECTOR;
- }
-
- if (model instanceof SmooksResourceListType) {
- return SmooksPackage.Literals.SMOOKS_RESOURCE_LIST_TYPE__DEFAULT_SELECTOR;
- }
-
- if (model instanceof WiringType) {
- return JavabeanPackage.Literals.WIRING_TYPE__WIRE_ON_ELEMENT;
- }
- if (model instanceof ExpressionType) {
- return JavabeanPackage.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT;
- }
- if (model instanceof ValueType) {
- return JavabeanPackage.Literals.VALUE_TYPE__DATA;
- }
-
- if(model instanceof BeanType){
- return Javabean12Package.Literals.BEAN_TYPE__CREATE_ON_ELEMENT;
- }
- if (model instanceof org.jboss.tools.smooks.model.javabean12.WiringType) {
- return Javabean12Package.Literals.WIRING_TYPE__WIRE_ON_ELEMENT;
- }
- if (model instanceof org.jboss.tools.smooks.model.javabean12.ExpressionType) {
- return Javabean12Package.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT;
- }
- if (model instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
- return Javabean12Package.Literals.VALUE_TYPE__DATA;
- }
- return null;
+ private EStructuralFeature getAttribute(Object model) {
+ return SmooksUIUtils.getSelectorFeature((EObject) model);
}
- /**
- * @deprecated
- * @param model
- * @return
- */
- private String getPath(Object model) {
- if (model instanceof ExpressionType) {
- return ((ExpressionType) model).getExecOnElement();
- }
- if (model instanceof ValueType) {
- return ((ValueType) model).getData();
- }
- if (model instanceof WiringType) {
- return ((WiringType) model).getWireOnElement();
- }
- if (model instanceof SmooksResourceListType) {
- return ((SmooksResourceListType) model).getDefaultSelector();
- }
- if (model instanceof ResourceConfigType) {
- return ((ResourceConfigType) model).getSelector();
- }
- if (model instanceof JmsRouter) {
- return ((JmsRouter) model).getRouteOnElement();
- }
- if (model instanceof GroovyUICreator) {
- return ((Groovy) model).getExecuteOnElement();
- }
- if (model instanceof Xsl) {
- return ((Xsl) model).getApplyOnElement();
- }
- if (model instanceof Counter) {
- return ((Counter) model).getCountOnElement();
- }
- if (model instanceof BindingsType) {
- return ((BindingsType) model).getCreateOnElement();
- }
- if (model instanceof Direct) {
- return ((Direct) model).getBindOnElement();
- }
- if (model instanceof RouteBean) {
- return ((RouteBean) model).getRouteOnElement();
- }
- if (model instanceof OutputStream) {
- return ((OutputStream) model).getOpenOnElement();
- }
- if (model instanceof Freemarker) {
- return ((Freemarker) model).getApplyOnElement();
- }
- return null;
- }
-
public void initValidator(Collection<?> selectedObjects, EditingDomain editingDomain) {
list.clear();
Resource resource = editingDomain.getResourceSet().getResources().get(0);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editparts/CreateConnectionCommand.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -4,8 +4,8 @@
package org.jboss.tools.smooks.gef.tree.editparts;
import org.eclipse.gef.commands.Command;
+import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
-import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
/**
* @author DartPeng
@@ -14,9 +14,9 @@
public class CreateConnectionCommand extends Command {
- private TreeNodeModel source;
+ private AbstractSmooksGraphicalModel source;
- private TreeNodeModel target;
+ private AbstractSmooksGraphicalModel target;
private TreeNodeConnection tempConnectionHandle = null;
@@ -45,19 +45,19 @@
tempConnectionHandle.disconnect();
}
}
- public TreeNodeModel getSource() {
+ public AbstractSmooksGraphicalModel getSource() {
return source;
}
- public void setSource(TreeNodeModel source) {
+ public void setSource(AbstractSmooksGraphicalModel source) {
this.source = source;
}
- public TreeNodeModel getTarget() {
+ public AbstractSmooksGraphicalModel getTarget() {
return target;
}
- public void setTarget(TreeNodeModel target) {
+ public void setTarget(AbstractSmooksGraphicalModel target) {
this.target = target;
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/TreeNodeGraphicalNodeEditPolicy.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/TreeNodeGraphicalNodeEditPolicy.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/editpolicy/TreeNodeGraphicalNodeEditPolicy.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -8,9 +8,9 @@
import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
import org.eclipse.gef.requests.CreateConnectionRequest;
import org.eclipse.gef.requests.ReconnectRequest;
+import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.editparts.CreateConnectionCommand;
import org.jboss.tools.smooks.gef.tree.editparts.TreeNodeEditPart;
-import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
/**
* @author DartPeng
@@ -30,15 +30,15 @@
Command command = request.getStartCommand();
if (command != null && command instanceof CreateConnectionCommand) {
Object targetModel = request.getTargetEditPart().getModel();
- if (targetModel instanceof TreeNodeModel) {
- if (!((TreeNodeModel) targetModel).canLinkWithSource(((CreateConnectionCommand) command).getSource()))
+ if (targetModel instanceof AbstractSmooksGraphicalModel) {
+ if (!((AbstractSmooksGraphicalModel) targetModel).canLinkWithSource(((CreateConnectionCommand) command).getSource()))
return null;
Object source = ((CreateConnectionCommand) command).getSource();
- if (source instanceof TreeNodeModel) {
- if (!((TreeNodeModel) source).canLinkWithTarget(targetModel))
+ if (source instanceof AbstractSmooksGraphicalModel) {
+ if (!((AbstractSmooksGraphicalModel) source).canLinkWithTarget(targetModel))
return null;
}
- ((CreateConnectionCommand) command).setTarget((TreeNodeModel) targetModel);
+ ((CreateConnectionCommand) command).setTarget((AbstractSmooksGraphicalModel) targetModel);
return command;
}
}
@@ -60,8 +60,8 @@
sourceEditpart = getHost();
}
model = sourceEditpart.getModel();
- if (model != null && model instanceof TreeNodeModel) {
- if (!((TreeNodeModel) model).isLinkable())
+ if (model != null && model instanceof AbstractSmooksGraphicalModel) {
+ if (!((AbstractSmooksGraphicalModel) model).isLinkable())
return null;
EditPart hostPart = getHost();
CreateConnectionCommand command = null;
@@ -71,7 +71,7 @@
if (command == null) {
command = new CreateConnectionCommand();
}
- command.setSource((TreeNodeModel) model);
+ command.setSource((AbstractSmooksGraphicalModel) model);
request.setStartCommand(command);
return command;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactory.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactory.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactory.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors;
+import java.util.Collection;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
@@ -23,12 +24,12 @@
*/
public interface ConnectionModelFactory {
- public boolean hasBeanIDReferenceConnection(AbstractSmooksGraphicalModel model);
+ public boolean hasBeanIDConnection(AbstractSmooksGraphicalModel model);
- public TreeNodeConnection createBeanIDReferenceConnection(EObject rootModel, RootModel root,
+ public Collection<TreeNodeConnection> createBeanIDReferenceConnection(EObject rootModel, RootModel root,
AbstractSmooksGraphicalModel model);
- public List<TreeNodeConnection> createSelectorConnection(List<Object> inputDataList, RootModel root,
+ public Collection<TreeNodeConnection> createSelectorConnection(List<Object> inputDataList, RootModel root,
AbstractSmooksGraphicalModel model);
public boolean hasSelectorConnection(AbstractSmooksGraphicalModel model);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -11,6 +11,7 @@
package org.jboss.tools.smooks.graphical.editors;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -18,6 +19,7 @@
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.gef.common.RootModel;
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
@@ -29,12 +31,108 @@
*/
public class ConnectionModelFactoryImpl implements ConnectionModelFactory {
- public TreeNodeConnection createBeanIDReferenceConnection(EObject rootModel , RootModel root,
+ public Collection<TreeNodeConnection> createBeanIDReferenceConnection(EObject rootModel, RootModel root,
AbstractSmooksGraphicalModel model) {
- return null;
+ Object mm = model.getData();
+ mm = AdapterFactoryEditingDomain.unwrap(mm);
+ if (mm == null && !(mm instanceof EObject))
+ return null;
+ EObject cmodel = (EObject) mm;
+ EStructuralFeature beanIDRefFeature = SmooksUIUtils.getBeanIDRefFeature(cmodel);
+ EStructuralFeature beanIDFeature = SmooksUIUtils.getBeanIDFeature(cmodel);
+ List<TreeNodeConnection> connections = new ArrayList<TreeNodeConnection>();
+ if (beanIDRefFeature != null) {
+ Object data = cmodel.eGet(beanIDRefFeature);
+ if (data != null) {
+ String refID = data.toString();
+ Collection<EObject> modelList = SmooksUIUtils.getBeanIdModelList(rootModel);
+ for (Iterator<?> iterator = modelList.iterator(); iterator.hasNext();) {
+ EObject eObject = (EObject) iterator.next();
+ EStructuralFeature idfeature = SmooksUIUtils.getBeanIDFeature(eObject);
+ if (idfeature == null)
+ continue;
+ Object iddata = eObject.eGet(idfeature);
+ if (iddata == null)
+ continue;
+ if (refID.equals(iddata)) {
+ AbstractSmooksGraphicalModel targetGraphModel = SmooksGraphUtil.findSmooksGraphModel(root, eObject);
+ List<TreeNodeConnection> tcs = targetGraphModel.getTargetConnections();
+ boolean createNewConnection = true;
+ for (Iterator<?> iterator2 = tcs.iterator(); iterator2.hasNext();) {
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator2.next();
+ if(treeNodeConnection.getSourceNode() == model){
+ // it means that the connection has been exist
+ createNewConnection = false;
+ break;
+ }
+ }
+ if(!createNewConnection) continue;
+ // create new connection;
+ AbstractSmooksGraphicalModel target = SmooksGraphUtil.findSmooksGraphModel(root, eObject);
+ TreeNodeConnection connection = new TreeNodeConnection(model, target);
+ model.getSourceConnections().add(connection);
+ model.fireConnectionChanged();
+ target.getTargetConnections().add(connection);
+ target.fireConnectionChanged();
+ connections.add(connection);
+ }
+ }
+ }
+ }
+
+ if(beanIDFeature != null){
+ Object data = cmodel.eGet(beanIDFeature);
+ if (data != null) {
+ String beanid = data.toString();
+ Collection<EObject> beanIdRefModelList = SmooksUIUtils.getBeanIdRefModelList(rootModel);
+ for (Iterator<?> iterator = beanIdRefModelList.iterator(); iterator.hasNext();) {
+ EObject eObject = (EObject) iterator.next();
+ EStructuralFeature idRefFeature = SmooksUIUtils.getBeanIDRefFeature(eObject);
+ if (idRefFeature == null)
+ continue;
+ Object idRefData = eObject.eGet(idRefFeature);
+ if (idRefData == null)
+ continue;
+ if (beanid.equals(idRefData)) {
+ AbstractSmooksGraphicalModel sourceGraphModel = SmooksGraphUtil.findSmooksGraphModel(root, eObject);
+ List<TreeNodeConnection> scs = sourceGraphModel.getSourceConnections();
+ boolean createNewConnection = true;
+ for (Iterator<?> iterator2 = scs.iterator(); iterator2.hasNext();) {
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator2.next();
+ if(treeNodeConnection.getTargetNode() == model){
+ // it means that the connection has been exist
+ createNewConnection = false;
+ break;
+ }
+ }
+ if(!createNewConnection) continue;
+ // create new connection;
+ AbstractSmooksGraphicalModel source = SmooksGraphUtil.findSmooksGraphModel(root, eObject);
+ TreeNodeConnection connection = new TreeNodeConnection(source ,model);
+ source.getSourceConnections().add(connection);
+ model.getTargetConnections().add(connection);
+ source.fireConnectionChanged();
+ model.fireConnectionChanged();
+ connections.add(connection);
+ }
+ }
+ }
+ }
+
+ if (connections.isEmpty())
+ return null;
+ return connections;
}
- public boolean hasBeanIDReferenceConnection(AbstractSmooksGraphicalModel model) {
+ public boolean hasBeanIDConnection(AbstractSmooksGraphicalModel model) {
+ Object data = model.getData();
+ data = AdapterFactoryEditingDomain.unwrap(data);
+ if (data instanceof EObject) {
+ if (!(SmooksUIUtils.getBeanIDRefFeature((EObject) data) != null)
+ || !(SmooksUIUtils.getBeanIDFeature((EObject) data) != null)) {
+ return true;
+ }
+ }
return false;
}
@@ -42,18 +140,18 @@
Object data = model.getData();
data = AdapterFactoryEditingDomain.unwrap(data);
if (data instanceof EObject) {
- return (SmooksGraphUtil.getSelectorFeature((EObject) data) != null);
+ return (SmooksUIUtils.getSelectorFeature((EObject) data) != null);
}
return false;
}
- public List<TreeNodeConnection> createSelectorConnection(List<Object> inputDataList, RootModel root,
+ public Collection<TreeNodeConnection> createSelectorConnection(List<Object> inputDataList, RootModel root,
AbstractSmooksGraphicalModel model) {
Object data = model.getData();
data = AdapterFactoryEditingDomain.unwrap(data);
List<TreeNodeConnection> connections = new ArrayList<TreeNodeConnection>();
if (data != null && data instanceof EObject) {
- EStructuralFeature feature = SmooksGraphUtil.getSelectorFeature((EObject) data);
+ EStructuralFeature feature = SmooksUIUtils.getSelectorFeature((EObject) data);
Object sd = ((EObject) data).eGet(feature);
if (sd != null) {
String selector = sd.toString();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksGraphicalEditorPart.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -186,15 +186,64 @@
super.createActions();
}
- private void deleteRelatedConnection(AbstractSmooksGraphicalModel targetNode, EStructuralFeature feature,
+ private void deleteRelatedConnection(AbstractSmooksGraphicalModel effecedNode, EStructuralFeature feature,
SetCommand command) {
- EObject data = (EObject) AdapterFactoryEditingDomain.unwrap(targetNode.getData());
- if (feature.equals(SmooksGraphUtil.getSelectorFeature(data))) {
- List<TreeNodeConnection> targetConnections = targetNode.getTargetConnections();
+ EObject data = (EObject) AdapterFactoryEditingDomain.unwrap(effecedNode.getData());
+
+ if (feature.equals(SmooksUIUtils.getBeanIDRefFeature(data))) {
+ List<TreeNodeConnection> sourceConnections = effecedNode.getSourceConnections();
+ List<TreeNodeConnection> temp = new ArrayList<TreeNodeConnection>(sourceConnections);
+ for (Iterator<?> iterator = temp.iterator(); iterator.hasNext();) {
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
+ AbstractSmooksGraphicalModel target = treeNodeConnection.getTargetNode();
+ String refID = command.getValue().toString();
+ Object targetModel = AdapterFactoryEditingDomain.unwrap(target.getData());
+ if (targetModel instanceof EObject) {
+ EStructuralFeature idfeature = SmooksUIUtils.getBeanIDFeature((EObject) targetModel);
+ if (idfeature == null)
+ continue;
+ Object iddata = ((EObject) targetModel).eGet(idfeature);
+ if (iddata != null) {
+ if (refID == null || !refID.equals(iddata)) {
+ target.getTargetConnections().remove(treeNodeConnection);
+ effecedNode.getSourceConnections().remove(treeNodeConnection);
+ target.fireConnectionChanged();
+ }
+ }
+ }
+ }
+ }
+
+ if (feature.equals(SmooksUIUtils.getBeanIDFeature(data))) {
+ List<TreeNodeConnection> targetConnections = effecedNode.getTargetConnections();
List<TreeNodeConnection> temp = new ArrayList<TreeNodeConnection>(targetConnections);
for (Iterator<?> iterator = temp.iterator(); iterator.hasNext();) {
TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
AbstractSmooksGraphicalModel source = treeNodeConnection.getSourceNode();
+ String beanID = command.getValue().toString();
+ Object sourceModel = AdapterFactoryEditingDomain.unwrap(source.getData());
+ if (sourceModel instanceof EObject) {
+ EStructuralFeature idRefFeature = SmooksUIUtils.getBeanIDRefFeature((EObject) sourceModel);
+ if (idRefFeature == null)
+ continue;
+ Object idRefData = ((EObject) sourceModel).eGet(idRefFeature);
+ if (idRefData != null) {
+ if (beanID == null || !beanID.equals(idRefData)) {
+ source.getSourceConnections().remove(treeNodeConnection);
+ effecedNode.getTargetConnections().remove(treeNodeConnection);
+ source.fireConnectionChanged();
+ }
+ }
+ }
+ }
+ }
+
+ if (feature.equals(SmooksUIUtils.getSelectorFeature(data))) {
+ List<TreeNodeConnection> targetConnections = effecedNode.getTargetConnections();
+ List<TreeNodeConnection> temp = new ArrayList<TreeNodeConnection>(targetConnections);
+ for (Iterator<?> iterator = temp.iterator(); iterator.hasNext();) {
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
+ AbstractSmooksGraphicalModel source = treeNodeConnection.getSourceNode();
if (source instanceof InputDataContianerModel || source instanceof InputDataTreeNodeModel) {
String selector = command.getValue().toString();
Object sourceModel = AdapterFactoryEditingDomain.unwrap(source.getData());
@@ -210,7 +259,7 @@
break;
} else {
source.getSourceConnections().remove(treeNodeConnection);
- targetNode.getTargetConnections().remove(treeNodeConnection);
+ effecedNode.getTargetConnections().remove(treeNodeConnection);
source.fireConnectionChanged();
}
}
@@ -220,6 +269,13 @@
}
}
+ /**
+ * Very important method ! neet to improve
+ *
+ * @param command
+ * @param affectedObjects
+ * @param commandType
+ */
protected void refershRecentAffectedModel(Command command, Collection<?> affectedObjects, int commandType) {
for (Iterator<?> iterator = affectedObjects.iterator(); iterator.hasNext();) {
Object object = (Object) iterator.next();
@@ -235,7 +291,7 @@
if (graphModel == null)
continue;
root.addTreeNode(graphModel);
- List<TreeNodeConnection> connections = createAllConnection(graphModel);
+ Collection<TreeNodeConnection> connections = createAllConnection(graphModel);
expandConnectedModels(connections);
}
}
@@ -262,7 +318,7 @@
EStructuralFeature feature = ((SetCommand) command).getFeature();
if (SmooksUIUtils.isRelatedConnectionFeature(feature)) {
deleteRelatedConnection(node, feature, (SetCommand) command);
- List<TreeNodeConnection> connections = createConnection(node);
+ Collection<TreeNodeConnection> connections = createConnection(node);
node.fireConnectionChanged();
expandConnectedModels(connections);
}
@@ -275,7 +331,7 @@
if (graphModel == null)
continue;
root.addTreeNode(graphModel);
- List<TreeNodeConnection> connections = createAllConnection(graphModel);
+ Collection<TreeNodeConnection> connections = createAllConnection(graphModel);
expandConnectedModels(connections);
} else {
AbstractSmooksGraphicalModel ownerGraph = findGraphicalModel(owner);
@@ -290,11 +346,8 @@
node.fireConnectionChanged();
}
if (command instanceof DeleteCommand) {
- Object owner = ((EObject) object).eContainer();
- owner = AdapterFactoryEditingDomain.unwrap(owner);
- AbstractSmooksGraphicalModel ownerGraph = findGraphicalModel(owner);
- if (ownerGraph != null) {
- ownerGraph.fireChildrenChanged();
+ if (node != null) {
+ node.fireChildrenChanged();
}
}
}
@@ -330,7 +383,7 @@
EStructuralFeature feature = ((SetCommand) command).getFeature();
if (SmooksUIUtils.isRelatedConnectionFeature(feature)) {
deleteRelatedConnection(node, feature, (SetCommand) command);
- List<TreeNodeConnection> connections = createConnection(node);
+ Collection<TreeNodeConnection> connections = createConnection(node);
node.fireConnectionChanged();
expandConnectedModels(connections);
}
@@ -353,7 +406,7 @@
continue;
node = graphModel;
root.addTreeNode(graphModel);
- List<TreeNodeConnection> connections = createAllConnection(graphModel);
+ Collection<TreeNodeConnection> connections = createAllConnection(graphModel);
expandConnectedModels(connections);
if (graphModel instanceof IMoveableModel) {
String id = SmooksGraphUtil.generateFigureID(graphModel);
@@ -375,7 +428,7 @@
node = findGraphicalModel(object);
if (node == null)
continue;
- List<TreeNodeConnection> connections = createAllConnection(node);
+ Collection<TreeNodeConnection> connections = createAllConnection(node);
expandConnectedModels(connections);
}
break;
@@ -388,38 +441,27 @@
}
private AbstractSmooksGraphicalModel findGraphicalModel(Object object) {
- if (this.root != null && object != null) {
- List<?> children = root.getChildren();
- for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
- AbstractSmooksGraphicalModel child = (AbstractSmooksGraphicalModel) iterator.next();
- if (child instanceof InputDataContianerModel) {
- continue;
- }
- AbstractSmooksGraphicalModel model = findGraphicalModel(child, object);
- if (model != null) {
- return model;
- }
- }
- }
- return null;
+ return SmooksGraphUtil.findSmooksGraphModel(root, object);
}
- private AbstractSmooksGraphicalModel findGraphicalModel(AbstractSmooksGraphicalModel graph, Object object) {
- if (AdapterFactoryEditingDomain.unwrap(graph.getData()) == object) {
- return graph;
- }
- List<?> children = graph.getChildrenWithoutDynamic();
- for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
- Object child = (Object) iterator.next();
- if (child instanceof AbstractSmooksGraphicalModel) {
- AbstractSmooksGraphicalModel model = findGraphicalModel((AbstractSmooksGraphicalModel) child, object);
- if (model != null) {
- return model;
- }
- }
- }
- return null;
- }
+ // private AbstractSmooksGraphicalModel
+ // findGraphicalModel(AbstractSmooksGraphicalModel graph, Object object) {
+ // if (AdapterFactoryEditingDomain.unwrap(graph.getData()) == object) {
+ // return graph;
+ // }
+ // List<?> children = graph.getChildrenWithoutDynamic();
+ // for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ // Object child = (Object) iterator.next();
+ // if (child instanceof AbstractSmooksGraphicalModel) {
+ // AbstractSmooksGraphicalModel model =
+ // findGraphicalModel((AbstractSmooksGraphicalModel) child, object);
+ // if (model != null) {
+ // return model;
+ // }
+ // }
+ // }
+ // return null;
+ // }
public DefaultEditDomain getEditDomain() {
return editDomain;
@@ -532,18 +574,18 @@
return connections;
}
- protected List<TreeNodeConnection> createAllConnection(AbstractSmooksGraphicalModel model) {
+ protected Collection<TreeNodeConnection> createAllConnection(AbstractSmooksGraphicalModel model) {
if (model == null)
return null;
List<TreeNodeConnection> connections = new ArrayList<TreeNodeConnection>();
- List<TreeNodeConnection> c1 = createConnection(model);
+ Collection<TreeNodeConnection> c1 = createConnection(model);
if (c1 != null) {
connections.addAll(c1);
}
List<AbstractSmooksGraphicalModel> children = model.getChildren();
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
- List<TreeNodeConnection> cc = createConnection(abstractSmooksGraphicalModel);
+ Collection<TreeNodeConnection> cc = createConnection(abstractSmooksGraphicalModel);
if (cc != null) {
connections.addAll(cc);
}
@@ -551,22 +593,22 @@
return connections;
}
- protected List<TreeNodeConnection> createConnection(AbstractSmooksGraphicalModel model) {
+ protected Collection<TreeNodeConnection> createConnection(AbstractSmooksGraphicalModel model) {
ConnectionModelFactory connectionModelFactory = getConnectionModelFactory();
List<TreeNodeConnection> cs = new ArrayList<TreeNodeConnection>();
if (connectionModelFactory != null) {
if (connectionModelFactory.hasSelectorConnection(model)) {
- List<TreeNodeConnection> cList = connectionModelFactory.createSelectorConnection(inputDataList, root,
- model);
+ Collection<TreeNodeConnection> cList = connectionModelFactory.createSelectorConnection(inputDataList,
+ root, model);
if (cList != null) {
cs.addAll(cList);
}
}
- if (connectionModelFactory.hasBeanIDReferenceConnection(model)) {
- TreeNodeConnection c = connectionModelFactory.createBeanIDReferenceConnection(smooksModelProvider
- .getSmooksModel(), root, model);
+ if (connectionModelFactory.hasBeanIDConnection(model)) {
+ Collection<TreeNodeConnection> c = connectionModelFactory.createBeanIDReferenceConnection(
+ getSmooksResourceList(), root, model);
if (c != null) {
- cs.add(c);
+ cs.addAll(c);
}
}
}
@@ -575,12 +617,27 @@
return cs;
}
+ private EObject getSmooksResourceList() {
+ if (smooksModelProvider != null) {
+ EObject m = null;
+ EObject smooksModel = smooksModelProvider.getSmooksModel();
+ if (smooksModel instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+ m = ((org.jboss.tools.smooks10.model.smooks.DocumentRoot) smooksModel).getSmooksResourceList();
+ }
+ if (smooksModel instanceof DocumentRoot) {
+ m = ((DocumentRoot) smooksModel).getSmooksResourceList();
+ }
+ return m;
+ }
+ return null;
+ }
+
private void createConnection(List<AbstractSmooksGraphicalModel> children, List<TreeNodeConnection> connections) {
for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
if (!(abstractSmooksGraphicalModel instanceof InputDataContianerModel)) {
if (canCreateConnection(abstractSmooksGraphicalModel)) {
- List<TreeNodeConnection> c = createConnection(abstractSmooksGraphicalModel);
+ Collection<TreeNodeConnection> c = createConnection(abstractSmooksGraphicalModel);
if (c != null) {
connections.addAll(c);
}
@@ -622,7 +679,7 @@
}
}
- protected void expandConnectedModels(List<TreeNodeConnection> connections) {
+ protected void expandConnectedModels(Collection<TreeNodeConnection> connections) {
if (connections == null)
return;
List<TreeNodeModel> expanedTreeNodeList = new ArrayList<TreeNodeModel>();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/JavaBeanChildNodeEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/JavaBeanChildNodeEditPart.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/JavaBeanChildNodeEditPart.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -10,16 +10,34 @@
******************************************************************************/
package org.jboss.tools.smooks.graphical.editors.editparts;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.editparts.TreeNodeEditPart;
/**
* @author Dart
- *
+ *
*/
public class JavaBeanChildNodeEditPart extends TreeNodeEditPart {
@Override
protected boolean isDragLink() {
+ AbstractSmooksGraphicalModel model = (AbstractSmooksGraphicalModel) getModel();
+ if (model != null) {
+ Object data = model.getData();
+ data = AdapterFactoryEditingDomain.unwrap(data);
+ if (data != null && data instanceof EObject) {
+ EStructuralFeature idRefFeature = SmooksUIUtils.getBeanIDRefFeature((EObject) data);
+ if (idRefFeature != null) {
+ if (((EObject) data).eGet(idRefFeature) == null || !((EObject) data).eIsSet(idRefFeature)) {
+ return true;
+ }
+ }
+ }
+ }
return false;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksGraphUtil.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksGraphUtil.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/editparts/SmooksGraphUtil.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -14,8 +14,6 @@
import java.util.Iterator;
import java.util.List;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.jboss.tools.smooks.configuration.editors.IXMLStructuredObject;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
@@ -23,11 +21,7 @@
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.graphical.editors.model.InputDataContianerModel;
import org.jboss.tools.smooks.model.javabean.BindingsType;
-import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
-import org.jboss.tools.smooks.model.javabean.ValueType;
-import org.jboss.tools.smooks.model.javabean.WiringType;
import org.jboss.tools.smooks.model.javabean12.BeanType;
-import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
/**
* @author Dart
@@ -70,32 +64,38 @@
}
return null;
}
-
- public static EStructuralFeature getSelectorFeature(EObject obj) {
- if (obj == null)
- return null;
- // for javabean 1.1
- if (obj instanceof BindingsType) {
- return JavabeanPackage.Literals.BINDINGS_TYPE__CREATE_ON_ELEMENT;
+
+ public static AbstractSmooksGraphicalModel findSmooksGraphModel(RootModel root,Object object){
+ if (root != null && object != null) {
+ List<?> children = root.getChildren();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ AbstractSmooksGraphicalModel child = (AbstractSmooksGraphicalModel) iterator.next();
+ if (child instanceof InputDataContianerModel) {
+ continue;
+ }
+ AbstractSmooksGraphicalModel model = findGraphicalModel(child, object);
+ if (model != null) {
+ return model;
+ }
+ }
}
- if(obj instanceof ValueType){
- return JavabeanPackage.Literals.VALUE_TYPE__DATA;
+ return null;
+ }
+
+ private static AbstractSmooksGraphicalModel findGraphicalModel(AbstractSmooksGraphicalModel graph, Object object) {
+ if (AdapterFactoryEditingDomain.unwrap(graph.getData()) == object) {
+ return graph;
}
- if(obj instanceof WiringType){
- return JavabeanPackage.Literals.WIRING_TYPE__WIRE_ON_ELEMENT;
+ List<?> children = graph.getChildrenWithoutDynamic();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ Object child = (Object) iterator.next();
+ if (child instanceof AbstractSmooksGraphicalModel) {
+ AbstractSmooksGraphicalModel model = findGraphicalModel((AbstractSmooksGraphicalModel) child, object);
+ if (model != null) {
+ return model;
+ }
+ }
}
-
- // for javabean 1.2
-
- if(obj instanceof BeanType){
- return Javabean12Package.Literals.BEAN_TYPE__CREATE_ON_ELEMENT;
- }
- if(obj instanceof org.jboss.tools.smooks.model.javabean12.ValueType){
- return Javabean12Package.Literals.VALUE_TYPE__DATA;
- }
- if(obj instanceof org.jboss.tools.smooks.model.javabean12.WiringType){
- return Javabean12Package.Literals.WIRING_TYPE__WIRE_ON_ELEMENT;
- }
return null;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/JavaBeanChildGraphModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/JavaBeanChildGraphModel.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/JavaBeanChildGraphModel.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -23,21 +23,17 @@
import org.jboss.tools.smooks.gef.model.AbstractSmooksGraphicalModel;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
-import org.jboss.tools.smooks.model.javabean.ExpressionType;
-import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
-import org.jboss.tools.smooks.model.javabean.ValueType;
-import org.jboss.tools.smooks.model.javabean.WiringType;
-import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
/**
* @author Dart
- *
+ *
*/
public class JavaBeanChildGraphModel extends TreeNodeModel {
protected IEditingDomainProvider domainProvider = null;
-
- public JavaBeanChildGraphModel(Object data, ITreeContentProvider contentProvider, ILabelProvider labelProvider , IEditingDomainProvider domainProvider) {
+
+ public JavaBeanChildGraphModel(Object data, ITreeContentProvider contentProvider, ILabelProvider labelProvider,
+ IEditingDomainProvider domainProvider) {
super(data, contentProvider, labelProvider);
this.domainProvider = domainProvider;
}
@@ -48,12 +44,99 @@
}
@Override
+ public boolean canLinkWithSource(Object model) {
+ if (model instanceof AbstractSmooksGraphicalModel) {
+ Object sourceModel = ((AbstractSmooksGraphicalModel) model).getData();
+ sourceModel = AdapterFactoryEditingDomain.unwrap(sourceModel);
+ Object targetModel = getData();
+ targetModel = AdapterFactoryEditingDomain.unwrap(targetModel);
+ if (sourceModel instanceof EObject && targetModel instanceof EObject) {
+ EStructuralFeature idFeature = SmooksUIUtils.getBeanIDFeature((EObject) targetModel);
+ EStructuralFeature idRefFeature = SmooksUIUtils.getBeanIDRefFeature((EObject) sourceModel);
+ if (idFeature != null && idRefFeature != null) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean canLinkWithTarget(Object model) {
+ if (model instanceof AbstractSmooksGraphicalModel) {
+ Object targetModel = ((AbstractSmooksGraphicalModel) model).getData();
+ targetModel = AdapterFactoryEditingDomain.unwrap(targetModel);
+ Object sourceModel = getData();
+ sourceModel = AdapterFactoryEditingDomain.unwrap(sourceModel);
+ if (sourceModel instanceof EObject && targetModel instanceof EObject) {
+ EStructuralFeature idFeature = SmooksUIUtils.getBeanIDFeature((EObject) targetModel);
+ EStructuralFeature idRefFeature = SmooksUIUtils.getBeanIDRefFeature((EObject) sourceModel);
+ if (idFeature != null && idRefFeature != null) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void addSourceConnection(TreeNodeConnection connection) {
+ super.addSourceConnection(connection);
+ Object sourceModel = getData();
+ sourceModel = AdapterFactoryEditingDomain.unwrap(sourceModel);
+ if (sourceModel instanceof EObject) {
+ EStructuralFeature feature = SmooksUIUtils.getBeanIDRefFeature((EObject) sourceModel);
+ Object model = connection.getTargetNode().getData();
+ if (feature != null) {
+ EStructuralFeature idFeature = SmooksUIUtils.getBeanIDFeature((EObject) model);
+ if (idFeature == null)
+ return;
+ // it's bean id connection
+ Object iddata = ((EObject) model).eGet(idFeature);
+ if (iddata != null) {
+ Command command = SetCommand.create(domainProvider.getEditingDomain(), (EObject) sourceModel,
+ feature, iddata);
+ domainProvider.getEditingDomain().getCommandStack().execute(command);
+ return;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void removeSourceConnection(TreeNodeConnection connection) {
+ super.removeSourceConnection(connection);
+ Object sourceModel = getData();
+ sourceModel = AdapterFactoryEditingDomain.unwrap(sourceModel);
+ if (sourceModel instanceof EObject) {
+ EStructuralFeature feature = SmooksUIUtils.getBeanIDRefFeature((EObject) sourceModel);
+ Object model = connection.getTargetNode().getData();
+ if (feature != null) {
+ EStructuralFeature idFeature = SmooksUIUtils.getBeanIDFeature((EObject) model);
+ if (idFeature == null)
+ return;
+ // it's bean id connection
+ if (idFeature != null) {
+ Command command = SetCommand.create(domainProvider.getEditingDomain(), (EObject) sourceModel,
+ feature, null);
+ domainProvider.getEditingDomain().getCommandStack().execute(command);
+ return;
+ }
+ }
+ }
+ }
+
+ @Override
public void addTargetConnection(TreeNodeConnection connection) {
super.addTargetConnection(connection);
Object model = getData();
model = AdapterFactoryEditingDomain.unwrap(model);
if (model instanceof EObject) {
- EStructuralFeature feature = getFeature(model);
+ // for the javabean children , there is only "Selector" target
+ // connection;
+ EStructuralFeature feature = SmooksUIUtils.getSelectorFeature((EObject) model);
+ if (feature == null)
+ return;
EObject owner = (EObject) model;
AbstractSmooksGraphicalModel targetGraphModel = connection.getSourceNode();
Object tm = targetGraphModel.getData();
@@ -64,33 +147,6 @@
}
}
}
-
- protected EStructuralFeature getFeature(Object model){
- EStructuralFeature feature = null;
- if(model == null){
- return null;
- }
- if (model instanceof WiringType) {
- feature = JavabeanPackage.Literals.WIRING_TYPE__WIRE_ON_ELEMENT;
- }
- if (model instanceof org.jboss.tools.smooks.model.javabean12.WiringType) {
- feature = Javabean12Package.Literals.WIRING_TYPE__WIRE_ON_ELEMENT;
- }
- if (model instanceof ValueType) {
- feature = JavabeanPackage.Literals.VALUE_TYPE__DATA;
- }
- if (model instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
- feature = Javabean12Package.Literals.VALUE_TYPE__DATA;
- }
- if (model instanceof ExpressionType) {
- feature = JavabeanPackage.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT;
- }
- if (model instanceof org.jboss.tools.smooks.model.javabean12.ExpressionType) {
- feature = Javabean12Package.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT;
- }
-
- return feature;
- }
@Override
public void removeTargetConnection(TreeNodeConnection connection) {
@@ -98,11 +154,13 @@
Object model = getData();
model = AdapterFactoryEditingDomain.unwrap(model);
if (model instanceof EObject) {
- EStructuralFeature feature = getFeature(model);
+ EStructuralFeature feature = SmooksUIUtils.getSelectorFeature((EObject) model);
+ if (feature == null)
+ return;
EObject owner = (EObject) model;
Command command = SetCommand.create(domainProvider.getEditingDomain(), owner, feature, null);
domainProvider.getEditingDomain().getCommandStack().execute(command);
}
}
-
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/JavaBeanGraphModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/JavaBeanGraphModel.java 2009-08-21 15:04:44 UTC (rev 17223)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/JavaBeanGraphModel.java 2009-08-21 15:10:28 UTC (rev 17224)
@@ -23,10 +23,6 @@
import org.jboss.tools.smooks.gef.tree.model.TreeContainerModel;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeConnection;
import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
-import org.jboss.tools.smooks.model.javabean.BindingsType;
-import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
-import org.jboss.tools.smooks.model.javabean12.BeanType;
-import org.jboss.tools.smooks.model.javabean12.Javabean12Package;
/**
* @author Dart
@@ -54,20 +50,42 @@
Object model = getData();
if (model instanceof EObject) {
EStructuralFeature feature = null;
- if (model instanceof BindingsType) {
- feature = JavabeanPackage.Literals.BINDINGS_TYPE__CREATE_ON_ELEMENT;
+ // judge the source model's type:
+ AbstractSmooksGraphicalModel sourceGraphModel = connection.getSourceNode();
+ if (sourceGraphModel instanceof InputDataTreeNodeModel
+ || sourceGraphModel instanceof InputDataContianerModel) {
+ // it's "Selector" connection
+ feature = SmooksUIUtils.getSelectorFeature((EObject) model);
+ if (feature != null) {
+ EObject owner = (EObject) model;
+ AbstractSmooksGraphicalModel targetGraphModel = connection.getSourceNode();
+ Object tm = targetGraphModel.getData();
+ if (tm instanceof IXMLStructuredObject) {
+ String selector = SmooksUIUtils.generateFullPath((IXMLStructuredObject) tm, "/");
+ Command command = SetCommand
+ .create(domainProvider.getEditingDomain(), owner, feature, selector);
+ domainProvider.getEditingDomain().getCommandStack().execute(command);
+ return;
+ }
+ }
}
- if (model instanceof BeanType) {
- feature = Javabean12Package.Literals.BEAN_TYPE__CREATE_ON_ELEMENT;
- }
- EObject owner = (EObject) model;
- AbstractSmooksGraphicalModel targetGraphModel = connection.getSourceNode();
- Object tm = targetGraphModel.getData();
- if (tm instanceof IXMLStructuredObject) {
- String selector = SmooksUIUtils.generateFullPath((IXMLStructuredObject) tm, "/");
- Command command = SetCommand.create(domainProvider.getEditingDomain(), owner, feature, selector);
- domainProvider.getEditingDomain().getCommandStack().execute(command);
- }
+
+// Object sourceModel = sourceGraphModel.getData();
+// sourceModel = AdapterFactoryEditingDomain.unwrap(sourceModel);
+// if (sourceModel instanceof EObject) {
+// feature = SmooksUIUtils.getBeanIDRefFeature((EObject) sourceModel);
+// if (feature != null) {
+// // it's bean id connection
+// EStructuralFeature idFeature = SmooksUIUtils.getBeanIDFeature((EObject) model);
+// Object iddata = ((EObject) model).eGet(idFeature);
+// if (iddata != null) {
+// Command command = SetCommand.create(domainProvider.getEditingDomain(), (EObject) sourceModel,
+// feature, iddata);
+// domainProvider.getEditingDomain().getCommandStack().execute(command);
+// return;
+// }
+// }
+// }
}
}
@@ -77,15 +95,31 @@
Object model = getData();
if (model instanceof EObject) {
EStructuralFeature feature = null;
- if (model instanceof BindingsType) {
- feature = JavabeanPackage.Literals.BINDINGS_TYPE__CREATE_ON_ELEMENT;
+ AbstractSmooksGraphicalModel sourceGraphModel = connection.getSourceNode();
+ if (sourceGraphModel instanceof InputDataTreeNodeModel
+ || sourceGraphModel instanceof InputDataContianerModel) {
+ // it's "Selector" connection
+ feature = SmooksUIUtils.getSelectorFeature((EObject) model);
+ if (feature != null) {
+ EObject owner = (EObject) model;
+ Command command = SetCommand.create(domainProvider.getEditingDomain(), owner, feature, null);
+ domainProvider.getEditingDomain().getCommandStack().execute(command);
+ return;
+ }
}
- if (model instanceof BeanType) {
- feature = Javabean12Package.Literals.BEAN_TYPE__CREATE_ON_ELEMENT;
- }
- EObject owner = (EObject) model;
- Command command = SetCommand.create(domainProvider.getEditingDomain(), owner, feature, null);
- domainProvider.getEditingDomain().getCommandStack().execute(command);
+
+// Object sourceModel = sourceGraphModel.getData();
+// sourceModel = AdapterFactoryEditingDomain.unwrap(sourceModel);
+// if (sourceModel instanceof EObject) {
+// feature = SmooksUIUtils.getBeanIDRefFeature((EObject) sourceModel);
+// if (feature != null) {
+// // it's bean id connection
+// Command command = SetCommand.create(domainProvider.getEditingDomain(), (EObject) sourceModel,
+// feature, null);
+// domainProvider.getEditingDomain().getCommandStack().execute(command);
+// return;
+// }
+// }
}
}
}
16 years, 8 months
JBoss Tools SVN: r17223 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-08-21 11:04:44 -0400 (Fri, 21 Aug 2009)
New Revision: 17223
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/DtdResolver.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4808
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/DtdResolver.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/DtdResolver.java 2009-08-21 14:47:54 UTC (rev 17222)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/xml/DtdResolver.java 2009-08-21 15:04:44 UTC (rev 17223)
@@ -50,7 +50,6 @@
String systemId2 = systemId.substring(i + 1);
location = XMLCorePlugin.getDefault().getDefaultXMLCatalog().resolveURI(systemId2);
}
-
}
if((location == null || location.startsWith("http:")) && systemId != null) { //$NON-NLS-1$
Bundle b = Platform.getBundle("org.eclipse.jst.standard.schemas"); //$NON-NLS-1$
@@ -73,9 +72,9 @@
if(location == null) {
if(systemId != null && !unfound.contains(systemId)) {
unfound.add(systemId);
- CommonPlugin.getPluginLog().logError("Cannot find locally: " //$NON-NLS-1$
- + "Public ID " + publicId //$NON-NLS-1$
- + " System ID " + systemId); //$NON-NLS-1$
+// CommonPlugin.getPluginLog().logInfo("Cannot find locally: " //$NON-NLS-1$
+// + "Public ID " + publicId //$NON-NLS-1$
+// + " System ID " + systemId); //$NON-NLS-1$
}
}
if(location!=null) {
@@ -88,7 +87,7 @@
return url.openStream();
}
} catch(FileNotFoundException e) {
- CommonPlugin.getPluginLog().logError("Error in DtdResolver: " + e.getMessage()); //$NON-NLS-1$
+ CommonPlugin.getPluginLog().logError(e);
}
}
@@ -110,11 +109,9 @@
is = HttpUtil.getInputStreamFromUrlByGetMethod(systemId);
}
} catch (MalformedURLException e) {
- CommonPlugin.getPluginLog().logError( e.getMessage());
- // don't handle any exeptions. Bug #ESL-306
+ CommonPlugin.getPluginLog().logError(e);
} catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ CommonPlugin.getPluginLog().logError(e);
}
}
return is;
16 years, 8 months
JBoss Tools SVN: r17222 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-08-21 10:47:54 -0400 (Fri, 21 Aug 2009)
New Revision: 17222
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
Log:
JBIDE-4766: CA not shows message bundle proposals
Issue is fixed
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2009-08-21 14:13:15 UTC (rev 17221)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/FaceletPageContectAssistProcessor.java 2009-08-21 14:47:54 UTC (rev 17222)
@@ -63,10 +63,10 @@
context.setElResolvers(superContext.getElResolvers());
setVars(context, superContext.getResource());
- context.setResourceBundles(superContext.getResourceBundles());
context.setDocument(getDocument());
setNameSpaces(superContext, context);
context.setLibraries(getTagLibraries(context));
+ context.setResourceBundles(super.getResourceBundles(context));
// IFaceletPageContext getParentContext();
// Map<String, String> getParams();
16 years, 8 months
JBoss Tools SVN: r17221 - in trunk: birt/docs/en/modules and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-08-21 10:13:15 -0400 (Fri, 21 Aug 2009)
New Revision: 17221
Modified:
trunk/as/docs/reference/en/modules/perspective.xml
trunk/as/docs/reference/en/modules/quick_start.xml
trunk/birt/docs/en/modules/birt_reports_deployment.xml
trunk/esb/docs/esb_ref_guide/en/modules/introduction.xml
trunk/hibernatetools/docs/reference/en/modules/codegen.xml
trunk/portlet/docs/reference/en/modules/jsf_portlet.xml
trunk/seam/docs/reference/en/modules/seam_faq.xml
trunk/smooks/docs/reference/en/modules/quick_start.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/introduction.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-740 Links as Pronounce were replace with more meaningful phrases
Modified: trunk/as/docs/reference/en/modules/perspective.xml
===================================================================
--- trunk/as/docs/reference/en/modules/perspective.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/as/docs/reference/en/modules/perspective.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -778,7 +778,7 @@
<para>Look up <ulink
url="http://docs.jboss.org/jbossas/guides/installguide/r1/en/html/start-stop.html"
- >here</ulink> to find parameters which can be specified for <property>JBoss
+ >AS Installation Guide </ulink> to find parameters which can be specified for <property>JBoss
Server</property>.</para>
<note>
Modified: trunk/as/docs/reference/en/modules/quick_start.xml
===================================================================
--- trunk/as/docs/reference/en/modules/quick_start.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/as/docs/reference/en/modules/quick_start.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -259,9 +259,9 @@
<title>Other relevant resources on the topic</title>
<para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink
- url="http://docs.jboss.org/tools/2.1.0.GA">here</ulink>.</para>
+ url="http://docs.jboss.org/tools/2.1.0.GA">on JBoss Tools release documentation page</ulink>.</para>
<para>The latest documentation builds are available <ulink
- url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
+ url="http://download.jboss.org/jbosstools/nightly-docs/"> JBoss Tools nightly builds documentation page</ulink>.</para>
<para>Find out the answers on the frequently asked questions about JBoss AS 5 usage in the
<ulink url="http://www.jboss.org/community/wiki/jboss5faq">JBoss5FAQ</ulink>.
Modified: trunk/birt/docs/en/modules/birt_reports_deployment.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_reports_deployment.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/birt/docs/en/modules/birt_reports_deployment.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -116,7 +116,7 @@
comments or suggestions on the topic, please feel free to ask in the <ulink
url="http://www.jboss.org/index.html?module=bb&op=viewforum&f=201">JBoss
Tools Forum</ulink>. You can also influence on how you want to see JBoss Tools docs in
- future leaving your vote on our page <ulink
- url="http://www.jboss.org/community/docs/DOC-10795">here</ulink>.</para>
+ future leaving your vote on the article <ulink
+ url="http://www.jboss.org/community/docs/DOC-10795">Overview of the improvements required by JBossTools/JBDS Docs users</ulink>.</para>
</chapter>
Modified: trunk/esb/docs/esb_ref_guide/en/modules/introduction.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en/modules/introduction.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/esb/docs/esb_ref_guide/en/modules/introduction.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -112,7 +112,7 @@
<para>The latest <property>JBoss Tools/JBoss Developer Studio</property> documentation
builds are available <ulink url="http://download.jboss.org/jbosstools/nightly-docs/"
- >here</ulink>.</para>
+ > JBoss Tools nightly documentation page</ulink>.</para>
</section>
</chapter>
Modified: trunk/hibernatetools/docs/reference/en/modules/codegen.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/codegen.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/hibernatetools/docs/reference/en/modules/codegen.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -405,7 +405,7 @@
</emphasis> could be a dangerous decision that could produce non expected
side-effect.</para>
- <para><ulink url="http://www.hibernate.org/109.html">Here</ulink> you can get more in-depth
+ <para><ulink url="http://www.hibernate.org/109.html">On www.hibernate.org </ulink> you can get more in-depth
explanation on the subject of <property>equals()</property> and
<property>hashcode()</property>.</para>
</section>
Modified: trunk/portlet/docs/reference/en/modules/jsf_portlet.xml
===================================================================
--- trunk/portlet/docs/reference/en/modules/jsf_portlet.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/portlet/docs/reference/en/modules/jsf_portlet.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -68,7 +68,7 @@
<title>Tip:</title>
<para>You can download JBoss Portlet Bridge 1.0.0.B4 from <ulink
- url="http://www.jboss.org/portletbridge/download/">here</ulink>.</para>
+ url="http://www.jboss.org/portletbridge/download/">Portletbridge Download page</ulink>.</para>
</tip>
<para>Next click <emphasis>
Modified: trunk/seam/docs/reference/en/modules/seam_faq.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/seam_faq.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/seam/docs/reference/en/modules/seam_faq.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -65,10 +65,10 @@
some questions, comments or suggestions on the topic, please fell free to ask in the <ulink
url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201">JBoss
Tools Forum</ulink>. You can also influence on how you want to see JBoss Tools docs in
- future leaving your vote on our page <ulink
+ future leaving your vote on the article <ulink
url="http://wiki.jboss.org/wiki/JBossToolsDocsFuture"
- >here</ulink>. </para>
+ >Overview of the improvements required by JBossTools/JBDS Docs users</ulink>. </para>
- <para>A set of movies on Seam tooling is available <ulink url="http://docs.jboss.org/tools/movies">here</ulink>.</para>
+ <para>A set of movies on Seam tooling is available on <ulink url="http://docs.jboss.org/tools/movies">Seam movies page</ulink>.</para>
</section>
</chapter>
Modified: trunk/smooks/docs/reference/en/modules/quick_start.xml
===================================================================
--- trunk/smooks/docs/reference/en/modules/quick_start.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/smooks/docs/reference/en/modules/quick_start.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -17,7 +17,7 @@
<title>Download Smooks Java-to-Java Example</title>
<para> Visit <ulink
url="http://svn.codehaus.org/milyn/tags/Smooks_V1.1.2/smooks-examples/java-to-..."
- >here</ulink> to download the "java-to-java" example project. </para>
+ >smooks examples page</ulink> to download the "java-to-java" example project. </para>
<tip>
<title>Tip:</title>
Modified: trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/editors.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -234,7 +234,7 @@
</figure>
<para>Find more information about editor features <ulink url="&jsflink;#editors_features"
- >here</ulink>.</para>
+ >in the editor features chapter</ulink>.</para>
</section>
</section>
Modified: trunk/struts/docs/struts_tools_ref_guide/en/modules/introduction.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/introduction.xml 2009-08-21 13:08:48 UTC (rev 17220)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/introduction.xml 2009-08-21 14:13:15 UTC (rev 17221)
@@ -102,8 +102,8 @@
<section>
<title>Other relevant resources on the topic</title>
- <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://docs.jboss.org/tools/">here</ulink>.</para>
- <para>The latest documentation builds are available <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
+ <para>All JBoss Developer Studio/JBoss Tools documentation you can find on<ulink url="http://docs.jboss.org/tools/">JBoss Tools project page </ulink>.</para>
+ <para>The latest documentation builds are available on<ulink url="http://download.jboss.org/jbosstools/nightly-docs/">nightly docs page</ulink>.</para>
</section>
16 years, 8 months