JBoss Tools SVN: r15317 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-05-15 13:52:33 -0400 (Fri, 15 May 2009)
New Revision: 15317
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4322 - npe fix
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2009-05-15 17:30:14 UTC (rev 15316)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/AllEntitiesInfoCollector.java 2009-05-15 17:52:33 UTC (rev 15317)
@@ -698,21 +698,29 @@
if (cu == null) {
return;
}
- if (cu.types() != null && cu.types().size() > 0 ) {
- Object tmp = cu.types().get(0);
- if (!(tmp instanceof TypeDeclaration)) {
- // ignore EnumDeclaration & AnnotationTypeDeclaration
- return;
- }
+ if (cu.types() == null || cu.types().size() == 0 ) {
+ return;
}
- String fullyQualifiedName = cu.getTypeRoot().findPrimaryType().getFullyQualifiedName();
+ Object tmp = cu.types().get(0);
+ if (!(tmp instanceof TypeDeclaration)) {
+ // ignore EnumDeclaration & AnnotationTypeDeclaration
+ return;
+ }
+ String fullyQualifiedName = null;
+ //TODO: should inspect all types in cu? so next method to get fullyQualifiedName:
+ //((TypeDeclaration)tmp).resolveBinding().getBinaryName()
+ if (cu.getTypeRoot() == null || cu.getTypeRoot().findPrimaryType() == null) {
+ //fullyQualifiedName = ((TypeDeclaration)tmp).resolveBinding().getBinaryName();
+ return;
+ } else {
+ fullyQualifiedName = cu.getTypeRoot().findPrimaryType().getFullyQualifiedName();
+ }
if (mapCUs_Info.containsKey(fullyQualifiedName)) {
return;
}
CollectEntityInfo finder = new CollectEntityInfo();
cu.accept(finder);
EntityInfo result = finder.getEntityInfo();
-
if (result != null) {
result.adjustParameters();
mapCUs_Info.put(fullyQualifiedName, result);
17 years, 2 months
JBoss Tools SVN: r15316 - in trunk/seam/tests/org.jboss.tools.seam.core.test: src/org/jboss/tools/seam/core/test/refactoring and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-05-15 13:30:14 -0400 (Fri, 15 May 2009)
New Revision: 15316
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.xhtml
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
Log:
Test for https://jira.jboss.org/jira/browse/JBIDE-1077
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.xhtml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.xhtml (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.xhtml 2009-05-15 17:30:14 UTC (rev 15316)
@@ -0,0 +1,45 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ template="layout/template.xhtml">
+
+<ui:define name="body">
+
+ <h:messages styleClass="message"/>
+
+ <h:form id="login">
+
+ <rich:panel>
+ <f:facet name="header">Login</f:facet>
+
+ <p>Please login using any username and password</p>
+
+ <div class="dialog">
+ <h:panelGrid columns="2" rowClasses="prop" columnClasses="name,value">
+ <h:outputLabel for="username">Username</h:outputLabel>
+ <h:inputText id="username"
+ value="#{test.value}"/>
+ <h:outputLabel for="password">Password</h:outputLabel>
+ <h:inputSecret id="password"
+ value="#{identity.password}"/>
+ <h:outputLabel for="rememberMe">Remember me</h:outputLabel>
+ <h:selectBooleanCheckbox id="rememberMe"
+ value="#{identity.rememberMe}"/>
+ </h:panelGrid>
+ </div>
+
+ </rich:panel>
+
+ <div class="actionButtons">
+ <h:commandButton value="Login" action="#{identity.login}"/>
+ </div>
+
+ </h:form>
+
+ </ui:define>
+</ui:composition>
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-15 17:03:07 UTC (rev 15315)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-15 17:30:14 UTC (rev 15316)
@@ -95,6 +95,10 @@
0, 4, "best");
list.add(structure);
+ structure = new TestChangeStructure(warProject, "/WebContent/test.xhtml",
+ 1088, 4, "best");
+ list.add(structure);
+
structure = new TestChangeStructure(warProject, "/WebContent/test.jsp",
227, 4, "best");
list.add(structure);
@@ -103,18 +107,16 @@
29, 4, "best");
list.add(structure);
- structure = new TestChangeStructure(earProject, "/EarContent/test.jsp",
- 227, 4, "best");
- list.add(structure);
+// structure = new TestChangeStructure(earProject, "/EarContent/test.jsp",
+// 227, 4, "best");
+// list.add(structure);
+//
+// structure = new TestChangeStructure(earProject, "/EarContent/test.properties",
+// 29, 4, "best");
+// list.add(structure);
- structure = new TestChangeStructure(earProject, "/EarContent/test.properties",
- 29, 4, "best");
- list.add(structure);
+ /*
- /*
- structure = new TestChangeStructure("/WebContent/login.xhtml",
- 1033, 4, "best");
- list.add(structure);
*/
renameComponent(seamEjbProject, "test", "best", list);
}
17 years, 2 months
JBoss Tools SVN: r15315 - trunk/jsf/docs/userguide/en/images/visual_page.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-15 13:03:07 -0400 (Fri, 15 May 2009)
New Revision: 15315
Added:
trunk/jsf/docs/userguide/en/images/visual_page/source_bottom.png
trunk/jsf/docs/userguide/en/images/visual_page/source_left.png
trunk/jsf/docs/userguide/en/images/visual_page/source_right.png
trunk/jsf/docs/userguide/en/images/visual_page/source_top.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_24.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_25.png
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-720 - Vertical Spliting view is added to Visual/Source Editor. All the new functionality was described and all the screens with Visual/Source Editor were updated.</p>
</body></html>
Added: trunk/jsf/docs/userguide/en/images/visual_page/source_bottom.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/visual_page/source_bottom.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/userguide/en/images/visual_page/source_left.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/visual_page/source_left.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/userguide/en/images/visual_page/source_right.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/visual_page/source_right.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/userguide/en/images/visual_page/source_top.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/visual_page/source_top.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_24.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_24.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_25.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_25.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 2 months
JBoss Tools SVN: r15314 - trunk/jsf/docs/userguide/en/images/visual_page.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-15 13:01:51 -0400 (Fri, 15 May 2009)
New Revision: 15314
Modified:
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_1.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_12.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_14.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_15.png
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-720 - Vertical Spliting view is added to Visual/Source Editor. All the new functionality was described and all the screens with Visual/Source Editor were updated.</p>
</body></html>
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_1.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_12.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_14.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_15.png
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Tools SVN: r15313 - in trunk/jsf/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-15 13:01:08 -0400 (Fri, 15 May 2009)
New Revision: 15313
Modified:
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_2.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23a.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23b.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_3.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_4.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_4a.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_4b.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_4c.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_5.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_7a.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_8.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_9.png
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-720 - Vertical Spliting view is added to Visual/Source Editor. All the new functionality was described and all the screens with Visual/Source Editor were updated.</p>
</body></html>
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_2.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23a.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23b.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_3.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_4.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_4a.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_4b.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_4c.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_5.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_7a.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_8.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_9.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2009-05-15 16:58:11 UTC (rev 15312)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2009-05-15 17:01:08 UTC (rev 15313)
@@ -1238,9 +1238,9 @@
<section id="AdvancedSettings954">
<title>Advanced Settings</title>
-
- <para>In the left vertical pane of the Visual part there are three buttons: <emphasis>
- <property>Preferences</property></emphasis>
+
+ <para>In the left vertical pane of the Visual part there are four buttons: <emphasis>
+ <property>Preferences</property></emphasis>
(
<inlinemediaobject>
<imageobject>
@@ -1262,16 +1262,45 @@
</imageobject>
</inlinemediaobject>
)
- and <emphasis>
+ ,<emphasis>
<property>Page Design Options</property> </emphasis>(
- <inlinemediaobject>
- <imageobject>
- <imagedata fileref="images/visual_page/icon_3.png"/>
- </imageobject>
- </inlinemediaobject>
- )
-
- .</para>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/icon_3.png"/>
+ </imageobject>
+ </inlinemediaobject>
+ )
+ and some of the next buttons:
+ <emphasis>
+ <property>Vertical Source on top</property> </emphasis>(
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/source_top.png"/>
+ </imageobject>
+ </inlinemediaobject>),
+ <emphasis>
+ <property>Vertical Visual on top</property> </emphasis>(
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/source_bottom.png"/>
+ </imageobject>
+ </inlinemediaobject>),
+ <emphasis>
+ <property>Horizontal Source to the left</property> </emphasis>(
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/source_left.png"/>
+ </imageobject>
+ </inlinemediaobject>),
+ <emphasis>
+ <property>Horizontal Visual to the left</property> </emphasis>(
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/source_right.png"/>
+ </imageobject>
+ </inlinemediaobject>),
+ depending on the current Visual/Source layout
+ .</para>
<figure>
<title>Buttons on the Visual Part of VPE</title>
@@ -1519,7 +1548,57 @@
</mediaobject>
</figure>
</listitem>
-
+ <listitem id="splitting_buttons">
+ <para><emphasis>
+ <property>Visual/Source Editors splitting buttons</property></emphasis>
+ provide the possibility to choose one of the four possible layouts for the Visual/Source Editor.
+ </para>
+
+
+ <para>The available layouts and corresponding buttons are as follows:</para>
+ <itemizedlist>
+ <listitem><para>Vertical Source on top(<inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/source_top.png"/>
+ </imageobject>
+ </inlinemediaobject>)</para></listitem>
+ <listitem><para>Vertical Visual on top ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/source_bottom.png"/>
+ </imageobject>
+ </inlinemediaobject>)</para></listitem>
+ <listitem><para>Horizontal Source to the left ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/source_left.png"/>
+ </imageobject>
+ </inlinemediaobject>)</para></listitem>
+ <listitem><para>Horizontal Visual to the left ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/source_right.png"/>
+ </imageobject>
+ </inlinemediaobject>)</para></listitem>
+
+ </itemizedlist>
+ <figure>
+ <title>Visual Page Editor Before Layout Changing </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/visual_page_24.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ Note, at the current view there is only <emphasis>
+ <property> one</property></emphasis> button, that proposes the possibility to change it in order the Source and the View are moved <emphasis>
+ <property>in a clockwise direction</property></emphasis>.
+ <figure>
+ <title>Visual Page Editor After Layout Changing </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/visual_page_25.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
</itemizedlist>
<para>You can find useful one more functionality provided by VPE. At the bottom of the
17 years, 2 months
JBoss Tools SVN: r15312 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 12:58:11 -0400 (Fri, 15 May 2009)
New Revision: 15312
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4263
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-15 16:57:12 UTC (rev 15311)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-15 16:58:11 UTC (rev 15312)
@@ -168,7 +168,7 @@
declarationFile = (IFile)javaDecl.getResource();
if(declarationFile != null && !coreHelper.isJar(javaDecl)){
ITextSourceReference location = ((SeamComponentDeclaration)javaDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
- if(location != null){
+ if(location != null && !isBadLocation(location)){
TextFileChange change = getChange(declarationFile);
TextEdit edit = new ReplaceEdit(location.getStartPosition(), location.getLength(), "\""+newName+"\""); //$NON-NLS-1$ //$NON-NLS-2$
change.addEdit(edit);
17 years, 2 months
JBoss Tools SVN: r15311 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-05-15 12:57:12 -0400 (Fri, 15 May 2009)
New Revision: 15311
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-722 - necessary details about the Finger Touch button are added.
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml 2009-05-15 16:56:28 UTC (rev 15310)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml 2009-05-15 16:57:12 UTC (rev 15311)
@@ -333,7 +333,20 @@
feature of auto-redeploy. It means that you don't need to restart
<property>JBoss Server</property>. Any changes made in the application in
exploded format will trigger a redeployment on the server.</para>
+
+ <para>You can also use the "Finger touch" button for a quick restart of the project without restarting the server:</para>
+ <figure>
+ <title>Finger Touch button</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/jsp_application/jsp_application_19_finger_touch.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The "Finger" touches descriptors dependent on project (i.e. web.xml for WAR, application.xml for EAR, jboss-esb.xml in ESB projects).</para>
+
</section>
+
</section>
<section id="Previewtab">
17 years, 2 months
JBoss Tools SVN: r15310 - trunk/documentation/guides/GettingStartedGuide/en/images/jsp_application.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-05-15 12:56:28 -0400 (Fri, 15 May 2009)
New Revision: 15310
Added:
trunk/documentation/guides/GettingStartedGuide/en/images/jsp_application/jsp_application_19_finger_touch.png
Log:
https://jira.jboss.org/jira/browse/JBDS-722 - necessary screenshot added to show the Finger Touch button.
Added: trunk/documentation/guides/GettingStartedGuide/en/images/jsp_application/jsp_application_19_finger_touch.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/guides/GettingStartedGuide/en/images/jsp_application/jsp_application_19_finger_touch.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 2 months
JBoss Tools SVN: r15309 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-05-15 12:52:17 -0400 (Fri, 15 May 2009)
New Revision: 15309
Modified:
trunk/as/docs/reference/en/modules/modules.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-722 - the required details are relocated to make the whole story more logical.
Modified: trunk/as/docs/reference/en/modules/modules.xml
===================================================================
--- trunk/as/docs/reference/en/modules/modules.xml 2009-05-15 16:39:14 UTC (rev 15308)
+++ trunk/as/docs/reference/en/modules/modules.xml 2009-05-15 16:52:17 UTC (rev 15309)
@@ -58,16 +58,6 @@
the <link linkend="Project_archivesView">Project Archives view</link> and customize
packaging yourself.</para>
- <para>You can also use the "Finger touch" for a quick restart of the project without restarting the server:</para>
- <figure>
- <title>Finger Touch button</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/modules/modules_8_finger_touch.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The "Finger" touches descriptors dependent on project (i.e. web.xml for WAR, application.xml for EAR, jboss-esb.xml in ESB projects).</para>
</section>
@@ -189,6 +179,19 @@
</emphasis> file, is to enable the builder for that project. This is done by either
changing the global preferences for the <property>Archives View</property>, or by
enabling project-specific preferences and ensuring the builder is on.</para>
+
+ <para>You can also use the "Finger touch" button for a quick restart of the project without restarting the server:</para>
+ <figure>
+ <title>Finger Touch button</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/modules/modules_8_finger_touch.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The "Finger" touches descriptors dependent on project (i.e. web.xml for WAR, application.xml for EAR, jboss-esb.xml in ESB projects).</para>
+
+
<para>The last chapter covers a variety of methods on how you can deploy needed modules onto a
server.</para>
</section>
17 years, 2 months
JBoss Tools SVN: r15308 - in trunk/seam/tests/org.jboss.tools.seam.core.test: projects/Test1-ear/EarContent and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-05-15 12:39:14 -0400 (Fri, 15 May 2009)
New Revision: 15308
Added:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.jsp
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.properties
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestComponent.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestSeamComponent.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.jsp
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.properties
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/seam.properties
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamRefactoringAllTests.java
Log:
Tests for https://jira.jboss.org/jira/browse/JBIDE-1077
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.jsp
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.jsp (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.jsp 2009-05-15 16:39:14 UTC (rev 15308)
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ <h:outputText value="Test value is #{test.value}!" />
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.properties
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.properties (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.properties 2009-05-15 16:39:14 UTC (rev 15308)
@@ -0,0 +1 @@
+TEST_VALUE = This value is #{test.value}!
\ No newline at end of file
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1/WebContent/test.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.jsp
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.jsp (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.jsp 2009-05-15 16:39:14 UTC (rev 15308)
@@ -0,0 +1,12 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ <h:outputText value="Test value is #{test.value}!" />
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.properties
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.properties (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.properties 2009-05-15 16:39:14 UTC (rev 15308)
@@ -0,0 +1 @@
+TEST_VALUE = This value is #{test.value}!
\ No newline at end of file
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ear/EarContent/test.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestComponent.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestComponent.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestComponent.java 2009-05-15 16:39:14 UTC (rev 15308)
@@ -0,0 +1,22 @@
+package org.domain.Test1.session;
+
+import org.jboss.seam.annotations.*;
+
+@Name(value="test")
+public class TestComponent {
+
+ String password;
+
+ public Object getPart(){
+ return null;
+ }
+
+ public boolean operate(){
+ return true;
+ }
+
+ public String value(){
+ return "Default Value";
+ }
+
+}
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestComponent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestSeamComponent.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestSeamComponent.java (rev 0)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestSeamComponent.java 2009-05-15 16:39:14 UTC (rev 15308)
@@ -0,0 +1,41 @@
+package org.domain.Test1.session;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.security.Identity;
+
+
+@Name("component")
+public class TestSeamComponent
+{
+ @Logger Log log;
+
+ @In Identity identity;
+
+ @In String test;
+
+ @In("test") boolean flag;
+
+ @Factory("test")
+ int getVar(){
+ return 2;
+ };
+
+ @Factory
+ String getTest(){
+ return "Test value is #{test.value}!";
+ };
+
+ public boolean authenticate()
+ {
+ log.info("authenticating #0", identity.getUsername());
+ //write your authentication logic here,
+ //return true if the authentication was
+ //successful, false otherwise
+ identity.addRole("admin");
+ return true;
+ }
+}
Property changes on: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/org/domain/Test1/session/TestSeamComponent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/seam.properties
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/seam.properties 2009-05-15 16:38:06 UTC (rev 15307)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/Test1-ejb/ejbModule/seam.properties 2009-05-15 16:39:14 UTC (rev 15308)
@@ -0,0 +1 @@
+test.operate = Test Component Operation
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-15 16:38:06 UTC (rev 15307)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamComponentRefactoringTest.java 2009-05-15 16:39:14 UTC (rev 15308)
@@ -19,9 +19,14 @@
import junit.framework.TestCase;
public class SeamComponentRefactoringTest extends TestCase {
- static String warProjectName = "SeamWebWarTestProject";
+ static String warProjectName = "Test1";
+ static String earProjectName = "Test1-ear";
+ static String ejbProjectName = "Test1-ejb";
static IProject warProject;
+ static IProject earProject;
+ static IProject ejbProject;
static ISeamProject seamWarProject;
+ static ISeamProject seamEjbProject;
public SeamComponentRefactoringTest(){
super("Seam Component Refactoring Test");
@@ -34,62 +39,84 @@
if(seamWarProject==null) {
seamWarProject = loadSeamProject(warProject);
}
+
+ if(earProject==null) {
+ earProject = ProjectImportTestSetup.loadProject(earProjectName);
+ }
+
+ if(ejbProject==null) {
+ ejbProject = ProjectImportTestSetup.loadProject(ejbProjectName);
+ }
+ if(seamEjbProject==null) {
+ seamEjbProject = loadSeamProject(ejbProject);
+ }
}
private ISeamProject loadSeamProject(IProject project) throws CoreException {
+ JobUtils.waitForIdle();
+ System.out.println("Project - "+project);
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
assertNotNull("Seam project for " + project.getName() + " is null", seamProject);
- JobUtils.waitForIdle();
+
return seamProject;
}
public void testSeamComponentRename() throws CoreException {
ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
- TestChangeStructure structure = new TestChangeStructure("/src/action/org/domain/SeamWebWarTestProject/session/TestComponent.java",
- 113, 6, "\"best\"");
+ TestChangeStructure structure = new TestChangeStructure(ejbProject.getProject(), "/ejbModule/org/domain/"+warProjectName+"/session/TestComponent.java",
+ 89, 6, "\"best\"");
list.add(structure);
-
+ /*
structure = new TestChangeStructure("/WebContent/WEB-INF/components.xml",
2660, 6, "best");
list.add(structure);
structure = new TestChangeStructure("/WebContent/WEB-INF/components.xml",
2756, 4, "best");
list.add(structure);
-
- structure = new TestChangeStructure("/src/action/org/domain/SeamWebWarTestProject/session/TestSeamComponent.java",
- 413, 0, "(\"best\")");
+ */
+ structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
+ 420, 11, "@In(\"best\")");
list.add(structure);
- structure = new TestChangeStructure("/src/action/org/domain/SeamWebWarTestProject/session/TestSeamComponent.java",
- 436, 11, "@In(\"best\")");
+ structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
+ 389, 8, "(\"best\")");
list.add(structure);
- structure = new TestChangeStructure("/src/action/org/domain/SeamWebWarTestProject/session/TestSeamComponent.java",
- 471, 16, "@Factory(\"best\")");
+ structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
+ 455, 16, "@Factory(\"best\")");
list.add(structure);
- structure = new TestChangeStructure("/src/action/org/domain/SeamWebWarTestProject/session/TestSeamComponent.java",
- 545, 0, "(\"best\")");
+ structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
+ 529, 8, "(\"best\")");
list.add(structure);
- structure = new TestChangeStructure("/src/action/org/domain/SeamWebWarTestProject/session/TestSeamComponent.java",
- 597, 4, "best");
+ structure = new TestChangeStructure(ejbProject, "/ejbModule/org/domain/"+warProjectName+"/session/TestSeamComponent.java",
+ 589, 4, "best");
list.add(structure);
- structure = new TestChangeStructure("/src/seam.properties",
+ structure = new TestChangeStructure(ejbProject, "/ejbModule/seam.properties",
0, 4, "best");
list.add(structure);
- structure = new TestChangeStructure("/WebContent/login.xhtml",
- 1033, 4, "best");
+ structure = new TestChangeStructure(warProject, "/WebContent/test.jsp",
+ 227, 4, "best");
list.add(structure);
- structure = new TestChangeStructure("/WebContent/refactoring_test.jsp",
+ structure = new TestChangeStructure(warProject, "/WebContent/test.properties",
+ 29, 4, "best");
+ list.add(structure);
+
+ structure = new TestChangeStructure(earProject, "/EarContent/test.jsp",
227, 4, "best");
list.add(structure);
- structure = new TestChangeStructure("/WebContent/test.properties",
+ structure = new TestChangeStructure(earProject, "/EarContent/test.properties",
29, 4, "best");
list.add(structure);
- renameComponent(seamWarProject, "test", "best", list);
+ /*
+ structure = new TestChangeStructure("/WebContent/login.xhtml",
+ 1033, 4, "best");
+ list.add(structure);
+ */
+ renameComponent(seamEjbProject, "test", "best", list);
}
private void renameComponent(ISeamProject seamProject, String componentName, String newName, List<TestChangeStructure> changeList) throws CoreException{
@@ -99,7 +126,7 @@
assertNotNull(component);
assertNull(seamProject.getComponent(newName));
for(TestChangeStructure changeStructure : changeList){
- IFile file = seamProject.getProject().getFile(changeStructure.getFileName());
+ IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
String content = null;
content = FileUtil.readStream(file.getContents());
assertNotSame(changeStructure.getText(), content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength()));
@@ -116,26 +143,33 @@
assertNull(seamProject.getComponent(componentName));
assertNotNull(seamProject.getComponent(newName));
for(TestChangeStructure changeStructure : changeList){
- IFile file = seamProject.getProject().getFile(changeStructure.getFileName());
+ IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
String content = null;
content = FileUtil.readStream(file.getContents());
+ System.out.println("File - "+file.getName()+" offset - "+changeStructure.getOffset()+" expected - ["+changeStructure.getText()+"] actual - ["+content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength())+"]");
assertEquals(changeStructure.getText(), content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength()));
}
}
class TestChangeStructure{
+ private IProject project;
private String fileName;
private int offset;
private int length;
private String text;
- public TestChangeStructure(String fileName, int offset, int length, String text){
+ public TestChangeStructure(IProject project, String fileName, int offset, int length, String text){
+ this.project = project;
this.fileName = fileName;
this.offset = offset;
this.length = length;
this.text = text;
}
+ public IProject getProject(){
+ return project;
+ }
+
public String getFileName(){
return fileName;
}
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamRefactoringAllTests.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamRefactoringAllTests.java 2009-05-15 16:38:06 UTC (rev 15307)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamRefactoringAllTests.java 2009-05-15 16:39:14 UTC (rev 15308)
@@ -28,8 +28,8 @@
new String[]{"RefactoringTestProject-war", "RefactoringTestProject-ejb", "RefactoringTestProject-test"}));
suite.addTest(new ProjectImportTestSetup(new TestSuite(SeamComponentRefactoringTest.class),
"org.jboss.tools.seam.core.test",
- new String[]{"projects/SeamWebWarTestProject"},
- new String[]{"SeamWebWarTestProject"}));
+ new String[]{"projects/Test1","projects/Test1-ear","projects/Test1-ejb"},
+ new String[]{"Test1","Test1-ear","Test1-ejb"}));
return suite;
}
}
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r15307 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 12:38:06 -0400 (Fri, 15 May 2009)
New Revision: 15307
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2009-05-15 16:37:41 UTC (rev 15306)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2009-05-15 16:38:06 UTC (rev 15307)
@@ -100,6 +100,7 @@
import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -111,7 +112,6 @@
import org.jboss.tools.seam.core.ISeamDeclaration;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.AbstractSeamDeclaration;
@@ -849,7 +849,7 @@
IResource resource = decl.getResource();
String name = decl.getName();
- ISeamTextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
+ ITextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
if (textSourceReference != null) {
int offset = textSourceReference.getStartPosition();
int length = textSourceReference.getLength();
@@ -878,7 +878,7 @@
IResource resource = decl.getResource();
String name = decl.getName();
- ISeamTextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
+ ITextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
if (textSourceReference != null) {
int offset = textSourceReference.getStartPosition();
int length = textSourceReference.getLength();
@@ -906,7 +906,7 @@
IResource resource = decl.getResource();
String name = decl.getName();
- ISeamTextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
+ ITextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
if (textSourceReference != null) {
int offset = textSourceReference.getStartPosition();
int length = textSourceReference.getLength();
@@ -927,7 +927,7 @@
IResource resource = decl.getResource();
String name = decl.getName();
- ISeamTextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
+ ITextSourceReference textSourceReference = decl.getLocationFor(AbstractSeamDeclaration.PATH_OF_NAME);
if (textSourceReference != null) {
int offset = textSourceReference.getStartPosition();
int length = textSourceReference.getLength();
17 years, 2 months
JBoss Tools SVN: r15306 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 12:37:41 -0400 (Fri, 15 May 2009)
New Revision: 15306
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2009-05-15 16:37:12 UTC (rev 15305)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2009-05-15 16:37:41 UTC (rev 15306)
@@ -20,6 +20,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
@@ -32,7 +33,6 @@
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamProperty;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
@@ -495,7 +495,7 @@
String MY_COMPONENT = "myComponent";
assertNotNull("XML declaration for component " + MY_COMPONENT + " is not found in components.xml.", xml);
- ISeamTextSourceReference location = xml.getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ ITextSourceReference location = xml.getLocationFor(ISeamXmlComponentDeclaration.NAME);
assertNotNull("Location of declaration of component " + MY_COMPONENT + " in components.xml is not found.", location);
assertTrue("Location should not point to 0", location.getStartPosition() > 0 && location.getLength() > 0);
}
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java 2009-05-15 16:37:12 UTC (rev 15305)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java 2009-05-15 16:37:41 UTC (rev 15306)
@@ -11,12 +11,12 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamFactory;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.internal.core.SeamAnnotatedFactory;
import org.jboss.tools.seam.internal.core.SeamJavaComponentDeclaration;
import org.jboss.tools.seam.internal.core.SeamProject;
17 years, 2 months
JBoss Tools SVN: r15305 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: core/event and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 12:37:12 -0400 (Fri, 15 May 2009)
New Revision: 15305
Removed:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamTextSourceReference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IValueInfo.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/IChangeVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ValueInfo.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLValueInfo.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamElement.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaSourceReference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/ISeamValueString.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/SeamProjectChangeEvent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/BijectedAttribute.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/DataModelSelectionAttribute.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentMethod.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueList.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMap.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLConstants.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamComponentDeclaration.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -10,11 +10,13 @@
******************************************************************************/
package org.jboss.tools.seam.core;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+
/**
* Represents declaration of seam component.
* @author Alexey Kazakov
*/
-public interface ISeamComponentDeclaration extends ISeamDeclaration, ISeamTextSourceReference {
+public interface ISeamComponentDeclaration extends ISeamDeclaration, ITextSourceReference {
public ISeamComponentDeclaration clone() throws CloneNotSupportedException;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamDeclaration.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.core;
import org.eclipse.core.runtime.IAdaptable;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
/**
* @author Viacheslav Kabanovich
@@ -28,6 +29,6 @@
* e.g. if you need source reference for @Name you have to
* invoke getLocationFor("name");
*/
- public ISeamTextSourceReference getLocationFor(String path);
+ public ITextSourceReference getLocationFor(String path);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamElement.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamElement.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamElement.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -15,7 +15,7 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.seam.core.event.Change;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.w3c.dom.Element;
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaSourceReference.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaSourceReference.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaSourceReference.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -11,12 +11,13 @@
package org.jboss.tools.seam.core;
import org.eclipse.jdt.core.IMember;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
/**
* An interface of seam tools model object that has associated source object in JDT model
* @author Alexey Kazakov
*/
-public interface ISeamJavaSourceReference extends ISeamTextSourceReference {
+public interface ISeamJavaSourceReference extends ITextSourceReference {
public IMember getSourceMember();
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProperty.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -10,12 +10,13 @@
******************************************************************************/
package org.jboss.tools.seam.core;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.seam.core.event.ISeamValue;
/**
* A property of Seam Component defined in component.xml or seam.properties files
*/
-public interface ISeamProperty extends ISeamDeclaration, ISeamTextSourceReference {
+public interface ISeamProperty extends ISeamDeclaration, ITextSourceReference {
/**
* @return value of this property
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamTextSourceReference.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamTextSourceReference.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamTextSourceReference.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,28 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.core;
-
-/**
- * An interface of seam tools model object that has text source.
- * @author Alexey Kazakov
- */
-public interface ISeamTextSourceReference {
-
- /**
- * @return start position of element in text
- */
- public int getStartPosition();
-
- /**
- * @return number of characters of element in text
- */
- public int getLength();
-}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamXmlFactory.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -10,11 +10,13 @@
******************************************************************************/
package org.jboss.tools.seam.core;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+
/**
* Represents <factory> element in components.xml
* @author Alexey Kazakov
*/
-public interface ISeamXmlFactory extends ISeamFactory, ISeamTextSourceReference {
+public interface ISeamXmlFactory extends ISeamFactory, ITextSourceReference {
/**
* @return string value of 'value' attribute
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IValueInfo.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IValueInfo.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/IValueInfo.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,31 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.core;
-
-import java.util.Properties;
-
-import org.w3c.dom.Element;
-
-/**
- * @author Viacheslav Kabanovich
- */
-public interface IValueInfo extends ISeamTextSourceReference {
-
- /**
- * Returns string value
- * @return
- */
- public String getValue();
-
- public Element toXML(Element parent, Properties context);
-
- public void loadXML(Element element, Properties context);
-}
\ No newline at end of file
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,125 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.core.event;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This object collects changes in target that should be fired to listeners.
- *
- * @author Viacheslav Kabanovich
- */
-public class Change {
- Object target;
- String property;
- Object oldValue;
- Object newValue;
- List<Change> children;
-
- /**
- * Constructs object with initial values
- *
- * @param target
- * @param property
- * name of property changed or null, if change is adding/removing
- * a child.
- * @param oldValue
- * old value; if null and property = null, then child (newValue)
- * is added
- * @param newValue
- * new value; if null and property = null, then child (oldValue)
- * is removed
- */
- public Change(Object target, String property, Object oldValue, Object newValue) {
- this.target = target;
- this.property = property;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
-
- public Object getTarget() {
- return target;
- }
-
- public String getProperty() {
- return property;
- }
-
- public Object getOldValue() {
- return oldValue;
- }
-
- public Object getNewValue() {
- return newValue;
- }
-
- public void addChildren(List<Change> children) {
- if(this.children == null) {
- this.children = children;
- } else if(children != null) {
- this.children.addAll(children);
- }
- }
-
- /**
- * Returns true if this object defines no actual change in seam model.
- * @return
- */
- public boolean isEmpty() {
- return oldValue == null && newValue == null && !isChildrenAffected();
- }
-
- /**
- * Returns true if this change includes sub-changes.
- * @return
- */
- public boolean isChildrenAffected() {
- return children != null && !children.isEmpty();
- }
-
- /**
- * Returns list of all changes
- * @return
- */
- public List<Change> getChildren() {
- return children;
- }
-
- /**
- * Invokes visitor for this change, and if visit returns true, iterates over
- * child changes.
- * @param visitor
- */
- public void visit(IChangeVisitor visitor) {
- if(!visitor.visit(this)) return;
- if(children != null) {
- for (Change c: children) {
- c.visit(visitor);
- }
- }
- }
-
- /**
- * Utility method to attach a single change to the list. If list is not provided,
- * new list is created, otherwise the provided list is returned.
- * @param changes
- * @param change
- * @return
- */
- public static List<Change> addChange(List<Change> changes, Change change) {
- if(change == null || change.isEmpty()) return changes;
- if(changes == null) changes = new ArrayList<Change>();
- changes.add(change);
- return changes;
- }
-
-}
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/IChangeVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/IChangeVisitor.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/IChangeVisitor.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.core.event;
-
-/**
- * This interface allows to process SeamProjectChangeEvent, or specific Change by
- * invoking method visit(IChangeVisitor) declared on them.
- *
- * @author Viacheslav Kabanovich
- */
-public interface IChangeVisitor {
-
- /**
- * Processes a single change. If this method returns true,
- * it shall be invoked with child changes
- * @param change
- * @return
- */
- public boolean visit(Change change);
-}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/ISeamValueString.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/ISeamValueString.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/ISeamValueString.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.seam.core.event;
-import org.jboss.tools.seam.core.IValueInfo;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
/**
* @author Viacheslav Kabanovich
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/SeamProjectChangeEvent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/SeamProjectChangeEvent.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/SeamProjectChangeEvent.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -14,6 +14,8 @@
import java.util.EventObject;
import java.util.List;
+import org.jboss.tools.common.model.project.ext.event.Change;
+import org.jboss.tools.common.model.project.ext.event.IChangeVisitor;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractContextVariable.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -13,12 +13,12 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/AbstractSeamDeclaration.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -18,19 +18,20 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.IOpenableElement;
import org.jboss.tools.seam.core.ISeamDeclaration;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
* @author Viacheslav Kabanovich
*/
-public abstract class AbstractSeamDeclaration extends SeamObject implements ISeamDeclaration, ISeamTextSourceReference, IOpenableElement {
+public abstract class AbstractSeamDeclaration extends SeamObject implements ISeamDeclaration, ITextSourceReference, IOpenableElement {
public static final String PATH_OF_NAME = "name"; //$NON-NLS-1$
protected String name;
@@ -65,9 +66,9 @@
* e.g. if you need source reference for @Name you have to
* invoke getLocationFor("name");
*/
- public ISeamTextSourceReference getLocationFor(String path) {
+ public ITextSourceReference getLocationFor(String path) {
final IValueInfo valueInfo = attributes.get(path);
- ISeamTextSourceReference reference = new ISeamTextSourceReference() {
+ ITextSourceReference reference = new ITextSourceReference() {
public int getLength() {
return valueInfo != null ? valueInfo.getLength() : 0;
}
@@ -116,7 +117,7 @@
XModelObject old = pushModelObject(context);
if(name != null) element.setAttribute(SeamXMLConstants.ATTR_NAME, name);
- SeamXMLHelper.saveMap(element, attributes, "attributes", context);
+ XMLStoreHelper.saveMap(element, attributes, "attributes", context);
popModelObject(context, old);
@@ -131,7 +132,7 @@
if(element.hasAttribute(SeamXMLConstants.ATTR_NAME)) {
name = element.getAttribute(SeamXMLConstants.ATTR_NAME);
}
- SeamXMLHelper.loadMap(element, attributes, "attributes", context);
+ XMLStoreHelper.loadMap(element, attributes, "attributes", context);
popModelObject(context, old);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/BijectedAttribute.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/BijectedAttribute.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/BijectedAttribute.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -14,11 +14,11 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/DataModelSelectionAttribute.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/DataModelSelectionAttribute.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/DataModelSelectionAttribute.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -13,9 +13,9 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/InnerModelHelper.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.seam.internal.core;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.XModelConstants;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.project.IModelNature;
-import org.jboss.tools.common.model.project.ProjectHome;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.model.util.XModelObjectUtil;
-
-public class InnerModelHelper {
-
- public static XModel createXModel(IProject project) {
- IModelNature n = EclipseResourceUtil.getModelNature(project.getProject());
- if(n != null) return n.getModel();
-
- XModel model = EclipseResourceUtil.createObjectForResource(project.getProject()).getModel();
- XModelObject webinf = model.getByPath("FileSystems/WEB-INF"); //$NON-NLS-1$
- if(webinf != null) return model;
-
- IPath webInfPath = getWebInfPath(project);
-
- if(webInfPath == null) return model;
-
- IFolder webInfFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(webInfPath);
-
- model.getProperties().setProperty(XModelConstants.WORKSPACE, webInfFolder.getLocation().toString());
- model.getProperties().setProperty(XModelConstants.WORKSPACE_OLD, webInfFolder.getLocation().toString());
-
- XModelObject fs = model.getByPath("FileSystems"); //$NON-NLS-1$
- webinf = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
- webinf.setAttributeValue("name", "WEB-INF"); //$NON-NLS-1$ //$NON-NLS-2$
- webinf.setAttributeValue("location", XModelConstants.WORKSPACE_REF); //$NON-NLS-1$
- fs.addChild(webinf);
-
- String webInfLocation = XModelObjectUtil.expand(XModelConstants.WORKSPACE_REF, model, null);
- String webRootLocation = getWebRootPath(project, webInfLocation);
-
- XModelObject webroot = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
- webroot.setAttributeValue("name", "WEB-ROOT"); //$NON-NLS-1$ //$NON-NLS-2$
- webroot.setAttributeValue("location", webRootLocation); //$NON-NLS-1$ //$NON-NLS-2$
- fs.addChild(webroot);
-
- XModelObject lib = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
- lib.setAttributeValue("name", "lib"); //$NON-NLS-1$ //$NON-NLS-2$
- lib.setAttributeValue("location", XModelConstants.WORKSPACE_REF + "/lib"); //$NON-NLS-1$ //$NON-NLS-2$
- fs.addChild(lib);
-
- return model;
- }
-
- //Taken from J2EEUtils and modified
- public static IPath getWebInfPath(IProject project) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- if(component == null) return null;
- IVirtualFolder webInfDir = component.getRootFolder().getFolder(new Path("/WEB-INF"));
- IPath modulePath = webInfDir.getWorkspaceRelativePath();
- return (!webInfDir.exists()) ? null : modulePath;
- }
-
- static String getWebRootPath(IProject project, String webInfLocation) {
- String webRootLocation = XModelConstants.WORKSPACE_REF + "/..";
-
- IPath wrp = ProjectHome.getFirstWebContentPath(project);
- IPath wip = ProjectHome.getWebInfPath(project);
-
- if(wrp == null || wip == null) {
- return webRootLocation;
- }
-
- IResource wrpc = ResourcesPlugin.getWorkspace().getRoot().findMember(wrp);
- IResource wipc = ResourcesPlugin.getWorkspace().getRoot().findMember(wip);
- if(wrpc != null && wipc != null && wipc.isLinked()) {
- IPath p = wrpc.getLocation();
- if(p != null) {
- try {
- webRootLocation = p.toFile().getCanonicalPath().replace('\\', '/');
- } catch (IOException e) {
- }
- String relative = org.jboss.tools.common.util.FileUtil.getRelativePath(webInfLocation, webRootLocation);
- if(relative != null) {
- webRootLocation = XModelConstants.WORKSPACE_REF + relative;
- }
- }
- }
- return webRootLocation;
- }
-
-}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -14,12 +14,12 @@
import java.util.Properties;
import org.eclipse.jdt.core.IMethod;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamAnnotatedFactory;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -16,6 +16,8 @@
import java.util.List;
import java.util.Set;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
import org.jboss.tools.seam.core.IRole;
@@ -27,11 +29,9 @@
import org.jboss.tools.seam.core.ISeamPackage;
import org.jboss.tools.seam.core.ISeamPropertiesDeclaration;
import org.jboss.tools.seam.core.ISeamProperty;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamComponentMethodType;
-import org.jboss.tools.seam.core.event.Change;
/**
* @author Viacheslav Kabanovich
@@ -89,7 +89,7 @@
return null;
}
- public ISeamTextSourceReference getLocationFor(String path) {
+ public ITextSourceReference getLocationFor(String path) {
ISeamJavaComponentDeclaration javaDeclaration = getJavaDeclaration();
if(javaDeclaration != null) return javaDeclaration.getLocationFor(path);
Set<ISeamXmlComponentDeclaration> xml = getXmlDeclarations();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -15,11 +15,11 @@
import java.util.Set;
import org.eclipse.core.resources.IResource;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
/**
* @author Viacheslav Kabanovich
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentMethod.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentMethod.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentMethod.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -18,10 +18,10 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamComponentMethod;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.SeamComponentMethodType;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamContextShortVariable.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,8 +1,8 @@
package org.jboss.tools.seam.internal.core;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.seam.core.ISeamContextShortVariable;
import org.jboss.tools.seam.core.ISeamContextVariable;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ScopeType;
public class SeamContextShortVariable extends SeamObject implements ISeamContextShortVariable {
@@ -36,7 +36,7 @@
throw new CloneNotSupportedException();
}
- public ISeamTextSourceReference getLocationFor(String path) {
+ public ITextSourceReference getLocationFor(String path) {
return original.getLocationFor(path);
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -26,8 +26,11 @@
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -38,12 +41,10 @@
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamComponentMethodType;
import org.jboss.tools.seam.core.SeamComponentPrecedenceType;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
public class SeamJavaComponentDeclaration extends SeamComponentDeclaration
@@ -503,14 +504,14 @@
if(v == null) continue;
Element e_type = XMLUtilities.createElement(e_types, "bean-type");
e_type.setAttribute(SeamXMLConstants.ATTR_NAME, t.toString());
- SeamXMLHelper.saveValueInfo(e_type, v, context);
+ XMLStoreHelper.saveValueInfo(e_type, v, context);
}
}
element.setAttribute(SeamXmlComponentDeclaration.PRECEDENCE, "" + precedence);
if(type != null && type != id) {
- SeamXMLHelper.saveType(element, type, "type", context);
+ XMLStoreHelper.saveType(element, type, "type", context);
}
if(type != null) context.put(SeamXMLConstants.ATTR_TYPE, type);
@@ -565,7 +566,7 @@
continue;
}
if(t == null) continue;
- IValueInfo value = SeamXMLHelper.loadValueInfo(e_type[i], context);
+ IValueInfo value = XMLStoreHelper.loadValueInfo(e_type[i], context);
if(value != null) {
types.put(t, value);
}
@@ -585,7 +586,7 @@
Element e_type = XMLUtilities.getUniqueChild(element, "type");
if(e_type != null) {
- type = SeamXMLHelper.loadType(e_type, context);
+ type = XMLStoreHelper.loadType(e_type, context);
} else if(id instanceof IType) {
type = (IType)id;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaContextVariable.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -25,11 +25,12 @@
import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
public abstract class SeamJavaContextVariable extends AbstractContextVariable implements ISeamJavaSourceReference {
@@ -95,13 +96,13 @@
Element element = super.toXML(parent, context);
if(javaSource instanceof IField) {
- SeamXMLHelper.saveField(element, (IField)javaSource, TAG_JAVA_SOURCE, context);
+ XMLStoreHelper.saveField(element, (IField)javaSource, TAG_JAVA_SOURCE, context);
} else if(javaSource instanceof IMethod) {
- SeamXMLHelper.saveMethod(element, (IMethod)javaSource, TAG_JAVA_SOURCE, context);
+ XMLStoreHelper.saveMethod(element, (IMethod)javaSource, TAG_JAVA_SOURCE, context);
} else if(javaSource instanceof IType) {
Element ce = XMLUtilities.createElement(element, TAG_JAVA_SOURCE);
ce.setAttribute(SeamXMLConstants.ATTR_CLASS, SeamXMLConstants.CLS_TYPE);
- SeamXMLHelper.saveType(ce, (IType)javaSource, context);
+ XMLStoreHelper.saveType(ce, (IType)javaSource, context);
}
return element;
@@ -114,11 +115,11 @@
if(c != null) {
String cls = c.getAttribute(SeamXMLConstants.ATTR_CLASS);
if(SeamXMLConstants.CLS_FIELD.equals(cls)) {
- javaSource = SeamXMLHelper.loadField(c, context);
+ javaSource = XMLStoreHelper.loadField(c, context);
} else if(SeamXMLConstants.CLS_METHOD.equals(cls)) {
- javaSource = SeamXMLHelper.loadMethod(c, context);
+ javaSource = XMLStoreHelper.loadMethod(c, context);
} else if(SeamXMLConstants.CLS_TYPE.equals(cls)) {
- javaSource = SeamXMLHelper.loadType(c, context);
+ javaSource = XMLStoreHelper.loadType(c, context);
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessages.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -16,10 +16,10 @@
import java.util.Properties;
import org.eclipse.core.resources.IResource;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamMessages;
import org.jboss.tools.seam.core.ISeamProperty;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesComponent.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -16,9 +16,9 @@
import java.util.Properties;
import org.eclipse.core.resources.IResource;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamMessages;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamObject.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -22,10 +22,11 @@
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
@@ -167,14 +168,14 @@
eid.setAttribute(SeamXMLConstants.ATTR_CLASS, SeamXMLConstants.CLS_STRING);
eid.setAttribute(SeamXMLConstants.ATTR_VALUE, id.toString());
} else if(id instanceof IType) {
- SeamXMLHelper.saveType(element, ((IType)id), SeamXMLConstants.TAG_ID, context);
+ XMLStoreHelper.saveType(element, ((IType)id), SeamXMLConstants.TAG_ID, context);
} else if(id instanceof IField) {
- SeamXMLHelper.saveField(element, ((IField)id), SeamXMLConstants.TAG_ID, context);
+ XMLStoreHelper.saveField(element, ((IField)id), SeamXMLConstants.TAG_ID, context);
} else if(id instanceof IMethod) {
- SeamXMLHelper.saveMethod(element, ((IMethod)id), SeamXMLConstants.TAG_ID, context);
+ XMLStoreHelper.saveMethod(element, ((IMethod)id), SeamXMLConstants.TAG_ID, context);
} else if(id instanceof XModelObject) {
XModelObject o = (XModelObject)id;
- SeamXMLHelper.saveModelObject(element, o, SeamXMLConstants.TAG_ID, context);
+ XMLStoreHelper.saveModelObject(element, o, SeamXMLConstants.TAG_ID, context);
}
}
return element;
@@ -193,13 +194,13 @@
if(SeamXMLConstants.CLS_STRING.equals(cls)) {
id = e_id.getAttribute("string");
} else if(SeamXMLConstants.CLS_TYPE.equals(cls)) {
- id = SeamXMLHelper.loadType(e_id, context);
+ id = XMLStoreHelper.loadType(e_id, context);
} else if(SeamXMLConstants.CLS_FIELD.equals(cls)) {
- id = SeamXMLHelper.loadField(e_id, context);
+ id = XMLStoreHelper.loadField(e_id, context);
} else if(SeamXMLConstants.CLS_METHOD.equals(cls)) {
- id = SeamXMLHelper.loadMethod(e_id, context);
+ id = XMLStoreHelper.loadMethod(e_id, context);
} else if(SeamXMLConstants.CLS_MODEL_OBJECT.equals(cls)) {
- id = SeamXMLHelper.loadModelObject(e_id, context);
+ id = XMLStoreHelper.loadModelObject(e_id, context);
}
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -5,10 +5,10 @@
import java.util.List;
import java.util.Map;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamPackage;
-import org.jboss.tools.seam.core.event.Change;
public class SeamPackageUtil {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -36,6 +36,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.BijectedAttributeType;
@@ -53,7 +54,6 @@
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamCoreBuilder;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamProjectChangeListener;
import org.jboss.tools.seam.core.event.SeamProjectChangeEvent;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -28,13 +28,13 @@
import org.jboss.tools.common.model.ServiceDialog;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamPropertiesDeclaration;
import org.jboss.tools.seam.core.ISeamProperty;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
public class SeamPropertiesDeclaration extends SeamComponentDeclaration
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -14,12 +14,12 @@
import java.util.Properties;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamProperty;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValue;
import org.w3c.dom.Element;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamResourceVisitor.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -27,6 +27,7 @@
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamScope.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -17,11 +17,11 @@
import java.util.List;
import java.util.Map;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamPackage;
import org.jboss.tools.seam.core.ISeamScope;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
public class SeamScope extends SeamObject implements ISeamScope {
//Contains all components for that scope.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamTextSourceReference.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -10,12 +10,12 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
/**
* @author Alexey Kazakov
*/
-public class SeamTextSourceReference implements ISeamTextSourceReference {
+public class SeamTextSourceReference implements ITextSourceReference {
private int length;
private int startPosition;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueList.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueList.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueList.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -14,9 +14,9 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValueList;
import org.jboss.tools.seam.core.event.ISeamValueString;
import org.w3c.dom.Element;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMap.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMap.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMap.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -14,9 +14,9 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValueMap;
import org.jboss.tools.seam.core.event.ISeamValueMapEntry;
import org.w3c.dom.Element;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -13,9 +13,9 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValueMapEntry;
import org.jboss.tools.seam.core.event.ISeamValueString;
import org.w3c.dom.Element;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueString.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -13,9 +13,10 @@
import java.util.List;
import java.util.Properties;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLStoreHelper;
import org.jboss.tools.seam.core.ISeamElement;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamValueString;
import org.w3c.dom.Element;
@@ -67,7 +68,7 @@
Element element = super.toXML(parent, context);
if(value != null) {
- SeamXMLHelper.saveValueInfo(element, value, context);
+ XMLStoreHelper.saveValueInfo(element, value, context);
}
return element;
@@ -75,7 +76,7 @@
public void loadXML(Element element, Properties context) {
super.loadXML(element, context);
- setValue(SeamXMLHelper.loadValueInfo(element, context));
+ setValue(XMLStoreHelper.loadValueInfo(element, context));
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLConstants.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLConstants.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLConstants.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,26 +1,18 @@
package org.jboss.tools.seam.internal.core;
-public interface SeamXMLConstants {
+import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
+
+public interface SeamXMLConstants extends XMLStoreConstants {
- public String TAG_VALUE_INFO = "value-info";
- public String TAG_ID = "id";
public String TAG_VALUE = "value";
public String TAG_PROPERTY = "property";
public String TAG_COMPONENT = "component";
- public String TAG_ENTRY = "entry";
public String TAG_BIJECTED_ATTRIBUTE = "bijected-attribute";
public String TAG_METHOD = "method";
public String TAG_ROLE = "role";
public String TAG_FACTORY = "factory";
public String TAG_IMPORT = "import";
- public String CLS_XML = "xml";
- public String CLS_MODEL_OBJECT = "model-object";
- public String CLS_STRING = "string";
- public String CLS_TYPE = "type";
- public String CLS_FIELD = "field";
- public String CLS_METHOD = "method";
-
public String CLS_PROPERTIES = "properties";
public String CLS_JAVA = "java";
public String CLS_MESSAGES = "messages";
@@ -30,17 +22,5 @@
public String CLS_DATA_MODEL = "datamodel";
- public String ATTR_CLASS = "class";
- public String ATTR_NAME = "name";
- public String ATTR_VALUE = "value";
- public String ATTR_PARAMS = "params";
-
- public String KEY_MODEL_OBJECT = "model-object";
-
- public String ATTR_PROJECT = "project";
- public String ATTR_TYPE = "type";
-
- public String ATTR_PATH = "path";
-
public String ATTR_SCOPE = "scope";
}
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,236 +0,0 @@
-package org.jboss.tools.seam.internal.core;
-
-import java.util.Map;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.common.model.XModel;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.xml.XMLUtilities;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.internal.core.scanner.java.ValueInfo;
-import org.jboss.tools.seam.internal.core.scanner.xml.XMLValueInfo;
-import org.w3c.dom.Element;
-
-public class SeamXMLHelper implements SeamXMLConstants {
-
- public static void saveValueInfo(Element parent, IValueInfo value, Properties context) {
- value.toXML(parent, context);
- }
-
- public static IValueInfo loadValueInfo(Element parent, Properties context) {
- Element c = XMLUtilities.getUniqueChild(parent, TAG_VALUE_INFO);
- if(c == null) return null;
- IValueInfo v = null;
- if(CLS_XML.equals(c.getAttribute(ATTR_CLASS))) {
- v = new XMLValueInfo();
- v.loadXML(c, context);
- if(((XMLValueInfo)v).getObject() == null) {
- v = new ValueInfo();
- //that may be a problem
- ((ValueInfo)v).setValue("");
- }
- } else {
- v = new ValueInfo();
- v.loadXML(c, context);
- }
-
- return v;
- }
-
- public static void saveModelObject(Element element, XModelObject object, Properties context) {
- if(object == null) return;
- String path = object.getPath();
- if(path == null) return;
- XModelObject base = (XModelObject)context.get(SeamXMLConstants.KEY_MODEL_OBJECT);
- if(base != null && base.getModel() == object.getModel()) {
- String basePath = base.getPath();
- if(path.startsWith("" + basePath + "/")) {
- path = path.substring(basePath.length());
- } else if(path.equals(basePath)) {
- path = ".";
- }
- }
-
- if(path != null) element.setAttribute(ATTR_PATH, path);
- IProject p = EclipseResourceUtil.getProject(object);
- if(p == null) return;
- element.setAttribute(ATTR_PROJECT, p.getName());
- }
-
- public static void saveModelObject(Element parent, XModelObject object, String child, Properties context) {
- Element element = XMLUtilities.createElement(parent, child);
- element.setAttribute(ATTR_CLASS, CLS_MODEL_OBJECT);
- saveModelObject(element, object, context);
- }
-
- public static XModelObject loadModelObject(Element element, Properties context) {
- String path = element.getAttribute(ATTR_PATH);
- XModelObject base = (XModelObject)context.get(SeamXMLConstants.KEY_MODEL_OBJECT);
- if(path == null || path.length() == 0) {
- //TODO reporting
- return null;
- } else if(path.equals(".")) {
- if(base == null) {
- //TODO reporting
- }
- return base;
- }
- if(path.startsWith("/")) {
- if(base != null) {
- if(base.getChildByPath(path.substring(1)) == null) {
- //TODO reporting
- }
- return base.getChildByPath(path.substring(1));
- }
- //TODO reporting
- return null;
- }
- IProject project = loadProject(element, context);
- if(project == null || !project.isAccessible()) return null;
- XModel model = InnerModelHelper.createXModel(project);
- if(model == null) return null;
- return model.getByPath(path);
- }
-
- public static XModelObject loadModelObject(Element parent, String child, Properties context) {
- Element element = XMLUtilities.getUniqueChild(parent, child);
- if(element == null) return null;
- return loadModelObject(element, context);
- }
-
- public static void saveType(Element element, IType type, Properties context) {
- if(type == null) return;
- if(context != null && type == context.get(ATTR_TYPE)) return;
- element.setAttribute(ATTR_PROJECT, type.getJavaProject().getProject().getName());
- element.setAttribute(ATTR_TYPE, type.getFullyQualifiedName());
- }
-
- public static void saveType(Element parent, IType type, String child, Properties context) {
- if(type == null) return;
- if(context != null && type == context.get(ATTR_TYPE)) return;
- Element element = XMLUtilities.createElement(parent, child);
- element.setAttribute(ATTR_CLASS, CLS_TYPE);
- saveType(element, type, context);
- }
-
- public static IProject loadProject(Element element, Properties context) {
- String project = element.getAttribute(ATTR_PROJECT);
- if(project == null || project.length() == 0) return null;
- return ResourcesPlugin.getWorkspace().getRoot().getProject(project);
- }
-
- public static IType loadType(Element element, Properties context) {
- String name = element.getAttribute(ATTR_TYPE);
- if(name == null || name.length() == 0) {
- if(context != null && context.containsKey(ATTR_TYPE)) {
- return (IType)context.get(ATTR_TYPE);
- }
- //TODO reporting
- return null;
- }
- IProject project = loadProject(element, context);
- if(project == null || !project.isAccessible()) return null;
- IJavaProject jp = JavaCore.create(project);
- if(jp != null) {
- try {
- IType type = jp.findType(name.replace('$', '.'));
- if(type == null && name.indexOf('$') >= 0) {
- int ii = name.lastIndexOf('.');
- String pack = (ii < 0) ? "" : name.substring(0, ii);
- String cls = name.substring(ii + 1);
- type = jp.findType(pack, cls.replace('$', '.'), new NullProgressMonitor());
- }
- return type;
- } catch (JavaModelException e) {
- //ignore
- }
- }
- return null;
- }
-
- public static void saveField(Element element, IField field, Properties context) {
- if(field == null) return;
- saveType(element, field.getDeclaringType(), context);
- element.setAttribute(ATTR_NAME, field.getElementName());
- }
-
- public static void saveField(Element parent, IField field, String child, Properties context) {
- if(field == null) return;
- Element element = XMLUtilities.createElement(parent, child);
- element.setAttribute(ATTR_CLASS, CLS_FIELD);
- saveField(element, field, context);
- }
-
- public static IField loadField(Element element, Properties context) {
- IType type = loadType(element, context);
- if(type == null) return null;
- String name = element.getAttribute(ATTR_NAME);
- if(name == null || name.length() == 0) return null;
- return type.getField(name);
- }
-
- public static void saveMethod(Element element, IMethod method, Properties context) {
- if(method == null) return;
- saveType(element, method.getDeclaringType(), context);
- element.setAttribute(ATTR_NAME, method.getElementName());
- String[] s = method.getParameterTypes();
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < s.length; i++) sb.append(s[i]).append(',');
- element.setAttribute(ATTR_PARAMS, sb.toString());
- }
-
- public static void saveMethod(Element parent, IMethod method, String child, Properties context) {
- if(method == null) return;
- Element element = XMLUtilities.createElement(parent, child);
- element.setAttribute(ATTR_CLASS, CLS_METHOD);
- saveMethod(element, method, context);
- }
-
- public static IMethod loadMethod(Element element, Properties context) {
- IType type = loadType(element, context);
- if(type == null) return null;
- String name = element.getAttribute(ATTR_NAME);
- if(name == null || name.length() == 0) return null;
- String params = element.getAttribute(ATTR_PARAMS);
- String[] ps = new String[0];
- if(params != null && params.length() > 0) {
- ps = params.split(",");
- }
- return type.getMethod(name, ps);
- }
-
- public static void saveMap(Element parent, Map<String, IValueInfo> map, String child, Properties context) {
- if(map == null || map.isEmpty()) return;
- Element element = XMLUtilities.createElement(parent, child);
- for (String name: map.keySet()) {
- IValueInfo value = map.get(name);
- Element c = XMLUtilities.createElement(element, TAG_ENTRY);
- c.setAttribute(ATTR_NAME, name);
- if(value == null) continue;
- value.toXML(c, context);
- }
- }
-
- public static void loadMap(Element parent, Map<String, IValueInfo> map, String child, Properties context) {
- Element element = XMLUtilities.getUniqueChild(parent, child);
- if(element == null) return;
- Element[] cs = XMLUtilities.getChildren(element, TAG_ENTRY);
- for (int i = 0; i < cs.length; i++) {
- String name = cs[i].getAttribute(ATTR_NAME);
- IValueInfo value = loadValueInfo(cs[i], context);
- if(name != null && value != null) {
- map.put(name, value);
- }
- }
- }
-}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlComponentDeclaration.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -15,12 +15,12 @@
import java.util.Properties;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.NamespaceMapping;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.ScopeType;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.internal.core.scanner.xml.XMLScanner;
import org.w3c.dom.Element;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlFactory.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXmlFactory.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -14,11 +14,11 @@
import java.util.Properties;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamXmlFactory;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.core.event.Change;
import org.w3c.dom.Element;
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -54,6 +54,8 @@
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
@@ -65,11 +67,9 @@
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.ISeamMessages;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.internal.core.el.SeamExpressionResolver.MessagesInfo;
import org.w3c.dom.Element;
@@ -1109,7 +1109,7 @@
}
public void setScope(ScopeType type) {
}
- public ISeamTextSourceReference getLocationFor(String path) {
+ public ITextSourceReference getLocationFor(String path) {
return null;
}
public String getName() {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -55,6 +55,7 @@
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.el.core.parser.ELParser;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.common.util.FileUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -62,7 +63,6 @@
import org.jboss.tools.seam.core.ISeamFactory;
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -167,7 +167,7 @@
private void renameJavaDeclaration(ISeamJavaComponentDeclaration javaDecl) throws CoreException{
declarationFile = (IFile)javaDecl.getResource();
if(declarationFile != null && !coreHelper.isJar(javaDecl)){
- ISeamTextSourceReference location = ((SeamComponentDeclaration)javaDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ ITextSourceReference location = ((SeamComponentDeclaration)javaDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
if(location != null){
TextFileChange change = getChange(declarationFile);
TextEdit edit = new ReplaceEdit(location.getStartPosition(), location.getLength(), "\""+newName+"\""); //$NON-NLS-1$ //$NON-NLS-2$
@@ -179,7 +179,7 @@
private void renameXMLDeclaration(ISeamXmlComponentDeclaration xmlDecl){
declarationFile = (IFile)xmlDecl.getResource();
if(declarationFile != null && !coreHelper.isJar(xmlDecl)){
- ISeamTextSourceReference location = ((SeamComponentDeclaration)xmlDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ ITextSourceReference location = ((SeamComponentDeclaration)xmlDecl).getLocationFor(ISeamXmlComponentDeclaration.NAME);
if(location != null)
changeXMLNode(location, declarationFile);
}
@@ -408,7 +408,7 @@
Set<IBijectedAttribute> inSet = seamProject.getBijectedAttributesByName(component.getName(), BijectedAttributeType.IN);
for(IBijectedAttribute inAtt : inSet){
- ISeamTextSourceReference location = inAtt.getLocationFor(SeamAnnotations.IN_ANNOTATION_TYPE);
+ ITextSourceReference location = inAtt.getLocationFor(SeamAnnotations.IN_ANNOTATION_TYPE);
if(location != null)
changeAnnotation(location, (IFile)inAtt.getResource());
}
@@ -419,25 +419,25 @@
for(ISeamFactory factory : factorySet){
IFile file = (IFile)factory.getResource();
if(file.getFileExtension().equalsIgnoreCase(JAVA_EXT)){
- ISeamTextSourceReference location = factory.getLocationFor(SeamAnnotations.FACTORY_ANNOTATION_TYPE);
+ ITextSourceReference location = factory.getLocationFor(SeamAnnotations.FACTORY_ANNOTATION_TYPE);
if(location != null)
changeAnnotation(location, file);
}else{
- ISeamTextSourceReference location = factory.getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ ITextSourceReference location = factory.getLocationFor(ISeamXmlComponentDeclaration.NAME);
if(location != null)
changeXMLNode(location, file);
}
}
}
- private boolean isBadLocation(ISeamTextSourceReference location){
+ private boolean isBadLocation(ITextSourceReference location){
if(location.getStartPosition() == 0 && location.getLength() == 0)
return true;
else
return false;
}
- private void changeXMLNode(ISeamTextSourceReference location, IFile file){
+ private void changeXMLNode(ITextSourceReference location, IFile file){
if(isBadLocation(location))
return;
@@ -466,7 +466,7 @@
}
}
- private void changeAnnotation(ISeamTextSourceReference location, IFile file){
+ private void changeAnnotation(ITextSourceReference location, IFile file){
if(isBadLocation(location))
return;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -29,10 +29,11 @@
import org.eclipse.jdt.core.dom.NormalAnnotation;
import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
import org.eclipse.jdt.core.dom.VariableDeclaration;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.SeamComponentMethodType;
import org.jboss.tools.seam.internal.core.BijectedAttribute;
import org.jboss.tools.seam.internal.core.DataModelSelectionAttribute;
@@ -82,9 +83,9 @@
component.setName(ValueInfo.getValueInfo(as[i].getAnnotation(), null));
} else if(SCOPE_ANNOTATION_TYPE.equals(type)) {
ValueInfo scope = ValueInfo.getValueInfo(as[i].getAnnotation(), null);
- if(scope != null && scope.value != null) {
- int q = scope.value.lastIndexOf('.');
- if(q >= 0) scope.value = scope.value.substring(q + 1).toLowerCase();
+ if(scope != null && scope.getValue() != null) {
+ int q = scope.getValue().lastIndexOf('.');
+ if(q >= 0) scope.setValue(scope.getValue().substring(q + 1).toLowerCase());
}
component.setScope(scope);
} else if(INSTALL_ANNOTATION_TYPE.equals(type)) {
@@ -98,7 +99,7 @@
Annotation a = findAnnotation(annotatedType, BeanType.values()[i].getAnnotationType());
if(a != null) {
ValueInfo v = new ValueInfo();
- v.value = "true"; //$NON-NLS-1$
+ v.setValue("true"); //$NON-NLS-1$
v.valueStartPosition = a.getStartPosition();
v.valueLength = a.getLength();
types.put(BeanType.values()[i], v);
@@ -124,7 +125,7 @@
ValueInfo factoryName = ValueInfo.getValueInfo(a, null);
if(factoryName == null) {
factoryName = new ValueInfo();
- factoryName.value = toPropertyName(m.getName().getIdentifier(), "get");
+ factoryName.setValue(toPropertyName(m.getName().getIdentifier(), "get"));
factoryName.valueLength = m.getName().getLength();
factoryName.valueStartPosition = m.getName().getStartPosition();
}
@@ -144,7 +145,7 @@
}
ValueInfo _a = new ValueInfo();
- _a.value = FACTORY_ANNOTATION_TYPE;
+ _a.setValue(FACTORY_ANNOTATION_TYPE);
_a.valueStartPosition = a.getStartPosition();
_a.valueLength = a.getLength();
factory.addAttribute(FACTORY_ANNOTATION_TYPE, _a);
@@ -181,7 +182,7 @@
Annotation in = as.get(BijectedAttributeType.IN);
if(in != null) {
ValueInfo _in = new ValueInfo();
- _in.value = IN_ANNOTATION_TYPE;
+ _in.setValue(IN_ANNOTATION_TYPE);
_in.valueStartPosition = in.getStartPosition();
_in.valueLength = in.getLength();
att.addAttribute(IN_ANNOTATION_TYPE, _in);
@@ -190,13 +191,13 @@
ValueInfo name = ValueInfo.getValueInfo(main, null);
att.setValue(name);
if(name == null || isDataModelSelectionType
- || name.value == null || name.value.length() == 0) {
+ || name.getValue() == null || name.getValue().length() == 0) {
name = new ValueInfo();
name.valueStartPosition = m.getStartPosition();
name.valueLength = m.getLength();
- name.value = m.getName().getIdentifier();
+ name.setValue(m.getName().getIdentifier());
if(in != null) {
- name.value = toPropertyName(name.value, "set");
+ name.setValue(toPropertyName(name.getValue(), "set"));
}
}
@@ -223,7 +224,7 @@
Annotation in = as.get(BijectedAttributeType.IN);
if(in != null) {
ValueInfo _in = new ValueInfo();
- _in.value = IN_ANNOTATION_TYPE;
+ _in.setValue(IN_ANNOTATION_TYPE);
_in.valueStartPosition = in.getStartPosition();
_in.valueLength = in.getLength();
att.addAttribute(IN_ANNOTATION_TYPE, _in);
@@ -232,11 +233,11 @@
ValueInfo name = ValueInfo.getValueInfo(main, null);
att.setValue(name);
if(name == null || isDataModelSelectionType
- || name.value == null || name.value.length() == 0) {
+ || name.getValue() == null || name.getValue().length() == 0) {
name = new ValueInfo();
name.valueStartPosition = m.getStartPosition();
name.valueLength = m.getLength();
- name.value = getFieldName(m);
+ name.setValue(getFieldName(m));
}
att.setName(name);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/PackageInfoRequestor.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -22,6 +22,7 @@
import org.eclipse.jdt.core.dom.IAnnotationBinding;
import org.eclipse.jdt.core.dom.NormalAnnotation;
import org.eclipse.jdt.core.dom.PackageDeclaration;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.seam.internal.core.SeamNamespace;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ValueInfo.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ValueInfo.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ValueInfo.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.seam.internal.core.scanner.java;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.QualifiedName;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.jboss.tools.common.xml.XMLUtilities;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.internal.core.SeamXMLConstants;
-import org.w3c.dom.Element;
-
-public class ValueInfo implements IValueInfo {
- String value;
- int valueStartPosition;
- int valueLength;
-
- /**
- * Factory method.
- * @param node
- * @param name
- * @return
- */
- public static ValueInfo getValueInfo(Annotation node, String name) {
- if(name == null) name = "value"; //$NON-NLS-1$
- if(node instanceof SingleMemberAnnotation) {
- if(name == null || "value".equals(name)) { //$NON-NLS-1$
- SingleMemberAnnotation m = (SingleMemberAnnotation)node;
- ValueInfo result = new ValueInfo();
- Expression exp = m.getValue();
- result.valueLength = exp.getLength();
- result.valueStartPosition = exp.getStartPosition();
- result.value = checkExpression(exp);
- return result;
- }
- return null;
- } else if(node instanceof NormalAnnotation) {
- NormalAnnotation n = (NormalAnnotation)node;
- List<?> vs = n.values();
- if(vs != null) for (int i = 0; i < vs.size(); i++) {
- MemberValuePair p = (MemberValuePair)vs.get(i);
- String pname = p.getName().getIdentifier();
- if(!name.equals(pname)) continue;
- ValueInfo result = new ValueInfo();
- Expression exp = p.getValue();
- result.valueLength = exp.getLength();
- result.valueStartPosition = exp.getStartPosition();
- result.value = checkExpression(exp);
- return result;
- }
- return null;
- }
- return null;
- }
-
- public ValueInfo() {
- }
-
- public String getValue() {
- return value;
- }
-
- public int getStartPosition() {
- return valueStartPosition;
- }
-
- public int getLength() {
- return valueLength;
- }
-
- static String checkExpression(Expression exp) {
- if(exp == null) return null;
- if(exp instanceof StringLiteral) {
- return ((StringLiteral)exp).getLiteralValue();
- } else if(exp instanceof QualifiedName) {
- Object o = exp.resolveConstantExpressionValue();
- if(o != null) return o.toString();
- return exp.toString();
- }
- Object o = exp.resolveConstantExpressionValue();
- if(o != null) return o.toString();
- return exp.toString();
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public Element toXML(Element parent, Properties context) {
- Element element = XMLUtilities.createElement(parent, SeamXMLConstants.TAG_VALUE_INFO);
- if(value != null) element.setAttribute(SeamXMLConstants.ATTR_VALUE, value);
- if(valueStartPosition != 0) element.setAttribute(ATTR_START, "" + valueStartPosition);
- if(valueLength != 0) element.setAttribute(ATTR_LENGTH, "" + valueLength);
- return element;
- }
-
- static String ATTR_START = "start";
- static String ATTR_LENGTH = "length";
-
- public void loadXML(Element element, Properties context) {
- value = element.getAttribute(SeamXMLConstants.ATTR_VALUE);
- String start = element.getAttribute(ATTR_START);
- if(start != null && start.length() > 0) {
- try {
- valueStartPosition = Integer.parseInt(start);
- } catch (NumberFormatException e) {
- //ignore
- }
- }
- String length = element.getAttribute(ATTR_LENGTH);
- if(length != null && length.length() > 0) {
- try {
- valueLength = Integer.parseInt(length);
- } catch (NumberFormatException e) {
- //ignore
- }
- }
- }
-}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassPath.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -33,9 +33,9 @@
import org.jboss.tools.common.model.filesystems.impl.FileSystemsLoader;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectUtil;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.ScannerException;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -32,9 +32,9 @@
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.XModelObjectUtil;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCoreMessages;
-import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamNamespace;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -31,9 +31,10 @@
import org.eclipse.jdt.internal.compiler.env.IBinaryField;
import org.eclipse.jdt.internal.compiler.env.IBinaryMethod;
import org.eclipse.jdt.internal.compiler.impl.Constant;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
-import org.jboss.tools.seam.core.IValueInfo;
import org.jboss.tools.seam.core.SeamComponentMethodType;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.AbstractContextVariable;
@@ -46,7 +47,6 @@
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.Util;
import org.jboss.tools.seam.internal.core.scanner.java.SeamAnnotations;
-import org.jboss.tools.seam.internal.core.scanner.java.ValueInfo;
public class TypeScanner implements SeamAnnotations {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/PropertiesScanner.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -22,8 +22,9 @@
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLValueInfo;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamPropertiesDeclaration;
import org.jboss.tools.seam.internal.core.SeamProperty;
import org.jboss.tools.seam.internal.core.SeamValueString;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLScanner.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -30,16 +30,18 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.model.util.NamespaceMapping;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
+import org.jboss.tools.jst.web.model.project.ext.store.XMLValueInfo;
import org.jboss.tools.seam.core.ISeamNamespace;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.event.ISeamValue;
import org.jboss.tools.seam.core.event.ISeamValueString;
-import org.jboss.tools.seam.internal.core.InnerModelHelper;
import org.jboss.tools.seam.internal.core.SeamProperty;
import org.jboss.tools.seam.internal.core.SeamValueList;
import org.jboss.tools.seam.internal.core.SeamValueMap;
@@ -50,7 +52,6 @@
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.ScannerException;
-import org.jboss.tools.seam.internal.core.scanner.java.ValueInfo;
/**
* @author Viacheslav Kabanovich
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLValueInfo.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLValueInfo.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/xml/XMLValueInfo.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -1,82 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.internal.core.scanner.xml;
-
-import java.util.Properties;
-
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.util.PositionHolder;
-import org.jboss.tools.common.xml.XMLUtilities;
-import org.jboss.tools.seam.core.IValueInfo;
-import org.jboss.tools.seam.internal.core.SeamXMLConstants;
-import org.jboss.tools.seam.internal.core.SeamXMLHelper;
-import org.w3c.dom.Element;
-
-/**
- * @author Viacheslav Kabanovich
- */
-public class XMLValueInfo implements IValueInfo {
- XModelObject object;
- String attribute;
-
- PositionHolder h = null;
-
- public XMLValueInfo() {
- }
-
- public XMLValueInfo(XModelObject object, String attribute) {
- this.object = object;
- this.attribute = attribute;
- }
-
- public int getLength() {
- getPositionHolder();
- int length = h.getEnd() - h.getStart();
- return length < 0 ? 0 : length;
- }
-
- public int getStartPosition() {
- getPositionHolder();
- return h.getStart();
- }
-
- public String getValue() {
- return object.getAttributeValue(attribute);
- }
-
- PositionHolder getPositionHolder() {
- if(h == null) {
- h = PositionHolder.getPosition(object, attribute);
- }
- h.update();
- return h;
- }
-
- public XModelObject getObject() {
- return object;
- }
-
- public Element toXML(Element parent, Properties context) {
- Element element = XMLUtilities.createElement(parent, SeamXMLConstants.TAG_VALUE_INFO);
- element.setAttribute(SeamXMLConstants.ATTR_CLASS, SeamXMLConstants.CLS_XML);
- if(attribute != null) element.setAttribute("attr", attribute);
- if(object != null) {
- SeamXMLHelper.saveModelObject(element, object, "object", context);
- }
- return element;
- }
-
- public void loadXML(Element element, Properties context) {
- attribute = element.getAttribute("attr");
- object = SeamXMLHelper.loadModelObject(element, "object", context);
- }
-
-}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -14,8 +14,8 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
/**
* @author Alexey Kazakov
@@ -31,7 +31,7 @@
* @param target
*/
void addError(String messageId, String preferenceKey,
- String[] messageArguments, ISeamTextSourceReference location,
+ String[] messageArguments, ITextSourceReference location,
IResource target);
/**
@@ -53,7 +53,7 @@
* @param target
*/
void addError(String messageId, String preferenceKey,
- ISeamTextSourceReference location, IResource target);
+ ITextSourceReference location, IResource target);
/**
* Adds a marker to the resource
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -32,6 +32,7 @@
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -46,7 +47,6 @@
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamProperty;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.ISeamXmlFactory;
import org.jboss.tools.seam.core.ScopeType;
@@ -317,7 +317,7 @@
(factoryScope == variable.getScope() || factoryScope.getPriority()>variable.getScope().getPriority())) {
// Duplicate factory name. Mark it.
// Save link to factory resource.
- ISeamTextSourceReference location = null;
+ ITextSourceReference location = null;
if(!firstDuplicateVariableWasMarked) {
firstDuplicateVariableWasMarked = true;
// mark original factory
@@ -449,7 +449,7 @@
if(!markedDeclarations.contains(checkedDeclaration) && sourceCheckedDeclaration) {
// Mark first wrong declaration with that name
IResource checkedDeclarationResource = checkedDeclaration.getResource();
- ISeamTextSourceReference location = ((SeamComponentDeclaration)checkedDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ ITextSourceReference location = ((SeamComponentDeclaration)checkedDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
if(!isEmptyLocation(location)) {
addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, SeamPreferences.NONUNIQUE_COMPONENT_NAME, new String[]{componentName}, location, checkedDeclarationResource);
}
@@ -457,7 +457,7 @@
}
// Mark next wrong declaration with that name
markedDeclarations.add(javaDeclaration);
- ISeamTextSourceReference location = ((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ ITextSourceReference location = ((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
if(!isEmptyLocation(location)) {
addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, SeamPreferences.NONUNIQUE_COMPONENT_NAME, new String[]{componentName}, location, javaDeclarationResource);
}
@@ -493,7 +493,7 @@
type = EclipseResourceUtil.getJavaProject(p).findType(className);
if(type==null) {
// Mark wrong class name
- ISeamTextSourceReference location = ((SeamComponentDeclaration)declaration).getLocationFor(ISeamXmlComponentDeclaration.CLASS);
+ ITextSourceReference location = ((SeamComponentDeclaration)declaration).getLocationFor(ISeamXmlComponentDeclaration.CLASS);
if(isEmptyLocation(location)) {
location = ((SeamComponentDeclaration)declaration).getLocationFor(ISeamXmlComponentDeclaration.NAME);
}
@@ -532,7 +532,7 @@
}
}
- static boolean isEmptyLocation(ISeamTextSourceReference location) {
+ static boolean isEmptyLocation(ITextSourceReference location) {
return (location == null
//is dead location, we cannot now change provider to return null
//because it may give rise to other errors.
@@ -546,22 +546,22 @@
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
ScopeType scope = component.getScope();
if(scope == ScopeType.STATELESS) {
- ISeamTextSourceReference location = getScopeLocation(component);
+ ITextSourceReference location = getScopeLocation(component);
addError(ENTITY_COMPONENT_WRONG_SCOPE_MESSAGE_ID, SeamPreferences.ENTITY_COMPONENT_WRONG_SCOPE, new String[]{component.getName()}, location, javaDeclaration.getResource());
}
}
}
- private ISeamTextSourceReference getScopeLocation(ISeamComponent component) {
+ private ITextSourceReference getScopeLocation(ISeamComponent component) {
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
- ISeamTextSourceReference location = ((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_SCOPE);
+ ITextSourceReference location = ((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_SCOPE);
if(isEmptyLocation(location)) {
location = getNameLocation(javaDeclaration);
}
return location;
}
- private ISeamTextSourceReference getNameLocation(ISeamJavaSourceReference source) {
+ private ITextSourceReference getNameLocation(ISeamJavaSourceReference source) {
int length = 0;
int offset = 0;
try {
@@ -580,7 +580,7 @@
validateStatefulComponentMethods(SeamComponentMethodType.REMOVE, component, REMOVE_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE);
ScopeType scope = component.getScope();
if(scope == ScopeType.PAGE || scope == ScopeType.STATELESS) {
- ISeamTextSourceReference location = getScopeLocation(component);
+ ITextSourceReference location = getScopeLocation(component);
addError(STATEFUL_COMPONENT_WRONG_SCOPE_MESSAGE_ID, SeamPreferences.STATEFUL_COMPONENT_WRONG_SCOPE, new String[]{component.getName()}, location, javaDeclaration.getResource());
}
validateDuplicateComponentMethod(SeamComponentMethodType.REMOVE, component, REMOVE_METHOD_SUFIX_MESSAGE_ID, SeamPreferences.DUPLICATE_REMOVE);
@@ -589,7 +589,7 @@
private void validateStatefulComponentMethods(SeamComponentMethodType methodType, ISeamComponent component, String postfixMessageId, String preferenceKey) {
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
- ISeamTextSourceReference classNameLocation = getNameLocation(javaDeclaration);
+ ITextSourceReference classNameLocation = getNameLocation(javaDeclaration);
Set<ISeamComponentMethod> methods = javaDeclaration.getMethodsByType(methodType);
if(methods==null || methods.isEmpty()) {
addError(STATEFUL_COMPONENT_DOES_NOT_CONTAIN_METHOD_SUFIX_MESSAGE_ID + postfixMessageId, preferenceKey, new String[]{component.getName()}, classNameLocation, javaDeclaration.getResource());
@@ -610,7 +610,7 @@
if(javaDeclaration.getSourcePath().equals(method.getSourcePath())) {
IMethod javaMethod = (IMethod)method.getSourceMember();
String methodName = javaMethod.getElementName();
- ISeamTextSourceReference methodNameLocation = getNameLocation(method);
+ ITextSourceReference methodNameLocation = getNameLocation(method);
addError(DUPLICATE_METHOD_PREFIX_MESSAGE_ID + postfixMessageId, preferenceKey, new String[]{methodName}, methodNameLocation, javaDeclaration.getResource());
}
}
@@ -659,7 +659,7 @@
if(variables==null || variables.size()<1) {
// Injection has unknown name. Mark it.
IResource declarationResource = declaration.getResource();
- ISeamTextSourceReference nameRef = getNameLocation(bijection);
+ ITextSourceReference nameRef = getNameLocation(bijection);
if(nameRef == null) {
nameRef = bijection;
}
@@ -727,7 +727,7 @@
String methodName = javaMethod.getElementName();
if(javaDeclaration.getSourcePath().equals(javaMethod.getPath())) {
validationContext.addLinkedCoreResource(component.getName(), javaDeclaration.getSourcePath());
- ISeamTextSourceReference methodNameLocation = getNameLocation(method);
+ ITextSourceReference methodNameLocation = getNameLocation(method);
addError(DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN_ID, SeamPreferences.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN, new String[]{methodName}, methodNameLocation, method.getResource());
}
}
@@ -741,7 +741,7 @@
IMethod javaMethod = (IMethod)method.getSourceMember();
String methodName = javaMethod.getElementName();
if(declaration.getSourcePath().equals(javaMethod.getPath())) {
- ISeamTextSourceReference methodNameLocation = getNameLocation(method);
+ ITextSourceReference methodNameLocation = getNameLocation(method);
addError(sufixMessageId + NONCOMPONENTS_METHOD_SUFIX_MESSAGE_ID, preferenceKey, new String[]{methodName}, methodNameLocation, method.getResource());
validationContext.addUnnamedCoreResource(declaration.getSourcePath());
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -24,12 +24,12 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.validation.internal.operations.WorkbenchContext;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamElement;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.AbstractContextVariable;
@@ -66,7 +66,7 @@
Set<ISeamComponentDeclaration> declarations = ((ISeamComponent)element).getAllDeclarations();
for (Object o : declarations) {
SeamComponentDeclaration d = (SeamComponentDeclaration)o;
- ISeamTextSourceReference location = d.getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ ITextSourceReference location = d.getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
if(!SeamCoreValidator.isEmptyLocation(location)) {
return d.getResource();
}
@@ -79,7 +79,7 @@
* @param seam model element
* @return location of name attribute
*/
- public ISeamTextSourceReference getLocationOfName(ISeamElement element) {
+ public ITextSourceReference getLocationOfName(ISeamElement element) {
return getLocationOfAttribute(element, SeamComponentDeclaration.PATH_OF_NAME);
}
@@ -87,8 +87,8 @@
* @param seam model element
* @return location of attribute
*/
- public ISeamTextSourceReference getLocationOfAttribute(ISeamElement element, String attributeName) {
- ISeamTextSourceReference location = null;
+ public ITextSourceReference getLocationOfAttribute(ISeamElement element, String attributeName) {
+ ITextSourceReference location = null;
if(element instanceof AbstractContextVariable) {
location = ((AbstractContextVariable)element).getLocationFor(attributeName);
} else if(element instanceof ISeamComponent) {
@@ -102,8 +102,8 @@
} else if(element instanceof SeamComponentDeclaration) {
location = ((SeamComponentDeclaration)element).getLocationFor(attributeName);
}
- if(SeamCoreValidator.isEmptyLocation(location) && element instanceof ISeamTextSourceReference) {
- location = (ISeamTextSourceReference)element;
+ if(SeamCoreValidator.isEmptyLocation(location) && element instanceof ITextSourceReference) {
+ location = (ITextSourceReference)element;
}
return location;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java 2009-05-15 16:33:08 UTC (rev 15304)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java 2009-05-15 16:37:12 UTC (rev 15305)
@@ -23,8 +23,8 @@
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamTextSourceReference;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamPreferences;
@@ -76,7 +76,7 @@
* org.eclipse.core.resources.IResource)
*/
public void addError(String messageId, String preferenceKey,
- String[] messageArguments, ISeamTextSourceReference location,
+ String[] messageArguments, ITextSourceReference location,
IResource target) {
addError(messageId, preferenceKey, messageArguments, location
.getLength(), location.getStartPosition(), target);
@@ -91,7 +91,7 @@
* org.eclipse.core.resources.IResource)
*/
public void addError(String messageId, String preferenceKey,
- ISeamTextSourceReference location, IResource target) {
+ ITextSourceReference location, IResource target) {
addError(messageId, preferenceKey, new String[0], location, target);
}
17 years, 2 months
JBoss Tools SVN: r15304 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal: scanner and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 12:33:08 -0400 (Fri, 15 May 2009)
New Revision: 15304
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-15 16:32:30 UTC (rev 15303)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-15 16:33:08 UTC (rev 15304)
@@ -29,6 +29,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.jst.web.WebModelPlugin;
@@ -500,17 +501,49 @@
* @param source
*/
public void pathRemoved(IPath source) {
+ if(!sourcePaths.contains(source) && !sourcePaths2.containsKey(source)) return;
+ sourcePaths.remove(source);
+ sourcePaths2.remove(source);
+
+ List<Change> changes = null;
//TODO
+
+ Set<ITagLibrary> ls = libraries.removePath(source);
+ if(ls != null) for (ITagLibrary l: ls) {
+ changes = Change.addChange(changes, new Change(this, null, l, null));
+ }
+ fireChanges(changes);
+
+// firePathRemovedToDependentProjects(source);
}
+ List<Change> postponedChanges = null;
+
public void postponeFiring() {
- //TODO
+ if(postponedChanges == null) {
+ postponedChanges = new ArrayList<Change>();
+ }
}
public void fireChanges() {
+ if(postponedChanges == null) return;
+ List<Change> changes = postponedChanges;
+ postponedChanges = null;
+ fireChanges(changes);
+ }
+
+ /**
+ *
+ * @param changes
+ */
+ void fireChanges(List<Change> changes) {
+ if(changes == null || changes.isEmpty()) return;
+ if(postponedChanges != null) {
+ postponedChanges.addAll(changes);
+ return;
+ }
//TODO
}
-
class LibraryStorage {
private Set<ITagLibrary> allFactories = new HashSet<ITagLibrary>();
private ITagLibrary[] allFactoriesArray = null;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java 2009-05-15 16:32:30 UTC (rev 15303)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java 2009-05-15 16:33:08 UTC (rev 15304)
@@ -10,26 +10,12 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.scanner;
-import java.io.ByteArrayInputStream;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IParent;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FileSystemsImpl;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.model.util.XModelObjectUtil;
import org.jboss.tools.jst.web.kb.IKbProject;
import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
@@ -81,25 +67,26 @@
public boolean isLikelyComponentSource(XModelObject o) {
if(o == null) return false;
- if(o.getChildByPath("seam.properties") != null) return true; //$NON-NLS-1$
- if(o.getChildByPath("META-INF/seam.properties") != null) return true; //$NON-NLS-1$
- if(o.getChildByPath("META-INF/components.xml") != null) return true; //$NON-NLS-1$
+ if(o.getChildByPath("META-INF") != null) return true; //$NON-NLS-1$
return false;
}
public LoadedDeclarations parse(XModelObject o, IPath path, IKbProject sp) throws ScannerException {
if(o == null) return null;
sourcePath = path;
- XModelObject seamProperties = o.getChildByPath("META-INF/seam.properties"); //$NON-NLS-1$
- if(seamProperties == null) seamProperties = o.getChildByPath("seam.properties"); //$NON-NLS-1$
- XModelObject componentsXML = o.getChildByPath("META-INF/components.xml"); //$NON-NLS-1$
- if(componentsXML == null && seamProperties == null) return null;
+ XModelObject metaInf = o.getChildByPath("META-INF"); //$NON-NLS-1$
+ if(metaInf == null) return null;
LoadedDeclarations ds = new LoadedDeclarations();
- if(componentsXML != null) {
- LoadedDeclarations ds1 = new XMLScanner().parse(componentsXML, path, sp);
- if(ds1 != null) ds.add(ds1);
+ if(metaInf != null) {
+ XModelObject[] tlds = metaInf.getChildren();
+ for (XModelObject tld: tlds) {
+ XMLScanner s = new XMLScanner();
+ //TODO check that tld object is correct.
+ LoadedDeclarations ds1 = s.parse(tld, path, sp);
+ if(ds1 != null) ds.add(ds1);
+ }
}
return ds;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2009-05-15 16:32:30 UTC (rev 15303)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2009-05-15 16:33:08 UTC (rev 15304)
@@ -66,6 +66,7 @@
if(model == null) return false;
XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
if(o == null) return false;
+ //TODO
if(o.getModelEntity().getName().startsWith("FileSeamComponent")) return true; //$NON-NLS-1$
return false;
}
17 years, 2 months
JBoss Tools SVN: r15303 - in trunk/jst/plugins/org.jboss.tools.jst.web: src/org/jboss/tools/jst/web/model and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 12:32:30 -0400 (Fri, 15 May 2009)
New Revision: 15303
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLStoreHelper.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLValueInfo.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-05-15 16:31:45 UTC (rev 15302)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-05-15 16:32:30 UTC (rev 15303)
@@ -53,6 +53,7 @@
org.jboss.tools.jst.web.model.pv,
org.jboss.tools.jst.web.model.pv.handler,
org.jboss.tools.jst.web.model.tree,
+ org.jboss.tools.jst.web.model.project.ext.store,
org.jboss.tools.jst.web.project,
org.jboss.tools.jst.web.project.handlers,
org.jboss.tools.jst.web.project.helpers,
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLStoreHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLStoreHelper.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLStoreHelper.java 2009-05-15 16:32:30 UTC (rev 15303)
@@ -0,0 +1,250 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.model.project.ext.store;
+
+import java.util.Map;
+import java.util.Properties;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.impl.ValueInfo;
+import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
+import org.w3c.dom.Element;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class XMLStoreHelper implements XMLStoreConstants {
+
+ public static void saveValueInfo(Element parent, IValueInfo value, Properties context) {
+ value.toXML(parent, context);
+ }
+
+ public static IValueInfo loadValueInfo(Element parent, Properties context) {
+ Element c = XMLUtilities.getUniqueChild(parent, TAG_VALUE_INFO);
+ if(c == null) return null;
+ IValueInfo v = null;
+ if(CLS_XML.equals(c.getAttribute(ATTR_CLASS))) {
+ v = new XMLValueInfo();
+ v.loadXML(c, context);
+ if(((XMLValueInfo)v).getObject() == null) {
+ v = new ValueInfo();
+ //that may be a problem
+ ((ValueInfo)v).setValue("");
+ }
+ } else {
+ v = new ValueInfo();
+ v.loadXML(c, context);
+ }
+
+ return v;
+ }
+
+ public static void saveModelObject(Element element, XModelObject object, Properties context) {
+ if(object == null) return;
+ String path = object.getPath();
+ if(path == null) return;
+ XModelObject base = (XModelObject)context.get(XMLStoreConstants.KEY_MODEL_OBJECT);
+ if(base != null && base.getModel() == object.getModel()) {
+ String basePath = base.getPath();
+ if(path.startsWith("" + basePath + "/")) {
+ path = path.substring(basePath.length());
+ } else if(path.equals(basePath)) {
+ path = ".";
+ }
+ }
+
+ if(path != null) element.setAttribute(ATTR_PATH, path);
+ IProject p = EclipseResourceUtil.getProject(object);
+ if(p == null) return;
+ element.setAttribute(ATTR_PROJECT, p.getName());
+ }
+
+ public static void saveModelObject(Element parent, XModelObject object, String child, Properties context) {
+ Element element = XMLUtilities.createElement(parent, child);
+ element.setAttribute(ATTR_CLASS, CLS_MODEL_OBJECT);
+ saveModelObject(element, object, context);
+ }
+
+ public static XModelObject loadModelObject(Element element, Properties context) {
+ String path = element.getAttribute(ATTR_PATH);
+ XModelObject base = (XModelObject)context.get(XMLStoreConstants.KEY_MODEL_OBJECT);
+ if(path == null || path.length() == 0) {
+ //TODO reporting
+ return null;
+ } else if(path.equals(".")) {
+ if(base == null) {
+ //TODO reporting
+ }
+ return base;
+ }
+ if(path.startsWith("/")) {
+ if(base != null) {
+ if(base.getChildByPath(path.substring(1)) == null) {
+ //TODO reporting
+ }
+ return base.getChildByPath(path.substring(1));
+ }
+ //TODO reporting
+ return null;
+ }
+ IProject project = loadProject(element, context);
+ if(project == null || !project.isAccessible()) return null;
+ XModel model = InnerModelHelper.createXModel(project);
+ if(model == null) return null;
+ return model.getByPath(path);
+ }
+
+ public static XModelObject loadModelObject(Element parent, String child, Properties context) {
+ Element element = XMLUtilities.getUniqueChild(parent, child);
+ if(element == null) return null;
+ return loadModelObject(element, context);
+ }
+
+ public static void saveType(Element element, IType type, Properties context) {
+ if(type == null) return;
+ if(context != null && type == context.get(ATTR_TYPE)) return;
+ element.setAttribute(ATTR_PROJECT, type.getJavaProject().getProject().getName());
+ element.setAttribute(ATTR_TYPE, type.getFullyQualifiedName());
+ }
+
+ public static void saveType(Element parent, IType type, String child, Properties context) {
+ if(type == null) return;
+ if(context != null && type == context.get(ATTR_TYPE)) return;
+ Element element = XMLUtilities.createElement(parent, child);
+ element.setAttribute(ATTR_CLASS, CLS_TYPE);
+ saveType(element, type, context);
+ }
+
+ public static IProject loadProject(Element element, Properties context) {
+ String project = element.getAttribute(ATTR_PROJECT);
+ if(project == null || project.length() == 0) return null;
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(project);
+ }
+
+ public static IType loadType(Element element, Properties context) {
+ String name = element.getAttribute(ATTR_TYPE);
+ if(name == null || name.length() == 0) {
+ if(context != null && context.containsKey(ATTR_TYPE)) {
+ return (IType)context.get(ATTR_TYPE);
+ }
+ //TODO reporting
+ return null;
+ }
+ IProject project = loadProject(element, context);
+ if(project == null || !project.isAccessible()) return null;
+ IJavaProject jp = JavaCore.create(project);
+ if(jp != null) {
+ try {
+ IType type = jp.findType(name.replace('$', '.'));
+ if(type == null && name.indexOf('$') >= 0) {
+ int ii = name.lastIndexOf('.');
+ String pack = (ii < 0) ? "" : name.substring(0, ii);
+ String cls = name.substring(ii + 1);
+ type = jp.findType(pack, cls.replace('$', '.'), new NullProgressMonitor());
+ }
+ return type;
+ } catch (JavaModelException e) {
+ //ignore
+ }
+ }
+ return null;
+ }
+
+ public static void saveField(Element element, IField field, Properties context) {
+ if(field == null) return;
+ saveType(element, field.getDeclaringType(), context);
+ element.setAttribute(ATTR_NAME, field.getElementName());
+ }
+
+ public static void saveField(Element parent, IField field, String child, Properties context) {
+ if(field == null) return;
+ Element element = XMLUtilities.createElement(parent, child);
+ element.setAttribute(ATTR_CLASS, CLS_FIELD);
+ saveField(element, field, context);
+ }
+
+ public static IField loadField(Element element, Properties context) {
+ IType type = loadType(element, context);
+ if(type == null) return null;
+ String name = element.getAttribute(ATTR_NAME);
+ if(name == null || name.length() == 0) return null;
+ return type.getField(name);
+ }
+
+ public static void saveMethod(Element element, IMethod method, Properties context) {
+ if(method == null) return;
+ saveType(element, method.getDeclaringType(), context);
+ element.setAttribute(ATTR_NAME, method.getElementName());
+ String[] s = method.getParameterTypes();
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < s.length; i++) sb.append(s[i]).append(',');
+ element.setAttribute(ATTR_PARAMS, sb.toString());
+ }
+
+ public static void saveMethod(Element parent, IMethod method, String child, Properties context) {
+ if(method == null) return;
+ Element element = XMLUtilities.createElement(parent, child);
+ element.setAttribute(ATTR_CLASS, CLS_METHOD);
+ saveMethod(element, method, context);
+ }
+
+ public static IMethod loadMethod(Element element, Properties context) {
+ IType type = loadType(element, context);
+ if(type == null) return null;
+ String name = element.getAttribute(ATTR_NAME);
+ if(name == null || name.length() == 0) return null;
+ String params = element.getAttribute(ATTR_PARAMS);
+ String[] ps = new String[0];
+ if(params != null && params.length() > 0) {
+ ps = params.split(",");
+ }
+ return type.getMethod(name, ps);
+ }
+
+ public static void saveMap(Element parent, Map<String, IValueInfo> map, String child, Properties context) {
+ if(map == null || map.isEmpty()) return;
+ Element element = XMLUtilities.createElement(parent, child);
+ for (String name: map.keySet()) {
+ IValueInfo value = map.get(name);
+ Element c = XMLUtilities.createElement(element, TAG_ENTRY);
+ c.setAttribute(ATTR_NAME, name);
+ if(value == null) continue;
+ value.toXML(c, context);
+ }
+ }
+
+ public static void loadMap(Element parent, Map<String, IValueInfo> map, String child, Properties context) {
+ Element element = XMLUtilities.getUniqueChild(parent, child);
+ if(element == null) return;
+ Element[] cs = XMLUtilities.getChildren(element, TAG_ENTRY);
+ for (int i = 0; i < cs.length; i++) {
+ String name = cs[i].getAttribute(ATTR_NAME);
+ IValueInfo value = loadValueInfo(cs[i], context);
+ if(name != null && value != null) {
+ map.put(name, value);
+ }
+ }
+ }
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLStoreHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLValueInfo.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLValueInfo.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLValueInfo.java 2009-05-15 16:32:30 UTC (rev 15303)
@@ -0,0 +1,81 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.model.project.ext.store;
+
+import java.util.Properties;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
+import org.jboss.tools.common.model.util.PositionHolder;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.w3c.dom.Element;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class XMLValueInfo implements IValueInfo {
+ XModelObject object;
+ String attribute;
+
+ PositionHolder h = null;
+
+ public XMLValueInfo() {
+ }
+
+ public XMLValueInfo(XModelObject object, String attribute) {
+ this.object = object;
+ this.attribute = attribute;
+ }
+
+ public int getLength() {
+ getPositionHolder();
+ int length = h.getEnd() - h.getStart();
+ return length < 0 ? 0 : length;
+ }
+
+ public int getStartPosition() {
+ getPositionHolder();
+ return h.getStart();
+ }
+
+ public String getValue() {
+ return object.getAttributeValue(attribute);
+ }
+
+ PositionHolder getPositionHolder() {
+ if(h == null) {
+ h = PositionHolder.getPosition(object, attribute);
+ }
+ h.update();
+ return h;
+ }
+
+ public XModelObject getObject() {
+ return object;
+ }
+
+ public Element toXML(Element parent, Properties context) {
+ Element element = XMLUtilities.createElement(parent, XMLStoreConstants.TAG_VALUE_INFO);
+ element.setAttribute(XMLStoreConstants.ATTR_CLASS, XMLStoreConstants.CLS_XML);
+ if(attribute != null) element.setAttribute("attr", attribute);
+ if(object != null) {
+ XMLStoreHelper.saveModelObject(element, object, "object", context);
+ }
+ return element;
+ }
+
+ public void loadXML(Element element, Properties context) {
+ attribute = element.getAttribute("attr");
+ object = XMLStoreHelper.loadModelObject(element, "object", context);
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/project/ext/store/XMLValueInfo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15302 - in trunk/common/plugins/org.jboss.tools.common.model: src/org/jboss/tools/common/model/project and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 12:31:45 -0400 (Fri, 15 May 2009)
New Revision: 15302
Added:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/ITextSourceReference.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/IValueInfo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/event/
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/event/Change.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/event/IChangeVisitor.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/XMLStoreConstants.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF 2009-05-15 16:25:48 UTC (rev 15301)
+++ trunk/common/plugins/org.jboss.tools.common.model/META-INF/MANIFEST.MF 2009-05-15 16:31:45 UTC (rev 15302)
@@ -31,6 +31,10 @@
org.jboss.tools.common.model.options.impl,
org.jboss.tools.common.model.plugin,
org.jboss.tools.common.model.project,
+ org.jboss.tools.common.model.project.ext,
+ org.jboss.tools.common.model.project.ext.store,
+ org.jboss.tools.common.model.project.ext.event,
+ org.jboss.tools.common.model.project.ext.impl,
org.jboss.tools.common.model.undo,
org.jboss.tools.common.model.util,
org.jboss.tools.common.model.util.extension,
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/ITextSourceReference.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/ITextSourceReference.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/ITextSourceReference.java 2009-05-15 16:31:45 UTC (rev 15302)
@@ -0,0 +1,28 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.model.project.ext;
+
+/**
+ * An interface of seam tools model object that has text source.
+ * @author Alexey Kazakov
+ */
+public interface ITextSourceReference {
+
+ /**
+ * @return start position of element in text
+ */
+ public int getStartPosition();
+
+ /**
+ * @return number of characters of element in text
+ */
+ public int getLength();
+}
\ No newline at end of file
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/IValueInfo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/IValueInfo.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/IValueInfo.java 2009-05-15 16:31:45 UTC (rev 15302)
@@ -0,0 +1,31 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.model.project.ext;
+
+import java.util.Properties;
+
+import org.w3c.dom.Element;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public interface IValueInfo extends ITextSourceReference {
+
+ /**
+ * Returns string value
+ * @return
+ */
+ public String getValue();
+
+ public Element toXML(Element parent, Properties context);
+
+ public void loadXML(Element element, Properties context);
+}
\ No newline at end of file
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/event/Change.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/event/Change.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/event/Change.java 2009-05-15 16:31:45 UTC (rev 15302)
@@ -0,0 +1,125 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.model.project.ext.event;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * This object collects changes in target that should be fired to listeners.
+ *
+ * @author Viacheslav Kabanovich
+ */
+public class Change {
+ Object target;
+ String property;
+ Object oldValue;
+ Object newValue;
+ List<Change> children;
+
+ /**
+ * Constructs object with initial values
+ *
+ * @param target
+ * @param property
+ * name of property changed or null, if change is adding/removing
+ * a child.
+ * @param oldValue
+ * old value; if null and property = null, then child (newValue)
+ * is added
+ * @param newValue
+ * new value; if null and property = null, then child (oldValue)
+ * is removed
+ */
+ public Change(Object target, String property, Object oldValue, Object newValue) {
+ this.target = target;
+ this.property = property;
+ this.oldValue = oldValue;
+ this.newValue = newValue;
+ }
+
+ public Object getTarget() {
+ return target;
+ }
+
+ public String getProperty() {
+ return property;
+ }
+
+ public Object getOldValue() {
+ return oldValue;
+ }
+
+ public Object getNewValue() {
+ return newValue;
+ }
+
+ public void addChildren(List<Change> children) {
+ if(this.children == null) {
+ this.children = children;
+ } else if(children != null) {
+ this.children.addAll(children);
+ }
+ }
+
+ /**
+ * Returns true if this object defines no actual change in seam model.
+ * @return
+ */
+ public boolean isEmpty() {
+ return oldValue == null && newValue == null && !isChildrenAffected();
+ }
+
+ /**
+ * Returns true if this change includes sub-changes.
+ * @return
+ */
+ public boolean isChildrenAffected() {
+ return children != null && !children.isEmpty();
+ }
+
+ /**
+ * Returns list of all changes
+ * @return
+ */
+ public List<Change> getChildren() {
+ return children;
+ }
+
+ /**
+ * Invokes visitor for this change, and if visit returns true, iterates over
+ * child changes.
+ * @param visitor
+ */
+ public void visit(IChangeVisitor visitor) {
+ if(!visitor.visit(this)) return;
+ if(children != null) {
+ for (Change c: children) {
+ c.visit(visitor);
+ }
+ }
+ }
+
+ /**
+ * Utility method to attach a single change to the list. If list is not provided,
+ * new list is created, otherwise the provided list is returned.
+ * @param changes
+ * @param change
+ * @return
+ */
+ public static List<Change> addChange(List<Change> changes, Change change) {
+ if(change == null || change.isEmpty()) return changes;
+ if(changes == null) changes = new ArrayList<Change>();
+ changes.add(change);
+ return changes;
+ }
+
+}
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/event/IChangeVisitor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/event/IChangeVisitor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/event/IChangeVisitor.java 2009-05-15 16:31:45 UTC (rev 15302)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.model.project.ext.event;
+
+/**
+ * This interface allows to process SeamProjectChangeEvent, or specific Change by
+ * invoking method visit(IChangeVisitor) declared on them.
+ *
+ * @author Viacheslav Kabanovich
+ */
+public interface IChangeVisitor {
+
+ /**
+ * Processes a single change. If this method returns true,
+ * it shall be invoked with child changes
+ * @param change
+ * @return
+ */
+ public boolean visit(Change change);
+}
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/impl/ValueInfo.java 2009-05-15 16:31:45 UTC (rev 15302)
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.model.project.ext.impl;
+
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.jdt.core.dom.Annotation;
+import org.eclipse.jdt.core.dom.Expression;
+import org.eclipse.jdt.core.dom.MemberValuePair;
+import org.eclipse.jdt.core.dom.NormalAnnotation;
+import org.eclipse.jdt.core.dom.QualifiedName;
+import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
+import org.eclipse.jdt.core.dom.StringLiteral;
+import org.jboss.tools.common.model.project.ext.IValueInfo;
+import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.w3c.dom.Element;
+
+public class ValueInfo implements IValueInfo {
+ String value;
+ public int valueStartPosition;
+ public int valueLength;
+
+ /**
+ * Factory method.
+ * @param node
+ * @param name
+ * @return
+ */
+ public static ValueInfo getValueInfo(Annotation node, String name) {
+ if(name == null) name = "value"; //$NON-NLS-1$
+ if(node instanceof SingleMemberAnnotation) {
+ if(name == null || "value".equals(name)) { //$NON-NLS-1$
+ SingleMemberAnnotation m = (SingleMemberAnnotation)node;
+ ValueInfo result = new ValueInfo();
+ Expression exp = m.getValue();
+ result.valueLength = exp.getLength();
+ result.valueStartPosition = exp.getStartPosition();
+ result.value = checkExpression(exp);
+ return result;
+ }
+ return null;
+ } else if(node instanceof NormalAnnotation) {
+ NormalAnnotation n = (NormalAnnotation)node;
+ List<?> vs = n.values();
+ if(vs != null) for (int i = 0; i < vs.size(); i++) {
+ MemberValuePair p = (MemberValuePair)vs.get(i);
+ String pname = p.getName().getIdentifier();
+ if(!name.equals(pname)) continue;
+ ValueInfo result = new ValueInfo();
+ Expression exp = p.getValue();
+ result.valueLength = exp.getLength();
+ result.valueStartPosition = exp.getStartPosition();
+ result.value = checkExpression(exp);
+ return result;
+ }
+ return null;
+ }
+ return null;
+ }
+
+ public ValueInfo() {
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public int getStartPosition() {
+ return valueStartPosition;
+ }
+
+ public int getLength() {
+ return valueLength;
+ }
+
+ static String checkExpression(Expression exp) {
+ if(exp == null) return null;
+ if(exp instanceof StringLiteral) {
+ return ((StringLiteral)exp).getLiteralValue();
+ } else if(exp instanceof QualifiedName) {
+ Object o = exp.resolveConstantExpressionValue();
+ if(o != null) return o.toString();
+ return exp.toString();
+ }
+ Object o = exp.resolveConstantExpressionValue();
+ if(o != null) return o.toString();
+ return exp.toString();
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public Element toXML(Element parent, Properties context) {
+ Element element = XMLUtilities.createElement(parent, XMLStoreConstants.TAG_VALUE_INFO);
+ if(value != null) element.setAttribute(XMLStoreConstants.ATTR_VALUE, value);
+ if(valueStartPosition != 0) element.setAttribute(ATTR_START, "" + valueStartPosition);
+ if(valueLength != 0) element.setAttribute(ATTR_LENGTH, "" + valueLength);
+ return element;
+ }
+
+ static String ATTR_START = "start";
+ static String ATTR_LENGTH = "length";
+
+ public void loadXML(Element element, Properties context) {
+ value = element.getAttribute(XMLStoreConstants.ATTR_VALUE);
+ String start = element.getAttribute(ATTR_START);
+ if(start != null && start.length() > 0) {
+ try {
+ valueStartPosition = Integer.parseInt(start);
+ } catch (NumberFormatException e) {
+ //ignore
+ }
+ }
+ String length = element.getAttribute(ATTR_LENGTH);
+ if(length != null && length.length() > 0) {
+ try {
+ valueLength = Integer.parseInt(length);
+ } catch (NumberFormatException e) {
+ //ignore
+ }
+ }
+ }
+}
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/XMLStoreConstants.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/XMLStoreConstants.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/XMLStoreConstants.java 2009-05-15 16:31:45 UTC (rev 15302)
@@ -0,0 +1,39 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.model.project.ext.store;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public interface XMLStoreConstants {
+ public String TAG_VALUE_INFO = "value-info";
+ public String TAG_ID = "id";
+ public String TAG_ENTRY = "entry";
+
+ public String CLS_XML = "xml";
+ public String CLS_MODEL_OBJECT = "model-object";
+ public String CLS_FIELD = "field";
+ public String CLS_STRING = "string";
+ public String CLS_TYPE = "type";
+ public String CLS_METHOD = "method";
+
+
+ public String ATTR_VALUE = "value";
+ public String ATTR_PATH = "path";
+ public String ATTR_CLASS = "class";
+ public String ATTR_NAME = "name";
+ public String ATTR_PROJECT = "project";
+ public String ATTR_TYPE = "type";
+ public String ATTR_PARAMS = "params";
+
+ public String KEY_MODEL_OBJECT = "model-object";
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/store/XMLStoreConstants.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15301 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-05-15 12:25:48 -0400 (Fri, 15 May 2009)
New Revision: 15301
Modified:
trunk/as/docs/reference/en/modules/modules.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-722 - added info and an appropriate screenshot about the Finger Touch button
Modified: trunk/as/docs/reference/en/modules/modules.xml
===================================================================
--- trunk/as/docs/reference/en/modules/modules.xml 2009-05-15 16:24:47 UTC (rev 15300)
+++ trunk/as/docs/reference/en/modules/modules.xml 2009-05-15 16:25:48 UTC (rev 15301)
@@ -57,6 +57,19 @@
directory. For quicker smarter deployment, you will need to create archives using
the <link linkend="Project_archivesView">Project Archives view</link> and customize
packaging yourself.</para>
+
+ <para>You can also use the "Finger touch" for a quick restart of the project without restarting the server:</para>
+ <figure>
+ <title>Finger Touch button</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/modules/modules_8_finger_touch.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The "Finger" touches descriptors dependent on project (i.e. web.xml for WAR, application.xml for EAR, jboss-esb.xml in ESB projects).</para>
+
+
</section>
<section id="single_file_deployment">
17 years, 2 months
JBoss Tools SVN: r15300 - trunk/as/docs/reference/en/images/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-05-15 12:24:47 -0400 (Fri, 15 May 2009)
New Revision: 15300
Added:
trunk/as/docs/reference/en/images/modules/modules_8_finger_touch.png
Log:
https://jira.jboss.org/jira/browse/JBDS-722 - added info about the Finger Touch button.
Added: trunk/as/docs/reference/en/images/modules/modules_8_finger_touch.png
===================================================================
(Binary files differ)
Property changes on: trunk/as/docs/reference/en/images/modules/modules_8_finger_touch.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 2 months
JBoss Tools SVN: r15299 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-05-15 11:51:15 -0400 (Fri, 15 May 2009)
New Revision: 15299
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
issue JBIDE-4225: Drag and Drop facelet tag in Visual part of VPE
https://jira.jboss.org/jira/browse/JBIDE-4225
- resolved
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-05-15 15:15:34 UTC (rev 15298)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-05-15 15:51:15 UTC (rev 15299)
@@ -2191,10 +2191,7 @@
dropCommand.getDefaultModel().setPromptForTagAttributesRequired(
promptAttributes);
- // because it is external, convert path to URL
- final String mimeData = DropUtils.convertPathToUrl(data);
-
- dropCommand.execute(new DropData(flavor, mimeData, sourceEditor
+ dropCommand.execute(new DropData(flavor, data, sourceEditor
.getEditorInput(), (ISourceViewer) sourceEditor
.getAdapter(ISourceViewer.class), new VpeSelectionProvider(
range.x, range.y), container));
@@ -2234,7 +2231,10 @@
nsIFile aFile = (nsIFile) aValue.queryInterface(nsIFile.NS_IFILE_IID);
if (aValue != null) {
- data = aFile.getPath();
+ // because it is external, convert the path to URL
+ final String path = aFile.getPath();
+ data = path != null ? DropUtils.convertPathToUrl(path)
+ : null;
aFlavor = DndUtil.kFileMime;
}
17 years, 2 months
JBoss Tools SVN: r15298 - trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 11:15:34 -0400 (Fri, 15 May 2009)
New Revision: 15298
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4321 fixed
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.xml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.xml 2009-05-15 15:14:03 UTC (rev 15297)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.xml 2009-05-15 15:15:34 UTC (rev 15298)
@@ -59,6 +59,5 @@
<security:identity authenticate-method="#{test.operate}"
security-rules="#{securityRules}"
remember-me="true"/>
-
- <factory name="authenticator"/>
+
</components>
17 years, 2 months
JBoss Tools SVN: r15297 - in trunk/seam: plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 11:14:03 -0400 (Fri, 15 May 2009)
New Revision: 15297
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.xml
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4321 fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-15 15:07:03 UTC (rev 15296)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-15 15:14:03 UTC (rev 15297)
@@ -312,7 +312,7 @@
boolean unknownVariable = true;
boolean firstDuplicateVariableWasMarked = false;
for (ISeamContextVariable variable : variables) {
- if(variable instanceof ISeamFactory || variable instanceof ISeamComponent || variable instanceof IRole) {
+ if(variable instanceof ISeamFactory) {
if(variable!=factory && !markedDuplicateFactoryNames.contains(factoryName) &&
(factoryScope == variable.getScope() || factoryScope.getPriority()>variable.getScope().getPriority())) {
// Duplicate factory name. Mark it.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2009-05-15 15:07:03 UTC (rev 15296)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2009-05-15 15:14:03 UTC (rev 15297)
@@ -31,13 +31,13 @@
#Factories
UNKNOWN_FACTORY_NAME=Factory method "{0}" with a void return type must have an associated @Out/Databinder
+DUPLICATE_VARIABLE_NAME=Duplicate factory name: "{0}"
#Bijections
MULTIPLE_DATA_BINDER=@DataModelSelection and @DataModelSelectionIndex without name of the DataModel requires the only one @DataModel in the component
UNKNOWN_DATA_MODEL=Unknown @DataModel/@Out name: "{0}"
#Context variables
-DUPLICATE_VARIABLE_NAME=Duplicate variable name: "{0}"
UNKNOWN_VARIABLE_NAME=Unknown context variable name: "{0}"
#Seam Expression language
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2009-05-15 15:07:03 UTC (rev 15296)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.java 2009-05-15 15:14:03 UTC (rev 15297)
@@ -124,6 +124,7 @@
//Section Factories
public static String SeamValidatorConfigurationBlock_section_factory;
+ public static String SeamValidatorConfigurationBlock_pb_duplicateVariableName_label;
public static String SeamValidatorConfigurationBlock_pb_unknownFactoryName_label;
//Section Bijections
@@ -133,7 +134,6 @@
//Section Context variables
public static String SeamValidatorConfigurationBlock_section_variable;
- public static String SeamValidatorConfigurationBlock_pb_duplicateVariableName_label;
public static String SeamValidatorConfigurationBlock_pb_unknownVariableName_label;
//Seam Expression language
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2009-05-15 15:07:03 UTC (rev 15296)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencesMessages.properties 2009-05-15 15:14:03 UTC (rev 15297)
@@ -43,6 +43,7 @@
##Section Factories
SeamValidatorConfigurationBlock_section_factory=Factories
SeamValidatorConfigurationBlock_pb_unknownFactoryName_label=Unknown factory name:
+SeamValidatorConfigurationBlock_pb_duplicateVariableName_label=Duplicate factory name:
##Section Bijections
SeamValidatorConfigurationBlock_section_bijection=Bijections
@@ -51,7 +52,6 @@
##Section Context variables
SeamValidatorConfigurationBlock_section_variable=Context variables
-SeamValidatorConfigurationBlock_pb_duplicateVariableName_label=Duplicate variable name:
SeamValidatorConfigurationBlock_pb_unknownVariableName_label=Unknown variable name:
##Seam Expression language
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2009-05-15 15:07:03 UTC (rev 15296)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamValidatorConfigurationBlock.java 2009-05-15 15:14:03 UTC (rev 15297)
@@ -103,6 +103,7 @@
private static SectionDescription SECTION_FACTORY = new SectionDescription(
SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_factory,
new String[][]{
+ {SeamPreferences.DUPLICATE_VARIABLE_NAME, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateVariableName_label},
{SeamPreferences.UNKNOWN_FACTORY_NAME, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unknownFactoryName_label},
}
);
@@ -118,7 +119,6 @@
private static SectionDescription SECTION_VARIABLE = new SectionDescription(
SeamPreferencesMessages.SeamValidatorConfigurationBlock_section_variable,
new String[][]{
- {SeamPreferences.DUPLICATE_VARIABLE_NAME, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_duplicateVariableName_label},
{SeamPreferences.UNKNOWN_VARIABLE_NAME, SeamPreferencesMessages.SeamValidatorConfigurationBlock_pb_unknownVariableName_label},
}
);
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.xml
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.xml 2009-05-15 15:07:03 UTC (rev 15296)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/SeamWebWarTestProject/WebContent/WEB-INF/components.xml 2009-05-15 15:14:03 UTC (rev 15297)
@@ -59,5 +59,6 @@
<security:identity authenticate-method="#{test.operate}"
security-rules="#{securityRules}"
remember-me="true"/>
-
+
+ <factory name="authenticator"/>
</components>
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-05-15 15:07:03 UTC (rev 15296)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2009-05-15 15:14:03 UTC (rev 15297)
@@ -636,15 +636,15 @@
String[] messages = getMarkersMessage(contextVariableTestFile);
- assertEquals("Not all problem markers 'Duplicate variable name' was found", 4, messages.length);
+ assertEquals("Not all problem markers 'Duplicate variable name' was found", 2, messages.length);
for(int i=0;i<4;i++)
assertEquals("Problem marker 'Duplicate variable name' not found", "Duplicate variable name: \"messageList\"", messages[i]);
int[] lineNumbers = getMarkersNumbersOfLine(contextVariableTestFile);
- for(int i=0;i<4;i++)
- assertTrue("Problem marker has wrong line number", (lineNumbers[i] == 16)||(lineNumbers[i] == 17)||(lineNumbers[i] == 36)||(lineNumbers[i] == 41));
+ for(int i=0;i<2;i++)
+ assertTrue("Problem marker has wrong line number", (lineNumbers[i] == 36)||(lineNumbers[i] == 41));
// Unknown variable name
System.out.println("Test - Unknown variable name");
17 years, 2 months
JBoss Tools SVN: r15296 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-05-15 11:07:03 -0400 (Fri, 15 May 2009)
New Revision: 15296
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFilePage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3457
Raw code - without validation Next and Finish,
without wizard's descriptions...
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage.java 2009-05-15 15:07:03 UTC (rev 15296)
@@ -0,0 +1,133 @@
+package org.hibernate.eclipse.jdt.ui.wizards;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IParent;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
+import org.eclipse.jdt.internal.core.JarPackageFragmentRoot;
+import org.eclipse.jdt.ui.JavaElementLabelProvider;
+import org.eclipse.jdt.ui.StandardJavaElementContentProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+
+public class NewHibernateMappingElementsSelectionPage extends WizardPage {
+
+ // the current selection
+ private IStructuredSelection fCurrentSelection;
+
+ private TreeViewer fViewer;
+
+ private boolean fAllowMultiple = true;
+
+ private int fWidth = 50;
+
+ private int fHeight = 18;
+
+ public NewHibernateMappingElementsSelectionPage(IStructuredSelection selection) {
+ super("", "", null);
+ fCurrentSelection = selection;
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayout(new GridLayout());
+ createTreeViewer(composite);
+
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = convertWidthInCharsToPixels(fWidth);
+ data.heightHint = convertHeightInCharsToPixels(fHeight);
+
+ Tree treeWidget = fViewer.getTree();
+ treeWidget.setLayoutData(data);
+ setControl(composite);
+ }
+
+ protected TreeViewer createTreeViewer(Composite composite) {
+ int style = SWT.BORDER | (fAllowMultiple ? SWT.MULTI : SWT.SINGLE);
+ fViewer = new TreeViewer(new Tree(composite, style));
+ fViewer.setContentProvider(new StandardJavaElementContentProvider());
+ fViewer.setLabelProvider(new JavaElementLabelProvider());
+ fViewer.setFilters(getFilters());
+ fViewer.addSelectionChangedListener(getSelectionChangedListener());
+ fViewer.setInput(getInput());
+ fViewer.setSelection(fCurrentSelection, true);
+ return fViewer;
+ }
+
+ protected ViewerFilter[] getFilters(){
+ return new ViewerFilter[] { new ViewerFilter() {
+
+ public boolean hasCompilationUnits(IParent parent){
+ IJavaElement[] elements;
+ try {
+ elements = parent.getChildren();
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i].getElementType() == IJavaElement.COMPILATION_UNIT){
+ return true;
+ } else if (elements[i] instanceof IParent
+ && !(elements[i] instanceof JarPackageFragmentRoot)){
+ if (hasCompilationUnits((IParent)elements[i])) {
+ return true;
+ }
+ }
+ }
+ } catch (JavaModelException e) {
+ return false;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement,
+ Object element) {
+ if (element instanceof JarPackageFragmentRoot) {
+ return false;
+ } else if (element instanceof ICompilationUnit) {
+ return true;
+ } else if (element instanceof IParent) {
+ return hasCompilationUnits((IParent)element);
+ } else {
+ return false;
+ }
+ }
+
+ } };
+ }
+
+ protected Object getInput(){
+ return JavaCore.create( ResourcesPlugin.getWorkspace().getRoot() );
+ }
+
+ public IStructuredSelection getSelection(){
+ return fCurrentSelection;
+ }
+
+ protected ISelectionChangedListener getSelectionChangedListener() {
+ return new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ fCurrentSelection = (IStructuredSelection) event.getSelection();
+ updateStatus();
+ }
+ };
+ }
+
+ public void setAllowMultiple(boolean isAllowMultiple){
+ fAllowMultiple = isAllowMultiple;
+ }
+
+ protected void updateStatus() {
+ // TODO Auto-generated method stub
+ }
+}
Property changes on: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingElementsSelectionPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFilePage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFilePage.java 2009-05-15 15:05:25 UTC (rev 15295)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFilePage.java 2009-05-15 15:07:03 UTC (rev 15296)
@@ -1,13 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.hibernate.eclipse.jdt.ui.wizards;
import java.util.ArrayList;
@@ -33,6 +33,7 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
@@ -46,19 +47,16 @@
*
*/
public class NewHibernateMappingFilePage extends WizardPage {
-
+
private TableViewer viewer;
-
- private Map<IJavaProject, Collection<EntityInfo>> project_infos;
/**
* @param pageName
*/
- protected NewHibernateMappingFilePage(Map<IJavaProject, Collection<EntityInfo>> project_infos) {
+ protected NewHibernateMappingFilePage() {
super("");
setTitle(HibernateConsoleMessages.NewHibernateMappingFilePage_hibernate_xml_mapping_file);
- setDescription(HibernateConsoleMessages.NewHibernateMappingFilePage_this_wizard_creates);
- this.project_infos = project_infos;
+ setDescription(HibernateConsoleMessages.NewHibernateMappingFilePage_this_wizard_creates);
}
public void createControl(Composite parent) {
@@ -69,100 +67,104 @@
sc.pack(false);
Composite container = new Composite(sc, SWT.NULL);
- sc.setContent(container);
+ sc.setContent(container);
- FillLayout layout = new FillLayout();
+ Layout layout = new FillLayout();
container.setLayout(layout);
-
+
Table table = new Table(container, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION );
table.setHeaderVisible(true);
table.setLinesVisible(true);
table.pack(false);
createTableColumns(table);
- viewer = createTableFilterViewer(table);
- viewer.setInput(project_infos);
-
+ viewer = createTableViewer(table);
+ viewer.setInput(null);
+
sc.setMinSize(container.computeSize(SWT.DEFAULT, SWT.DEFAULT));
- setControl(sc);
+ setControl(container);
}
-
+
private void createTableColumns(Table table){
int coulmnIndex = 0;
TableColumn column = new TableColumn(table, SWT.CENTER, coulmnIndex++);
column.setText("!");
column.setWidth(20);
- column.setResizable(false);
-
- if (project_infos.keySet().size() > 1){
- column = new TableColumn(table, SWT.LEFT, coulmnIndex++);
- column.setText("Project name");
- column.setWidth(120);
- }
-
+ column.setResizable(false);
+
+ //if (project_infos.keySet().size() > 1){
column = new TableColumn(table, SWT.LEFT, coulmnIndex++);
+ column.setText("Project name");
+ column.setWidth(120);
+ //}
+
+ column = new TableColumn(table, SWT.LEFT, coulmnIndex++);
column.setText("Class name");
column.setWidth(150);
-
+
column = new TableColumn(table, SWT.LEFT, coulmnIndex++);
column.setText("File name");
column.setWidth(150);
}
-
- private TableViewer createTableFilterViewer(Table table) {
+
+ private TableViewer createTableViewer(Table table) {
TableViewer result = new TableViewer( table );
result.setUseHashlookup( true );
- if (project_infos.keySet().size() > 1){
- result.setColumnProperties( new String[] {"create", "project", //$NON-NLS-1$//$NON-NLS-2$
- "class", "file",} ); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
+ //if (project_infos.keySet().size() > 1){
+ result.setColumnProperties( new String[] {"create", "project", //$NON-NLS-1$//$NON-NLS-2$
+ "class", "file",} ); //$NON-NLS-1$ //$NON-NLS-2$
+ /*} else {
result.setColumnProperties( new String[] {"create", //$NON-NLS-1$
"class", "file",} ); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
+ }*/
CellEditor[] editors = new CellEditor[result.getColumnProperties().length];
editors[0] = new CheckboxCellEditor( result.getTable() );
editors[1] = new TextCellEditor( result.getTable() );
editors[2] = new TextCellEditor( result.getTable() );
- if (project_infos.keySet().size() > 1){
- editors[3] = new TextCellEditor( result.getTable() );
- }
+ //if (project_infos.keySet().size() > 1){
+ editors[3] = new TextCellEditor( result.getTable() );
+ //}
+
result.setCellEditors( editors );
result.setCellModifier( new TableCellModifier(result) );
result.setLabelProvider(new TableLableProvider(result));
result.setContentProvider( new TableContentProvider() );
return result;
}
-
+
+ public void setInput(Map<IJavaProject, Collection<EntityInfo>> project_infos){
+ viewer.setInput(project_infos);
+ }
+
private class TableLine {
-
+
public String projectName;
-
+
public String className;
-
+
public String fileName;
-
+
public Boolean isCreate = true;
-
+
public TableLine(String projectName, String className){
this(projectName, className, className + ".hbm.xml",true);
}
-
+
public TableLine(String projectName, String className, String fileName, boolean isCreate){
this.projectName = projectName;
this.className = className;
this.fileName = fileName;
this.isCreate = isCreate;
}
-
+
}
-
+
private class TableContentProvider implements IStructuredContentProvider {
- public Object[] getElements(Object inputElement) {
+ public Object[] getElements(Object inputElement) {
if (inputElement instanceof Map) {
- List<TableLine> result = new ArrayList<TableLine>();
+ List<TableLine> result = new ArrayList<TableLine>();
Map<IJavaProject, Collection<EntityInfo>> configs = (Map<IJavaProject, Collection<EntityInfo>>)inputElement;
for (Entry<IJavaProject, Collection<EntityInfo>> entry : configs.entrySet()) {
Iterator<EntityInfo> iter = entry.getValue().iterator();
@@ -170,35 +172,32 @@
EntityInfo ei = iter.next();
result.add(new TableLine(entry.getKey().getProject().getName(), ei.getName()));
}
- }
+ }
return result.toArray();
}
return new Object[0];
}
- public void dispose() { }
+ public void dispose() {}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // TODO Auto-generated method stub
-
- }
-
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { }
+
}
-
+
private class TableLableProvider extends LabelProvider implements ITableLabelProvider {
-
+
private final TableViewer tv;
public TableLableProvider(TableViewer tv) {
this.tv = tv;
}
-
+
public Image getColumnImage(Object element, int columnIndex) {
String property = (String) tv.getColumnProperties()[columnIndex];
if("create".equals(property)) {
TableLine tl = (TableLine) element;
String key = tl.isCreate ? null : ImageConstants.CLOSE ; // TODO: find a better image
- return EclipseImages.getImage(key);
+ return EclipseImages.getImage(key);
}
return null;
}
@@ -206,19 +205,21 @@
public String getColumnText(Object element, int columnIndex) {
String property = (String) tv.getColumnProperties()[columnIndex];
TableLine tl = (TableLine) element;
-
+
if ("class".equals(property)){
return tl.className;
} else if ("project".equals(property)){
return tl.projectName;
} else if ("file".equals(property)){
return tl.fileName;
- } else return "";
- }
+ } else {
+ return "";
+ }
+ }
}
-
+
private class TableCellModifier implements ICellModifier {
-
+
private final TableViewer tv;
public TableCellModifier(TableViewer tv) {
@@ -253,8 +254,8 @@
} else if ("create".equals(property)){
tl.isCreate = (Boolean)value;
}
-
+
tv.update(new Object[] { tl }, new String[] { property });
- }
+ }
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-05-15 15:05:25 UTC (rev 15295)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/wizards/NewHibernateMappingFileWizard.java 2009-05-15 15:07:03 UTC (rev 15296)
@@ -1,16 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2007-2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.hibernate.eclipse.jdt.ui.wizards;
-import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
@@ -19,35 +19,32 @@
import java.util.Set;
import java.util.Map.Entry;
-import org.eclipse.core.internal.filebuffers.SynchronizableDocument;
import org.eclipse.core.internal.resources.File;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTParser;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.internal.core.JavaElement;
import org.eclipse.jdt.internal.core.JavaElementInfo;
import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.jdt.internal.core.PackageFragment;
import org.eclipse.jdt.internal.core.PackageFragmentRoot;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.dialogs.IPageChangingListener;
+import org.eclipse.jface.dialogs.PageChangingEvent;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ImageConstants;
+import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.jdt.ui.internal.jpa.collect.AllEntitiesInfoCollector;
@@ -60,32 +57,81 @@
* @author Dmitry Geraskov
*
*/
-public class NewHibernateMappingFileWizard extends Wizard implements INewWizard {
-
+public class NewHibernateMappingFileWizard extends Wizard implements INewWizard, IPageChangingListener{
+
/**
* Selected compilation units for startup processing,
* result of processing selection
*/
private Set<ICompilationUnit> selectionCU = new HashSet<ICompilationUnit>();
-
+
private Map<IJavaProject, Collection<EntityInfo>> project_infos = new HashMap<IJavaProject, Collection<EntityInfo>>();
-
+ private IStructuredSelection selection;
+
+ private NewHibernateMappingFilePage page2 = null;
+
+ private NewHibernateMappingElementsSelectionPage page1 = null;
+
public NewHibernateMappingFileWizard(){
setDefaultPageImageDescriptor(EclipseImages.getImageDescriptor(ImageConstants.NEW_WIZARD) );
+ setNeedsProgressMonitor(true);
}
-
+
@Override
public void addPages() {
super.addPages();
- addPage(new NewHibernateMappingFilePage(project_infos));
+ page1 = new NewHibernateMappingElementsSelectionPage(selection);
+ page1.setTitle( HibernateConsoleMessages.NewHibernateMappingFileWizard_create_hibernate_xml_mapping_file );
+ page1.setDescription( HibernateConsoleMessages.NewHibernateMappingFileWizard_create_new_xml_mapping_file );
+ addPage(page1);
+ page2 = new NewHibernateMappingFilePage();
+ addPage(page2);
+ if (getContainer() instanceof WizardDialog) {
+ ((WizardDialog) getContainer()).addPageChangingListener(this);
+ } else {
+ throw new IllegalArgumentException("Must use WizardDialog implementation as WizardContainer");
+ }
}
-
+
+ public void handlePageChanging(PageChangingEvent event) {
+ if (event.getTargetPage() == page2){
+ selection = page1.getSelection();
+ try {
+ getContainer().run(false, false, new IRunnableWithProgress(){
+
+ public void run(IProgressMonitor monitor) throws InvocationTargetException,
+ InterruptedException {
+ monitor.beginTask("Find dependent compilation units", selection.size() + 1);
+ Iterator it = selection.iterator();
+ int done = 1;
+ while (it.hasNext()) {
+ Object obj = it.next();
+ processJavaElements(obj);
+ monitor.worked(done++);
+ Thread.currentThread();
+ Thread.sleep(1000);
+ }
+ initEntitiesInfo();
+ monitor.worked(1);
+ monitor.done();
+ }
+ });
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ page2.setInput(project_infos);
+ }
+ }
+
public void init(IWorkbench workbench, IStructuredSelection selection) {
- updateSelectedItems(selection);
- initEntitiesInfo();
+ this.selection = selection;
}
-
+
@Override
public boolean performFinish() {
Map<IJavaProject, Configuration> configs = createConfigurations();
@@ -95,13 +141,13 @@
IResource container;
try {
- container = entry.getKey().getPackageFragmentRoots().length > 0
- ? entry.getKey().getPackageFragmentRoots()[0].getResource()
- : entry.getKey().getResource();
-
- HibernateMappingExporter hce = new HibernateMappingExporter(config,
+ container = entry.getKey().getPackageFragmentRoots().length > 0
+ ? entry.getKey().getPackageFragmentRoots()[0].getResource()
+ : entry.getKey().getResource();
+
+ HibernateMappingExporter hce = new HibernateMappingExporter(config,
container.getLocation().toFile());
-
+
hce.setGlobalSettings(hmgs);
//hce.setForEach("entity");
//hce.setFilePattern(file.getName());
@@ -110,7 +156,7 @@
} catch (Exception e){
e.getCause().printStackTrace();
}
- container.refreshLocal(IResource.DEPTH_INFINITE, null);
+ container.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (JavaModelException e1) {
HibernateConsolePlugin.getDefault().log(e1);
} catch (CoreException e) {
@@ -121,8 +167,10 @@
}
protected void initEntitiesInfo(){
- if (selectionCU.size() == 0) return;
- AllEntitiesInfoCollector collector = new AllEntitiesInfoCollector();
+ if (selectionCU.size() == 0) {
+ return;
+ }
+ AllEntitiesInfoCollector collector = new AllEntitiesInfoCollector();
Iterator<ICompilationUnit> it = selectionCU.iterator();
Map<IJavaProject, Set<ICompilationUnit>> mapJP_CUSet =
@@ -138,10 +186,10 @@
set.add(cu);
}
Iterator<Map.Entry<IJavaProject, Set<ICompilationUnit>>>
- mapIt = mapJP_CUSet.entrySet().iterator();
+ mapIt = mapJP_CUSet.entrySet().iterator();
while (mapIt.hasNext()) {
Map.Entry<IJavaProject, Set<ICompilationUnit>>
- entry = mapIt.next();
+ entry = mapIt.next();
IJavaProject javaProject = entry.getKey();
Iterator<ICompilationUnit> setIt = entry.getValue().iterator();
collector.initCollector(javaProject);
@@ -155,78 +203,7 @@
}
}
-
- private Map<IJavaProject, Configuration> createConfigurations() {
- ConfigurationActor actor = new ConfigurationActor(selectionCU);
- Map<IJavaProject, Configuration> configs = actor.createConfigurations();
- return configs;
- }
- protected void updateSelectedItems(ISelection sel) {
- if (sel instanceof TextSelection) {
- String fullyQualifiedName = ""; //$NON-NLS-1$
- IDocument fDocument = null;
- SynchronizableDocument sDocument = null;
- org.eclipse.jdt.core.dom.CompilationUnit resultCU = null;
- Class clazz = sel.getClass();
- Field fd = null;
- try {
- fd = clazz.getDeclaredField("fDocument"); //$NON-NLS-1$
- } catch (NoSuchFieldException e) {
- // just ignore it!
- }
- if (fd != null) {
- try {
- fd.setAccessible(true);
- fDocument = (IDocument)fd.get(sel);
- if (fDocument instanceof SynchronizableDocument) {
- sDocument = (SynchronizableDocument)fDocument;
- }
- if (sDocument != null) {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setSource(sDocument.get().toCharArray());
- parser.setResolveBindings(false);
- resultCU = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null);
- }
- if (resultCU != null && resultCU.types().size() > 0 ) {
- if (resultCU.getPackage() != null) {
- fullyQualifiedName = resultCU.getPackage().getName().getFullyQualifiedName() + "."; //$NON-NLS-1$
- }
- else {
- fullyQualifiedName = ""; //$NON-NLS-1$
- }
- Object tmp = resultCU.types().get(0);
- if (tmp instanceof AbstractTypeDeclaration) {
- fullyQualifiedName += ((AbstractTypeDeclaration)tmp).getName();
- }
- if (!(tmp instanceof TypeDeclaration)) {
- // ignore EnumDeclaration & AnnotationTypeDeclaration
- fullyQualifiedName = ""; //$NON-NLS-1$
- }
- }
- } catch (IllegalArgumentException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("IllegalArgumentException: ", e); //$NON-NLS-1$
- } catch (IllegalAccessException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("IllegalAccessException: ", e); //$NON-NLS-1$
- } catch (SecurityException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("SecurityException: ", e); //$NON-NLS-1$
- }
- }
- if (fullyQualifiedName.length() > 0) {
- ICompilationUnit cu = Utils.findCompilationUnit(fullyQualifiedName);
- selectionCU.add(cu);
- }
- }
- else if (sel instanceof TreeSelection) {
- TreeSelection treeSelection = (TreeSelection)sel;
- Iterator it = treeSelection.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- processJavaElements(obj);
- }
- }
- }
-
protected void processJavaElements(Object obj) {
if (obj instanceof ICompilationUnit) {
ICompilationUnit cu = (ICompilationUnit)obj;
@@ -239,8 +216,8 @@
ICompilationUnit[] cus = Utils.findCompilationUnits(javaProject,
file.getFullPath());
if (cus != null) {
- for (int i = 0; i < cus.length; i++) {
- selectionCU.add(cus[i]);
+ for (ICompilationUnit cu : cus) {
+ selectionCU.add(cu);
}
}
}
@@ -255,8 +232,8 @@
//HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
}
if (pfr != null) {
- for (int i = 0; i < pfr.length; i++) {
- processJavaElements(pfr[i]);
+ for (IPackageFragmentRoot element : pfr) {
+ processJavaElements(element);
}
}
}
@@ -270,13 +247,12 @@
//HibernateConsolePlugin.getDefault().logErrorMessage("JavaModelException: ", e); //$NON-NLS-1$
}
if (cus != null) {
- for (int i = 0; i < cus.length; i++) {
- selectionCU.add(cus[i]);
+ for (ICompilationUnit cu : cus) {
+ selectionCU.add(cu);
}
}
}
else if (obj instanceof PackageFragmentRoot) {
- PackageFragmentRoot packageFragmentRoot = (PackageFragmentRoot)obj;
JavaElement javaElement = (JavaElement)obj;
JavaElementInfo javaElementInfo = null;
try {
@@ -287,8 +263,8 @@
}
if (javaElementInfo != null) {
IJavaElement[] je = javaElementInfo.getChildren();
- for (int i = 0; i < je.length; i++) {
- processJavaElements(je[i]);
+ for (IJavaElement element : je) {
+ processJavaElements(element);
}
}
}
@@ -299,4 +275,11 @@
}
}
+
+ protected Map<IJavaProject, Configuration> createConfigurations() {
+ ConfigurationActor actor = new ConfigurationActor(selectionCU);
+ Map<IJavaProject, Configuration> configs = actor.createConfigurations();
+ return configs;
+ }
+
}
17 years, 2 months
JBoss Tools SVN: r15295 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb: internal and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 11:05:25 -0400 (Fri, 15 May 2009)
New Revision: 15295
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbResourceVisitor.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2009-05-15 14:41:11 UTC (rev 15294)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2009-05-15 15:05:25 UTC (rev 15295)
@@ -17,7 +17,7 @@
* @param resolve if true and results of last build have not been resolved they are loaded.
* @return
*/
- public static IKbProject getSeamProject(IProject project, boolean resolve) {
+ public static IKbProject getKbProject(IProject project, boolean resolve) {
if(project == null || !project.exists() || !project.isOpen()) return null;
try {
if(!project.hasNature(IKbProject.NATURE_ID)) return null;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java 2009-05-15 14:41:11 UTC (rev 15294)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java 2009-05-15 15:05:25 UTC (rev 15295)
@@ -10,13 +10,24 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal;
+import java.io.IOException;
import java.util.Map;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
+import org.jboss.tools.jst.web.WebModelPlugin;
+import org.jboss.tools.jst.web.kb.KbProjectFactory;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.internal.scanner.IFileScanner;
+import org.jboss.tools.jst.web.kb.internal.scanner.LibraryScanner;
+import org.jboss.tools.jst.web.kb.internal.scanner.XMLScanner;
/**
*
@@ -26,10 +37,131 @@
public class KbBuilder extends IncrementalProjectBuilder {
public static String BUILDER_ID = WebKbPlugin.PLUGIN_ID + ".kbbuilder"; //$NON-NLS-1$
+ KbResourceVisitor resourceVisitor = null;
+
+ KbProject getKbProject() {
+ IProject p = getProject();
+ if(p == null) return null;
+ return (KbProject)KbProjectFactory.getKbProject(p, false);
+ }
+
+ KbResourceVisitor getResourceVisitor() {
+ if(resourceVisitor == null) {
+ KbProject p = getKbProject();
+ resourceVisitor = new KbResourceVisitor(p);
+ }
+ return resourceVisitor;
+ }
+
+ class SampleDeltaVisitor implements IResourceDeltaVisitor {
+ /*
+ * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
+ */
+ public boolean visit(IResourceDelta delta) throws CoreException {
+ IResource resource = delta.getResource();
+ switch (delta.getKind()) {
+ case IResourceDelta.ADDED:
+ return getResourceVisitor().getVisitor().visit(resource);
+ case IResourceDelta.REMOVED:
+ KbProject p = getKbProject();
+ if(p != null) p.pathRemoved(resource.getFullPath());
+ break;
+ case IResourceDelta.CHANGED:
+ return getResourceVisitor().getVisitor().visit(resource);
+ }
+ //return true to continue visiting children.
+ return true;
+ }
+ }
+
+ /**
+ * @see org.eclipse.core.resource.InternalProjectBuilder#build(int,
+ * java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
+ */
protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
throws CoreException {
- // TODO Auto-generated method stub
+ KbProject sp = getKbProject();
+ if(sp == null) {
+ return null;
+ }
+
+ long begin = System.currentTimeMillis();
+
+ sp.postponeFiring();
+
+ try {
+
+ sp.resolveStorage(kind != FULL_BUILD);
+
+ if(sp.getClassPath().update()) {
+ sp.getClassPath().process();
+ } else if(sp.getClassPath().hasToUpdateProjectDependencies()) {
+ sp.getClassPath().validateProjectDependencies();
+ }
+
+ TypeInfoCollector.cleanCache();
+
+ if (kind == FULL_BUILD) {
+ fullBuild(monitor);
+ } else {
+ IResourceDelta delta = getDelta(getProject());
+ if (delta == null) {
+ fullBuild(monitor);
+ } else {
+ incrementalBuild(delta, monitor);
+ }
+ }
+ long end = System.currentTimeMillis();
+ sp.fullBuildTime += end - begin;
+ try {
+ sp.store();
+ } catch (IOException e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ }
+
+// sp.postBuild();
+
+ } finally {
+ sp.fireChanges();
+ }
+
return null;
}
+ protected void fullBuild(final IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ getProject().accept(getResourceVisitor().getVisitor());
+ } catch (CoreException e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ }
+ }
+
+ protected void incrementalBuild(IResourceDelta delta,
+ IProgressMonitor monitor) throws CoreException {
+ // the visitor does the work.
+ delta.accept(new SampleDeltaVisitor());
+ }
+
+ /**
+ * Access to xml scanner for test.
+ * @return
+ */
+ public static IFileScanner getXMLScanner() {
+ return new XMLScanner();
+ }
+
+ /**
+ * Access to library scanner for test.
+ * @return
+ */
+ public static IFileScanner getLibraryScanner() {
+ return new LibraryScanner();
+ }
+
+ protected void clean(IProgressMonitor monitor) throws CoreException {
+ KbProject sp = getKbProject();
+ if(sp != null) sp.clean();
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-15 14:41:11 UTC (rev 15294)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-15 15:05:25 UTC (rev 15295)
@@ -10,23 +10,35 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
+import java.util.Properties;
import java.util.Set;
import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.jst.web.WebModelPlugin;
import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.KbProjectFactory;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.jboss.tools.jst.web.kb.internal.scanner.ClassPathMonitor;
import org.jboss.tools.jst.web.kb.internal.scanner.LoadedDeclarations;
import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+import org.w3c.dom.Element;
/**
*
@@ -166,12 +178,239 @@
public void load() {
if(isStorageResolved) return;
isStorageResolved = true;
+
+ postponeFiring();
+
+ try {
+
+ boolean b = getClassPath().update();
+ if(b) {
+ getClassPath().validateProjectDependencies();
+ }
+ File file = getStorageFile();
+ Element root = null;
+ if(file != null && file.isFile()) {
+ root = XMLUtilities.getElement(file, null);
+ if(root != null) {
+ loadProjectDependencies(root);
+ if(XMLUtilities.getUniqueChild(root, "paths") != null) {
+ loadSourcePaths2(root);
+ }
+ }
+ }
+
+ if(b) {
+ getClassPath().process();
+ }
+
+ } finally {
+ fireChanges();
+ }
+
+ }
+
+ public void clean() {
+ File file = getStorageFile();
+ if(file != null && file.isFile()) {
+ file.delete();
+ }
+ classPath.clean();
+ postponeFiring();
+ IPath[] ps = sourcePaths2.keySet().toArray(new IPath[0]);
+ for (int i = 0; i < ps.length; i++) {
+ pathRemoved(ps[i]);
+ }
+ fireChanges();
+ }
- //TODO
+ public long fullBuildTime;
+ public List<Long> statistics;
+
+
+ /**
+ * Method testing how long it takes to load Seam model
+ * serialized previously.
+ * This approach makes sure, that all other services
+ * (JDT, XModel, etc) are already loaded at first start of
+ * Seam model, so that now it is more or less pure time
+ * to be computed.
+ *
+ * @return
+ */
+ public long reload() {
+ statistics = new ArrayList<Long>();
+ classPath = new ClassPathMonitor(this);
+ sourcePaths.clear();
+ sourcePaths2.clear();
+ isStorageResolved = false;
+ dependsOn.clear();
+ usedBy.clear();
+ libraries.clear();
+
+ long begin = System.currentTimeMillis();
+
+ classPath.init();
+ resolve();
+
+ long end = System.currentTimeMillis();
+ return end - begin;
}
/**
+ * Stores results of last build, so that on exit/enter Eclipse
+ * load them without rebuilding project
+ * @throws IOException
+ */
+ public void store() throws IOException {
+ File file = getStorageFile();
+ file.getParentFile().mkdirs();
+
+ Element root = XMLUtilities.createDocumentElement("seam-project"); //$NON-NLS-1$
+ storeProjectDependencies(root);
+
+// storeSourcePaths(root);
+ storeSourcePaths2(root);
+
+ XMLUtilities.serialize(root, file.getAbsolutePath());
+ }
+
+ /*
*
+ */
+ private File getStorageFile() {
+ IPath path = WebKbPlugin.getDefault().getStateLocation();
+ File file = new File(path.toFile(), "projects/" + project.getName()); //$NON-NLS-1$
+ return file;
+ }
+
+ public void clearStorage() {
+ File f = getStorageFile();
+ if(f != null && f.isFile()) f.delete();
+ }
+
+ /*
+ *
+ */
+ private void loadProjectDependencies(Element root) {
+ Element dependsOnElement = XMLUtilities.getUniqueChild(root, "depends-on-projects"); //$NON-NLS-1$
+ if(dependsOnElement != null) {
+ Element[] paths = XMLUtilities.getChildren(dependsOnElement, "project"); //$NON-NLS-1$
+ for (int i = 0; i < paths.length; i++) {
+ String p = paths[i].getAttribute("name"); //$NON-NLS-1$
+ if(p == null || p.trim().length() == 0) continue;
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(p);
+ if(project == null || !project.isAccessible()) continue;
+ KbProject sp = (KbProject)KbProjectFactory.getKbProject(project, false);
+ if(sp != null) {
+ dependsOn.add(sp);
+ sp.addDependentSeamProject(this);
+ }
+ }
+ }
+
+ Element usedElement = XMLUtilities.getUniqueChild(root, "used-by-projects"); //$NON-NLS-1$
+ if(usedElement != null) {
+ Element[] paths = XMLUtilities.getChildren(usedElement, "project"); //$NON-NLS-1$
+ for (int i = 0; i < paths.length; i++) {
+ String p = paths[i].getAttribute("name"); //$NON-NLS-1$
+ if(p == null || p.trim().length() == 0) continue;
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(p);
+ if(project == null || !project.isAccessible()) continue;
+ KbProject sp = (KbProject)KbProjectFactory.getKbProject(project, false);
+ if(sp != null) usedBy.add(sp);
+ }
+ }
+
+ }
+
+ private void loadSourcePaths2(Element root) {
+ Properties context = new Properties();
+ context.put("seamProject", this);
+ Element sourcePathsElement = XMLUtilities.getUniqueChild(root, "paths"); //$NON-NLS-1$
+ if(sourcePathsElement == null) return;
+ Element[] paths = XMLUtilities.getChildren(sourcePathsElement, "path"); //$NON-NLS-1$
+ if(paths != null) for (int i = 0; i < paths.length; i++) {
+ String p = paths[i].getAttribute("value"); //$NON-NLS-1$
+ if(p == null || p.trim().length() == 0) continue;
+ IPath path = new Path(p.trim());
+ if(sourcePaths2.containsKey(path)) continue;
+
+ if(!getClassPath().hasPath(path)) {
+ IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if(f == null || !f.exists() || !f.isSynchronized(IResource.DEPTH_ZERO)) continue;
+ }
+
+ //TODO
+
+ long t1 = System.currentTimeMillis();
+ LoadedDeclarations ds = new LoadedDeclarations();
+
+ Element libraries = XMLUtilities.getUniqueChild(paths[i], "libraries");
+ if(libraries != null) {
+
+ //TODO
+
+ }
+
+ getClassPath().pathLoaded(path);
+
+ registerComponents(ds, path);
+ long t2 = System.currentTimeMillis();
+ if(statistics != null) {
+ statistics.add(new Long(t2 - t1));
+ if(t2 - t1 > 30) {
+ System.out.println("--->" + statistics.size() + " " + (t2 - t1));
+ System.out.println("stop");
+ }
+ }
+ }
+ }
+
+ private void storeSourcePaths2(Element root) {
+ Properties context = new Properties();
+ Element sourcePathsElement = XMLUtilities.createElement(root, "paths"); //$NON-NLS-1$
+ for (IPath path : sourcePaths2.keySet()) {
+ IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if(f != null && f.exists() && f.getProject() != project) {
+ continue;
+ }
+ //TODO
+// context.put(SeamXMLConstants.ATTR_PATH, path);
+ LoadedDeclarations ds = sourcePaths2.get(path);
+ Element pathElement = XMLUtilities.createElement(sourcePathsElement, "path"); //$NON-NLS-1$
+ pathElement.setAttribute("value", path.toString()); //$NON-NLS-1$
+
+ List<ITagLibrary> fs = ds.getLibraries();
+ if(fs != null && !fs.isEmpty()) {
+ Element cse = XMLUtilities.createElement(pathElement, "factories"); //$NON-NLS-1$
+ for (ITagLibrary d: fs) {
+ //TODO
+// SeamObject o = (SeamObject)d;
+// o.toXML(cse, context);
+ }
+ }
+ }
+ }
+ /*
+ *
+ */
+ private void storeProjectDependencies(Element root) {
+ Element dependsOnElement = XMLUtilities.createElement(root, "depends-on-projects"); //$NON-NLS-1$
+ for (IKbProject p : dependsOn) {
+ if(!p.getProject().isAccessible()) continue;
+ Element pathElement = XMLUtilities.createElement(dependsOnElement, "project"); //$NON-NLS-1$
+ pathElement.setAttribute("name", p.getProject().getName()); //$NON-NLS-1$
+ }
+ Element usedElement = XMLUtilities.createElement(root, "used-by-projects"); //$NON-NLS-1$
+ for (IKbProject p : usedBy) {
+ if(!p.getProject().isAccessible()) continue;
+ Element pathElement = XMLUtilities.createElement(usedElement, "project"); //$NON-NLS-1$
+ pathElement.setAttribute("name", p.getProject().getName()); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ *
* @return
* @throws CloneNotSupportedException
*/
@@ -264,7 +503,14 @@
//TODO
}
+ public void postponeFiring() {
+ //TODO
+ }
+ public void fireChanges() {
+ //TODO
+ }
+
class LibraryStorage {
private Set<ITagLibrary> allFactories = new HashSet<ITagLibrary>();
private ITagLibrary[] allFactoriesArray = null;
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbResourceVisitor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbResourceVisitor.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbResourceVisitor.java 2009-05-15 15:05:25 UTC (rev 15295)
@@ -0,0 +1,149 @@
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.internal.scanner.IFileScanner;
+import org.jboss.tools.jst.web.kb.internal.scanner.LoadedDeclarations;
+import org.jboss.tools.jst.web.kb.internal.scanner.ScannerException;
+import org.jboss.tools.jst.web.kb.internal.scanner.XMLScanner;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
+
+public class KbResourceVisitor implements IResourceVisitor {
+ static IFileScanner[] FILE_SCANNERS = {
+ new XMLScanner(),
+ };
+
+ KbProject p;
+
+ IPath[] outs = new IPath[0];
+ IPath[] srcs = new IPath[0];
+ IPath webinf = null;
+
+ public KbResourceVisitor(KbProject p) {
+ this.p = p;
+
+ if(p.getProject() != null && p.getProject().isOpen()) {
+ getJavaSourceRoots(p.getProject());
+
+ XModel model = InnerModelHelper.createXModel(p.getProject());
+ if(model != null) {
+ XModelObject wio = FileSystemsHelper.getWebInf(model);
+ if(wio != null) {
+ IResource wir = (IResource)wio.getAdapter(IResource.class);
+ if(wir != null) {
+ webinf = wir.getFullPath();
+ }
+ }
+ }
+ }
+ }
+
+ public IResourceVisitor getVisitor() {
+ return this;
+ }
+
+ public boolean visit(IResource resource) {
+ if(resource instanceof IFile) {
+ IFile f = (IFile)resource;
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(resource.getFullPath())) {
+ return false;
+ }
+ }
+ for (int i = 0; i < FILE_SCANNERS.length; i++) {
+ IFileScanner scanner = FILE_SCANNERS[i];
+ if(scanner.isRelevant(f)) {
+ long t = System.currentTimeMillis();
+ if(!scanner.isLikelyComponentSource(f)) {
+ p.pathRemoved(f.getFullPath());
+ return false;
+ }
+ LoadedDeclarations c = null;
+ try {
+ c = scanner.parse(f, p);
+ } catch (ScannerException e) {
+ WebKbPlugin.getDefault().logError(e);
+ }
+ if(c != null) componentsLoaded(c, f);
+ long dt = System.currentTimeMillis() - t;
+// timeUsed += dt;
+// System.out.println("Time=" + timeUsed);
+ }
+ }
+ }
+ if(resource instanceof IFolder) {
+ IPath path = resource.getFullPath();
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(path)) {
+ return false;
+ }
+ }
+ for (int i = 0; i < srcs.length; i++) {
+ if(srcs[i].isPrefixOf(path) || path.isPrefixOf(srcs[i])) {
+ return true;
+ }
+ }
+ if(webinf != null) {
+ if(webinf.isPrefixOf(path) || path.isPrefixOf(webinf)) {
+ return true;
+ }
+ }
+ if(resource == resource.getProject()) {
+ return true;
+ }
+ return false;
+ }
+ //return true to continue visiting children.
+ return true;
+ }
+
+ void componentsLoaded(LoadedDeclarations c, IFile resource) {
+ if(c == null || c.getLibraries().size() == 0) return;
+ p.registerComponents(c, resource.getFullPath());
+ }
+
+ void getJavaSourceRoots(IProject project) {
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
+ if(javaProject == null) return;
+ List<IPath> ps = new ArrayList<IPath>();
+ List<IPath> os = new ArrayList<IPath>();
+ try {
+ IPath output = javaProject.getOutputLocation();
+ if(output != null) os.add(output);
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ IResource findMember = ModelPlugin.getWorkspace().getRoot().findMember(es[i].getPath());
+ if(findMember != null && findMember.exists()) {
+ ps.add(findMember.getFullPath());
+ }
+ IPath out = es[i].getOutputLocation();
+ if(out != null && !os.contains(out)) {
+ os.add(out);
+ }
+ }
+ }
+ srcs = ps.toArray(new IPath[0]);
+ outs = os.toArray(new IPath[0]);
+ } catch(CoreException ce) {
+ ModelPlugin.getPluginLog().logError("Error while locating java source roots for " + project, ce);
+ }
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbResourceVisitor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java 2009-05-15 14:41:11 UTC (rev 15294)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java 2009-05-15 15:05:25 UTC (rev 15295)
@@ -261,7 +261,7 @@
if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
if(p == null || !p.isAccessible()) continue;
- IKbProject sp = KbProjectFactory.getSeamProject(p, false);
+ IKbProject sp = KbProjectFactory.getKbProject(p, false);
if(sp != null) list.add((KbProject)sp);
}
}
17 years, 2 months
JBoss Tools SVN: r15294 - trunk/jsf/plugins/org.jboss.tools.jsf/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 10:41:11 -0400 (Fri, 15 May 2009)
New Revision: 15294
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2009-05-15 14:34:43 UTC (rev 15293)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2009-05-15 14:41:11 UTC (rev 15294)
@@ -29,6 +29,7 @@
org.jboss.tools.jsf.web.helpers.context,
org.jboss.tools.jsf.web.pattern
Require-Bundle: org.jboss.tools.jst.web;visibility:=reexport,
+ org.jboss.tools.jst.web.kb;visibility:=reexport,
org.eclipse.ui.ide,
org.eclipse.ui.views,
org.eclipse.jface.text,
17 years, 2 months
JBoss Tools SVN: r15291 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb: META-INF and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 10:23:50 -0400 (Fri, 15 May 2009)
New Revision: 15291
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IKbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/IFileScanner.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LoadedDeclarations.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ScannerException.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties
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/taglib/ITagLibrary.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-05-15 14:19:46 UTC (rev 15290)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-05-15 14:23:50 UTC (rev 15291)
@@ -2,7 +2,9 @@
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.jboss.tools.jst.web.kb;singleton:=true
+Bundle-Localization: plugin
Bundle-Version: 1.0.0
+Bundle-ClassPath: webKb.jar
Bundle-Activator: org.jboss.tools.jst.web.kb.WebKbPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
@@ -13,4 +15,5 @@
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
Export-Package: org.jboss.tools.jst.web.kb,
+ org.jboss.tools.jst.web.kb.internal,
org.jboss.tools.jst.web.kb.taglib
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties 2009-05-15 14:19:46 UTC (rev 15290)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties 2009-05-15 14:23:50 UTC (rev 15291)
@@ -1,4 +1,5 @@
-bin.includes = META-INF/,\
+bin.includes = plugin.xml,\
+ META-INF/,\
plugin.properties,\
webKb.jar,\
about.html
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+
+ <extension
+ id="kbbuilder"
+ name="KB Builder"
+ point="org.eclipse.core.resources.builders">
+ <builder
+ hasNature="false">
+ <run
+ class="org.jboss.tools.jst.web.kb.internal.KbBuilder">
+ </run>
+ </builder>
+ </extension>
+ <extension
+ id="kbnature"
+ name="KB Project Nature"
+ point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run
+ class="org.jboss.tools.jst.web.kb.internal.KbProject">
+ </run>
+ </runtime>
+ <builder
+ id="org.jboss.tools.jst.web.kb.kbbuilder">
+ </builder>
+ </extension>
+
+</plugin>
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IKbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IKbProject.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IKbProject.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import org.eclipse.core.resources.IProjectNature;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ *
+ * @author V.Kabanovich
+ *
+ */
+public interface IKbProject extends IProjectNature {
+ public static String NATURE_ID = Activator.PLUGIN_ID + ".kbnature"; //$NON-NLS-1$
+
+ public ITagLibrary[] getTagLibraries();
+
+ public void resolve();
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IKbProject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,40 @@
+package org.jboss.tools.jst.web.kb;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.jst.web.WebModelPlugin;
+
+public class KbProjectFactory {
+
+ /**
+ * Factory method creating seam project instance by project resource.
+ * Returns null if
+ * (1) project does not exist
+ * (2) project is closed
+ * (3) project has no seam nature
+ * (4) creating seam project failed.
+ * @param project
+ * @param resolve if true and results of last build have not been resolved they are loaded.
+ * @return
+ */
+ public static IKbProject getSeamProject(IProject project, boolean resolve) {
+ if(project == null || !project.exists() || !project.isOpen()) return null;
+ try {
+ if(!project.hasNature(IKbProject.NATURE_ID)) return null;
+ } catch (CoreException e) {
+ //ignore - all checks are done above
+ return null;
+ }
+
+ IKbProject kbProject;
+ try {
+ kbProject = (IKbProject)project.getNature(IKbProject.NATURE_ID);
+ if(resolve) kbProject.resolve();
+ return kbProject;
+ } catch (CoreException e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ }
+ return null;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.jst.web.kb.Activator;
+
+/**
+ *
+ * @author V.Kabanovich
+ *
+ */
+public class KbBuilder extends IncrementalProjectBuilder {
+ public static String BUILDER_ID = Activator.PLUGIN_ID + ".kbbuilder"; //$NON-NLS-1$
+
+ protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
+ throws CoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,344 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.WebModelPlugin;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.internal.scanner.ClassPathMonitor;
+import org.jboss.tools.jst.web.kb.internal.scanner.LoadedDeclarations;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ *
+ * @author V.Kabanovich
+ *
+ */
+public class KbProject implements IKbProject {
+ IProject project;
+
+ ClassPathMonitor classPath = new ClassPathMonitor(this);
+
+ Set<IPath> sourcePaths = new HashSet<IPath>();
+
+ Map<IPath, LoadedDeclarations> sourcePaths2 = new HashMap<IPath, LoadedDeclarations>();
+
+ private boolean isStorageResolved = false;
+
+ Set<KbProject> dependsOn = new HashSet<KbProject>();
+
+ Set<KbProject> usedBy = new HashSet<KbProject>();
+
+ LibraryStorage libraries = new LibraryStorage();
+
+ public ITagLibrary[] getTagLibraries() {
+ return libraries.getAllFactoriesArray();
+ }
+
+ public void configure() throws CoreException {
+ addToBuildSpec(KbBuilder.BUILDER_ID);
+ }
+
+ public void deconfigure() throws CoreException {
+ removeFromBuildSpec(KbBuilder.BUILDER_ID);
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public IPath getSourcePath() {
+ return project == null ? null : project.getFullPath();
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ /**
+ *
+ * @param p
+ */
+ public void addSeamProject(KbProject p) {
+ if(dependsOn.contains(p)) return;
+ dependsOn.add(p);
+ p.addDependentSeamProject(this);
+ if(!p.isStorageResolved) {
+ p.resolve();
+ } else {
+ Map<IPath,LoadedDeclarations> map = null;
+ try {
+ map = p.getAllDeclarations();
+ } catch (CloneNotSupportedException e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ }
+ for (IPath source : map.keySet()) {
+ LoadedDeclarations ds = map.get(source);
+ registerComponents(ds, source);
+ }
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Set<KbProject> getSeamProjects() {
+ return dependsOn;
+ }
+
+ /**
+ *
+ * @param p
+ */
+ public void addDependentSeamProject(KbProject p) {
+ usedBy.add(p);
+ }
+
+ /**
+ *
+ * @param p
+ */
+ public void removeSeamProject(KbProject p) {
+ if(!dependsOn.contains(p)) return;
+ p.usedBy.remove(this);
+ dependsOn.remove(p);
+ IPath[] ps = sourcePaths2.keySet().toArray(new IPath[0]);
+ for (int i = 0; i < ps.length; i++) {
+ IPath pth = ps[i];
+ if(p.getSourcePath().isPrefixOf(pth) || (p.isPathLoaded(pth) && !EclipseResourceUtil.isJar(pth.toString()))) {
+ pathRemoved(pth);
+ }
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ public ClassPathMonitor getClassPath() {
+ return classPath;
+ }
+
+ /**
+ *
+ * @param load
+ */
+ public void resolveStorage(boolean load) {
+ if(isStorageResolved) return;
+ if(load) {
+ load();
+ } else {
+ isStorageResolved = true;
+ }
+ }
+
+ /**
+ *
+ */
+ public void resolve() {
+ resolveStorage(true);
+ }
+
+ /**
+ * Loads results of last build, which are considered
+ * actual until next build.
+ */
+ public void load() {
+ if(isStorageResolved) return;
+ isStorageResolved = true;
+
+ //TODO
+ }
+
+ /**
+ *
+ * @return
+ * @throws CloneNotSupportedException
+ */
+ Map<IPath, LoadedDeclarations> getAllDeclarations() throws CloneNotSupportedException {
+ Map<IPath, LoadedDeclarations> map = new HashMap<IPath, LoadedDeclarations>();
+ for (ITagLibrary f : getTagLibraries()) {
+ IPath p = f.getSourcePath();
+ if(p == null || EclipseResourceUtil.isJar(p.toString())) continue;
+ LoadedDeclarations ds = map.get(p);
+ if(ds == null) {
+ ds = new LoadedDeclarations();
+ map.put(p, ds);
+ }
+ ds.getLibraries().add(f.clone());
+ }
+ return map;
+ }
+
+ /**
+ *
+ * @param builderID
+ * @throws CoreException
+ */
+ protected void addToBuildSpec(String builderID) throws CoreException {
+ IProjectDescription description = getProject().getDescription();
+ ICommand command = null;
+ ICommand commands[] = description.getBuildSpec();
+ for (int i = 0; i < commands.length && command == null; ++i) {
+ if (commands[i].getBuilderName().equals(builderID))
+ command = commands[i];
+ }
+ if (command == null) {
+ command = description.newCommand();
+ command.setBuilderName(builderID);
+ ICommand[] oldCommands = description.getBuildSpec();
+ ICommand[] newCommands = new ICommand[oldCommands.length + 1];
+ System.arraycopy(oldCommands, 0, newCommands, 0, oldCommands.length);
+ newCommands[oldCommands.length] = command;
+ description.setBuildSpec(newCommands);
+ getProject().setDescription(description, null);
+ }
+ }
+
+ static String EXTERNAL_TOOL_BUILDER = "org.eclipse.ui.externaltools.ExternalToolBuilder";
+ static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle";
+
+ /**
+ *
+ * @param builderID
+ * @throws CoreException
+ */
+ protected void removeFromBuildSpec(String builderID) throws CoreException {
+ IProjectDescription description = getProject().getDescription();
+ ICommand[] commands = description.getBuildSpec();
+ for (int i = 0; i < commands.length; ++i) {
+ String builderName = commands[i].getBuilderName();
+ if (!builderName.equals(builderID)) {
+ if(!builderName.equals(EXTERNAL_TOOL_BUILDER)) continue;
+ Object handle = commands[i].getArguments().get(LAUNCH_CONFIG_HANDLE);
+ if(handle == null || handle.toString().indexOf(builderID) < 0) continue;
+ }
+ ICommand[] newCommands = new ICommand[commands.length - 1];
+ System.arraycopy(commands, 0, newCommands, 0, i);
+ System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1);
+ description.setBuildSpec(newCommands);
+ getProject().setDescription(description, null);
+ return;
+ }
+ }
+
+ /**
+ * Package local method called by builder.
+ * @param component
+ * @param source
+ */
+ public void registerComponents(LoadedDeclarations ds, IPath source) {
+ //TODO
+ }
+
+ public boolean isPathLoaded(IPath source) {
+ return sourcePaths2.containsKey(source);
+ }
+
+
+ /**
+ * Package local method called by builder.
+ * @param source
+ */
+ public void pathRemoved(IPath source) {
+ //TODO
+ }
+
+
+ class LibraryStorage {
+ private Set<ITagLibrary> allFactories = new HashSet<ITagLibrary>();
+ private ITagLibrary[] allFactoriesArray = null;
+ Map<IPath, Set<ITagLibrary>> factoriesBySource = new HashMap<IPath, Set<ITagLibrary>>();
+
+ public void clear() {
+ synchronized(allFactories) {
+ allFactories.clear();
+ allFactoriesArray = null;
+ }
+ factoriesBySource.clear();
+ }
+
+ public ITagLibrary[] getAllFactoriesArray() {
+ ITagLibrary[] result = allFactoriesArray;
+ if(result == null) {
+ synchronized(allFactories) {
+ allFactoriesArray = allFactories.toArray(new ITagLibrary[0]);
+ result = allFactoriesArray;
+ }
+ }
+ return result;
+ }
+
+ public Set<ITagLibrary> getFactoriesBySource(IPath path) {
+ return factoriesBySource.get(path);
+ }
+
+ public void addFactory(ITagLibrary f) {
+ synchronized(allFactories) {
+ allFactories.add(f);
+ allFactoriesArray = null;
+ }
+ IPath path = f.getSourcePath();
+ if(path != null) {
+ Set<ITagLibrary> fs = factoriesBySource.get(path);
+ if(fs == null) {
+ fs = new HashSet<ITagLibrary>();
+ factoriesBySource.put(path, fs);
+ }
+ fs.add(f);
+ }
+ }
+
+ public void removeFactory(ITagLibrary f) {
+ synchronized(allFactories) {
+ allFactories.remove(f);
+ allFactoriesArray = null;
+ }
+ IPath path = f.getSourcePath();
+ if(path != null) {
+ Set<ITagLibrary> fs = factoriesBySource.get(path);
+ if(fs != null) {
+ fs.remove(f);
+ }
+ if(fs.isEmpty()) {
+ factoriesBySource.remove(fs);
+ }
+ }
+ }
+
+ public Set<ITagLibrary> removePath(IPath path) {
+ Set<ITagLibrary> fs = factoriesBySource.get(path);
+ if(fs == null) return null;
+ for (ITagLibrary f: fs) {
+ synchronized(allFactories) {
+ allFactories.remove(f);
+ allFactoriesArray = null;
+ }
+ }
+ factoriesBySource.remove(path);
+ return fs;
+ }
+
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,288 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.scanner;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.impl.FileSystemsLoader;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.XModelObjectUtil;
+import org.jboss.tools.jst.web.WebModelPlugin;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.KbProjectFactory;
+import org.jboss.tools.jst.web.kb.internal.KbProject;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
+
+/**
+ * Monitors class path of project and loads seam components of it.
+ *
+ * @author Viacheslav Kabanovich
+ */
+public class ClassPathMonitor {
+ KbProject project;
+ XModel model = null;
+
+ List<String> paths = null;
+ Map<IPath, String> paths2 = new HashMap<IPath, String>();
+
+ Set<String> processedPaths = new HashSet<String>();
+
+ /**
+ * Creates instance of class path for seam project
+ * @param project
+ */
+ public ClassPathMonitor(KbProject project) {
+ this.project = project;
+ }
+
+ /**
+ * Returns seam project
+ * @return
+ */
+ public KbProject getProject() {
+ return project;
+ }
+
+ /**
+ * Initialization of inner model.
+ */
+ public void init() {
+ model = InnerModelHelper.createXModel(project.getProject());
+ }
+
+ static String[] SYSTEM_JARS = {"rt.jar", "jsse.jar", "jce.jar", "charsets.jar"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ static Set<String> SYSTEM_JAR_SET = new HashSet<String>();
+
+ static {
+ for (int i = 0; i < SYSTEM_JARS.length; i++) SYSTEM_JAR_SET.add(SYSTEM_JARS[i]);
+ }
+
+ /**
+ * Returns true if class path was up-to-date.
+ * Otherwise, updates inner model and disables class loader.
+ * @return
+ */
+ public boolean update() {
+ List<String> newPaths = null;
+ try {
+ newPaths = EclipseResourceUtil.getClassPath(project.getProject());
+ List<String> jre = EclipseResourceUtil.getJREClassPath(project.getProject());
+ if(jre != null) newPaths.removeAll(jre);
+ } catch (CoreException e) {
+ //TODO
+ WebModelPlugin.getDefault().logError(e);
+ } catch(IOException e) {
+ WebModelPlugin.getDefault().logError(e);
+ }
+ if(paths == null && newPaths == null) return false;
+ if((newPaths == null || paths == null) || (paths.size() != newPaths.size())) {
+ paths = newPaths;
+ } else {
+ boolean b = false;
+ for (int i = 0; i < paths.size() && !b; i++) {
+ if(!paths.get(i).equals(newPaths.get(i))) b = true;
+ }
+ if(!b) return false;
+ paths = newPaths;
+ }
+ createMap();
+ XModelObject object = model.getByPath("FileSystems"); //$NON-NLS-1$
+ XModelObject[] fs = object.getChildren("FileSystemJar"); //$NON-NLS-1$
+ Set<XModelObject> fss = new HashSet<XModelObject>();
+ for (int i = 0; i < fs.length; i++) fss.add(fs[i]);
+
+ for (int i = 0; i < paths.size(); i++) {
+ String path = paths.get(i);
+ if(!EclipseResourceUtil.isJar(path)) continue;
+ String fileName = new File(path).getName();
+ if(SYSTEM_JAR_SET.contains(fileName)) continue;
+ String jsname = "lib-" + fileName; //$NON-NLS-1$
+ XModelObject o = model.getByPath("FileSystems").getChildByPath(jsname); //$NON-NLS-1$
+ if(o != null) {
+ fss.remove(o);
+ } else {
+ o = object.getModel().createModelObject("FileSystemJar", null); //$NON-NLS-1$
+ o.setAttributeValue("name", jsname); //$NON-NLS-1$
+ o.setAttributeValue("location", path); //$NON-NLS-1$
+ o.set(FileSystemsLoader.IS_ADDED_TO_CLASSPATH, "true"); //$NON-NLS-1$
+ object.addChild(o);
+// object.setModified(true);
+ }
+ }
+
+ for (XModelObject o: fss) {
+ String path = XModelObjectUtil.expand(o.getAttributeValue("location"), o.getModel(), null); //$NON-NLS-1$
+ if("true".equals(o.get(FileSystemsLoader.IS_ADDED_TO_CLASSPATH))) { //$NON-NLS-1$
+ o.removeFromParent();
+ } else if(!new File(path).exists()) {
+ o.removeFromParent();
+ }
+ }
+
+ return true;
+ }
+
+ private void createMap() {
+ paths2.clear();
+ if(paths != null) {
+ for (String p : paths) {
+ paths2.put(new Path(p), p);
+ }
+ }
+ }
+
+ /**
+ * Loads seam components from items recently added to class path.
+ */
+ public void process() {
+ Iterator<String> it = processedPaths.iterator();
+ while(it.hasNext()) {
+ String p = it.next();
+ if(paths.contains(p)) continue;
+ project.pathRemoved(new Path(p));
+ it.remove();
+ }
+ for (int i = 0; i < paths.size(); i++) {
+ String p = paths.get(i);
+ if(processedPaths.contains(p)) continue;
+ processedPaths.add(p);
+
+ LibraryScanner scanner = new LibraryScanner();
+ scanner.setClassPath(this);
+
+ String fileName = new File(p).getName();
+ if(SYSTEM_JAR_SET.contains(fileName)) continue;
+ String jsname = "lib-" + fileName; //$NON-NLS-1$
+ XModelObject o = model.getByPath("FileSystems").getChildByPath(jsname); //$NON-NLS-1$
+ if(o == null) continue;
+
+ LoadedDeclarations c = null;
+ try {
+ if(scanner.isLikelyComponentSource(o)) {
+ c = scanner.parse(o, new Path(p), project);
+ }
+ } catch (ScannerException e) {
+ WebModelPlugin.getDefault().logError(e);
+ }
+ if(c == null) {
+ c = new LoadedDeclarations();
+ }
+ if(c != null) {
+ componentsLoaded(c, new Path(p));
+ }
+ }
+
+ validateProjectDependencies();
+ }
+
+ public void validateProjectDependencies() {
+ List<KbProject> ps = null;
+
+ try {
+ ps = getSeamProjects(project.getProject());
+ } catch (CoreException e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ }
+ if(ps != null) {
+ Set<KbProject> set = project.getSeamProjects();
+ Set<KbProject> removable = new HashSet<KbProject>();
+ removable.addAll(set);
+ removable.removeAll(ps);
+ ps.removeAll(set);
+ for (KbProject p : ps) {
+ project.addSeamProject(p);
+ }
+ for (KbProject p : removable) {
+ project.removeSeamProject(p);
+ }
+ }
+ }
+
+ public boolean hasToUpdateProjectDependencies() {
+ List<KbProject> ps = null;
+
+ try {
+ ps = getSeamProjects(project.getProject());
+ } catch (CoreException e) {
+ WebModelPlugin.getPluginLog().logError(e);
+ }
+ if(ps != null) {
+ Set<KbProject> set = project.getSeamProjects();
+ Set<KbProject> removable = new HashSet<KbProject>();
+ removable.addAll(set);
+ removable.removeAll(ps);
+ ps.removeAll(set);
+ for (KbProject p : ps) {
+ return true;
+ }
+ for (KbProject p : removable) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ void componentsLoaded(LoadedDeclarations c, IPath path) {
+ if(c == null) return;
+ project.registerComponents(c, path);
+ }
+
+ List<KbProject> getSeamProjects(IProject project) throws CoreException {
+ List<KbProject> list = new ArrayList<KbProject>();
+ IJavaProject javaProject = JavaCore.create(project);
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
+ if(p == null || !p.isAccessible()) continue;
+ IKbProject sp = KbProjectFactory.getSeamProject(p, false);
+ if(sp != null) list.add((KbProject)sp);
+ }
+ }
+ return list;
+ }
+
+ public void pathLoaded(IPath path) {
+ String p = paths2.get(path);
+ if(p != null) {
+ processedPaths.add(p);
+ }
+ }
+
+ public boolean hasPath(IPath path) {
+ return paths2.get(path) != null;
+ }
+
+ public void clean() {
+ paths = null;
+ if(paths2 != null) paths2.clear();
+ processedPaths.clear();
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ClassPathMonitor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/IFileScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/IFileScanner.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/IFileScanner.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.scanner;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.jst.web.kb.IKbProject;
+
+public interface IFileScanner {
+
+ /**
+ * First, the most trivial check by file mask.
+ * If it returns false, other scanners will be invoked.
+ * If it returns true, other scanners will NOT be invoked.
+ * @param resource
+ * @return
+ */
+ public boolean isRelevant(IFile resource);
+
+ /**
+ * Second, more detailed check of file content.
+ * @param f
+ * @return
+ */
+ public boolean isLikelyComponentSource(IFile f);
+
+ /**
+ * Loading components declared in resource.
+ * @param f
+ * @return
+ * @throws ScannerException
+ */
+ public LoadedDeclarations parse(IFile f, IKbProject sp) throws ScannerException;
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/IFileScanner.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.scanner;
+
+import java.io.ByteArrayInputStream;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IParent;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.impl.FileSystemsImpl;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.XModelObjectUtil;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class LibraryScanner implements IFileScanner {
+ ClassPathMonitor classPath = null;
+
+ //Now it is absolute file on disk
+ IPath sourcePath = null;
+
+ public LibraryScanner() {}
+
+ public void setClassPath(ClassPathMonitor classPath) {
+ this.classPath = classPath;
+ }
+
+ public boolean isRelevant(IFile f) {
+ if(EclipseResourceUtil.isJar(f.getName())) return true;
+ return false;
+ }
+
+ public boolean isLikelyComponentSource(IFile f) {
+ XModel model = InnerModelHelper.createXModel(f.getProject());
+ if(model == null) return false;
+ XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
+ if(o == null) return false;
+ if(!o.getModelEntity().getName().equals("FileSystemJar")) { //$NON-NLS-1$
+ ((FileSystemsImpl)o.getModel().getByPath("FileSystems")).updateOverlapped(); //$NON-NLS-1$
+ o = EclipseResourceUtil.getObjectByResource(f);
+ if(o == null || !o.getModelEntity().getName().equals("FileSystemJar")) return false; //$NON-NLS-1$
+ }
+ return isLikelyComponentSource(o);
+ }
+
+ public LoadedDeclarations parse(IFile f, IKbProject sp) throws ScannerException {
+ XModel model = InnerModelHelper.createXModel(f.getProject());
+ if(model == null) return null;
+ XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
+ if(o == null) return null;
+ if(!o.getModelEntity().getName().equals("FileSystemJar")) { //$NON-NLS-1$
+ ((FileSystemsImpl)o.getModel().getByPath("FileSystems")).updateOverlapped(); //$NON-NLS-1$
+ o = EclipseResourceUtil.getObjectByResource(f);
+ if(o == null || !o.getModelEntity().getName().equals("FileSystemJar")) return null; //$NON-NLS-1$
+ }
+ return parse(o, f.getFullPath(), sp);
+ }
+
+ public boolean isLikelyComponentSource(XModelObject o) {
+ if(o == null) return false;
+ if(o.getChildByPath("seam.properties") != null) return true; //$NON-NLS-1$
+ if(o.getChildByPath("META-INF/seam.properties") != null) return true; //$NON-NLS-1$
+ if(o.getChildByPath("META-INF/components.xml") != null) return true; //$NON-NLS-1$
+ return false;
+ }
+
+ public LoadedDeclarations parse(XModelObject o, IPath path, IKbProject sp) throws ScannerException {
+ if(o == null) return null;
+ sourcePath = path;
+ XModelObject seamProperties = o.getChildByPath("META-INF/seam.properties"); //$NON-NLS-1$
+ if(seamProperties == null) seamProperties = o.getChildByPath("seam.properties"); //$NON-NLS-1$
+ XModelObject componentsXML = o.getChildByPath("META-INF/components.xml"); //$NON-NLS-1$
+ if(componentsXML == null && seamProperties == null) return null;
+
+ LoadedDeclarations ds = new LoadedDeclarations();
+
+ if(componentsXML != null) {
+ LoadedDeclarations ds1 = new XMLScanner().parse(componentsXML, path, sp);
+ if(ds1 != null) ds.add(ds1);
+ }
+
+ return ds;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LibraryScanner.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LoadedDeclarations.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LoadedDeclarations.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LoadedDeclarations.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.scanner;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ * This object keeps all declarations loaded from one source.
+ *
+ * @author Viacheslav Kabanovich
+ */
+public class LoadedDeclarations {
+ List<ITagLibrary> libraries = new ArrayList<ITagLibrary>();
+
+ public List<ITagLibrary> getLibraries() {
+ return libraries;
+ }
+
+ public void add(LoadedDeclarations ds) {
+ if(ds == null) return;
+ libraries.addAll(ds.libraries);
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/LoadedDeclarations.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ScannerException.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ScannerException.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ScannerException.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jst.web.kb.internal.scanner;
+
+public class ScannerException extends Exception {
+ private static final long serialVersionUID = 1L;
+
+ public ScannerException() {
+ }
+
+ public ScannerException(Throwable cause) {
+ super(cause);
+ }
+
+ public ScannerException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/ScannerException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.scanner;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.impl.FolderImpl;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.NamespaceMapping;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.model.helpers.InnerModelHelper;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class XMLScanner implements IFileScanner {
+
+ public XMLScanner() {}
+
+ /**
+ * Returns true if file is probable component source -
+ * has components.xml name or *.component.xml mask.
+ * @param resource
+ * @return
+ */
+ public boolean isRelevant(IFile resource) {
+ if(resource.getName().equals("components.xml")) return true; //$NON-NLS-1$
+ if(resource.getName().endsWith(".component.xml")) return true; //$NON-NLS-1$
+ return false;
+ }
+
+ /**
+ * This method should be called only if isRelevant returns true;
+ * Makes simple check if this java file contains annotation Name.
+ * @param resource
+ * @return
+ */
+ public boolean isLikelyComponentSource(IFile f) {
+ if(!f.isSynchronized(IFile.DEPTH_ZERO) || !f.exists()) return false;
+ XModel model = InnerModelHelper.createXModel(f.getProject());
+ if(model == null) return false;
+ XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
+ if(o == null) return false;
+ if(o.getModelEntity().getName().startsWith("FileSeamComponent")) return true; //$NON-NLS-1$
+ return false;
+ }
+
+ /**
+ * Returns list of components
+ * @param f
+ * @return
+ * @throws ScannerException
+ */
+ public LoadedDeclarations parse(IFile f, IKbProject sp) throws ScannerException {
+ XModel model = InnerModelHelper.createXModel(f.getProject());
+ if(model == null) return null;
+ XModelObject o = EclipseResourceUtil.getObjectByResource(model, f);
+ return parse(o, f.getFullPath(), sp);
+ }
+
+ static Set<String> INTERNAL_ATTRIBUTES = new HashSet<String>();
+
+ static {
+ INTERNAL_ATTRIBUTES.add("NAME"); //$NON-NLS-1$
+ INTERNAL_ATTRIBUTES.add("EXTENSION"); //$NON-NLS-1$
+ INTERNAL_ATTRIBUTES.add("#comment"); //$NON-NLS-1$
+ }
+
+ public LoadedDeclarations parse(XModelObject o, IPath source, IKbProject sp) {
+ if(o == null) return null;
+
+ if(o.getParent() instanceof FolderImpl) {
+ IFile f = ResourcesPlugin.getWorkspace().getRoot().getFile(source);
+ if(f != null && f.exists()) {
+ try {
+ ((FolderImpl)o.getParent()).updateChildFile(o, f.getLocation().toFile());
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
+ }
+ if(o.getParent() == null) {
+ boolean b = isLikelyComponentSource(f);
+ if(!b) return null;
+ o = EclipseResourceUtil.getObjectByResource(o.getModel(), f);
+ if(o == null) return null;
+ }
+ }
+ }
+
+ LoadedDeclarations ds = new LoadedDeclarations();
+ XModelObject[] os = o.getChildren();
+ for (int i = 0; i < os.length; i++) {
+ XModelEntity componentEntity = os[i].getModelEntity();
+ //TODO
+// if(os[i].getModelEntity().getName().startsWith("SeamFactory")) { //$NON-NLS-1$
+// SeamXmlFactory factory = new SeamXmlFactory();
+// factory.setId(os[i]);
+// factory.setSourcePath(source);
+// factory.setName(new XMLValueInfo(os[i], ISeamXmlComponentDeclaration.NAME));
+// factory.setValue(new XMLValueInfo(os[i], "value")); //$NON-NLS-1$
+// factory.setMethod(new XMLValueInfo(os[i], "method")); //$NON-NLS-1$
+// ds.getLibraries().add(factory);
+// }
+ }
+ return ds;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/scanner/XMLScanner.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-05-15 14:19:46 UTC (rev 15290)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
@@ -100,6 +101,14 @@
this.components = components;
}
+ public IPath getSourcePath() {
+ //TODO
+ if(resource != null) {
+ return resource.getFullPath();
+ }
+ return null;
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getResource()
*/
@@ -176,4 +185,11 @@
}
return proposals.toArray(new TextProposal[proposals.size()]);
}
+
+ public AbstractTagLib clone() throws CloneNotSupportedException {
+ AbstractTagLib t = (AbstractTagLib)super.clone();
+ t.components = new HashMap<String, IComponent>();
+ t.components.putAll(components);
+ return t;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java 2009-05-15 14:19:46 UTC (rev 15290)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java 2009-05-15 14:23:50 UTC (rev 15291)
@@ -11,6 +11,7 @@
package org.jboss.tools.jst.web.kb.taglib;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.IProposalProcessor;
@@ -21,6 +22,8 @@
*/
public interface ITagLibrary extends IProposalProcessor {
+ public IPath getSourcePath();
+
/**
* @return URI of the tag lib.
*/
@@ -54,4 +57,7 @@
* @return components
*/
public IComponent[] getComponents(KbQuery query, IPageContext context);
-}
\ No newline at end of file
+
+ public ITagLibrary clone() throws CloneNotSupportedException;
+
+}
17 years, 2 months
JBoss Tools SVN: r15290 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-05-15 10:19:46 -0400 (Fri, 15 May 2009)
New Revision: 15290
Modified:
trunk/as/docs/reference/en/modules/perspective.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-671 - adding info on server polling to the 'Server editor' section;
Modified: trunk/as/docs/reference/en/modules/perspective.xml
===================================================================
--- trunk/as/docs/reference/en/modules/perspective.xml 2009-05-15 14:18:56 UTC (rev 15289)
+++ trunk/as/docs/reference/en/modules/perspective.xml 2009-05-15 14:19:46 UTC (rev 15290)
@@ -45,9 +45,9 @@
<section id="jbossserver_view_toolbar">
<title>JBoss Server View Toolbar</title>
<para>In the right top corner of the <property>JBoss Server View</property> there is a
- special toolbar which provides a quick access to starting a server (in the debug mode,
- run mode, or profile mode), restarting a server, stopping a server and a possibility to publish to a
- server.</para>
+ special toolbar which provides a quick access to starting a server (in the debug
+ mode, run mode, or profile mode), restarting a server, stopping a server and a
+ possibility to publish to a server.</para>
<figure>
<title>The JBoss Server View Toolbar</title>
@@ -74,7 +74,7 @@
</emphasis> button will republish any modules where it has determined the workspace
is out of sync with the server. It will attempt to do an incremental publish if it
turns out that the module in question is capable of doing one.</para>
-
+
</section>
<section id="jbossserver_view_structure">
@@ -728,13 +728,16 @@
</mediaobject>
</figure>
- <para>The settings related to <emphasis>
- <property>Publishing</property>
- </emphasis>, <emphasis>
- <property>Timeouts</property>
- </emphasis> or <emphasis>
- <property>Server Polling</property>
- </emphasis> can be also adjusted in the <property>Server editor</property>.</para>
+ <para>In the <property>Server editor</property> you are able to edit the timeouts and the server pollers to use.</para>
+
+ <note>
+ <title>Note:</title>
+ <para>By default, the Startup poller is set to JMX Poller (see the <emphasis>
+ <property>Server Polling</property></emphasis> section). If you change the Startup poller
+ to Timeout Poller (it may need in case, for example, you're using the minimal configuration for your server), this will do no polling at all and will only set the server
+ state to <emphasis>
+ <property>"Started"</property></emphasis> after your startup timeout is reached.</para>
+ </note>
<para id="com_line_arg"><property>Server editor</property> makes it also possible to
modify the server's launch configuration. It's just after clicking <emphasis>
@@ -774,10 +777,10 @@
on unaltered.</para>
</note>
- <para>Until 3.0.0.GA release of <property>JBoss Tools</property>, the servers classpath was readonly, but that caused
- problems for users wanting to add their own jars in the startup classpath. That is
- relevant if you need to patch the server, add a custom charset or other tweaks that
- require early access to the classpath.</para>
+ <para>Until 3.0.0.GA release of <property>JBoss Tools</property>, the servers classpath
+ was readonly, but that caused problems for users wanting to add their own jars in
+ the startup classpath. That is relevant if you need to patch the server, add a
+ custom charset or other tweaks that require early access to the classpath.</para>
<para>Now all servers have a custom 'server runtime classpath
container', which is there by default and point to the default jars in
@@ -794,11 +797,10 @@
</figure>
<para>If for some reason you have a launch configuration without this container, <emphasis>
- <property>Restore
- Default Entries</property></emphasis> should add it properly. Also, <emphasis>
- <property>Restore
- Default Entries</property></emphasis> will also remove any
- extra entries you added yourself.</para>
+ <property>Restore Default Entries</property>
+ </emphasis> should add it properly. Also, <emphasis>
+ <property>Restore Default Entries</property>
+ </emphasis> will also remove any extra entries you added yourself.</para>
</section>
<section>
17 years, 2 months
JBoss Tools SVN: r15289 - in trunk: jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2009-05-15 10:18:56 -0400 (Fri, 15 May 2009)
New Revision: 15289
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.doc.user/
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test/
Log:
svn bin ignore
Property changes on: trunk/as/plugins/org.jboss.ide.eclipse.as.doc.user
___________________________________________________________________
Name: svn:ignore
+ bin
Property changes on: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.multipage
___________________________________________________________________
Name: svn:ignore
- bin
+ bin
bin
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jstl.test
___________________________________________________________________
Name: svn:ignore
- bin
+ bin
bin
17 years, 2 months
JBoss Tools SVN: r15288 - trunk/jsf/features/org.jboss.tools.richfaces.feature.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 09:28:33 -0400 (Fri, 15 May 2009)
New Revision: 15288
Modified:
trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
===================================================================
--- trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2009-05-15 13:26:43 UTC (rev 15287)
+++ trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2009-05-15 13:28:33 UTC (rev 15288)
@@ -354,6 +354,12 @@
version="0.0.0"/>
<plugin
+ id="org.jboss.tools.jst.web.kb"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
id="org.jboss.tools.jst.web.tiles"
download-size="0"
install-size="0"
17 years, 2 months
JBoss Tools SVN: r15287 - in trunk/jst: tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 09:26:43 -0400 (Fri, 15 May 2009)
New Revision: 15287
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-05-15 13:24:53 UTC (rev 15286)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-05-15 13:26:43 UTC (rev 15287)
@@ -6,9 +6,9 @@
Bundle-Activator: org.jboss.tools.jst.web.kb.WebKbPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.jboss.tools.jst.web;bundle-version="2.0.0",
- org.jboss.tools.common.el.core;bundle-version="2.0.0",
- org.eclipse.jface.text;bundle-version="3.5.0"
+ org.jboss.tools.jst.web,
+ org.jboss.tools.common.el.core,
+ org.eclipse.jface.text
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
Modified: trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java 2009-05-15 13:24:53 UTC (rev 15286)
+++ trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java 2009-05-15 13:26:43 UTC (rev 15287)
@@ -20,15 +20,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.jobs.IJobManager;
-import org.eclipse.core.runtime.jobs.Job;
-import org.jboss.tools.common.model.XJob;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.project.Watcher;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.test.util.TestProjectProvider;
17 years, 2 months
JBoss Tools SVN: r15286 - trunk/jst/plugins/org.jboss.tools.jst.web.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 09:24:53 -0400 (Fri, 15 May 2009)
New Revision: 15286
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-15 13:24:01 UTC (rev 15285)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-15 13:24:53 UTC (rev 15286)
@@ -272,29 +272,4 @@
</extension>
- <extension
- id="kbbuilder"
- name="KB Builder"
- point="org.eclipse.core.resources.builders">
- <builder
- hasNature="false">
- <run
- class="org.jboss.tools.jst.web.kb.internal.KbBuilder">
- </run>
- </builder>
- </extension>
- <extension
- id="kbnature"
- name="KB Project Nature"
- point="org.eclipse.core.resources.natures">
- <runtime>
- <run
- class="org.jboss.tools.jst.web.kb.internal.KbProject">
- </run>
- </runtime>
- <builder
- id="org.jboss.tools.jst.web.kbbuilder">
- </builder>
- </extension>
-
</plugin>
17 years, 2 months
JBoss Tools SVN: r15285 - trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 09:24:01 -0400 (Fri, 15 May 2009)
New Revision: 15285
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF 2009-05-15 13:23:02 UTC (rev 15284)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF 2009-05-15 13:24:01 UTC (rev 15285)
@@ -6,7 +6,7 @@
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.jboss.tools.jst.web.kb,
- org.junit;bundle-version="3.8.2"
+ org.junit
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor.0
17 years, 2 months
JBoss Tools SVN: r15284 - in trunk/jst/tests/org.jboss.tools.jst.web.kb.test: .settings and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 09:23:02 -0400 (Fri, 15 May 2009)
New Revision: 15284
Added:
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jst.web.kb.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,8 @@
+#Fri May 15 16:50:56 MSD 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.tools.jst.web.kb.test
+Bundle-Version: 1.0.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.jst.web.kb,
+ org.junit;bundle-version="3.8.2"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %Bundle-Vendor.0
+Export-Package: org.jboss.tools.jst.web.kb.test
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.jst.web.test
+Bundle-Vendor.0 = JBoss, a division of Red Hat
+Bundle-Name.0 = Tests Plug-in
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class JstWebKbAllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(JstWebKbAllTests.class.getName());
+ suite.addTest(WebKbTest.suite());
+ return suite;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java 2009-05-15 13:23:02 UTC (rev 15284)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.test;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class WebKbTest extends TestCase {
+
+ public void testKb() {
+ //TODO
+ }
+
+ public static Test suite() {
+ return new TestSuite(WebKbTest.class);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/WebKbTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15282 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb: src/org/jboss/tools/jst/web/kb and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:55:45 -0400 (Fri, 15 May 2009)
New Revision: 15282
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-05-15 12:54:50 UTC (rev 15281)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-05-15 12:55:45 UTC (rev 15282)
@@ -3,7 +3,7 @@
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.jboss.tools.jst.web.kb;singleton:=true
Bundle-Version: 1.0.0
-Bundle-Activator: org.jboss.tools.jst.web.kb.Activator
+Bundle-Activator: org.jboss.tools.jst.web.kb.WebKbPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.jboss.tools.jst.web;bundle-version="2.0.0",
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java 2009-05-15 12:54:50 UTC (rev 15281)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java 2009-05-15 12:55:45 UTC (rev 15282)
@@ -1,50 +0,0 @@
-package org.jboss.tools.jst.web.kb;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.jst.web.kb";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
-}
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java (from rev 15273, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java 2009-05-15 12:55:45 UTC (rev 15282)
@@ -0,0 +1,49 @@
+package org.jboss.tools.jst.web.kb;
+
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class WebKbPlugin extends BaseUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jst.web.kb";
+
+ // The shared instance
+ private static WebKbPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public WebKbPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static WebKbPlugin getDefault() {
+ return plugin;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/WebKbPlugin.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15281 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-15 08:54:50 -0400 (Fri, 15 May 2009)
New Revision: 15281
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java 2009-05-15 12:54:50 UTC (rev 15281)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jst.web.model.helpers;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelConstants;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.project.ProjectHome;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.XModelObjectUtil;
+
+public class InnerModelHelper {
+
+ public static XModel createXModel(IProject project) {
+ IModelNature n = EclipseResourceUtil.getModelNature(project.getProject());
+ if(n != null) return n.getModel();
+
+ XModel model = EclipseResourceUtil.createObjectForResource(project.getProject()).getModel();
+ XModelObject webinf = model.getByPath("FileSystems/WEB-INF"); //$NON-NLS-1$
+ if(webinf != null) return model;
+
+ IPath webInfPath = getWebInfPath(project);
+
+ if(webInfPath == null) return model;
+
+ IFolder webInfFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(webInfPath);
+
+ model.getProperties().setProperty(XModelConstants.WORKSPACE, webInfFolder.getLocation().toString());
+ model.getProperties().setProperty(XModelConstants.WORKSPACE_OLD, webInfFolder.getLocation().toString());
+
+ XModelObject fs = model.getByPath("FileSystems"); //$NON-NLS-1$
+ webinf = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
+ webinf.setAttributeValue("name", "WEB-INF"); //$NON-NLS-1$ //$NON-NLS-2$
+ webinf.setAttributeValue("location", XModelConstants.WORKSPACE_REF); //$NON-NLS-1$
+ fs.addChild(webinf);
+
+ String webInfLocation = XModelObjectUtil.expand(XModelConstants.WORKSPACE_REF, model, null);
+ String webRootLocation = getWebRootPath(project, webInfLocation);
+
+ XModelObject webroot = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
+ webroot.setAttributeValue("name", "WEB-ROOT"); //$NON-NLS-1$ //$NON-NLS-2$
+ webroot.setAttributeValue("location", webRootLocation); //$NON-NLS-1$ //$NON-NLS-2$
+ fs.addChild(webroot);
+
+ XModelObject lib = model.createModelObject("FileSystemFolder", null); //$NON-NLS-1$
+ lib.setAttributeValue("name", "lib"); //$NON-NLS-1$ //$NON-NLS-2$
+ lib.setAttributeValue("location", XModelConstants.WORKSPACE_REF + "/lib"); //$NON-NLS-1$ //$NON-NLS-2$
+ fs.addChild(lib);
+
+ return model;
+ }
+
+ //Taken from J2EEUtils and modified
+ public static IPath getWebInfPath(IProject project) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if(component == null) return null;
+ IVirtualFolder webInfDir = component.getRootFolder().getFolder(new Path("/WEB-INF"));
+ IPath modulePath = webInfDir.getWorkspaceRelativePath();
+ return (!webInfDir.exists()) ? null : modulePath;
+ }
+
+ static String getWebRootPath(IProject project, String webInfLocation) {
+ String webRootLocation = XModelConstants.WORKSPACE_REF + "/..";
+
+ IPath wrp = ProjectHome.getFirstWebContentPath(project);
+ IPath wip = ProjectHome.getWebInfPath(project);
+
+ if(wrp == null || wip == null) {
+ return webRootLocation;
+ }
+
+ IResource wrpc = ResourcesPlugin.getWorkspace().getRoot().findMember(wrp);
+ IResource wipc = ResourcesPlugin.getWorkspace().getRoot().findMember(wip);
+ if(wrpc != null && wipc != null && wipc.isLinked()) {
+ IPath p = wrpc.getLocation();
+ if(p != null) {
+ try {
+ webRootLocation = p.toFile().getCanonicalPath().replace('\\', '/');
+ } catch (IOException e) {
+ }
+ String relative = org.jboss.tools.common.util.FileUtil.getRelativePath(webInfLocation, webRootLocation);
+ if(relative != null) {
+ webRootLocation = XModelConstants.WORKSPACE_REF + relative;
+ }
+ }
+ }
+ return webRootLocation;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/InnerModelHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15279 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:48:23 -0400 (Fri, 15 May 2009)
New Revision: 15279
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java 2009-05-15 12:46:55 UTC (rev 15278)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java 2009-05-15 12:48:23 UTC (rev 15279)
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb;
-
-import org.eclipse.core.resources.IProjectNature;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- *
- * @author V.Kabanovich
- *
- */
-public interface IKbProject extends IProjectNature {
- public static String NATURE_ID = "org.jboss.tools.jst.web.kbnature"; //$NON-NLS-1$
-
- public ITagLibrary[] getTagLibraries();
-
-}
17 years, 2 months
JBoss Tools SVN: r15277 - in trunk/jst/plugins/org.jboss.tools.jst.web: src/org/jboss/tools/jst/web/kb and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:45:03 -0400 (Fri, 15 May 2009)
New Revision: 15277
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IResourceBundle.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-05-15 12:45:03 UTC (rev 15277)
@@ -42,8 +42,6 @@
org.jboss.tools.jst.web.browser,
org.jboss.tools.jst.web.browser.wtp,
org.jboss.tools.jst.web.context,
- org.jboss.tools.jst.web.kb,
- org.jboss.tools.jst.web.kb.taglib,
org.jboss.tools.jst.web.launching.sourcelookup,
org.jboss.tools.jst.web.launching.sourcelookup.xpl,
org.jboss.tools.jst.web.messages.xpl,
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb;
-
-import java.util.Map;
-
-/**
- * @author Alexey Kazakov
- */
-public interface IFaceletPageContext extends IPageContext {
-
- /**
- * Returns parent page context. For example if some this facelet page is used in a template then
- * this method will return a page context for that template.
- * May return null.
- * @return
- */
- IFaceletPageContext getParentContext();
-
- /**
- * Returns parameters which are declared in the parent context and are available within this page.
- * Key - name of Parameter.
- * Value - value of Parameter.
- * @return
- */
- Map<String, String> getParams();
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IPageContext.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IPageContext.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb;
-
-import org.eclipse.jface.text.IDocument;
-import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.Var;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- * Page context
- * @author Alexey Kazakov
- */
-public interface IPageContext extends ELContext {
-
- /**
- * Returns libraries which should be used in this context
- * @return
- */
- ITagLibrary[] getLibraries();
-
- /**
- * Returns EL Resolvers which are declared for this page
- * @return
- */
- ELResolver[] getElResolvers();
-
- /**
- * Returns resource bundles
- * @return
- */
- IResourceBundle[] getResourceBundles();
-
- /**
- * Returns IDocument for source file
- * @return
- */
- IDocument getDocument();
-
- /**
- * Returns "var" attributes which are available in particular offset.
- * @param offset
- * @return
- */
- Var[] getVars(int offset);
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb;
-
-import org.jboss.tools.common.text.TextProposal;
-
-/**
- * @author Alexey Kazakov
- */
-public interface IProposalProcessor {
-
- /**
- * @return proposals
- */
- TextProposal[] getProposals(KbQuery query, IPageContext context);
-
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IResourceBundle.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IResourceBundle.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IResourceBundle.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb;
-
-/**
- * @author Alexey Kazakov
- */
-public interface IResourceBundle {
-
- /**
- * @return var attribute value
- */
- String getVar();
-
- /**
- * @return basename attribute value
- */
- String getBasename();
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/KbQuery.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb;
-
-/**
- * Query object is used to get info from Page Processors.
- * @author Alexey Kazakov
- */
-public class KbQuery {
-
- public static final String PREFIX_SEPARATOR = ":";
-
- private int offset;
- private String uri;
- private String[] parentTags;
- private String value;
- private String stringQuery;
- private boolean useAsMask;
- private String prefix;
- private Type type;
- private String parent;
-
- /**
- * Type of object for which we want to get info
- * @author Alexey Kazakov
- */
- public static enum Type {
- TEXT,
- TAG_NAME,
- ATTRIBUTE_NAME,
- ATTRIBUTE_VALUE
- }
-
- public KbQuery() {
- }
-
- /**
- * URI of tag library
- * @return
- */
- public String getUri() {
- return uri;
- }
-
- public void setUri(String uri) {
- this.uri = uri;
- }
-
- /**
- * The stack of parent tags
- * @return
- */
- public String[] getParentTags() {
- return parentTags;
- }
-
- /**
- * @param parentTags the stack of parent tags
- */
- public void setParentTags(String[] parentTags) {
- this.parentTags = parentTags;
- }
-
- /**
- * return the last parent tag
- */
- public String getLastParentTag() {
- if(parentTags.length>0) {
- return parentTags[parentTags.length-1];
- }
- return null;
- }
-
- /**
- * @return the name of parent tag (type==TAG_NAME) or attribute (type==ATTRIBUTE_NAME or type==ATTRIBUTE_VALE) to set
- */
- public String getParent() {
- if(type == Type.TAG_NAME) {
- return getLastParentTag();
- }
- return parent;
- }
-
- /**
- * @param name the name of parent tag or attribute to set
- */
- public void setParent(String name) {
- this.parent = name;
- }
-
- /**
- * Value of query. For example in case of ATTRIBUTE_NAME type it is an attribute name.
- * @return
- */
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- /**
- * True if the value is a mask. For example we ask all tags which start with "<h:outputT" then the value "outputT" is a mask.
- * @return
- */
- public boolean isMask() {
- return useAsMask;
- }
-
- public void setMask(boolean useAsMask) {
- this.useAsMask = useAsMask;
- }
-
- /**
- * Returns type of value
- * @return
- */
- public Type getType() {
- return type;
- }
-
- public void setType(Type type) {
- this.type = type;
- }
-
- /**
- * @return offset
- */
- public int getOffset() {
- return offset;
- }
-
- public void setOffset(int offset) {
- this.offset = offset;
- }
-
- /**
- * @return the string representation of this query.
- * In case of tag name this method will return "<h:outputText"
- * but getValue() will return "outputText".
- */
- public String getStringQuery() {
- return stringQuery;
- }
-
- /**
- * @param stringQuery the stringQuery to set
- */
- public void setStringQuery(String stringQuery) {
- this.stringQuery = stringQuery;
- }
-
- /**
- * @return the tag prefix.
- */
- public String getPrefix() {
- return prefix;
- }
-
- /**
- * @param prefix the prefix to set
- */
- public void setPrefix(String prefix) {
- this.prefix = prefix;
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb;
-
-import org.eclipse.core.resources.IFile;
-
-/**
- * @author Alexey Kazakov
- */
-public class PageContextFactory {
-
- /**
- * Creates a page context for given resource and offset.
- * @param file
- * @param offset
- * @return
- */
- public static IPageContext createPageContext(IFile file, int offset) {
- // TODO
- return null;
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb;
-
-import java.util.ArrayList;
-
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.taglib.IAttribute;
-import org.jboss.tools.jst.web.kb.taglib.IComponent;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- * @author Alexey Kazakov
- */
-public class PageProcessor implements IProposalProcessor {
-
- /*
- * (non-Javadoc)
- * @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) {
- ArrayList<TextProposal> proposals = new ArrayList<TextProposal>();
- ITagLibrary[] libs = context.getLibraries();
- for (int i = 0; i < libs.length; i++) {
- TextProposal[] libProposals = libs[i].getProposals(query, context);
- for (int j = 0; j < libProposals.length; j++) {
- proposals.add(libProposals[i]);
- }
- }
- if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE || query.getType() == KbQuery.Type.TEXT) {
- String value = query.getValue();
- //TODO convert value to EL string.
- String elString = value;
- ELResolver[] resolvers = context.getElResolvers();
- for (int i = 0; i < resolvers.length; i++) {
- proposals.addAll(resolvers[i].getCompletions(elString, !query.isMask(), query.getOffset(), context));
- }
- }
-
- return proposals.toArray(new TextProposal[proposals.size()]);
- }
-
- /**
- * Returns components
- * @param query
- * @param context
- * @return components
- */
- public IComponent[] getComponents(KbQuery query, IPageContext context) {
- ArrayList<IComponent> components = new ArrayList<IComponent>();
- ITagLibrary[] libs = context.getLibraries();
- for (int i = 0; i < libs.length; i++) {
- IComponent[] libComponents = libs[i].getComponents(query, context);
- for (int j = 0; j < libComponents.length; j++) {
- components.add(libComponents[i]);
- }
- }
- return components.toArray(new IComponent[components.size()]);
- }
-
- /**
- * Returns attributes
- * @param query
- * @param context
- * @return attributes
- */
- public IAttribute[] getAttributes(KbQuery query, IPageContext context) {
- ArrayList<IAttribute> attributes = new ArrayList<IAttribute>();
- if(query.getType() == KbQuery.Type.ATTRIBUTE_NAME || query.getType() == KbQuery.Type.ATTRIBUTE_VALUE) {
- IComponent[] components = getComponents(query, context);
- for (int i = 0; i < components.length; i++) {
- IAttribute[] libAttributess = components[i].getAttributes(query, context);
- for (int j = 0; j < libAttributess.length; j++) {
- attributes.add(libAttributess[i]);
- }
- }
- }
- return attributes.toArray(new IAttribute[attributes.size()]);
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal;
-
-import java.util.Map;
-
-import org.jboss.tools.jst.web.kb.IFaceletPageContext;
-
-/**
- * Facelet page context
- * @author Alexey Kazakov
- */
-public class FaceletContextImpl extends JspContextImpl implements IFaceletPageContext {
-
- private IFaceletPageContext parentContext;
- private Map<String, String> params;
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParentContext()
- */
- public IFaceletPageContext getParentContext() {
- return parentContext;
- }
-
- public void setParentContext(IFaceletPageContext parentContext) {
- this.parentContext = parentContext;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParams()
- */
- public Map<String, String> getParams() {
- return params;
- }
-
- public void setParams(Map<String, String> params) {
- this.params = params;
- }
-}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-05-15 12:44:23 UTC (rev 15276)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-05-15 12:45:03 UTC (rev 15277)
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.kb.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.Region;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
-import org.jboss.tools.common.el.core.resolver.Var;
-import org.jboss.tools.jst.web.kb.IPageContext;
-import org.jboss.tools.jst.web.kb.IResourceBundle;
-import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
-
-/**
- * JSP page context
- * @author Alexey Kazakov
- */
-public class JspContextImpl implements IPageContext {
-
- private IFile resource;
- private IDocument document;
- private ElVarSearcher varSearcher;
- private ITagLibrary[] libs;
- private ELResolver[] elResolvers;
- private Map<Region, Var[]> vars = new HashMap<Region, Var[]>();
- private Set<Var> allVars = new HashSet<Var>();
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getResource()
- */
- public IFile getResource() {
- return resource;
- }
-
- public void setResource(IFile resource) {
- this.resource = resource;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getLibraries()
- */
- public ITagLibrary[] getLibraries() {
- return libs;
- }
-
- public void setLibraries(ITagLibrary[] libs) {
- this.libs = libs;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getElResolvers()
- */
- public ELResolver[] getElResolvers() {
- return elResolvers;
- }
-
- public void setElResolvers(ELResolver[] elResolvers) {
- this.elResolvers = elResolvers;
- }
-
- private final static Var[] EMPTY_VAR_ARRAY = new Var[0];
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getVars(int)
- */
- public Var[] getVars(int offset) {
- for (Region region : vars.keySet()) {
- if(offset>=region.getOffset() && offset<=region.getOffset() + region.getLength()) {
- return vars.get(region);
- }
- }
- return EMPTY_VAR_ARRAY;
- }
-
- /**
- * Adds new Var to the context
- * @param region
- * @param vars
- */
- public void addVars(Region region, Var[] vars) {
- this.vars.put(region, vars);
- for (int i = 0; i < vars.length; i++) {
- allVars.add(vars[i]);
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.kb.text.PageContext#getResourceBundles()
- */
- public IResourceBundle[] getResourceBundles() {
- // TODO
- return null;
- }
-
- /**
- * @return the libs
- */
- public ITagLibrary[] getLibs() {
- return libs;
- }
-
- /**
- * @param libs the libs to set
- */
- public void setLibs(ITagLibrary[] libs) {
- this.libs = libs;
- }
-
- /**
- * @param document the document to set
- */
- public void setDocument(IDocument document) {
- this.document = document;
- }
-
- /**
- * @param varSearcher the varSearcher to set
- */
- public void setVarSearcher(ElVarSearcher varSearcher) {
- this.varSearcher = varSearcher;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.PageContext#getDocument()
- */
- public IDocument getDocument() {
- return document;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.core.resolver.ELContext#getVarSearcher()
- */
- public ElVarSearcher getVarSearcher() {
- return varSearcher;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.core.resolver.ELContext#getVars()
- */
- public Var[] getVars() {
- return allVars.toArray(new Var[allVars.size()]);
- }
-}
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r15276 - trunk/seam/plugins/org.jboss.tools.seam.core/META-INF.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:44:23 -0400 (Fri, 15 May 2009)
New Revision: 15276
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2009-05-15 12:43:44 UTC (rev 15275)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2009-05-15 12:44:23 UTC (rev 15276)
@@ -51,7 +51,8 @@
org.eclipse.jst.j2ee.core,
org.eclipse.jst.jsf.facesconfig,
org.eclipse.jst.common.frameworks,
- org.jboss.tools.common.kb
+ org.jboss.tools.common.kb,
+ org.jboss.tools.jst.web.kb;bundle-version="1.0.0"
Bundle-Version: 2.0.0
Export-Package:
org.jboss.tools.seam.core,
17 years, 2 months
JBoss Tools SVN: r15275 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb: internal and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:43:44 -0400 (Fri, 15 May 2009)
New Revision: 15275
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.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/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Share project "org.jboss.tools.jst.web.kb" into "https://svn.jboss.org/repos/jbosstools"
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java 2009-05-15 12:43:44 UTC (rev 15275)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.Map;
+
+import org.jboss.tools.jst.web.kb.IFaceletPageContext;
+
+/**
+ * Facelet page context
+ * @author Alexey Kazakov
+ */
+public class FaceletContextImpl extends JspContextImpl implements IFaceletPageContext {
+
+ private IFaceletPageContext parentContext;
+ private Map<String, String> params;
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParentContext()
+ */
+ public IFaceletPageContext getParentContext() {
+ return parentContext;
+ }
+
+ public void setParentContext(IFaceletPageContext parentContext) {
+ this.parentContext = parentContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParams()
+ */
+ public Map<String, String> getParams() {
+ return params;
+ }
+
+ public void setParams(Map<String, String> params) {
+ this.params = params;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-05-15 12:43:44 UTC (rev 15275)
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Region;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.IResourceBundle;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ * JSP page context
+ * @author Alexey Kazakov
+ */
+public class JspContextImpl implements IPageContext {
+
+ private IFile resource;
+ private IDocument document;
+ private ElVarSearcher varSearcher;
+ private ITagLibrary[] libs;
+ private ELResolver[] elResolvers;
+ private Map<Region, Var[]> vars = new HashMap<Region, Var[]>();
+ private Set<Var> allVars = new HashSet<Var>();
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getResource()
+ */
+ public IFile getResource() {
+ return resource;
+ }
+
+ public void setResource(IFile resource) {
+ this.resource = resource;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getLibraries()
+ */
+ public ITagLibrary[] getLibraries() {
+ return libs;
+ }
+
+ public void setLibraries(ITagLibrary[] libs) {
+ this.libs = libs;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getElResolvers()
+ */
+ public ELResolver[] getElResolvers() {
+ return elResolvers;
+ }
+
+ public void setElResolvers(ELResolver[] elResolvers) {
+ this.elResolvers = elResolvers;
+ }
+
+ private final static Var[] EMPTY_VAR_ARRAY = new Var[0];
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getVars(int)
+ */
+ public Var[] getVars(int offset) {
+ for (Region region : vars.keySet()) {
+ if(offset>=region.getOffset() && offset<=region.getOffset() + region.getLength()) {
+ return vars.get(region);
+ }
+ }
+ return EMPTY_VAR_ARRAY;
+ }
+
+ /**
+ * Adds new Var to the context
+ * @param region
+ * @param vars
+ */
+ public void addVars(Region region, Var[] vars) {
+ this.vars.put(region, vars);
+ for (int i = 0; i < vars.length; i++) {
+ allVars.add(vars[i]);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getResourceBundles()
+ */
+ public IResourceBundle[] getResourceBundles() {
+ // TODO
+ return null;
+ }
+
+ /**
+ * @return the libs
+ */
+ public ITagLibrary[] getLibs() {
+ return libs;
+ }
+
+ /**
+ * @param libs the libs to set
+ */
+ public void setLibs(ITagLibrary[] libs) {
+ this.libs = libs;
+ }
+
+ /**
+ * @param document the document to set
+ */
+ public void setDocument(IDocument document) {
+ this.document = document;
+ }
+
+ /**
+ * @param varSearcher the varSearcher to set
+ */
+ public void setVarSearcher(ElVarSearcher varSearcher) {
+ this.varSearcher = varSearcher;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.PageContext#getDocument()
+ */
+ public IDocument getDocument() {
+ return document;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.ELContext#getVarSearcher()
+ */
+ public ElVarSearcher getVarSearcher() {
+ return varSearcher;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.ELContext#getVars()
+ */
+ public Var[] getVars() {
+ return allVars.toArray(new Var[allVars.size()]);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java 2009-05-15 12:43:44 UTC (rev 15275)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.taglib;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.taglib.IAttribute;
+
+/**
+ * Abstract implementation of IAttribute
+ * @author Alexey Kazakov
+ */
+public abstract class AbstractAttribute implements IAttribute {
+
+ protected String description;
+ protected String name;
+ protected boolean preferable;
+ protected boolean required;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IAttribute#getDescription()
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IAttribute#getName()
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IAttribute#isPreferable()
+ */
+ public boolean isPreferable() {
+ return preferable;
+ }
+
+ /**
+ * @param preferable the preferable to set
+ */
+ public void setPreferable(boolean preferable) {
+ this.preferable = preferable;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IAttribute#isRequired()
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /**
+ * @param required the required to set
+ */
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ public TextProposal[] getProposals(KbQuery query, IPageContext context) {
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ ELResolver[] resolvers = context.getElResolvers();
+ for (int i = 0; i < resolvers.length; i++) {
+ proposals.addAll(resolvers[i].getCompletions(query.getValue(), false, query.getValue().length(), context));
+ }
+ return proposals.toArray(new TextProposal[proposals.size()]);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-05-15 12:43:44 UTC (rev 15275)
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.taglib;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.taglib.IAttribute;
+import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.INameSpace;
+
+/**
+ * Abstract implementation of IComponent
+ * @author Alexey Kazakov
+ */
+public abstract class AbstractComponent implements IComponent {
+
+ protected boolean canHaveBody;
+ protected String componentClass;
+ protected String componentType;
+ protected String description;
+ protected String name;
+ protected INameSpace nameSpace;
+ protected Map<String, IAttribute> attributes = new HashMap<String, IAttribute>();
+ protected Map<String, IAttribute> preferableAttributes = new HashMap<String, IAttribute>();
+ protected Map<String, IAttribute> requiredAttributes = new HashMap<String, IAttribute>();
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#canHaveBody()
+ */
+ public boolean canHaveBody() {
+ return canHaveBody;
+ }
+
+ /**
+ * @param canHaveBody
+ */
+ public void setCanHaveBody(boolean canHaveBody) {
+ this.canHaveBody = canHaveBody;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getAttribute(java.lang.String)
+ */
+ public IAttribute getAttribute(String name) {
+ return attributes.get(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getAttributes()
+ */
+ public IAttribute[] getAttributes() {
+ synchronized (attributes) {
+ return attributes.values().toArray(new IAttribute[attributes.size()]);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getAttributes(java.lang.String)
+ */
+ public IAttribute[] getAttributes(String nameTemplate) {
+ List<IAttribute> list = new ArrayList<IAttribute>();
+ IAttribute[] atts = getAttributes();
+ for (int i = 0; i < atts.length; i++) {
+ if(atts[i].getName().startsWith(nameTemplate)) {
+ list.add(atts[i]);
+ }
+ }
+ return list.toArray(new IAttribute[list.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getAttributes(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ public IAttribute[] getAttributes(KbQuery query, IPageContext context) {
+ String attrName = null;
+ boolean mask = false;
+ if(query.getType()==KbQuery.Type.ATTRIBUTE_NAME) {
+ attrName = query.getValue();
+ mask = query.isMask();
+ } else if(query.getType()==KbQuery.Type.ATTRIBUTE_VALUE) {
+ attrName = query.getParent();
+ }
+ if(attrName == null) {
+ return null;
+ }
+ if(mask) {
+ return getAttributes(attrName);
+ }
+ return new IAttribute[]{getAttribute(attrName)};
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getComponentClass()
+ */
+ public String getComponentClass() {
+ return componentClass;
+ }
+
+ /**
+ * @param componentClass the component class name to set
+ */
+ public void setComponentClass(String componentClass) {
+ this.componentClass = componentClass;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getComponentType()
+ */
+ public String getComponentType() {
+ return componentType;
+ }
+
+ /**
+ * @param componentType the component type to set
+ */
+ public void setComponentType(String componentType) {
+ this.componentType = componentType;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getDescription()
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getName()
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getNameSpace()
+ */
+ public INameSpace getNameSpace() {
+ return nameSpace;
+ }
+
+ /**
+ * @param nameSpace the name space to set
+ */
+ public void setNameSpace(INameSpace nameSpace) {
+ this.nameSpace = nameSpace;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getPreferableAttributes()
+ */
+ public IAttribute[] getPreferableAttributes() {
+ synchronized (preferableAttributes) {
+ return preferableAttributes.values().toArray(new IAttribute[preferableAttributes.size()]);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IComponent#getRequiredAttributes()
+ */
+ public IAttribute[] getRequiredAttributes() {
+ synchronized (requiredAttributes) {
+ return requiredAttributes.values().toArray(new IAttribute[requiredAttributes.size()]);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ public TextProposal[] getProposals(KbQuery query, IPageContext context) {
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ IAttribute[] attributes = getAttributes(query, context);
+ if(query.getType() == KbQuery.Type.ATTRIBUTE_NAME) {
+ for (int i = 0; i < attributes.length; i++) {
+ TextProposal proposal = new TextProposal();
+ proposal.setContextInfo(attributes[i].getDescription());
+ proposal.setReplacementString(attributes[i].getName());
+ proposal.setLabel(attributes[i].getName());
+ proposals.add(proposal);
+ }
+ } else if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE) {
+ for (int i = 0; i < attributes.length; i++) {
+ TextProposal[] attributeProposals = attributes[i].getProposals(query, context);
+ for (int j = 0; j < attributeProposals.length; j++) {
+ proposals.add(attributeProposals[j]);
+ }
+ }
+ }
+ return proposals.toArray(new TextProposal[proposals.size()]);
+ }
+
+ /**
+ * Adds the attribute to the component.
+ * @param attribute
+ */
+ public void addAttribute(IAttribute attribute) {
+ attributes.put(attribute.getName(), attribute);
+ if(attribute.isPreferable()) {
+ preferableAttributes.put(attribute.getName(), attribute);
+ }
+ if(attribute.isRequired()) {
+ requiredAttributes.put(attribute.getName(), attribute);
+ }
+ }
+
+ /**
+ * Removes the attribute from the component
+ * @param attribute
+ */
+ public void removeAttribute(IAttribute attribute) {
+ attributes.remove(attribute.getName());
+ preferableAttributes.remove(attribute.getName());
+ requiredAttributes.remove(attribute.getName());
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-05-15 12:43:44 UTC (rev 15275)
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.taglib;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.taglib.IAttribute;
+import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ * Abstract implementation of ITagLibrary
+ * @author Alexey Kazakov
+ */
+public abstract class AbstractTagLib implements ITagLibrary {
+
+ protected String uri;
+ protected IFile resource;
+ protected Map<String, IComponent> components = new HashMap<String, IComponent>();
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getAllComponents()
+ */
+ public IComponent[] getComponents() {
+ synchronized (components) {
+ return components.values().toArray(new IComponent[components.size()]);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getComponent(java.lang.String)
+ */
+ public IComponent getComponent(String name) {
+ return components.get(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getComponents(java.lang.String)
+ */
+ public IComponent[] getComponents(String nameTemplate) {
+ List<IComponent> list = new ArrayList<IComponent>();
+ IComponent[] comps = getComponents();
+ for (int i = 0; i < comps.length; i++) {
+ if(comps[i].getName().startsWith(nameTemplate)) {
+ list.add(comps[i]);
+ }
+ }
+ return list.toArray(new IComponent[list.size()]);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getComponents(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.PageContext)
+ */
+ public IComponent[] getComponents(KbQuery query, IPageContext context) {
+ String tagName = null;
+ boolean mask = false;
+ if(query.getType()==KbQuery.Type.TAG_NAME) {
+ tagName = query.getValue();
+ mask = query.isMask();
+ } else {
+ tagName = query.getLastParentTag();
+ }
+ if(tagName == null) {
+ return null;
+ }
+ if(mask) {
+ return getComponents(tagName);
+ }
+ return new IComponent[]{getComponent(tagName)};
+ }
+
+ /**
+ * Adds component to tag lib.
+ * @param component
+ */
+ public void addComponent(IComponent component) {
+ components.put(component.getName(), component);
+ }
+
+ /**
+ * @param components the components to set
+ */
+ protected void setComponents(Map<String, IComponent> components) {
+ this.components = components;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getResource()
+ */
+ public IResource getResource() {
+ return resource;
+ }
+
+ /**
+ * @param resource the resource to set
+ */
+ public void setResource(IFile resource) {
+ this.resource = resource;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.TagLibrary#getURI()
+ */
+ public String getURI() {
+ return uri;
+ }
+
+ /**
+ * @param uri the URI to set
+ */
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ /* (non-Javadoc)
+ * @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) {
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ IComponent[] components = getComponents(query, context);
+ if(query.getType() == KbQuery.Type.TAG_NAME) {
+ for (int i = 0; i < components.length; i++) {
+ TextProposal proposal = new TextProposal();
+ proposal.setContextInfo(components[i].getDescription());
+ StringBuffer label = new StringBuffer();
+ if(query.getPrefix()!=null) {
+ label.append(query.getPrefix() + KbQuery.PREFIX_SEPARATOR);
+ }
+ label.append(components[i].getName());
+ proposal.setLabel(label.toString());
+
+ IAttribute[] attributes = components[i].getPreferableAttributes();
+ StringBuffer attributeSB = new StringBuffer();
+ for (int j = 0; j < attributes.length; j++) {
+ attributeSB.append(" ").append(attributes[j].getName()).append("=\"\"");
+ }
+ label.append(attributeSB);
+ if(!components[i].canHaveBody()) {
+ label.append(" /");
+ }
+
+ proposal.setReplacementString(label.toString());
+
+ int position = proposal.getReplacementString().indexOf('"');
+ if(position!=-1) {
+ position ++;
+ } else {
+ position = proposal.getReplacementString().length();
+ }
+ proposal.setPosition(position);
+ proposals.add(proposal);
+ }
+ } else {
+ for (int i = 0; i < components.length; i++) {
+ TextProposal[] componentProposals = components[i].getProposals(query, context);
+ for (int j = 0; j < componentProposals.length; j++) {
+ proposals.add(componentProposals[j]);
+ }
+ }
+ }
+ return proposals.toArray(new TextProposal[proposals.size()]);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15274 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb: taglib and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:42:35 -0400 (Fri, 15 May 2009)
New Revision: 15274
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ICustomTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IELFunction.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFaceletTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFacesConfigTagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/INameSpace.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITLDLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Share project "org.jboss.tools.jst.web.kb" into "https://svn.jboss.org/repos/jbosstools"
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * JSF Facet Component
+ * @author Alexey Kazakov
+ */
+public class Facet {
+
+ private String description;
+ private String name;
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IAttribute.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IAttribute.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+import org.jboss.tools.jst.web.kb.IProposalProcessor;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IAttribute extends IProposalProcessor {
+
+ /**
+ * @return name of attribute
+ */
+ String getName();
+
+ /**
+ * @return description
+ */
+ String getDescription();
+
+ /**
+ * @return true if the attribute is required.
+ */
+ boolean isRequired();
+
+ /**
+ * @return true if the attribute is preferable. E.g. <h:outputText value=""/>
+ */
+ boolean isPreferable();
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IAttribute.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IComponent.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IComponent.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.IProposalProcessor;
+import org.jboss.tools.jst.web.kb.KbQuery;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IComponent extends IProposalProcessor {
+
+ /**
+ * @return name space
+ */
+ INameSpace getNameSpace();
+
+ /**
+ * @return component name
+ */
+ String getName();
+
+ /**
+ * @return description
+ */
+ String getDescription();
+
+ /**
+ * @return true if the tag can have a body
+ */
+ boolean canHaveBody();
+
+ /**
+ * @return the component type
+ */
+ String getComponentType();
+
+ /**
+ * @return the component class name
+ */
+ String getComponentClass();
+
+ /**
+ * @return all attributes of this component
+ */
+ IAttribute[] getAttributes();
+
+ /**
+ * @param nameTemplate
+ * @return attributes with names which start with given template.
+ */
+ IAttribute[] getAttributes(String nameTemplate);
+
+ /**
+ * @return all required attributes of this component
+ */
+ IAttribute[] getRequiredAttributes();
+
+ /**
+ * @return all preferable attributes of this component
+ */
+ IAttribute[] getPreferableAttributes();
+
+ /**
+ * @param name
+ * @return attribute by name
+ */
+ IAttribute getAttribute(String name);
+
+ /**
+ * Return attributes
+ * @param query
+ * @param context
+ * @return
+ */
+ public IAttribute[] getAttributes(KbQuery query, IPageContext context);
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IComponent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ICustomTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ICustomTagLibrary.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ICustomTagLibrary.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface ICustomTagLibrary extends ITagLibrary {
+
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ICustomTagLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IELFunction.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IELFunction.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IELFunction.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IELFunction {
+
+ /**
+ * @return the name of EL function
+ */
+ String getName();
+
+ /**
+ * @return the signature
+ */
+ String getFunctionSignature();
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IELFunction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFaceletTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFaceletTagLibrary.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFaceletTagLibrary.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IFaceletTagLibrary extends ITagLibrary {
+
+ /**
+ * @return EL functions
+ */
+ IELFunction[] getFunctions();
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFaceletTagLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFacesConfigTagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFacesConfigTagLibrary.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFacesConfigTagLibrary.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IFacesConfigTagLibrary extends ITagLibrary {
+
+ /**
+ * @param type
+ * @return component by type
+ */
+ IComponent getComponentByType(String type);
+
+ /**
+ * @return all facets of this component
+ */
+ Facet[] getFacets();
+
+ /**
+ * @param nameTemplate
+ * @return facets with names which start with given template.
+ */
+ Facet[] getFacets(String nameTemplate);
+
+ /**
+ * @param name
+ * @return facet by name
+ */
+ Facet getFacet(String name);
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/IFacesConfigTagLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/INameSpace.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/INameSpace.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/INameSpace.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface INameSpace {
+
+ /**
+ * @return URI
+ */
+ String getURI();
+
+ /**
+ * @return prefix
+ */
+ String getPrefix();
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/INameSpace.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITLDLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITLDLibrary.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITLDLibrary.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface ITLDLibrary extends ITagLibrary {
+
+ /**
+ * @return version of TLD
+ */
+ String getVersion();
+
+ /**
+ * @return display name
+ */
+ String displayName();
+
+ /**
+ * @return short name
+ */
+ String getShortName();
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITLDLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+import org.eclipse.core.resources.IResource;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.IProposalProcessor;
+
+/**
+ * Represents a tag library.
+ * @author Alexey Kazakov
+ */
+public interface ITagLibrary extends IProposalProcessor {
+
+ /**
+ * @return URI of the tag lib.
+ */
+ String getURI();
+
+ /**
+ * @return resource of this tag lib.
+ */
+ IResource getResource();
+
+ /**
+ * @return all tags
+ */
+ IComponent[] getComponents();
+
+ /**
+ * @param nameTemplate
+ * @return tags with names which start with given template
+ */
+ IComponent[] getComponents(String nameTemplate);
+
+ /**
+ * @param name
+ * @return tag by name
+ */
+ IComponent getComponent(String name);
+
+ /**
+ * @param query
+ * @param context
+ * @return components
+ */
+ public IComponent[] getComponents(KbQuery query, IPageContext context);
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/ITagLibrary.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java 2009-05-15 12:42:35 UTC (rev 15274)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.taglib;
+
+import org.eclipse.core.resources.IFile;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class TagLibriryManager {
+
+ /**
+ * Returns all tag libraries which are available in the page.
+ * @param page
+ * @return
+ */
+ public static ITagLibrary[] getLibraries(IFile page) {
+ //TODO
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/taglib/TagLibriryManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15273 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:29:17 -0400 (Fri, 15 May 2009)
New Revision: 15273
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Share project "org.jboss.tools.jst.web.kb" into "https://svn.jboss.org/repos/jbosstools"
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Facet.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Facet.java 2009-05-15 12:24:51 UTC (rev 15272)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/Facet.java 2009-05-15 12:29:17 UTC (rev 15273)
@@ -17,7 +17,7 @@
public class Facet {
private String description;
- private String name;
+ private String name;
/**
* @return the description
17 years, 2 months
JBoss Tools SVN: r15271 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb: .settings and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-15 08:18:47 -0400 (Fri, 15 May 2009)
New Revision: 15271
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/.classpath
trunk/jst/plugins/org.jboss.tools.jst.web.kb/.project
trunk/jst/plugins/org.jboss.tools.jst.web.kb/.settings/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/.settings/org.eclipse.jdt.core.prefs
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
trunk/jst/plugins/org.jboss.tools.jst.web.kb/about.html
trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.properties
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.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/IProposalProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IResourceBundle.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbQuery.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Share project "org.jboss.tools.jst.web.kb" into "https://svn.jboss.org/repos/jbosstools"
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/.classpath
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/.classpath (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/.classpath 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/.project
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/.project (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/.project 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jst.web.kb</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/.settings/org.eclipse.jdt.core.prefs 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,8 @@
+#Fri May 15 15:20:06 MSD 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.jboss.tools.jst.web.kb;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.jst.web.kb.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.jst.web;bundle-version="2.0.0",
+ org.jboss.tools.common.el.core;bundle-version="2.0.0",
+ org.eclipse.jface.text;bundle-version="3.5.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %providerName
+Export-Package: org.jboss.tools.jst.web.kb,
+ org.jboss.tools.jst.web.kb.taglib
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/about.html
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/about.html (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/about.html 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>©2009 Red Hat, Inc. All rights reserved</P>
+
+<H3>License</H3>
+
+<P>Red Hat Inc., through its JBoss division, makes available all content in this plug-in
+("Content"). Unless otherwise indicated below, the Content is provided to you
+under the terms and conditions of the Eclipse Public License Version 1.0
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from Red Hat Inc., the
+Content is being redistributed by another party ("Redistributor") and different
+terms and conditions may apply to your use of any object code in the Content.
+Check the Redistributor's license that was provided with the Content. If no such
+license exists, contact the Redistributor. Unless otherwise indicated below, the
+terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at
+ <A href="http://www.jboss.org/tools">http://www.jboss.org/tools</A>.</P>
+
+</BODY>
+</HTML>
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/about.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,7 @@
+bin.includes = META-INF/,\
+ plugin.properties,\
+ webKb.jar,\
+ about.html
+source.webKb.jar = src/
+output.webKb.jar = bin/
+jars.compile.order = webKb.jar
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.properties (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.properties 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,4 @@
+providerName=JBoss, a division of Red Hat
+# START NON-TRANSLATABLE
+Bundle-Name.0 = Web KB
+# END NON-TRANSLATABLE
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,50 @@
+package org.jboss.tools.jst.web.kb;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jst.web.kb";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/Activator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import java.util.Map;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IFaceletPageContext extends IPageContext {
+
+ /**
+ * Returns parent page context. For example if some this facelet page is used in a template then
+ * this method will return a page context for that template.
+ * May return null.
+ * @return
+ */
+ IFaceletPageContext getParentContext();
+
+ /**
+ * Returns parameters which are declared in the parent context and are available within this page.
+ * Key - name of Parameter.
+ * Value - value of Parameter.
+ * @return
+ */
+ Map<String, String> getParams();
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IFaceletPageContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import org.eclipse.jface.text.IDocument;
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ * Page context
+ * @author Alexey Kazakov
+ */
+public interface IPageContext extends ELContext {
+
+ /**
+ * Returns libraries which should be used in this context
+ * @return
+ */
+ ITagLibrary[] getLibraries();
+
+ /**
+ * Returns EL Resolvers which are declared for this page
+ * @return
+ */
+ ELResolver[] getElResolvers();
+
+ /**
+ * Returns resource bundles
+ * @return
+ */
+ IResourceBundle[] getResourceBundles();
+
+ /**
+ * Returns IDocument for source file
+ * @return
+ */
+ IDocument getDocument();
+
+ /**
+ * Returns "var" attributes which are available in particular offset.
+ * @param offset
+ * @return
+ */
+ Var[] getVars(int offset);
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import org.jboss.tools.common.text.TextProposal;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IProposalProcessor {
+
+ /**
+ * @return proposals
+ */
+ TextProposal[] getProposals(KbQuery query, IPageContext context);
+
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IResourceBundle.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IResourceBundle.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IResourceBundle.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+/**
+ * @author Alexey Kazakov
+ */
+public interface IResourceBundle {
+
+ /**
+ * @return var attribute value
+ */
+ String getVar();
+
+ /**
+ * @return basename attribute value
+ */
+ String getBasename();
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IResourceBundle.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbQuery.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbQuery.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbQuery.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+/**
+ * Query object is used to get info from Page Processors.
+ * @author Alexey Kazakov
+ */
+public class KbQuery {
+
+ public static final String PREFIX_SEPARATOR = ":";
+
+ private int offset;
+ private String uri;
+ private String[] parentTags;
+ private String value;
+ private String stringQuery;
+ private boolean useAsMask;
+ private String prefix;
+ private Type type;
+ private String parent;
+
+ /**
+ * Type of object for which we want to get info
+ * @author Alexey Kazakov
+ */
+ public static enum Type {
+ TEXT,
+ TAG_NAME,
+ ATTRIBUTE_NAME,
+ ATTRIBUTE_VALUE
+ }
+
+ public KbQuery() {
+ }
+
+ /**
+ * URI of tag library
+ * @return
+ */
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+
+ /**
+ * The stack of parent tags
+ * @return
+ */
+ public String[] getParentTags() {
+ return parentTags;
+ }
+
+ /**
+ * @param parentTags the stack of parent tags
+ */
+ public void setParentTags(String[] parentTags) {
+ this.parentTags = parentTags;
+ }
+
+ /**
+ * return the last parent tag
+ */
+ public String getLastParentTag() {
+ if(parentTags.length>0) {
+ return parentTags[parentTags.length-1];
+ }
+ return null;
+ }
+
+ /**
+ * @return the name of parent tag (type==TAG_NAME) or attribute (type==ATTRIBUTE_NAME or type==ATTRIBUTE_VALE) to set
+ */
+ public String getParent() {
+ if(type == Type.TAG_NAME) {
+ return getLastParentTag();
+ }
+ return parent;
+ }
+
+ /**
+ * @param name the name of parent tag or attribute to set
+ */
+ public void setParent(String name) {
+ this.parent = name;
+ }
+
+ /**
+ * Value of query. For example in case of ATTRIBUTE_NAME type it is an attribute name.
+ * @return
+ */
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * True if the value is a mask. For example we ask all tags which start with "<h:outputT" then the value "outputT" is a mask.
+ * @return
+ */
+ public boolean isMask() {
+ return useAsMask;
+ }
+
+ public void setMask(boolean useAsMask) {
+ this.useAsMask = useAsMask;
+ }
+
+ /**
+ * Returns type of value
+ * @return
+ */
+ public Type getType() {
+ return type;
+ }
+
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ /**
+ * @return offset
+ */
+ public int getOffset() {
+ return offset;
+ }
+
+ public void setOffset(int offset) {
+ this.offset = offset;
+ }
+
+ /**
+ * @return the string representation of this query.
+ * In case of tag name this method will return "<h:outputText"
+ * but getValue() will return "outputText".
+ */
+ public String getStringQuery() {
+ return stringQuery;
+ }
+
+ /**
+ * @param stringQuery the stringQuery to set
+ */
+ public void setStringQuery(String stringQuery) {
+ this.stringQuery = stringQuery;
+ }
+
+ /**
+ * @return the tag prefix.
+ */
+ public String getPrefix() {
+ return prefix;
+ }
+
+ /**
+ * @param prefix the prefix to set
+ */
+ public void setPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbQuery.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import org.eclipse.core.resources.IFile;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class PageContextFactory {
+
+ /**
+ * Creates a page context for given resource and offset.
+ * @param file
+ * @param offset
+ * @return
+ */
+ public static IPageContext createPageContext(IFile file, int offset) {
+ // TODO
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import java.util.ArrayList;
+
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.taglib.IAttribute;
+import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class PageProcessor implements IProposalProcessor {
+
+ /*
+ * (non-Javadoc)
+ * @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) {
+ ArrayList<TextProposal> proposals = new ArrayList<TextProposal>();
+ ITagLibrary[] libs = context.getLibraries();
+ for (int i = 0; i < libs.length; i++) {
+ TextProposal[] libProposals = libs[i].getProposals(query, context);
+ for (int j = 0; j < libProposals.length; j++) {
+ proposals.add(libProposals[i]);
+ }
+ }
+ if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE || query.getType() == KbQuery.Type.TEXT) {
+ String value = query.getValue();
+ //TODO convert value to EL string.
+ String elString = value;
+ ELResolver[] resolvers = context.getElResolvers();
+ for (int i = 0; i < resolvers.length; i++) {
+ proposals.addAll(resolvers[i].getCompletions(elString, !query.isMask(), query.getOffset(), context));
+ }
+ }
+
+ return proposals.toArray(new TextProposal[proposals.size()]);
+ }
+
+ /**
+ * Returns components
+ * @param query
+ * @param context
+ * @return components
+ */
+ public IComponent[] getComponents(KbQuery query, IPageContext context) {
+ ArrayList<IComponent> components = new ArrayList<IComponent>();
+ ITagLibrary[] libs = context.getLibraries();
+ for (int i = 0; i < libs.length; i++) {
+ IComponent[] libComponents = libs[i].getComponents(query, context);
+ for (int j = 0; j < libComponents.length; j++) {
+ components.add(libComponents[i]);
+ }
+ }
+ return components.toArray(new IComponent[components.size()]);
+ }
+
+ /**
+ * Returns attributes
+ * @param query
+ * @param context
+ * @return attributes
+ */
+ public IAttribute[] getAttributes(KbQuery query, IPageContext context) {
+ ArrayList<IAttribute> attributes = new ArrayList<IAttribute>();
+ if(query.getType() == KbQuery.Type.ATTRIBUTE_NAME || query.getType() == KbQuery.Type.ATTRIBUTE_VALUE) {
+ IComponent[] components = getComponents(query, context);
+ for (int i = 0; i < components.length; i++) {
+ IAttribute[] libAttributess = components[i].getAttributes(query, context);
+ for (int j = 0; j < libAttributess.length; j++) {
+ attributes.add(libAttributess[i]);
+ }
+ }
+ }
+ return attributes.toArray(new IAttribute[attributes.size()]);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.Map;
+
+import org.jboss.tools.jst.web.kb.IFaceletPageContext;
+
+/**
+ * Facelet page context
+ * @author Alexey Kazakov
+ */
+public class FaceletContextImpl extends JspContextImpl implements IFaceletPageContext {
+
+ private IFaceletPageContext parentContext;
+ private Map<String, String> params;
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParentContext()
+ */
+ public IFaceletPageContext getParentContext() {
+ return parentContext;
+ }
+
+ public void setParentContext(IFaceletPageContext parentContext) {
+ this.parentContext = parentContext;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.FaceletPageContext#getParams()
+ */
+ public Map<String, String> getParams() {
+ return params;
+ }
+
+ public void setParams(Map<String, String> params) {
+ this.params = params;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/FaceletContextImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: 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 (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java 2009-05-15 12:18:47 UTC (rev 15271)
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Region;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.IResourceBundle;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ * JSP page context
+ * @author Alexey Kazakov
+ */
+public class JspContextImpl implements IPageContext {
+
+ private IFile resource;
+ private IDocument document;
+ private ElVarSearcher varSearcher;
+ private ITagLibrary[] libs;
+ private ELResolver[] elResolvers;
+ private Map<Region, Var[]> vars = new HashMap<Region, Var[]>();
+ private Set<Var> allVars = new HashSet<Var>();
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getResource()
+ */
+ public IFile getResource() {
+ return resource;
+ }
+
+ public void setResource(IFile resource) {
+ this.resource = resource;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getLibraries()
+ */
+ public ITagLibrary[] getLibraries() {
+ return libs;
+ }
+
+ public void setLibraries(ITagLibrary[] libs) {
+ this.libs = libs;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getElResolvers()
+ */
+ public ELResolver[] getElResolvers() {
+ return elResolvers;
+ }
+
+ public void setElResolvers(ELResolver[] elResolvers) {
+ this.elResolvers = elResolvers;
+ }
+
+ private final static Var[] EMPTY_VAR_ARRAY = new Var[0];
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getVars(int)
+ */
+ public Var[] getVars(int offset) {
+ for (Region region : vars.keySet()) {
+ if(offset>=region.getOffset() && offset<=region.getOffset() + region.getLength()) {
+ return vars.get(region);
+ }
+ }
+ return EMPTY_VAR_ARRAY;
+ }
+
+ /**
+ * Adds new Var to the context
+ * @param region
+ * @param vars
+ */
+ public void addVars(Region region, Var[] vars) {
+ this.vars.put(region, vars);
+ for (int i = 0; i < vars.length; i++) {
+ allVars.add(vars[i]);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.kb.text.PageContext#getResourceBundles()
+ */
+ public IResourceBundle[] getResourceBundles() {
+ // TODO
+ return null;
+ }
+
+ /**
+ * @return the libs
+ */
+ public ITagLibrary[] getLibs() {
+ return libs;
+ }
+
+ /**
+ * @param libs the libs to set
+ */
+ public void setLibs(ITagLibrary[] libs) {
+ this.libs = libs;
+ }
+
+ /**
+ * @param document the document to set
+ */
+ public void setDocument(IDocument document) {
+ this.document = document;
+ }
+
+ /**
+ * @param varSearcher the varSearcher to set
+ */
+ public void setVarSearcher(ElVarSearcher varSearcher) {
+ this.varSearcher = varSearcher;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.PageContext#getDocument()
+ */
+ public IDocument getDocument() {
+ return document;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.ELContext#getVarSearcher()
+ */
+ public ElVarSearcher getVarSearcher() {
+ return varSearcher;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.ELContext#getVars()
+ */
+ public Var[] getVars() {
+ return allVars.toArray(new Var[allVars.size()]);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/JspContextImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15269 - in trunk/as/plugins: org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-05-15 03:09:19 -0400 (Fri, 15 May 2009)
New Revision: 15269
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
Log:
Fixing broken unit test
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java 2009-05-15 04:47:06 UTC (rev 15268)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ServerListener.java 2009-05-15 07:09:19 UTC (rev 15269)
@@ -49,6 +49,7 @@
}
public void serverAdded(IServer server) {
+ ServerUtil.createStandardFolders(server);
}
public void serverRemoved(IServer server) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-05-15 04:47:06 UTC (rev 15268)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-05-15 07:09:19 UTC (rev 15269)
@@ -202,7 +202,6 @@
IServer saved = serverWC.save(false, new NullProgressMonitor());
getTaskModel().putObject(TaskModel.TASK_SERVER, saved);
- ServerUtil.createStandardFolders(saved);
}
private IJBossServerRuntime getRuntime() {
17 years, 2 months
JBoss Tools SVN: r15268 - trunk/jmx/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-05-15 00:47:06 -0400 (Fri, 15 May 2009)
New Revision: 15268
Modified:
trunk/jmx/releng/build.properties
Log:
tests.feature
Modified: trunk/jmx/releng/build.properties
===================================================================
--- trunk/jmx/releng/build.properties 2009-05-15 04:44:40 UTC (rev 15267)
+++ trunk/jmx/releng/build.properties 2009-05-15 04:47:06 UTC (rev 15268)
@@ -9,7 +9,7 @@
version=0.2.2
mainFeatureToBuildID=org.jboss.tools.jmx.sdk.feature
-testFeatureToBuildID=org.jboss.tools.jmx.test.feature
+testFeatureToBuildID=org.jboss.tools.jmx.tests.feature
build.steps=buildUpdate,buildTests,generateDigests,test,publish,cleanup
17 years, 2 months
JBoss Tools SVN: r15267 - trunk/jmx/releng.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-05-15 00:44:40 -0400 (Fri, 15 May 2009)
New Revision: 15267
Removed:
trunk/jmx/releng/buildlog.latest.txt
Log:
Deleted: trunk/jmx/releng/buildlog.latest.txt
===================================================================
--- trunk/jmx/releng/buildlog.latest.txt 2009-05-15 04:43:57 UTC (rev 15266)
+++ trunk/jmx/releng/buildlog.latest.txt 2009-05-15 04:44:40 UTC (rev 15267)
@@ -1,388 +0,0 @@
-Buildfile: /home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx/releng/build.xml
-run:
-runEclipse:
- [mkdir] Created dir: /tmp/build/N200905142058-JMX/eclipse
-check.ant-contrib:
-get.pde.build.svn:
-get.ant4eclipse:
- [echo] Run /usr/lib/jvm/java/bin/java
- [echo] -enableassertions
- [echo] -jar /home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher_1.0.200.v20090306-1900.jar
- [echo] -application org.eclipse.ant.core.antRunner
- [echo] -f /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml run
- [echo] -Dprojectid=jbosstools.jmx -DbuildTimestamp=200905142058 -DbuildType=N -Dversion=0.2.2 -DwritableBuildRoot=/tmp/build -DdownloadsDir=/tmp/build/downloads -DthirdPartyJarsDir=/tmp/build/3rdPartyJars -DbuildDir=/tmp/build/N200905142058-JMX -DrelengBuilderDir=/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx/releng -DrelengCommonBuilderDir=/home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng -DrelengBaseBuilderDir=/home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder -DJAVA_HOME=/usr/lib/jvm/java -DdependencyURLs=http://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops/S-3.5M7-200904302300/eclipse-SDK-3.5M7-linux-gtk.tar.gz -DlocalSourceCheckoutDir=/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx
- [build] Buildfile: /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml
- [build] init:
- [build] check.ant-contrib:
- [build] init:
- [build] genBuildCfgInit:
- [build] Trying to override old definition of task echo-timestamp
- [build] projectid2names:
- [build] genBuildCfg:
- [build] Trying to override old definition of task echo-timestamp
- [build] createBuildConfigFile:
- [build] [echo] Created /tmp/build/N200905142058-JMX/build.cfg
- [build] Trying to override old definition of task echo-timestamp
- [build] collectURLs:
- [build] getZip:
- [build] [echo] Found 1 dependency URLs
- [build] [echo] Load properties from /tmp/build/N200905142058-JMX/build.cfg
- [build] create.label.properties:
- [build] [echo] subprojectName = jmx
- [build] [echo] Base OS: linux; Base Window System: gtk
- [build] collectMaps:
- [build] run:
- [build] [echo] Get pde.build.svn
- [build] get.pde.build.svn:
- [build] [echo] Get ant4eclipse
- [build] get.ant4eclipse:
- [build] [echo] buildAll.xml#run :: build.step :: buildUpdate
- [build] buildUpdate:
- [build] buildMasterZip:
- [build] -timestamp:
- [build] [echo] 08:58:30
- [build] init:
- [build] main:
- [build] main:
- [build] preBuild:
- [build] preSetup:
- [build] [mkdir] Created dir: /tmp/build/N200905142058-JMX/eclipse/N200905142058
- [build] copyLocalSourceCheckout:
- [build] [copy] Copying 142 files to /tmp/build/N200905142058-JMX/eclipse/plugins
- [build] [copy] Copying 67 files to /tmp/build/N200905142058-JMX/eclipse/plugins
- [build] getMapFiles:
- [build] [copy] Copying 1 file to /tmp/build/N200905142058-JMX/eclipse
- [build] postSetup:
- [build] [echo] Download, then unpack Eclipse ...
- [build] init:
- [build] stripVersionsDef:
- [build] getDependency:
- [build] getBundle:
- [build] downloadFile:
- [build] unpackBundle:
- [build] unzipFile:
- [build] untarFile:
- [build] [untar] Expanding: /tmp/build/downloads/eclipse-SDK-3.5M7-linux-gtk.tar.gz into /tmp/build/N200905142058-JMX
- [build] unpackDocISV:
- [build] processRepos:
- [build] fetch:
- [build] generate:
- [build] preGenerate:
- [build] allElements:
- [build] allElementsDelegator:
- [build] init:
- [build] generateScript:
- [build] [eclipse.buildScript] Some inter-plug-in dependencies have not been satisfied.
- [build] [eclipse.buildScript] Bundle org.eclipse.core.filesystem:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.filesystem_1.2.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.frameworkadmin:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.frameworkadmin_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.jboss.tools.jmx.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.jboss.tools.jmx.ui_0.2.2
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.intro:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.intro_3.3.0.v20090429_1800
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.launching:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.launching_3.5.0.v20090429
- [build] [eclipse.buildScript] Bundle org.eclipse.update.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.update.core_3.2.300.v20090429-1625
- [build] [eclipse.buildScript] Bundle org.eclipse.ant.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ant.core_3.2.100.v20090429
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.metadata.generator:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.metadata.generator_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.browser:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.browser_3.2.300.v20090413
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.jarprocessor:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.jarprocessor_1.0.1.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.console:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.console_3.4.0.v20090429
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.intro.universal:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.intro.universal_3.2.300.v20090429_1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.ui.sdk:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.ui.sdk_1.0.100.v20090430-0100
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.app:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.app_1.2.0.v20090429-1630
- [build] [eclipse.buildScript] Bundle org.eclipse.sdk:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.sdk_3.5.0.v200904302300
- [build] [eclipse.buildScript] Bundle org.eclipse.swt.gtk.linux.x86:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.swt.gtk.linux.x86_3.5.0.v3545a
- [build] [eclipse.buildScript] Bundle org.eclipse.platform:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.platform_3.3.200.v200904302300
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.publisher:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.publisher_1.0.0.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.pde:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde_3.4.100.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.build:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.build_3.5.0.v20090430-1420
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.debug:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.debug_3.5.0.v20090429
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.api.tools:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.api.tools_1.0.100.v20090430-1530
- [build] [eclipse.buildScript] Bundle org.eclipse.compare:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.compare_3.5.0.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.core.runtime:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.runtime_3.5.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.jboss.tools.jmx.ui.test.interactive:
- [build] [eclipse.buildScript] Another singleton version selected: org.jboss.tools.jmx.ui.test.interactive_0.2.2
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.junit.runtime:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.junit.runtime_3.4.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.registry:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.registry_3.4.100.v20090429-1630
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.externaltools:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.externaltools_3.2.0.v20090429
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.junit:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.junit_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.common:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.common_3.5.0.v20090429-1630
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.views.properties.tabbed:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.views.properties.tabbed_3.5.0.I20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.repository.tools:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.repository.tools_1.0.0.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.core.net:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.net_1.2.0.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.touchpoint.eclipse:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.touchpoint.eclipse_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.core.manipulation:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.core.manipulation_1.3.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.debug.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.debug.ui_3.5.0.v20090430-1530
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.ua.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ua.ui_1.0.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.apt.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.apt.ui_3.3.200.v20090429-1720
- [build] [eclipse.buildScript] Bundle org.eclipse.help:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help_3.4.0.v20090429_1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.exemplarysetup:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.exemplarysetup_1.0.0.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.views:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.views_3.4.0.I20090421-0800
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ui_3.5.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.ecf.filetransfer:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf.filetransfer_3.0.0.v20090429-2045
- [build] [eclipse.buildScript] Bundle org.eclipse.team.cvs.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.cvs.core_3.3.200.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.core.jobs:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.jobs_3.4.100.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.core.variables:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.variables_3.2.200.v20090428
- [build] [eclipse.buildScript] Bundle org.eclipse.team.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.ui_3.5.0.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.compiler.tool:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.compiler.tool_1.0.100.v_955
- [build] [eclipse.buildScript] Bundle org.eclipse.help.webapp:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help.webapp_3.4.0.v20090429_1800
- [build] [eclipse.buildScript] Bundle org.eclipse.rcp:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.rcp_3.4.0.v20080507
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.console:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.console_1.0.0.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.api.tools.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.api.tools.ui_1.0.100.v20090430-1530
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.debug.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.debug.ui_3.4.0.v20090429
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.core_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui_3.5.0.I20090430-0800
- [build] [eclipse.buildScript] Bundle org.eclipse.core.contenttype:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.contenttype_3.4.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.jsch.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jsch.ui_1.1.200.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.core_3.5.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.preferences:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.preferences_3.2.300.v20090429-1630
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.http.registry:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.http.registry_1.0.200.v20090429-1630
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.junit4.runtime:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.junit4.runtime_1.1.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.simpleconfigurator.manipulator:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.simpleconfigurator.manipulator_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.doc.user:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.doc.user_3.3.0.v20090430-1445
- [build] [eclipse.buildScript] Bundle org.jboss.tools.jmx.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.jboss.tools.jmx.core_0.2.1
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.metadata:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.metadata_1.0.0.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.update.scheduler:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.update.scheduler_3.2.200.v20081127
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.ds.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ds.ui_1.0.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.navigator.resources:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.navigator.resources_3.4.0.I20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.apt.pluggable.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.apt.pluggable.core_1.0.200.v20090429-1720
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.updatesite:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.updatesite_1.0.100.v20090430-1645
- [build] [eclipse.buildScript] Bundle com.ibm.icu:
- [build] [eclipse.buildScript] Another singleton version selected: com.ibm.icu_4.0.1.v20090415
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.directorywatcher:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.directorywatcher_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.ua.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ua.core_1.0.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.artifact.repository:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.artifact.repository_1.0.100.v20090430-2300
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.ds:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.ds_1.1.0.v20090429-1630
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.garbagecollector:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.garbagecollector_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.junit.runtime:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.junit.runtime_3.4.100.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.platform.doc.isv:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.platform.doc.isv_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.workbench:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.workbench_3.5.0.I20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.simpleconfigurator:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.simpleconfigurator_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.ltk.ui.refactoring:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ltk.ui.refactoring_3.4.100.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.update.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.update.ui_3.2.200.v20090213
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.director.app:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.director.app_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.team.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.core_3.5.0.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.cvs:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.cvs_1.0.100.v20090123
- [build] [eclipse.buildScript] Bundle org.eclipse.ecf.provider.filetransfer.httpclient.ssl:
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.reconciler.dropins:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.reconciler.dropins_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.compiler.apt:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.compiler.apt_1.0.200.v20090429-1720
- [build] [eclipse.buildScript] Bundle org.eclipse.help.base:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help.base_3.4.0.v20090429_1800
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.core_3.5.0.v_955
- [build] [eclipse.buildScript] Bundle org.eclipse.ecf.provider.filetransfer:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf.provider.filetransfer_3.0.0.v20090429-2045
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.doc.user:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.doc.user_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.core.net.linux.x86:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.net.linux.x86_1.1.0.I20081021
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.workbench.texteditor:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.workbench.texteditor_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.ecf.provider.filetransfer.ssl:
- [build] [eclipse.buildScript] Bundle org.eclipse.core.resources.compatibility:
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.ui.templates:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ui.templates_3.4.100.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.jsch.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jsch.core_1.1.100.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.team.cvs.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.cvs.ui_3.3.200.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.core.expressions:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.expressions_3.4.100.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.navigator:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.navigator_3.4.0.I20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.engine:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.engine_1.0.100.v20090430-0100
- [build] [eclipse.buildScript] Bundle org.eclipse.osgi:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.osgi_3.5.0.v20090429-1630
- [build] [eclipse.buildScript] Bundle org.eclipse.core.filebuffers:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.filebuffers_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.core.runtime.compatibility:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.runtime.compatibility_3.2.0.v20090413
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.ui_3.5.0.v20090430-0800
- [build] [eclipse.buildScript] Bundle org.eclipse.ecf:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf_3.0.0.v20090429-2045
- [build] [eclipse.buildScript] Bundle org.eclipse.platform.doc.user:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.platform.doc.user_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.cheatsheets:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.cheatsheets_3.3.200.v20090413
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.workbench.compatibility:
- [build] [eclipse.buildScript] Bundle org.jboss.tools.jmx.ui.test:
- [build] [eclipse.buildScript] Bundle org.eclipse.core.resources:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.resources_3.5.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.security:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.security_1.0.100.v20090429-1630
- [build] [eclipse.buildScript] Bundle org.eclipse.team.cvs.ssh2:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.cvs.ssh2_3.2.200.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.security.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.security.ui_1.0.100.v20090429-1630
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.ds.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ds.core_1.0.0.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.net:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.net_1.2.0.I20090430-0408
- [build] [eclipse.buildScript] Bundle org.eclipse.search:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.search_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.editors:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.editors_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.ui_1.0.100.v20090430-0100
- [build] [eclipse.buildScript] Bundle org.eclipse.ant.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ant.ui_3.4.0.v20090429
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.launcher.gtk.linux.x86:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090306-1900
- [build] [eclipse.buildScript] Bundle org.eclipse.ecf.provider.filetransfer.httpclient:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf.provider.filetransfer.httpclient_3.0.0.v20090429-2045
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.touchpoint.natives:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.touchpoint.natives_1.0.0.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.update.core.linux:
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.views.log:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.views.log_1.0.100.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.doc.isv:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.doc.isv_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.extensionlocation:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.extensionlocation_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.presentations.r21:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.presentations.r21_3.2.100.I20081007-0800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.metadata.repository:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.metadata.repository_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.ide.application:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.ide.application_1.0.100.I20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.jdt.apt.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.apt.core_3.3.200.v20090429-1720
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.updatechecker:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.updatechecker_1.1.0.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.help.ui:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help.ui_3.4.0.v20090429_1800
- [build] [eclipse.buildScript] Bundle org.eclipse.ecf.identity:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf.identity_3.0.0.v20090429-2045
- [build] [eclipse.buildScript] Bundle org.eclipse.ltk.core.refactoring:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ltk.core.refactoring_3.5.0.v20090429-1800b
- [build] [eclipse.buildScript] Bundle org.eclipse.debug.core:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.debug.core_3.5.0.v20090429
- [build] [eclipse.buildScript] Bundle org.eclipse.pde.runtime:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.runtime_3.4.100.v20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.ui.sdk.scheduler:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.ui.sdk.scheduler_1.0.0.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.update.configurator:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.update.configurator_3.3.0.v20090312
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.director:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.director_1.0.100.v20090429-2126
- [build] [eclipse.buildScript] Bundle org.eclipse.core.runtime.compatibility.registry:
- [build] [eclipse.buildScript] Bundle org.eclipse.swt:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.swt_3.5.0.v3545a
- [build] [eclipse.buildScript] Unsatisfied import package org.eclipse.swt.accessibility2_0.0.0.
- [build] [eclipse.buildScript] Unsatisfied import package org.mozilla.xpcom_0.0.0.
- [build] [eclipse.buildScript] Bundle org.eclipse.ui.ide:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.ide_3.5.0.I20090429-1800
- [build] [eclipse.buildScript] Bundle org.eclipse.help.appserver:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help.appserver_3.1.400.v20090429_1800
- [build] [eclipse.buildScript] Bundle org.eclipse.ecf.ssl:
- [build] [eclipse.buildScript] Bundle org.eclipse.core.filesystem.linux.x86:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.filesystem.linux.x86_1.2.0.v20080604-1400
- [build] BUILD FAILED
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.repository:
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml:309: The following error occurred while executing this line:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.repository_1.0.0.v20090430-1645
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml:346: The following error occurred while executing this line:
- [build] [eclipse.buildScript] Bundle org.eclipse.equinox.frameworkadmin.equinox:
- [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.frameworkadmin.equinox_1.0.100.v20090429-2126
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml:522: The following error occurred while executing this line:
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml:775: The following error occurred while executing this line:
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/build.xml:24: The following error occurred while executing this line:
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder/plugins/org.eclipse.pde.build_3.5.0.v20090330/scripts/build.xml:25: The following error occurred while executing this line:
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder/plugins/org.eclipse.pde.build_3.5.0.v20090330/scripts/build.xml:77: The following error occurred while executing this line:
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/builder/all/customTargets.xml:12: The following error occurred while executing this line:
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/builder/all/allElements.xml:16: The following error occurred while executing this line:
- [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder/plugins/org.eclipse.pde.build_3.5.0.v20090330/scripts/genericTargets.xml:96: Unable to find feature: org.jboss.tools.jmx.sdk.feature.
- [build] Total time: 24 seconds
-
-BUILD FAILED
-/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx/releng/build.xml:52: The following error occurred while executing this line:
-/home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml:269: The following error occurred while executing this line:
-/home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml:288: Java returned: 13
-
-Total time: 28 seconds
17 years, 2 months
JBoss Tools SVN: r15266 - trunk/jmx/releng/maps.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-05-15 00:43:57 -0400 (Fri, 15 May 2009)
New Revision: 15266
Modified:
trunk/jmx/releng/maps/jmx.map
Log:
[JBDS-486] ad JMX tests feature
Modified: trunk/jmx/releng/maps/jmx.map
===================================================================
--- trunk/jmx/releng/maps/jmx.map 2009-05-15 04:43:28 UTC (rev 15265)
+++ trunk/jmx/releng/maps/jmx.map 2009-05-15 04:43:57 UTC (rev 15266)
@@ -1,5 +1,7 @@
feature@org.jboss.tools.jmx.sdk.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.sdk.feature
feature@org.jboss.tools.jmx.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.feature
+feature@org.jboss.tools.jmx.tests.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.tests.feature
+
plugin@org.jboss.tools.jmx.core=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.core
plugin@org.jboss.tools.jmx.ui=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.ui
plugin@org.jboss.tools.jmx.core.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.core.test
17 years, 2 months
JBoss Tools SVN: r15265 - in trunk/jmx/features: org.jboss.tools.jmx.tests.feature and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-05-15 00:43:28 -0400 (Fri, 15 May 2009)
New Revision: 15265
Added:
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/build.properties
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/feature.properties
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/license.html
Modified:
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/.project
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/build.properties
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.xml
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.project
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/build.properties
Log:
[JBDS-486] initial JMX component builder
Modified: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/.project
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/.project 2009-05-15 04:36:07 UTC (rev 15264)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/.project 2009-05-15 04:43:28 UTC (rev 15265)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.jem.sdk-feature</name>
+ <name>org.jboss.tools.jmx.sdk-feature</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/build.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/build.properties 2009-05-15 04:36:07 UTC (rev 15264)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/build.properties 2009-05-15 04:43:28 UTC (rev 15265)
@@ -1,4 +1,4 @@
bin.includes = feature.xml,\
feature.properties,\
license.html
-generate.feature(a)org.eclipse.jem.source=org.eclipse.jem
+generate.feature(a)org.jboss.tools.jmx.source.feature=org.jboss.tools.jmx.feature
Modified: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.xml
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.xml 2009-05-15 04:36:07 UTC (rev 15264)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.xml 2009-05-15 04:43:28 UTC (rev 15265)
@@ -25,11 +25,11 @@
</url>
<includes
- id="org.jboss.tools.jmx"
+ id="org.jboss.tools.jmx.feature"
version="0.0.0"/>
<includes
- id="org.jboss.tools.jmx.source"
+ id="org.jboss.tools.jmx.source.feature"
version="0.0.0"/>
</feature>
Modified: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.project
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.project 2009-05-15 04:36:07 UTC (rev 15264)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.project 2009-05-15 04:43:28 UTC (rev 15265)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.ve.tests-feature</name>
+ <name>org.jboss.tools.jmx.tests-feature</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/build.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/build.properties 2009-05-15 04:36:07 UTC (rev 15264)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/build.properties 2009-05-15 04:43:28 UTC (rev 15265)
@@ -1,5 +1,5 @@
bin.includes = feature.xml,\
feature.properties,\
license.html
-generate.plugin(a)org.eclipse.ve.tests.source=org.eclipse.ve.tests
+generate.plugin(a)org.jboss.tools.tests.source.feature=org.jboss.tools.tests.feature
root=rootfiles
\ No newline at end of file
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/build.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/build.properties (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/build.properties 2009-05-15 04:43:28 UTC (rev 15265)
@@ -0,0 +1,15 @@
+###############################################################################
+# Copyright (c) 2009 Red Hat and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Red Hat - initial API and implementation
+###############################################################################
+
+bin.includes = feature.*,\
+ license.html
+
+
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/feature.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/feature.properties (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/feature.properties 2009-05-15 04:43:28 UTC (rev 15265)
@@ -0,0 +1,21 @@
+# properties file for org.jboss.tools.jmx.source
+featureName=JMX Console Tests Source
+featureProvider=JBoss, a division of Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+# "description" property - description of the feature
+description=eclipse-jmx is a JMX console which is used to manage Java applications through JMX and its RMI Connector. eclipse-jmx can be run from the Eclipse IDE.
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\nMarch 17, 2005\n\nUsage Of Content\n\nTHE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\nOTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\nUSE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\nAGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\nNOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\nAGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\nAND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\nOR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\nTERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\nOF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\nBELOW, THEN YOU MAY NOT USE THE CONTENT.\n\nApplicable Licenses\n\nUnless otherwise indicated, all Content made available by the Eclipse Foundation\nis provided to you under the terms and conditio!
ns of the Eclipse Public\nLicense Version 1.0 ("EPL"). A copy of the EPL is provided with this\nContent and is also available at http\://www.eclipse.org/legal/epl-v10.html.\nFor purposes of the EPL, "Program" will mean the Content.\n\nContent includes, but is not limited to, source code, object code,\ndocumentation and other files maintained in the Eclipse.org CVS\nrepository ("Repository") in CVS modules ("Modules") and made available\nas downloadable archives ("Downloads").\n\n- Content may be structured and packaged into modules to facilitate delivering,\nextending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\nplug-in fragments ("Fragments"), and features ("Features").\n- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\nin a directory named "plugins".\n- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\nEach Feature may be packaged as a sub-directory in a directory!
named "features".\nWithin a Feature, files named "feature.xml" may co
ntain a list of the names and version\nnumbers of the Plug-ins and/or Fragments associated with that Feature.\n- Features may also include other Features ("Included Features"). Within a Feature, files\nnamed "feature.xml" may contain a list of the names and version numbers of Included Features.\n\nFeatures may also include other Features ("Included Features"). Files named\n"feature.xml" may contain a list of the names and version numbers of\nIncluded Features.\n\nThe terms and conditions governing Plug-ins and Fragments should be\ncontained in files named "about.html" ("Abouts"). The terms and\nconditions governing Features and Included Features should be contained\nin files named "license.html" ("Feature Licenses"). Abouts and Feature\nLicenses may be located in any directory of a Download or Module\nincluding, but not limited to the following locations\:\n\n- The top-level (root) directory\n- Plug-in and Fragment directories\n- Inside Plug-ins and Fragments packaged as JAR!
s\n- Sub-directories of the directory named "src" of certain Plug-ins\n- Feature directories\n\nNote\: if a Feature made available by the Eclipse Foundation is installed using the\nEclipse Update Manager, you must agree to a license ("Feature Update\nLicense") during the installation process. If the Feature contains\nIncluded Features, the Feature Update License should either provide you\nwith the terms and conditions governing the Included Features or inform\nyou where you can locate them. Feature Update Licenses may be found in\nthe "license" property of files named "feature.properties". Such Abouts,\nFeature Licenses and Feature Update Licenses contain the terms and\nconditions (or references to such terms and conditions) that govern your\nuse of the associated Content in that directory.\n\nTHE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\nTO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\nSOME OF THESE OTHER LICENSE AGREEMENTS MA!
Y INCLUDE (BUT ARE NOT LIMITED TO)\:\n\n- Common Public License Versio
n 1.0 (available at http\://www.eclipse.org/legal/cpl-v10.html)\n- Apache Software License 1.1 (available at http\://www.apache.org/licenses/LICENSE)\n- Apache Software License 2.0 (available at http\://www.apache.org/licenses/LICENSE-2.0)\n- IBM Public License 1.0 (available at http\://oss.software.ibm.com/developerworks/opensource/license10.html)\n- Metro Link Public License 1.00 (available at http\://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n- Mozilla Public License Version 1.1 (available at http\://www.mozilla.org/MPL/MPL-1.1.html)\n\nIT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\nTO USE OF THE CONTENT. If no About, Feature License or Feature Update License\nis provided, please contact the Eclipse Foundation to determine what terms and conditions\ngovern that particular Content.\n\nCryptography\n\nContent may contain encryption software. The country in which you are\ncurrently may have restrictions on the import, posse!
ssion, and use,\nand/or re-export to another country, of encryption software. BEFORE\nusing any encryption software, please check the country's laws,\nregulations and policies concerning the import, possession, or use,\nand re-export of encryption software, to see if this is permitted.\n\nJava and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
+
\ No newline at end of file
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/feature.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/license.html
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/license.html (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/license.html 2009-05-15 04:43:28 UTC (rev 15265)
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+<title>Eclipse.org Software User Agreement</title>
+</head>
+
+<body lang="EN-US" link=blue vlink=purple>
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>March 17, 2005</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
+ modules ("Modules") and made available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
+</body>
+</html>
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplateFeature/license.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15264 - in trunk/jmx/features/org.jboss.tools.jmx.tests.feature: sourceTemplatePlugin/CVS and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-05-15 00:36:07 -0400 (Fri, 15 May 2009)
New Revision: 15264
Removed:
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Entries
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Repository
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Root
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Template
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Entries
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Repository
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Root
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Template
Log:
Deleted: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Entries
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Entries 2009-05-15 04:22:03 UTC (rev 15263)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Entries 2009-05-15 04:36:07 UTC (rev 15264)
@@ -1,2 +0,0 @@
-/epl-v10.html/1.1/Thu May 18 14:32:43 2006//
-/notice.html/1.1/Thu May 18 14:32:43 2006//
Deleted: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Repository
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Repository 2009-05-15 04:22:03 UTC (rev 15263)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Repository 2009-05-15 04:36:07 UTC (rev 15264)
@@ -1 +0,0 @@
-org.eclipse.ve/features/org.eclipse.ve.tests-feature/rootfiles
Deleted: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Root
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Root 2009-05-15 04:22:03 UTC (rev 15263)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Root 2009-05-15 04:36:07 UTC (rev 15264)
@@ -1 +0,0 @@
-:ext:nickb@dev.eclipse.org:/cvsroot/tools
Deleted: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Template
===================================================================
Deleted: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Entries
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Entries 2009-05-15 04:22:03 UTC (rev 15263)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Entries 2009-05-15 04:36:07 UTC (rev 15264)
@@ -1,7 +0,0 @@
-/about.html/1.4/Fri May 5 18:04:14 2006//
-/about.ini/1.2/Thu May 18 14:32:43 2006//
-/about.mappings/1.1/Mon Nov 3 19:16:21 2003/-kb/
-/about.properties/1.7/Thu May 18 19:09:59 2006//
-/build.properties/1.6/Thu May 18 14:32:43 2006//
-/eclipse32.png/1.1/Thu May 18 14:32:43 2006/-kb/
-/plugin.properties/1.4/Wed Aug 24 23:54:35 2005//
Deleted: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Repository
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Repository 2009-05-15 04:22:03 UTC (rev 15263)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Repository 2009-05-15 04:36:07 UTC (rev 15264)
@@ -1 +0,0 @@
-org.eclipse.ve/features/org.eclipse.ve.tests-feature/sourceTemplatePlugin
Deleted: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Root
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Root 2009-05-15 04:22:03 UTC (rev 15263)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Root 2009-05-15 04:36:07 UTC (rev 15264)
@@ -1 +0,0 @@
-:ext:nickb@dev.eclipse.org:/cvsroot/tools
Deleted: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Template
===================================================================
17 years, 2 months
JBoss Tools SVN: r15263 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-15 00:22:03 -0400 (Fri, 15 May 2009)
New Revision: 15263
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksVersionSelectionPage.java
Log:
JBIDE-4281
change wizard page title and some label text.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksVersionSelectionPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksVersionSelectionPage.java 2009-05-15 04:13:49 UTC (rev 15262)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksVersionSelectionPage.java 2009-05-15 04:22:03 UTC (rev 15263)
@@ -45,7 +45,7 @@
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
Label label = new Label(buttonComposite, SWT.NONE);
- label.setText("Smooks Version");
+ label.setText("Smooks configuration file version");
@@ -80,13 +80,13 @@
public SmooksVersionSelectionPage(String pageName, String title, ImageDescriptor titleImage) {
super(pageName, title, titleImage);
- this.setTitle("Smooks version selection");
+ this.setTitle("Smooks configuration file version selection");
this.setDescription("Please select Smooks configuration file version");
}
public SmooksVersionSelectionPage(String pageName) {
super(pageName);
- this.setTitle("Smooks version selection");
+ this.setTitle("Smooks configuration file version selection");
this.setDescription("Please select Smooks configuration file version");
}
17 years, 2 months
JBoss Tools SVN: r15262 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-15 00:13:49 -0400 (Fri, 15 May 2009)
New Revision: 15262
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksVersionSelectionPage.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksFileContainerSelectionPage.java
Log:
JBIDE-4281
1. Move smooks version selection to a new wizardpage.
2. Give "xml" as smooks file extension name.
3. Give "smooks-config.xml" as default file name.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-05-15 03:56:39 UTC (rev 15261)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksConfigurationFileNewWizard.java 2009-05-15 04:13:49 UTC (rev 15262)
@@ -39,6 +39,7 @@
*/
public class SmooksConfigurationFileNewWizard extends Wizard implements INewWizard {
private SmooksFileContainerSelectionPage containerSelectionPage;
+ private SmooksVersionSelectionPage versionSelectionPage;
private ISelection selection;
/**
@@ -58,6 +59,9 @@
containerSelectionPage = new SmooksFileContainerSelectionPage("Smooks Configuration File",
(IStructuredSelection) selection);
addPage(containerSelectionPage);
+
+ versionSelectionPage = new SmooksVersionSelectionPage("Smooks Version Selection");
+ addPage(versionSelectionPage);
}
/**
@@ -67,7 +71,7 @@
public boolean performFinish() {
final IPath containerPath = containerSelectionPage.getContainerFullPath();
final String fileName = containerSelectionPage.getFileName();
- final String version = containerSelectionPage.getVersion();
+ final String version = versionSelectionPage.getVersion();
IRunnableWithProgress op = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksFileContainerSelectionPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksFileContainerSelectionPage.java 2009-05-15 03:56:39 UTC (rev 15261)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksFileContainerSelectionPage.java 2009-05-15 04:13:49 UTC (rev 15262)
@@ -1,16 +1,8 @@
package org.jboss.tools.smooks.configuration.wizards;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.jboss.tools.smooks.configuration.SmooksConstants;
/**
*
@@ -18,68 +10,17 @@
*/
public class SmooksFileContainerSelectionPage extends WizardNewFileCreationPage {
- String version = SmooksConstants.VERSION_1_1;
-
public SmooksFileContainerSelectionPage(String pageName, IStructuredSelection selection) {
super(pageName, selection);
setTitle("Smooks Configuration File Wizard Page");
setDescription("Create a new Smooks configuration file.");
+ setFileExtension("xml");
+ setFileName("smooks-config.xml");
}
@Override
public void createControl(Composite parent) {
super.createControl(parent);
- Composite buttonComposite = new Composite((Composite) getControl(), SWT.NONE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- buttonComposite.setLayoutData(gd);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- buttonComposite.setLayout(layout);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- Label speator = new Label(buttonComposite, SWT.SEPARATOR|SWT.HORIZONTAL);
- gd.widthHint = 10;
- speator.setLayoutData(gd);
-
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- Label label = new Label(buttonComposite, SWT.NONE);
- label.setText("Please select Smooks configuration file version");
-
-
- final CCombo combo = new CCombo(buttonComposite,SWT.BORDER);
- combo.setEditable(false);
-
- for(int i = 0 ; i < SmooksConstants.SMOOKS_VERSIONS.length ; i++){
- combo.add(SmooksConstants.SMOOKS_VERSIONS[i]);
- }
-
- int defaultIndex = 0 ;
- for(int i = 0 ; i < SmooksConstants.SMOOKS_VERSIONS.length ; i++){
- if(SmooksConstants.SMOOKS_VERSIONS[i].equals(version)){
- defaultIndex = i;
- break;
- }
- }
- combo.select(defaultIndex);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- combo.setLayoutData(gd);
-
- combo.addModifyListener(new ModifyListener(){
-
- public void modifyText(ModifyEvent e) {
- version = combo.getText();
- }
-
- });
+ validatePage();
}
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
}
\ No newline at end of file
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksVersionSelectionPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksVersionSelectionPage.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksVersionSelectionPage.java 2009-05-15 04:13:49 UTC (rev 15262)
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.wizards;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.jboss.tools.smooks.configuration.SmooksConstants;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ *
+ */
+public class SmooksVersionSelectionPage extends WizardPage {
+
+ protected String version = SmooksConstants.VERSION_1_1;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createControl(Composite parent) {
+
+ Composite buttonComposite = new Composite((Composite)parent, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ buttonComposite.setLayoutData(gd);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ buttonComposite.setLayout(layout);
+
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ Label label = new Label(buttonComposite, SWT.NONE);
+ label.setText("Smooks Version");
+
+
+
+ final Combo combo = new Combo(buttonComposite,SWT.BORDER | SWT.READ_ONLY);
+
+ for(int i = 0 ; i < SmooksConstants.SMOOKS_VERSIONS.length ; i++){
+ combo.add(SmooksConstants.SMOOKS_VERSIONS[i]);
+ }
+
+ int defaultIndex = 0 ;
+ for(int i = 0 ; i < SmooksConstants.SMOOKS_VERSIONS.length ; i++){
+ if(SmooksConstants.SMOOKS_VERSIONS[i].equals(version)){
+ defaultIndex = i;
+ break;
+ }
+ }
+ combo.select(defaultIndex);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ combo.setLayoutData(gd);
+
+ combo.addModifyListener(new ModifyListener(){
+
+ public void modifyText(ModifyEvent e) {
+ version = combo.getText();
+ }
+
+ });
+
+ setControl(buttonComposite);
+ }
+
+ public SmooksVersionSelectionPage(String pageName, String title, ImageDescriptor titleImage) {
+ super(pageName, title, titleImage);
+ this.setTitle("Smooks version selection");
+ this.setDescription("Please select Smooks configuration file version");
+ }
+
+ public SmooksVersionSelectionPage(String pageName) {
+ super(pageName);
+ this.setTitle("Smooks version selection");
+ this.setDescription("Please select Smooks configuration file version");
+ }
+
+ /**
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * @param version the version to set
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/SmooksVersionSelectionPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15261 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors: calc and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-14 23:56:39 -0400 (Thu, 14 May 2009)
New Revision: 15261
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanExpressionUICreator.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/calc/CounterUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/FreemarkerUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/BindingsPropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanValueUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanWiringUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/jms/JmsRouterUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ResourceConfigTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SmooksResourceListTypeUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/XslUICreator.java
Log:
JBIDE-4298
change some field editor to be "selector group section"
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -20,6 +20,7 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.ViewerFilter;
@@ -296,6 +297,31 @@
protected List<AttributeFieldEditPart> createElementSelectionSection(String sectionTitle,
AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
+ SmooksMultiFormEditor formEditor, EAttribute nameAttribute, EAttribute namespaceAttribute) {
+ IItemPropertySource itemPropertySource = (IItemPropertySource) editingdomain.getAdapterFactory().adapt(model,
+ IItemPropertySource.class);
+ List<IItemPropertyDescriptor> propertyDes = itemPropertySource.getPropertyDescriptors(model);
+ IItemPropertyDescriptor createOnElementFeature = null;
+ IItemPropertyDescriptor createOnElementFeatureNS = null;
+ for (Iterator<?> iterator = propertyDes.iterator(); iterator.hasNext();) {
+ IItemPropertyDescriptor itemPropertyDescriptor = (IItemPropertyDescriptor) iterator.next();
+ if (itemPropertyDescriptor.getFeature(model) == nameAttribute) {
+ createOnElementFeature = itemPropertyDescriptor;
+ }
+ if (itemPropertyDescriptor.getFeature(model) == namespaceAttribute) {
+ createOnElementFeatureNS = itemPropertyDescriptor;
+ }
+ }
+ if (createOnElementFeature == null || createOnElementFeatureNS == null) {
+ return Collections.emptyList();
+ }
+
+ return createElementSelectionSection(sectionTitle, editingdomain, toolkit, parent, model, formEditor,
+ createOnElementFeature, createOnElementFeatureNS);
+ }
+
+ protected List<AttributeFieldEditPart> createElementSelectionSection(String sectionTitle,
+ AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor, IItemPropertyDescriptor createOnElementFeature,
IItemPropertyDescriptor createOnElementFeatureNS) {
Section section = toolkit.createSection(parent, Section.TITLE_BAR);
@@ -319,12 +345,19 @@
GridLayout glayout = new GridLayout();
glayout.numColumns = 2;
container.setLayout(glayout);
-
- AttributeFieldEditPart editPart1 = SmooksUIUtils.createSelectorFieldEditor("Name", toolkit, container,
+ String name = "Name";
+ if (((EAttribute) createOnElementFeature.getFeature(model)).isRequired()) {
+ name += "*";
+ }
+ AttributeFieldEditPart editPart1 = SmooksUIUtils.createSelectorFieldEditor(name, toolkit, container,
createOnElementFeature, model, formEditor.getSmooksGraphicsExt());
editPart1.setAttribute(createOnElementFeature.getFeature(model));
- AttributeFieldEditPart editPart2 = SmooksUIUtils.createStringFieldEditor("Namespace", container, editingdomain,
+ String namespace = "Namespace";
+ if (((EAttribute) createOnElementFeatureNS.getFeature(model)).isRequired()) {
+ namespace += "*";
+ }
+ AttributeFieldEditPart editPart2 = SmooksUIUtils.createStringFieldEditor(namespace, container, editingdomain,
toolkit, createOnElementFeatureNS, model, false, false, false, 0, null, SmooksUIUtils.VALUE_TYPE_VALUE,
null);
editPart2.setAttribute(createOnElementFeatureNS.getFeature(model));
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreatorManager.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -39,6 +39,7 @@
import org.jboss.tools.smooks.configuration.editors.groovy.ScriptUICreator;
import org.jboss.tools.smooks.configuration.editors.iorouting.IORouterUICreator;
import org.jboss.tools.smooks.configuration.editors.javabean.BindingsPropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.javabean.JavabeanExpressionUICreator;
import org.jboss.tools.smooks.configuration.editors.javabean.JavabeanValueUICreator;
import org.jboss.tools.smooks.configuration.editors.javabean.JavabeanWiringUICreator;
import org.jboss.tools.smooks.configuration.editors.jms.ConnectionUICreator;
@@ -86,6 +87,7 @@
import org.jboss.tools.smooks.model.groovy.impl.ScriptTypeImpl;
import org.jboss.tools.smooks.model.iorouting.impl.IORouterImpl;
import org.jboss.tools.smooks.model.javabean.impl.BindingsTypeImpl;
+import org.jboss.tools.smooks.model.javabean.impl.ExpressionTypeImpl;
import org.jboss.tools.smooks.model.javabean.impl.ValueTypeImpl;
import org.jboss.tools.smooks.model.javabean.impl.WiringTypeImpl;
import org.jboss.tools.smooks.model.jmsrouting.impl.ConnectionImpl;
@@ -149,6 +151,7 @@
map.put(BindingsTypeImpl.class, new BindingsPropertyUICreator());
map.put(ValueTypeImpl.class, new JavabeanValueUICreator());
map.put(WiringTypeImpl.class, new JavabeanWiringUICreator());
+ map.put(ExpressionTypeImpl.class,new JavabeanExpressionUICreator());
// for smooks models
map.put(ConditionTypeImpl.class, new ConditionTypeUICreator());
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/calc/CounterUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/calc/CounterUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/calc/CounterUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.calc;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -33,9 +36,10 @@
* org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
* org.eclipse.emf.ecore.EAttribute)
*/
- public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
-
+ public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+
if (feature == CalcPackage.eINSTANCE.getCounter_StartExpression()) {
}
if (feature == CalcPackage.eINSTANCE.getCounter_AmountExpression()) {
@@ -59,12 +63,42 @@
@Override
public boolean isSelectorFeature(EAttribute attribute) {
- if (attribute == CalcPackage.eINSTANCE.getCounter_CountOnElement()) {
+ return super.isSelectorFeature(attribute);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return createElementSelectionSection("Count On Element", editingdomain, toolkit, parent, model, formEditor,
+ CalcPackage.Literals.COUNTER__COUNT_ON_ELEMENT, CalcPackage.Literals.COUNTER__COUNT_ON_ELEMENT_NS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
+ @Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == CalcPackage.eINSTANCE.getCounter_CountOnElement()) {
return true;
}
- return super.isSelectorFeature(attribute);
+ if (feature == CalcPackage.eINSTANCE.getCounter_CountOnElementNS()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
}
-
-
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/FreemarkerUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/FreemarkerUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/FreemarkerUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.freemarker;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -34,17 +37,19 @@
* org.eclipse.emf.ecore.EAttribute)
*/
public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
- SmooksMultiFormEditor formEditor) {
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (feature == FreemarkerPackage.eINSTANCE.getFreemarker_ApplyBefore()) {
}
-// if (feature == FreemarkerPackage.eINSTANCE.getFreemarker_ApplyOnElement()) {
-// SmooksGraphicsExtType ext = formEditor.getSmooksGraphicsExt();
-// if (ext != null) {
-// return SmooksUIUtils.createSelectorFieldEditor(toolkit, parent, propertyDescriptor,
-// model, ext);
-// }
-// }
+ // if (feature ==
+ // FreemarkerPackage.eINSTANCE.getFreemarker_ApplyOnElement()) {
+ // SmooksGraphicsExtType ext = formEditor.getSmooksGraphicsExt();
+ // if (ext != null) {
+ // return SmooksUIUtils.createSelectorFieldEditor(toolkit, parent,
+ // propertyDescriptor,
+ // model, ext);
+ // }
+ // }
if (feature == FreemarkerPackage.eINSTANCE.getFreemarker_ApplyOnElementNS()) {
}
@@ -58,7 +63,41 @@
}
return super.isSelectorFeature(attribute);
}
-
-
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return createElementSelectionSection("Apply On Element", editingdomain, toolkit, parent, model, formEditor,
+ FreemarkerPackage.Literals.FREEMARKER__APPLY_ON_ELEMENT,
+ FreemarkerPackage.Literals.FREEMARKER__APPLY_ON_ELEMENT_NS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
+ @Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == FreemarkerPackage.eINSTANCE.getFreemarker_ApplyOnElement()) {
+ return true;
+ }
+ if (feature == FreemarkerPackage.eINSTANCE.getFreemarker_ApplyOnElementNS()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.groovy;
-import java.util.Collections;
import java.util.List;
import org.eclipse.emf.ecore.EAttribute;
@@ -38,20 +37,16 @@
* org.eclipse.emf.ecore.EAttribute)
*/
public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
- SmooksMultiFormEditor formEditor) {
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (feature == GroovyPackage.eINSTANCE.getGroovy_Imports()) {
}
if (feature == GroovyPackage.eINSTANCE.getGroovy_Script()) {
}
if (feature == GroovyPackage.eINSTANCE.getGroovy_ExecuteBefore()) {
}
- if (feature == GroovyPackage.eINSTANCE.getGroovy_ExecuteOnElementNS()) {
- }
return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
-
-
@Override
public boolean isSelectorFeature(EAttribute attribute) {
@@ -61,17 +56,24 @@
return super.isSelectorFeature(attribute);
}
-
-
@Override
public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
- Composite parent, Object model, SmooksMultiFormEditor formEditor) {
- return Collections.emptyList();
-// SmooksUIUtils.createCommentFieldEditor("Script Contents",editingdomain, toolkit, parent, model);
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return createElementSelectionSection("Execute On Element", editingdomain, toolkit, parent, model, formEditor,
+ GroovyPackage.eINSTANCE.getGroovy_ExecuteOnElement(), GroovyPackage.eINSTANCE
+ .getGroovy_ExecuteOnElementNS());
+ // SmooksUIUtils.createCommentFieldEditor("Script Contents",editingdomain,
+ // toolkit, parent, model);
}
@Override
public boolean ignoreProperty(EAttribute feature) {
+ if (feature == GroovyPackage.eINSTANCE.getGroovy_ExecuteOnElement()) {
+ return true;
+ }
+ if (feature == GroovyPackage.eINSTANCE.getGroovy_ExecuteOnElementNS()) {
+ return true;
+ }
return super.ignoreProperty(feature);
}
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/BindingsPropertyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/BindingsPropertyUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/BindingsPropertyUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,8 +10,11 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.javabean;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -46,6 +49,24 @@
/*
* (non-Javadoc)
*
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
+ @Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == JavabeanPackage.eINSTANCE.getBindingsType_CreateOnElement()) {
+ return true;
+ }
+ if (feature == JavabeanPackage.eINSTANCE.getBindingsType_CreateOnElementNS()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @seeorg.jboss.tools.smooks.configuration.editors.IPropertyUICreator#
* createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
* org.eclipse.swt.widgets.Composite,
@@ -53,25 +74,39 @@
* org.eclipse.emf.ecore.EAttribute)
*/
public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,SmooksMultiFormEditor formEditor) {
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (feature == JavabeanPackage.eINSTANCE.getBindingsType_Class()) {
return createBeanClassTextWithButton(parent, toolkit, propertyDescriptor, model);
}
return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
-
-
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
@Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return createElementSelectionSection("Create On Element", editingdomain, toolkit, parent, model, formEditor,
+ JavabeanPackage.Literals.BINDINGS_TYPE__CREATE_ON_ELEMENT,
+ JavabeanPackage.Literals.BINDINGS_TYPE__CREATE_ON_ELEMENT_NS);
+ }
+
+ @Override
public boolean isSelectorFeature(EAttribute attribute) {
- if(attribute == JavabeanPackage.eINSTANCE.getBindingsType_CreateOnElement()){
- return true;
- }
return super.isSelectorFeature(attribute);
}
protected AttributeFieldEditPart createBeanClassTextWithButton(Composite composite, FormToolkit toolkit,
final IItemPropertyDescriptor propertyDescriptor, final Object model) {
- return SmooksUIUtils.createJavaTypeSearchFieldEditor(composite, toolkit, propertyDescriptor, (EObject)model);
+ return SmooksUIUtils.createJavaTypeSearchFieldEditor(composite, toolkit, propertyDescriptor, (EObject) model);
}
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanExpressionUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanExpressionUICreator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanExpressionUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors.javabean;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.xml.type.AnyType;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.jboss.tools.smooks.configuration.actions.OpenEditorEditInnerContentsAction;
+import org.jboss.tools.smooks.configuration.editors.AttributeFieldEditPart;
+import org.jboss.tools.smooks.configuration.editors.IPropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.PropertyUICreator;
+import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ *
+ */
+public class JavabeanExpressionUICreator extends PropertyUICreator implements IPropertyUICreator {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ List<AttributeFieldEditPart> list = createElementSelectionSection("Execute On Element", editingdomain, toolkit,
+ parent, model, formEditor, JavabeanPackage.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT,
+ JavabeanPackage.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT_NS);
+
+ OpenEditorEditInnerContentsAction openCDATAEditorAction = new OpenEditorEditInnerContentsAction(editingdomain,
+ (AnyType) model, SmooksUIUtils.VALUE_TYPE_TEXT, "txt");
+
+ AttributeFieldEditPart cdatatext = SmooksUIUtils.createStringFieldEditor("Expression", parent, editingdomain,
+ toolkit, null, model, true, false, false, 300, null, SmooksUIUtils.VALUE_TYPE_TEXT,
+ openCDATAEditorAction);
+
+ if(cdatatext != null){
+ list.add(cdatatext);
+ }
+ openCDATAEditorAction.setRelateText((Text)cdatatext.getContentControl());
+
+ return list;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
+ @Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == JavabeanPackage.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT) {
+ return true;
+ }
+ if (feature == JavabeanPackage.Literals.EXPRESSION_TYPE__EXEC_ON_ELEMENT_NS) {
+ return true;
+ }
+ if (feature == JavabeanPackage.Literals.EXPRESSION_TYPE__VALUE) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.PropertyUICreator#
+ * createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanExpressionUICreator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanValueUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanValueUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanValueUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.javabean;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -18,7 +21,6 @@
import org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor;
import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
-
/**
* @author Dart (dpeng(a)redhat.com)
* <p>
@@ -28,7 +30,7 @@
@Override
protected boolean canCreatePropertiesSearchFieldEditor(EAttribute feature) {
- if(feature == JavabeanPackage.eINSTANCE.getValueType_Property()){
+ if (feature == JavabeanPackage.eINSTANCE.getValueType_Property()) {
return true;
}
return false;
@@ -36,14 +38,22 @@
@Override
protected boolean canCreateMethodsSearchFieldEditor(EAttribute feature) {
- if(feature == JavabeanPackage.eINSTANCE.getValueType_SetterMethod()){
+ if (feature == JavabeanPackage.eINSTANCE.getValueType_SetterMethod()) {
return true;
}
return super.canCreateMethodsSearchFieldEditor(feature);
}
- /* (non-Javadoc)
- * @see org.jboss.tools.smooks.configuration.editors.javabean.PropertiesAndSetterMethodSearchFieldEditorCreator#createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.swt.widgets.Composite, org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object, org.eclipse.emf.ecore.EAttribute, org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.jboss.tools.smooks.configuration.editors.javabean.
+ * PropertiesAndSetterMethodSearchFieldEditorCreator
+ * #createPropertyUI(org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
+ * org.eclipse.emf.ecore.EAttribute,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
*/
@Override
public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
@@ -52,14 +62,44 @@
return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
@Override
- public boolean isSelectorFeature(EAttribute attribute) {
- if(attribute == JavabeanPackage.eINSTANCE.getValueType_Data()){
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return createElementSelectionSection("Data", editingdomain, toolkit, parent, model, formEditor,
+ JavabeanPackage.eINSTANCE.getValueType_Data(), JavabeanPackage.eINSTANCE.getValueType_DataNS());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
+ @Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == JavabeanPackage.eINSTANCE.getValueType_Data()) {
return true;
}
+ if (feature == JavabeanPackage.eINSTANCE.getValueType_DataNS()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
+ @Override
+ public boolean isSelectorFeature(EAttribute attribute) {
return super.isSelectorFeature(attribute);
}
-
-
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanWiringUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanWiringUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/javabean/JavabeanWiringUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.javabean;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -38,12 +41,46 @@
}
return super.canCreateMethodsSearchFieldEditor(feature);
}
-
-
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
@Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == JavabeanPackage.eINSTANCE.getWiringType_WireOnElement()) {
+ return true;
+ }
+ if (feature == JavabeanPackage.eINSTANCE.getWiringType_WireOnElementNS()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return createElementSelectionSection("Wrie On Element", editingdomain, toolkit, parent, model, formEditor,
+ JavabeanPackage.eINSTANCE.getWiringType_WireOnElement(),
+ JavabeanPackage.Literals.WIRING_TYPE__WIRE_ON_ELEMENT_NS);
+ }
+
+ @Override
public boolean isBeanIDRefFieldFeature(EAttribute attribute) {
- if(attribute == JavabeanPackage.eINSTANCE.getWiringType_BeanIdRef()){
+ if (attribute == JavabeanPackage.eINSTANCE.getWiringType_BeanIdRef()) {
return true;
}
return super.isBeanIDRefFieldFeature(attribute);
@@ -51,17 +88,13 @@
@Override
public boolean isSelectorFeature(EAttribute attribute) {
- if(attribute == JavabeanPackage.eINSTANCE.getWiringType_WireOnElement()){
- return true;
- }
return super.isSelectorFeature(attribute);
}
@Override
public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
- SmooksMultiFormEditor formEditor) {
- return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature,
- formEditor);
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/jms/JmsRouterUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/jms/JmsRouterUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/jms/JmsRouterUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.jms;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -33,9 +36,10 @@
* org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
* org.eclipse.emf.ecore.EAttribute)
*/
- public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
-
+ public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
+
if (feature == JmsroutingPackage.eINSTANCE.getJmsRouter_BeanId()) {
}
if (feature == JmsroutingPackage.eINSTANCE.getJmsRouter_Destination()) {
@@ -50,4 +54,40 @@
return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return createElementSelectionSection("Route On Element", editingdomain, toolkit, parent, model, formEditor,
+ JmsroutingPackage.eINSTANCE.getJmsRouter_RouteOnElement(), JmsroutingPackage.eINSTANCE
+ .getJmsRouter_RouteOnElementNS());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
+ @Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == JmsroutingPackage.eINSTANCE.getJmsRouter_RouteOnElement()) {
+ return true;
+ }
+ if (feature == JmsroutingPackage.eINSTANCE.getJmsRouter_RouteOnElementNS()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ResourceConfigTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ResourceConfigTypeUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ResourceConfigTypeUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.smooks;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -41,8 +44,7 @@
if (feature == SmooksPackage.eINSTANCE.getResourceConfigType_Selector()) {
SmooksGraphicsExtType ext = formEditor.getSmooksGraphicsExt();
if (ext != null) {
- return SmooksUIUtils.createSelectorFieldEditor(toolkit, parent, propertyDescriptor, model,
- ext);
+ return SmooksUIUtils.createSelectorFieldEditor(toolkit, parent, propertyDescriptor, model, ext);
}
}
if (feature == SmooksPackage.eINSTANCE.getResourceConfigType_SelectorNamespace()) {
@@ -60,4 +62,40 @@
return super.isSelectorFeature(attribute);
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return createElementSelectionSection("Selector", editingdomain, toolkit, parent, model, formEditor,
+ SmooksPackage.eINSTANCE.getResourceConfigType_Selector(), SmooksPackage.eINSTANCE
+ .getResourceConfigType_SelectorNamespace());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
+ @Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == SmooksPackage.eINSTANCE.getResourceConfigType_Selector()) {
+ return true;
+ }
+ if (feature == SmooksPackage.eINSTANCE.getResourceConfigType_SelectorNamespace()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SmooksResourceListTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SmooksResourceListTypeUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/SmooksResourceListTypeUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.smooks;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -33,8 +36,9 @@
* org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
* org.eclipse.emf.ecore.EAttribute)
*/
- public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (feature == SmooksPackage.eINSTANCE.getSmooksResourceListType_AbstractReaderGroup()) {
}
if (feature == SmooksPackage.eINSTANCE.getSmooksResourceListType_AbstractResourceConfigGroup()) {
@@ -48,11 +52,45 @@
return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
@Override
- public boolean isSelectorFeature(EAttribute attribute) {
- if (attribute == SmooksPackage.eINSTANCE.getSmooksResourceListType_DefaultSelector()) {
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+
+ return createElementSelectionSection("Default Selector", editingdomain, toolkit, parent, model, formEditor,
+ SmooksPackage.eINSTANCE.getSmooksResourceListType_DefaultSelector(), SmooksPackage.eINSTANCE
+ .getSmooksResourceListType_DefaultSelectorNamespace());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
+ @Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == SmooksPackage.eINSTANCE.getSmooksResourceListType_DefaultSelector()) {
return true;
}
+ if (feature == SmooksPackage.eINSTANCE.getSmooksResourceListType_DefaultSelectorNamespace()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
+ @Override
+ public boolean isSelectorFeature(EAttribute attribute) {
return super.isSelectorFeature(attribute);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/XslUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/XslUICreator.java 2009-05-15 01:06:00 UTC (rev 15260)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/XslUICreator.java 2009-05-15 03:56:39 UTC (rev 15261)
@@ -10,7 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.xsl;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -34,23 +37,54 @@
* org.eclipse.emf.ecore.EAttribute)
*/
public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
- IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
- SmooksMultiFormEditor formEditor) {
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (feature == XslPackage.eINSTANCE.getXsl_ApplyBefore()) {
}
if (feature == XslPackage.eINSTANCE.getXsl_ApplyOnElementNS()) {
}
- return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature,
- formEditor);
+ return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
@Override
public boolean isSelectorFeature(EAttribute attribute) {
- if (attribute == XslPackage.eINSTANCE.getXsl_ApplyOnElement()) {
+ return super.isSelectorFeature(attribute);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return createElementSelectionSection("Apply On Element", editingdomain, toolkit, parent, model, formEditor,
+ XslPackage.Literals.XSL__APPLY_ON_ELEMENT, XslPackage.Literals.XSL__APPLY_ON_ELEMENT_NS);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
+ @Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == XslPackage.eINSTANCE.getXsl_ApplyOnElement()) {
return true;
}
- return super.isSelectorFeature(attribute);
+ if (feature == XslPackage.eINSTANCE.getXsl_ApplyOnElementNS()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
}
}
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r15260 - in trunk/jmx/releng: maps and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-05-14 21:06:00 -0400 (Thu, 14 May 2009)
New Revision: 15260
Added:
trunk/jmx/releng/maps/
trunk/jmx/releng/maps/jmx.map
trunk/jmx/releng/psfs/
trunk/jmx/releng/psfs/jmx.psf
trunk/jmx/releng/psfs/jmxAndAthena.psf
Log:
[JBDS-486] initial JMX component builder; requires o.moz.xpcom and o.e.swt.accessibility2 ?
Added: trunk/jmx/releng/maps/jmx.map
===================================================================
--- trunk/jmx/releng/maps/jmx.map (rev 0)
+++ trunk/jmx/releng/maps/jmx.map 2009-05-15 01:06:00 UTC (rev 15260)
@@ -0,0 +1,7 @@
+feature@org.jboss.tools.jmx.sdk.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.sdk.feature
+feature@org.jboss.tools.jmx.feature=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/features/org.jboss.tools.jmx.feature
+plugin@org.jboss.tools.jmx.core=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.core
+plugin@org.jboss.tools.jmx.ui=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/plugins/org.jboss.tools.jmx.ui
+plugin@org.jboss.tools.jmx.core.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.core.test
+plugin@org.jboss.tools.jmx.ui.test=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.ui.test
+plugin@org.jboss.tools.jmx.ui.test.interactive=SVN,,http://anonsvn.jboss.org/repos,,jbosstools/trunk/jmx/tests/org.jboss.tools.jmx.ui.test.interactive
Property changes on: trunk/jmx/releng/maps/jmx.map
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/releng/psfs/jmx.psf
===================================================================
--- trunk/jmx/releng/psfs/jmx.psf (rev 0)
+++ trunk/jmx/releng/psfs/jmx.psf 2009-05-15 01:06:00 UTC (rev 15260)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.tigris.subversion.subclipse.core.svnnature">
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/features/org.jboss.t..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/features/org.jboss.t..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/plugins/org.jboss.to..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/plugins/org.jboss.to..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/tests/org.jboss.tool..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/tests/org.jboss.tool..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/tests/org.jboss.tool..."/>
+</provider>
+</psf>
\ No newline at end of file
Property changes on: trunk/jmx/releng/psfs/jmx.psf
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/releng/psfs/jmxAndAthena.psf
===================================================================
--- trunk/jmx/releng/psfs/jmxAndAthena.psf (rev 0)
+++ trunk/jmx/releng/psfs/jmxAndAthena.psf 2009-05-15 01:06:00 UTC (rev 15260)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="org.tigris.subversion.subclipse.core.svnnature">
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/features/org.jboss.t..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/features/org.jboss.t..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/plugins/org.jboss.to..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/plugins/org.jboss.to..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/tests/org.jboss.tool..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/tests/org.jboss.tool..."/>
+<project reference="0.9.3,svn://svn.jboss.org/repos/jbosstools/trunk/jmx/tests/org.jboss.tool..."/>
+</provider>
+<provider id="org.eclipse.team.cvs.core.cvsnature">
+<project reference="1.0,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.commonbuilder.releng,org.eclipse.dash.common.releng"/>
+<project reference="1.0,:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse,org.eclipse.releng.basebuilder,org.eclipse.releng.basebuilder,R35_M6"/>
+</provider>
+</psf>
\ No newline at end of file
Property changes on: trunk/jmx/releng/psfs/jmxAndAthena.psf
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15259 - in trunk/jmx: features and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-05-14 21:04:03 -0400 (Thu, 14 May 2009)
New Revision: 15259
Added:
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/.project
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Entries
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Repository
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Root
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Template
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/build.properties
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.properties
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.xml
trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/license.html
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.cvsignore
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.project
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Entries
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Repository
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Root
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Template
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/build.properties
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.properties
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.xml
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/license.html
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Entries
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Repository
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Root
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Template
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Entries
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Repository
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Root
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Template
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.ini
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.mappings
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.properties
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/build.properties
trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/plugin.properties
trunk/jmx/releng/
trunk/jmx/releng/build.properties
trunk/jmx/releng/build.xml
trunk/jmx/releng/buildlog.latest.txt
trunk/jmx/releng/jbosstools-trunk jmx releng build.xml.launch
trunk/jmx/releng/testing.properties
Log:
[JBDS-486] initial JMX component builder; requires o.moz.xpcom and o.e.swt.accessibility2 ?
Added: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/.project
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/.project (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/.project 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jem.sdk-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Entries
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Entries (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Entries 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,7 @@
+/.project/1.1/Mon Apr 6 04:11:27 2009//
+/build.properties/1.1/Sat Apr 4 05:57:28 2009//
+/eclipse_update_120.jpg/1.1/Fri Jul 8 23:08:01 2005/-kb/
+/epl-v10.html/1.1/Wed Feb 16 14:25:48 2005//
+/feature.properties/1.3/Wed May 6 00:49:54 2009//
+/feature.xml/1.1/Sat Apr 4 06:00:34 2009//
+/license.html/1.1/Thu May 18 19:09:58 2006//
Added: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Repository
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Repository (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Repository 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1 @@
+org.eclipse.ve/features/org.eclipse.jem.sdk-feature
Added: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Root
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Root (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Root 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1 @@
+:ext:nickb@dev.eclipse.org:/cvsroot/tools
Added: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/CVS/Template
===================================================================
Added: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/build.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/build.properties (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/build.properties 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,4 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ license.html
+generate.feature(a)org.eclipse.jem.source=org.eclipse.jem
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.properties (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.properties 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,20 @@
+# properties file for org.jboss.tools.jmx
+featureName=JMX Console SDK
+featureProvider=JBoss, a division of Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+# "description" property - description of the feature
+description=eclipse-jmx is a JMX console which is used to manage Java applications through JMX and its RMI Connector. eclipse-jmx can be run from the Eclipse IDE.
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\nMarch 17, 2005\n\nUsage Of Content\n\nTHE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\nOTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\nUSE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\nAGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\nNOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\nAGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\nAND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\nOR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\nTERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\nOF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\nBELOW, THEN YOU MAY NOT USE THE CONTENT.\n\nApplicable Licenses\n\nUnless otherwise indicated, all Content made available by the Eclipse Foundation\nis provided to you under the terms and conditio!
ns of the Eclipse Public\nLicense Version 1.0 ("EPL"). A copy of the EPL is provided with this\nContent and is also available at http\://www.eclipse.org/legal/epl-v10.html.\nFor purposes of the EPL, "Program" will mean the Content.\n\nContent includes, but is not limited to, source code, object code,\ndocumentation and other files maintained in the Eclipse.org CVS\nrepository ("Repository") in CVS modules ("Modules") and made available\nas downloadable archives ("Downloads").\n\n- Content may be structured and packaged into modules to facilitate delivering,\nextending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\nplug-in fragments ("Fragments"), and features ("Features").\n- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\nin a directory named "plugins".\n- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\nEach Feature may be packaged as a sub-directory in a directory!
named "features".\nWithin a Feature, files named "feature.xml" may co
ntain a list of the names and version\nnumbers of the Plug-ins and/or Fragments associated with that Feature.\n- Features may also include other Features ("Included Features"). Within a Feature, files\nnamed "feature.xml" may contain a list of the names and version numbers of Included Features.\n\nFeatures may also include other Features ("Included Features"). Files named\n"feature.xml" may contain a list of the names and version numbers of\nIncluded Features.\n\nThe terms and conditions governing Plug-ins and Fragments should be\ncontained in files named "about.html" ("Abouts"). The terms and\nconditions governing Features and Included Features should be contained\nin files named "license.html" ("Feature Licenses"). Abouts and Feature\nLicenses may be located in any directory of a Download or Module\nincluding, but not limited to the following locations\:\n\n- The top-level (root) directory\n- Plug-in and Fragment directories\n- Inside Plug-ins and Fragments packaged as JAR!
s\n- Sub-directories of the directory named "src" of certain Plug-ins\n- Feature directories\n\nNote\: if a Feature made available by the Eclipse Foundation is installed using the\nEclipse Update Manager, you must agree to a license ("Feature Update\nLicense") during the installation process. If the Feature contains\nIncluded Features, the Feature Update License should either provide you\nwith the terms and conditions governing the Included Features or inform\nyou where you can locate them. Feature Update Licenses may be found in\nthe "license" property of files named "feature.properties". Such Abouts,\nFeature Licenses and Feature Update Licenses contain the terms and\nconditions (or references to such terms and conditions) that govern your\nuse of the associated Content in that directory.\n\nTHE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\nTO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\nSOME OF THESE OTHER LICENSE AGREEMENTS MA!
Y INCLUDE (BUT ARE NOT LIMITED TO)\:\n\n- Common Public License Versio
n 1.0 (available at http\://www.eclipse.org/legal/cpl-v10.html)\n- Apache Software License 1.1 (available at http\://www.apache.org/licenses/LICENSE)\n- Apache Software License 2.0 (available at http\://www.apache.org/licenses/LICENSE-2.0)\n- IBM Public License 1.0 (available at http\://oss.software.ibm.com/developerworks/opensource/license10.html)\n- Metro Link Public License 1.00 (available at http\://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n- Mozilla Public License Version 1.1 (available at http\://www.mozilla.org/MPL/MPL-1.1.html)\n\nIT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\nTO USE OF THE CONTENT. If no About, Feature License or Feature Update License\nis provided, please contact the Eclipse Foundation to determine what terms and conditions\ngovern that particular Content.\n\nCryptography\n\nContent may contain encryption software. The country in which you are\ncurrently may have restrictions on the import, posse!
ssion, and use,\nand/or re-export to another country, of encryption software. BEFORE\nusing any encryption software, please check the country's laws,\nregulations and policies concerning the import, possession, or use,\nand re-export of encryption software, to see if this is permitted.\n\nJava and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.xml
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.xml (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.xml 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.jmx.sdk.feature"
+ label="%featureName"
+ version="0.2.2.qualifier"
+ provider-name="%featureProvider">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ JBoss, Home of Professional Open Source
+Copyright 2006-2009, JBoss, a division of Red Hat, and individual contributors as indicated
+by the @authors tag. See the copyright.txt in the distribution
+for a full listing of individual contributors.
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="%updateSiteName" url="http://download.jboss.org/jbosstools/updates/stable/"/>
+ </url>
+
+ <includes
+ id="org.jboss.tools.jmx"
+ version="0.0.0"/>
+
+ <includes
+ id="org.jboss.tools.jmx.source"
+ version="0.0.0"/>
+
+</feature>
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/feature.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/license.html
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/license.html (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/license.html 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+<title>Eclipse.org Software User Agreement</title>
+</head>
+
+<body lang="EN-US" link=blue vlink=purple>
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>March 17, 2005</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
+ modules ("Modules") and made available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
+</body>
+</html>
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.sdk.feature/license.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.cvsignore
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.cvsignore (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.cvsignore 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1 @@
+build.xml
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.cvsignore
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.project
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.project (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.project 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ve.tests-feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Entries
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Entries (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Entries 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,10 @@
+/.cvsignore/1.1/Tue Oct 28 16:22:07 2003//
+/.project/1.1/Tue Oct 28 16:22:07 2003//
+/build.properties/1.6/Thu May 18 14:32:43 2006//
+/eclipse_update_120.jpg/1.2/Fri Jul 8 23:07:57 2005/-kb/
+/epl-v10.html/1.1/Wed Feb 16 14:25:38 2005//
+/feature.properties/1.9/Sat Apr 4 05:44:59 2009//
+/feature.xml/1.27/Thu Apr 9 18:33:34 2009//
+/license.html/1.4/Thu May 18 19:09:59 2006//
+D/rootfiles////
+D/sourceTemplatePlugin////
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Repository
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Repository (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Repository 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1 @@
+org.eclipse.ve/features/org.eclipse.ve.tests-feature
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Root
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Root (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Root 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1 @@
+:ext:nickb@dev.eclipse.org:/cvsroot/tools
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/CVS/Template
===================================================================
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/build.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/build.properties (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/build.properties 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,5 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ license.html
+generate.plugin(a)org.eclipse.ve.tests.source=org.eclipse.ve.tests
+root=rootfiles
\ No newline at end of file
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.properties (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.properties 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,21 @@
+# properties file for org.jboss.tools.jmx.*.test*
+featureName=JMX Console Tests
+featureProvider=JBoss, a division of Red Hat
+
+# "updateSiteName" property - label for the update site
+updateSiteName=JBossTools Update Site
+
+# "description" property - description of the feature
+description=eclipse-jmx is a JMX console which is used to manage Java applications through JMX and its RMI Connector. eclipse-jmx can be run from the Eclipse IDE.
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT\nMarch 17, 2005\n\nUsage Of Content\n\nTHE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\nOTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\nUSE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\nAGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\nNOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\nAGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\nAND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\nOR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\nTERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\nOF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\nBELOW, THEN YOU MAY NOT USE THE CONTENT.\n\nApplicable Licenses\n\nUnless otherwise indicated, all Content made available by the Eclipse Foundation\nis provided to you under the terms and conditio!
ns of the Eclipse Public\nLicense Version 1.0 ("EPL"). A copy of the EPL is provided with this\nContent and is also available at http\://www.eclipse.org/legal/epl-v10.html.\nFor purposes of the EPL, "Program" will mean the Content.\n\nContent includes, but is not limited to, source code, object code,\ndocumentation and other files maintained in the Eclipse.org CVS\nrepository ("Repository") in CVS modules ("Modules") and made available\nas downloadable archives ("Downloads").\n\n- Content may be structured and packaged into modules to facilitate delivering,\nextending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\nplug-in fragments ("Fragments"), and features ("Features").\n- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java? ARchive)\nin a directory named "plugins".\n- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\nEach Feature may be packaged as a sub-directory in a directory!
named "features".\nWithin a Feature, files named "feature.xml" may co
ntain a list of the names and version\nnumbers of the Plug-ins and/or Fragments associated with that Feature.\n- Features may also include other Features ("Included Features"). Within a Feature, files\nnamed "feature.xml" may contain a list of the names and version numbers of Included Features.\n\nFeatures may also include other Features ("Included Features"). Files named\n"feature.xml" may contain a list of the names and version numbers of\nIncluded Features.\n\nThe terms and conditions governing Plug-ins and Fragments should be\ncontained in files named "about.html" ("Abouts"). The terms and\nconditions governing Features and Included Features should be contained\nin files named "license.html" ("Feature Licenses"). Abouts and Feature\nLicenses may be located in any directory of a Download or Module\nincluding, but not limited to the following locations\:\n\n- The top-level (root) directory\n- Plug-in and Fragment directories\n- Inside Plug-ins and Fragments packaged as JAR!
s\n- Sub-directories of the directory named "src" of certain Plug-ins\n- Feature directories\n\nNote\: if a Feature made available by the Eclipse Foundation is installed using the\nEclipse Update Manager, you must agree to a license ("Feature Update\nLicense") during the installation process. If the Feature contains\nIncluded Features, the Feature Update License should either provide you\nwith the terms and conditions governing the Included Features or inform\nyou where you can locate them. Feature Update Licenses may be found in\nthe "license" property of files named "feature.properties". Such Abouts,\nFeature Licenses and Feature Update Licenses contain the terms and\nconditions (or references to such terms and conditions) that govern your\nuse of the associated Content in that directory.\n\nTHE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER\nTO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\nSOME OF THESE OTHER LICENSE AGREEMENTS MA!
Y INCLUDE (BUT ARE NOT LIMITED TO)\:\n\n- Common Public License Versio
n 1.0 (available at http\://www.eclipse.org/legal/cpl-v10.html)\n- Apache Software License 1.1 (available at http\://www.apache.org/licenses/LICENSE)\n- Apache Software License 2.0 (available at http\://www.apache.org/licenses/LICENSE-2.0)\n- IBM Public License 1.0 (available at http\://oss.software.ibm.com/developerworks/opensource/license10.html)\n- Metro Link Public License 1.00 (available at http\://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n- Mozilla Public License Version 1.1 (available at http\://www.mozilla.org/MPL/MPL-1.1.html)\n\nIT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\nTO USE OF THE CONTENT. If no About, Feature License or Feature Update License\nis provided, please contact the Eclipse Foundation to determine what terms and conditions\ngovern that particular Content.\n\nCryptography\n\nContent may contain encryption software. The country in which you are\ncurrently may have restrictions on the import, posse!
ssion, and use,\nand/or re-export to another country, of encryption software. BEFORE\nusing any encryption software, please check the country's laws,\nregulations and policies concerning the import, possession, or use,\nand re-export of encryption software, to see if this is permitted.\n\nJava and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.\n
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
+
\ No newline at end of file
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.xml
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.xml (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.xml 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.jmx.tests"
+ label="%featureName"
+ version="0.2.2.qualifier"
+ provider-name="%featureProvider"
+ image="eclipse_update_120.jpg">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="%updateSiteName" url="http://download.jboss.org/jbosstools/updates/stable/"/>
+ </url>
+
+ <requires>
+ <import plugin="org.junit" version="3.8.1" match="compatible"/>
+ <import plugin="org.eclipse.core.runtime" version="3.3.0" match="compatible"/>
+ <import plugin="org.eclipse.core.resources" version="3.3.0" match="compatible"/>
+ <import plugin="org.eclipse.ant.core" version="3.1.100" match="compatible"/>
+ <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/>
+ <import plugin="org.eclipse.debug.core" version="3.2.0" match="compatible"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.ant.optional.junit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"/>
+
+ <plugin
+ id="org.eclipse.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jmx.core.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jmx.ui.test"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.jmx.ui.test.interactive"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/feature.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/license.html
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/license.html (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/license.html 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,79 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
+<title>Eclipse.org Software User Agreement</title>
+</head>
+
+<body lang="EN-US" link=blue vlink=purple>
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>March 17, 2005</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ ("EPL"). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository ("Repository") in CVS
+ modules ("Modules") and made available as downloadable archives ("Downloads").</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and
+Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named "src" of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license ("Feature Update License") during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
+</body>
+</html>
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/license.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Entries
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Entries (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Entries 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,2 @@
+/epl-v10.html/1.1/Thu May 18 14:32:43 2006//
+/notice.html/1.1/Thu May 18 14:32:43 2006//
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Repository
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Repository (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Repository 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1 @@
+org.eclipse.ve/features/org.eclipse.ve.tests-feature/rootfiles
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Root
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Root (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Root 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1 @@
+:ext:nickb@dev.eclipse.org:/cvsroot/tools
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/rootfiles/CVS/Template
===================================================================
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Entries
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Entries (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Entries 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,7 @@
+/about.html/1.4/Fri May 5 18:04:14 2006//
+/about.ini/1.2/Thu May 18 14:32:43 2006//
+/about.mappings/1.1/Mon Nov 3 19:16:21 2003/-kb/
+/about.properties/1.7/Thu May 18 19:09:59 2006//
+/build.properties/1.6/Thu May 18 14:32:43 2006//
+/eclipse32.png/1.1/Thu May 18 14:32:43 2006/-kb/
+/plugin.properties/1.4/Wed Aug 24 23:54:35 2005//
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Repository
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Repository (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Repository 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1 @@
+org.eclipse.ve/features/org.eclipse.ve.tests-feature/sourceTemplatePlugin
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Root
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Root (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Root 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1 @@
+:ext:nickb@dev.eclipse.org:/cvsroot/tools
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/CVS/Template
===================================================================
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.ini
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.ini (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.ini 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,29 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+#featureImage=eclipse32.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (translated)
+# needed for primary features only
+
+# Property "welcomePage" contains path to welcome page (special XML-based format)
+# optional
+
+# Property "welcomePerspective" contains the id of the perspective in which the
+# welcome page is to be opened.
+# optional
+
+
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.ini
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.mappings
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.mappings (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.mappings 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,6 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@
\ No newline at end of file
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.properties (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.properties 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,7 @@
+blurb=JMX Console Tests Source\n\
+\n\
+Version: {featureVersion}\n\
+Build id: {0}\n\
+\n\
+(c) Copyright Red Hat contributors and others, 2009. All rights reserved.\n\
+Visit http://www.jboss.org/tools
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/about.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/build.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/build.properties (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/build.properties 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,5 @@
+bin.includes = plugin.*,\
+ about.*,\
+ src/,\
+ META-INF/
+sourcePlugin = true
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/plugin.properties
===================================================================
--- trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/plugin.properties (rev 0)
+++ trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/plugin.properties 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,3 @@
+pluginName = JMX Console Tests Source
+providerName = JBoss, a division of Red Hat
+
Property changes on: trunk/jmx/features/org.jboss.tools.jmx.tests.feature/sourceTemplatePlugin/plugin.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/releng/build.properties
===================================================================
--- trunk/jmx/releng/build.properties (rev 0)
+++ trunk/jmx/releng/build.properties 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,50 @@
+## BEGIN PROJECT BUILD PROPERTIES ##
+
+thirdPartyDownloadLicenseAcceptance="I accept"
+
+projectid=jbosstools.jmx
+zipPrefix=JMX
+incubation=
+buildType=N
+version=0.2.2
+
+mainFeatureToBuildID=org.jboss.tools.jmx.sdk.feature
+testFeatureToBuildID=org.jboss.tools.jmx.test.feature
+
+build.steps=buildUpdate,buildTests,generateDigests,test,publish,cleanup
+
+# Re-use local sources?
+localSourceCheckoutDir=/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx
+relengBuilderDir=/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx/releng
+relengBaseBuilderDir=/home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder
+relengCommonBuilderDir=/home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng
+
+JAVA_HOME=/usr/lib/jvm/java
+JAVA50_HOME=/usr/lib/jvm/java
+
+dependencyURLs=\
+http://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops/S-3.5M7-200904302300/eclipse-SDK-3.5M7-linux-gtk.tar.gz
+#,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops/S-3.5M7-200904302300/eclipse-SDK-3.5M7-win32.zip,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops/S-3.5M7-200904302300/eclipse-SDK-3.5M7-linux-gtk-x86_64.tar.gz,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops/S-3.5M7-200904302300/eclipse-SDK-3.5M7-macosx-carbon.tar.gz,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/tools/gef/downloads/drops/3.5.0/S200905011522/GEF-runtime-3.5.0M7.zip,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/birt/downloads/drops/M-R1-2.5M7-200905061338/birt-report-framework-2.5M7.zip,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/birt/downloads/drops/M-R1-2.5M7-200905061338/birt-wtp-integration-sdk-2.5M7.zip,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/datatools/downloads/drops/N_DTP_1.7/dtp-1.7.0M7-200905052200.zip,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/modeling/emf/emf/downloads/drops/2.5.0/S200905041408/emf-runtime-2.5.0M7.zip,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/tptp/4.6.0/TPTP-4.6.0M7-200904260100/tptp.runtime-TPTP-4.6.0M7.zip,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/webtools/downloads/drops/R3.1/S-3.1M7-20090505073946/wtp-S-3.1M7-20090505073946.zip,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/webtools/downloads/drops/R3.1/S-3.1M7-20090505073946/wtp-jpt-S-3.1M7-20090505073946.zip,\
+#http://www.eclipse.org/downloads/download.php?r=1&file=/modeling/emf/emf/downloads/drops/2.5.0/S200905041408/xsd-runtime-2.5.0M7.zip
+
+domainNamespace=*
+projNamespace=org.jboss.tools.jmx
+projRelengName=org.jboss.tools.jmx.releng
+
+# needed for Hudson, not for local?
+#projRelengRoot=svn://svn.jboss.org/repos/jbosstools/trunk/jmx
+#projRelengPath=releng
+#basebuilderBranch=R35_M6
+
+## END PROJECT BUILD PROPERTIES ##
Property changes on: trunk/jmx/releng/build.properties
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/releng/build.xml
===================================================================
--- trunk/jmx/releng/build.xml (rev 0)
+++ trunk/jmx/releng/build.xml 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,55 @@
+<project default="run" name="org.jboss.tools.jmx.releng/build.xml - Run a JMX build using the Athena CBI">
+ <target name="run">
+ <!--
+ 1. You must check out the following projects to your workspace:
+
+ org.eclipse.releng.basebuilder
+ org.eclipse.dash.common.releng
+ org.eclipse.myproject.releng
+
+ 2. You must provide Ant-Contrib in one of four places:
+
+ org.eclipse.dash.common.releng/lib/ant-contrib.jar
+ org.eclipse.myproject.releng/lib/ant-contrib.jar
+ ${thirdPartyJarsDir}/ant-contrib.jar (path can be customized below)
+ /usr/share/java/ant-contrib.jar (may require a symlink)
+
+ You can install Ant-Contrib via RPM, or download it here:
+
+ http://sourceforge.net/project/showfiles.php?group_id=36177&package_id=28636
+
+ 3. If your project's sources are in SVN, you must unpack this zip into the basebuilder project's plugins/ folder:
+
+ http://downloads.sourceforge.net/svn-pde-build/org.eclipse.pde.build.svn-...
+ -->
+
+ <!-- load properties and set timestamp for the build -->
+ <property file="build.properties" />
+ <tstamp>
+ <format property="buildTimestamp" pattern="yyyyMMddHHmm" />
+ </tstamp>
+
+ <!-- calculate workspaceDir as parent of this folder, the project's .releng folder (relengBuilderDir) -->
+ <property name="relengBuilderDir" value="${basedir}" />
+ <dirname file="${relengBuilderDir}" property="workspaceDir" />
+
+ <!--
+ can build in /tmp, eg., in /tmp/build, or in workspace, eg.,
+ ${relengBuilderDir}/build
+ -->
+ <property name="writableBuildRoot" value="/tmp/build" />
+
+ <!--
+ can be simple path, eg.,
+ ${writableBuildRoot}/${buildType}${buildTimestamp} or longer, eg.,
+ ${writableBuildRoot}/${topprojectName}/${projectName}/downloads/drops/${version}/${buildType}${buildTimestamp} or
+ ${writableBuildRoot}/${topprojectName}/${projectName}/${subprojectName}/downloads/drops/${version}/${buildType}${buildTimestamp}
+ -->
+ <property name="buildDir" value="${writableBuildRoot}/${buildType}${buildTimestamp}-${zipPrefix}" />
+
+ <!-- invoke a new Eclipse process and launch the build from the common.releng folder -->
+ <property name="relengCommonBuilderDir" value="${workspaceDir}/org.eclipse.dash.common.releng" />
+ <ant antfile="${relengCommonBuilderDir}/buildAll.xml" target="runEclipse" dir="${relengCommonBuilderDir}" />
+
+ </target>
+</project>
Property changes on: trunk/jmx/releng/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/releng/buildlog.latest.txt
===================================================================
--- trunk/jmx/releng/buildlog.latest.txt (rev 0)
+++ trunk/jmx/releng/buildlog.latest.txt 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,388 @@
+Buildfile: /home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx/releng/build.xml
+run:
+runEclipse:
+ [mkdir] Created dir: /tmp/build/N200905142058-JMX/eclipse
+check.ant-contrib:
+get.pde.build.svn:
+get.ant4eclipse:
+ [echo] Run /usr/lib/jvm/java/bin/java
+ [echo] -enableassertions
+ [echo] -jar /home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder/plugins/org.eclipse.equinox.launcher_1.0.200.v20090306-1900.jar
+ [echo] -application org.eclipse.ant.core.antRunner
+ [echo] -f /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml run
+ [echo] -Dprojectid=jbosstools.jmx -DbuildTimestamp=200905142058 -DbuildType=N -Dversion=0.2.2 -DwritableBuildRoot=/tmp/build -DdownloadsDir=/tmp/build/downloads -DthirdPartyJarsDir=/tmp/build/3rdPartyJars -DbuildDir=/tmp/build/N200905142058-JMX -DrelengBuilderDir=/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx/releng -DrelengCommonBuilderDir=/home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng -DrelengBaseBuilderDir=/home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder -DJAVA_HOME=/usr/lib/jvm/java -DdependencyURLs=http://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops/S-3.5M7-200904302300/eclipse-SDK-3.5M7-linux-gtk.tar.gz -DlocalSourceCheckoutDir=/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx
+ [build] Buildfile: /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml
+ [build] init:
+ [build] check.ant-contrib:
+ [build] init:
+ [build] genBuildCfgInit:
+ [build] Trying to override old definition of task echo-timestamp
+ [build] projectid2names:
+ [build] genBuildCfg:
+ [build] Trying to override old definition of task echo-timestamp
+ [build] createBuildConfigFile:
+ [build] [echo] Created /tmp/build/N200905142058-JMX/build.cfg
+ [build] Trying to override old definition of task echo-timestamp
+ [build] collectURLs:
+ [build] getZip:
+ [build] [echo] Found 1 dependency URLs
+ [build] [echo] Load properties from /tmp/build/N200905142058-JMX/build.cfg
+ [build] create.label.properties:
+ [build] [echo] subprojectName = jmx
+ [build] [echo] Base OS: linux; Base Window System: gtk
+ [build] collectMaps:
+ [build] run:
+ [build] [echo] Get pde.build.svn
+ [build] get.pde.build.svn:
+ [build] [echo] Get ant4eclipse
+ [build] get.ant4eclipse:
+ [build] [echo] buildAll.xml#run :: build.step :: buildUpdate
+ [build] buildUpdate:
+ [build] buildMasterZip:
+ [build] -timestamp:
+ [build] [echo] 08:58:30
+ [build] init:
+ [build] main:
+ [build] main:
+ [build] preBuild:
+ [build] preSetup:
+ [build] [mkdir] Created dir: /tmp/build/N200905142058-JMX/eclipse/N200905142058
+ [build] copyLocalSourceCheckout:
+ [build] [copy] Copying 142 files to /tmp/build/N200905142058-JMX/eclipse/plugins
+ [build] [copy] Copying 67 files to /tmp/build/N200905142058-JMX/eclipse/plugins
+ [build] getMapFiles:
+ [build] [copy] Copying 1 file to /tmp/build/N200905142058-JMX/eclipse
+ [build] postSetup:
+ [build] [echo] Download, then unpack Eclipse ...
+ [build] init:
+ [build] stripVersionsDef:
+ [build] getDependency:
+ [build] getBundle:
+ [build] downloadFile:
+ [build] unpackBundle:
+ [build] unzipFile:
+ [build] untarFile:
+ [build] [untar] Expanding: /tmp/build/downloads/eclipse-SDK-3.5M7-linux-gtk.tar.gz into /tmp/build/N200905142058-JMX
+ [build] unpackDocISV:
+ [build] processRepos:
+ [build] fetch:
+ [build] generate:
+ [build] preGenerate:
+ [build] allElements:
+ [build] allElementsDelegator:
+ [build] init:
+ [build] generateScript:
+ [build] [eclipse.buildScript] Some inter-plug-in dependencies have not been satisfied.
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.filesystem:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.filesystem_1.2.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.frameworkadmin:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.frameworkadmin_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.jboss.tools.jmx.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.jboss.tools.jmx.ui_0.2.2
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.intro:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.intro_3.3.0.v20090429_1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.launching:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.launching_3.5.0.v20090429
+ [build] [eclipse.buildScript] Bundle org.eclipse.update.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.update.core_3.2.300.v20090429-1625
+ [build] [eclipse.buildScript] Bundle org.eclipse.ant.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ant.core_3.2.100.v20090429
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.metadata.generator:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.metadata.generator_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.browser:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.browser_3.2.300.v20090413
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.jarprocessor:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.jarprocessor_1.0.1.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.console:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.console_3.4.0.v20090429
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.intro.universal:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.intro.universal_3.2.300.v20090429_1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.ui.sdk:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.ui.sdk_1.0.100.v20090430-0100
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.app:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.app_1.2.0.v20090429-1630
+ [build] [eclipse.buildScript] Bundle org.eclipse.sdk:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.sdk_3.5.0.v200904302300
+ [build] [eclipse.buildScript] Bundle org.eclipse.swt.gtk.linux.x86:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.swt.gtk.linux.x86_3.5.0.v3545a
+ [build] [eclipse.buildScript] Bundle org.eclipse.platform:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.platform_3.3.200.v200904302300
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.publisher:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.publisher_1.0.0.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde_3.4.100.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.build:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.build_3.5.0.v20090430-1420
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.debug:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.debug_3.5.0.v20090429
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.api.tools:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.api.tools_1.0.100.v20090430-1530
+ [build] [eclipse.buildScript] Bundle org.eclipse.compare:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.compare_3.5.0.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.runtime:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.runtime_3.5.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.jboss.tools.jmx.ui.test.interactive:
+ [build] [eclipse.buildScript] Another singleton version selected: org.jboss.tools.jmx.ui.test.interactive_0.2.2
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.junit.runtime:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.junit.runtime_3.4.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.registry:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.registry_3.4.100.v20090429-1630
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.externaltools:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.externaltools_3.2.0.v20090429
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.junit:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.junit_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.common:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.common_3.5.0.v20090429-1630
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.views.properties.tabbed:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.views.properties.tabbed_3.5.0.I20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.repository.tools:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.repository.tools_1.0.0.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.net:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.net_1.2.0.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.touchpoint.eclipse:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.touchpoint.eclipse_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.core.manipulation:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.core.manipulation_1.3.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.debug.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.debug.ui_3.5.0.v20090430-1530
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.ua.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ua.ui_1.0.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.apt.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.apt.ui_3.3.200.v20090429-1720
+ [build] [eclipse.buildScript] Bundle org.eclipse.help:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help_3.4.0.v20090429_1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.exemplarysetup:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.exemplarysetup_1.0.0.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.views:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.views_3.4.0.I20090421-0800
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ui_3.5.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.ecf.filetransfer:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf.filetransfer_3.0.0.v20090429-2045
+ [build] [eclipse.buildScript] Bundle org.eclipse.team.cvs.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.cvs.core_3.3.200.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.jobs:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.jobs_3.4.100.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.variables:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.variables_3.2.200.v20090428
+ [build] [eclipse.buildScript] Bundle org.eclipse.team.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.ui_3.5.0.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.compiler.tool:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.compiler.tool_1.0.100.v_955
+ [build] [eclipse.buildScript] Bundle org.eclipse.help.webapp:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help.webapp_3.4.0.v20090429_1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.rcp:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.rcp_3.4.0.v20080507
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.console:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.console_1.0.0.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.api.tools.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.api.tools.ui_1.0.100.v20090430-1530
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.debug.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.debug.ui_3.4.0.v20090429
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.core_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui_3.5.0.I20090430-0800
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.contenttype:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.contenttype_3.4.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.jsch.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jsch.ui_1.1.200.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.core_3.5.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.preferences:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.preferences_3.2.300.v20090429-1630
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.http.registry:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.http.registry_1.0.200.v20090429-1630
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.junit4.runtime:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.junit4.runtime_1.1.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.simpleconfigurator.manipulator:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.simpleconfigurator.manipulator_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.doc.user:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.doc.user_3.3.0.v20090430-1445
+ [build] [eclipse.buildScript] Bundle org.jboss.tools.jmx.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.jboss.tools.jmx.core_0.2.1
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.metadata:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.metadata_1.0.0.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.update.scheduler:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.update.scheduler_3.2.200.v20081127
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.ds.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ds.ui_1.0.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.navigator.resources:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.navigator.resources_3.4.0.I20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.apt.pluggable.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.apt.pluggable.core_1.0.200.v20090429-1720
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.updatesite:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.updatesite_1.0.100.v20090430-1645
+ [build] [eclipse.buildScript] Bundle com.ibm.icu:
+ [build] [eclipse.buildScript] Another singleton version selected: com.ibm.icu_4.0.1.v20090415
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.directorywatcher:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.directorywatcher_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.ua.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ua.core_1.0.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.artifact.repository:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.artifact.repository_1.0.100.v20090430-2300
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.ds:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.ds_1.1.0.v20090429-1630
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.garbagecollector:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.garbagecollector_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.junit.runtime:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.junit.runtime_3.4.100.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.platform.doc.isv:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.platform.doc.isv_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.workbench:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.workbench_3.5.0.I20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.simpleconfigurator:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.simpleconfigurator_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.ltk.ui.refactoring:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ltk.ui.refactoring_3.4.100.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.update.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.update.ui_3.2.200.v20090213
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.director.app:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.director.app_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.team.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.core_3.5.0.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.cvs:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.cvs_1.0.100.v20090123
+ [build] [eclipse.buildScript] Bundle org.eclipse.ecf.provider.filetransfer.httpclient.ssl:
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.reconciler.dropins:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.reconciler.dropins_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.compiler.apt:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.compiler.apt_1.0.200.v20090429-1720
+ [build] [eclipse.buildScript] Bundle org.eclipse.help.base:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help.base_3.4.0.v20090429_1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.core_3.5.0.v_955
+ [build] [eclipse.buildScript] Bundle org.eclipse.ecf.provider.filetransfer:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf.provider.filetransfer_3.0.0.v20090429-2045
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.doc.user:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.doc.user_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.net.linux.x86:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.net.linux.x86_1.1.0.I20081021
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.workbench.texteditor:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.workbench.texteditor_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.ecf.provider.filetransfer.ssl:
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.resources.compatibility:
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.ui.templates:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ui.templates_3.4.100.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.jsch.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jsch.core_1.1.100.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.team.cvs.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.cvs.ui_3.3.200.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.expressions:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.expressions_3.4.100.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.navigator:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.navigator_3.4.0.I20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.engine:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.engine_1.0.100.v20090430-0100
+ [build] [eclipse.buildScript] Bundle org.eclipse.osgi:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.osgi_3.5.0.v20090429-1630
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.filebuffers:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.filebuffers_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.runtime.compatibility:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.runtime.compatibility_3.2.0.v20090413
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.ui_3.5.0.v20090430-0800
+ [build] [eclipse.buildScript] Bundle org.eclipse.ecf:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf_3.0.0.v20090429-2045
+ [build] [eclipse.buildScript] Bundle org.eclipse.platform.doc.user:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.platform.doc.user_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.cheatsheets:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.cheatsheets_3.3.200.v20090413
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.workbench.compatibility:
+ [build] [eclipse.buildScript] Bundle org.jboss.tools.jmx.ui.test:
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.resources:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.resources_3.5.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.security:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.security_1.0.100.v20090429-1630
+ [build] [eclipse.buildScript] Bundle org.eclipse.team.cvs.ssh2:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.team.cvs.ssh2_3.2.200.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.security.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.security.ui_1.0.100.v20090429-1630
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.ds.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.ds.core_1.0.0.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.net:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.net_1.2.0.I20090430-0408
+ [build] [eclipse.buildScript] Bundle org.eclipse.search:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.search_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.editors:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.editors_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.ui_1.0.100.v20090430-0100
+ [build] [eclipse.buildScript] Bundle org.eclipse.ant.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ant.ui_3.4.0.v20090429
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.launcher.gtk.linux.x86:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090306-1900
+ [build] [eclipse.buildScript] Bundle org.eclipse.ecf.provider.filetransfer.httpclient:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf.provider.filetransfer.httpclient_3.0.0.v20090429-2045
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.touchpoint.natives:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.touchpoint.natives_1.0.0.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.update.core.linux:
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.views.log:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.views.log_1.0.100.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.doc.isv:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.doc.isv_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.extensionlocation:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.extensionlocation_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.presentations.r21:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.presentations.r21_3.2.100.I20081007-0800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.metadata.repository:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.metadata.repository_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.ide.application:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.ide.application_1.0.100.I20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.jdt.apt.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.jdt.apt.core_3.3.200.v20090429-1720
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.updatechecker:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.updatechecker_1.1.0.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.help.ui:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help.ui_3.4.0.v20090429_1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.ecf.identity:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ecf.identity_3.0.0.v20090429-2045
+ [build] [eclipse.buildScript] Bundle org.eclipse.ltk.core.refactoring:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ltk.core.refactoring_3.5.0.v20090429-1800b
+ [build] [eclipse.buildScript] Bundle org.eclipse.debug.core:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.debug.core_3.5.0.v20090429
+ [build] [eclipse.buildScript] Bundle org.eclipse.pde.runtime:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.pde.runtime_3.4.100.v20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.ui.sdk.scheduler:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.ui.sdk.scheduler_1.0.0.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.update.configurator:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.update.configurator_3.3.0.v20090312
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.director:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.director_1.0.100.v20090429-2126
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.runtime.compatibility.registry:
+ [build] [eclipse.buildScript] Bundle org.eclipse.swt:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.swt_3.5.0.v3545a
+ [build] [eclipse.buildScript] Unsatisfied import package org.eclipse.swt.accessibility2_0.0.0.
+ [build] [eclipse.buildScript] Unsatisfied import package org.mozilla.xpcom_0.0.0.
+ [build] [eclipse.buildScript] Bundle org.eclipse.ui.ide:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.ui.ide_3.5.0.I20090429-1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.help.appserver:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.help.appserver_3.1.400.v20090429_1800
+ [build] [eclipse.buildScript] Bundle org.eclipse.ecf.ssl:
+ [build] [eclipse.buildScript] Bundle org.eclipse.core.filesystem.linux.x86:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.core.filesystem.linux.x86_1.2.0.v20080604-1400
+ [build] BUILD FAILED
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.p2.repository:
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml:309: The following error occurred while executing this line:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.p2.repository_1.0.0.v20090430-1645
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml:346: The following error occurred while executing this line:
+ [build] [eclipse.buildScript] Bundle org.eclipse.equinox.frameworkadmin.equinox:
+ [build] [eclipse.buildScript] Another singleton version selected: org.eclipse.equinox.frameworkadmin.equinox_1.0.100.v20090429-2126
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml:522: The following error occurred while executing this line:
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/tools/scripts/buildAllHelper.xml:775: The following error occurred while executing this line:
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/build.xml:24: The following error occurred while executing this line:
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder/plugins/org.eclipse.pde.build_3.5.0.v20090330/scripts/build.xml:25: The following error occurred while executing this line:
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder/plugins/org.eclipse.pde.build_3.5.0.v20090330/scripts/build.xml:77: The following error occurred while executing this line:
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/builder/all/customTargets.xml:12: The following error occurred while executing this line:
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/builder/all/allElements.xml:16: The following error occurred while executing this line:
+ [build] /home/nboldt/eclipse/workspace-jboss/org.eclipse.releng.basebuilder/plugins/org.eclipse.pde.build_3.5.0.v20090330/scripts/genericTargets.xml:96: Unable to find feature: org.jboss.tools.jmx.sdk.feature.
+ [build] Total time: 24 seconds
+
+BUILD FAILED
+/home/nboldt/eclipse/workspace-jboss/jbosstools-trunk/jmx/releng/build.xml:52: The following error occurred while executing this line:
+/home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml:269: The following error occurred while executing this line:
+/home/nboldt/eclipse/workspace-jboss/org.eclipse.dash.common.releng/buildAll.xml:288: Java returned: 13
+
+Total time: 28 seconds
Property changes on: trunk/jmx/releng/buildlog.latest.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/releng/jbosstools-trunk jmx releng build.xml.launch
===================================================================
--- trunk/jmx/releng/jbosstools-trunk jmx releng build.xml.launch (rev 0)
+++ trunk/jmx/releng/jbosstools-trunk jmx releng build.xml.launch 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
+<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${container}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/jbosstools-trunk/jmx/releng/build.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="${workspace_loc:/jbosstools-trunk/jmx/releng}/buildlog.latest.txt"/>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jbosstools-trunk"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="java-1.6.0-openjdk-1.6.0.0"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/jbosstools-trunk/jmx/releng/build.xml}"/>
+<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
+</launchConfiguration>
Property changes on: trunk/jmx/releng/jbosstools-trunk jmx releng build.xml.launch
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jmx/releng/testing.properties
===================================================================
--- trunk/jmx/releng/testing.properties (rev 0)
+++ trunk/jmx/releng/testing.properties 2009-05-15 01:04:03 UTC (rev 15259)
@@ -0,0 +1,6 @@
+#extraVMargs="-Dfoo=bar"
+
+#csv list of test plugins to run
+testPluginsToRun=\
+org.jboss.tools.core.test,\
+org.jboss.tools.ui.test
\ No newline at end of file
Property changes on: trunk/jmx/releng/testing.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15258 - in trunk/jsf/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-05-14 13:24:37 -0400 (Thu, 14 May 2009)
New Revision: 15258
Modified:
trunk/jsf/docs/userguide/en/images/preferences/preferences_7.png
trunk/jsf/docs/userguide/en/modules/preferences.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-720 - Vertical Spliting view is added to Visual/Source Editor. preferences_7.png and visual_page_9.png together with VPE Preferences description were updated in the guide.</p>
</body></html>
Modified: trunk/jsf/docs/userguide/en/images/preferences/preferences_7.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/modules/preferences.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/preferences.xml 2009-05-14 16:54:53 UTC (rev 15257)
+++ trunk/jsf/docs/userguide/en/modules/preferences.xml 2009-05-14 17:24:37 UTC (rev 15258)
@@ -431,8 +431,14 @@
editor</entry>
<entry>Visual/Source</entry>
</row>
-
<row>
+ <entry>Visual/Source Editors Splitting</entry>
+ <entry>The option allows to choose one of the following
+ Visual,Source layouts - Vertical Source on top, Vertical Visual on top,Horizontal Source to the left or Horizontal Visual to the left ,as a default one when opening the
+ Visual/Source view</entry>
+ <entry>Vertical Source on top</entry>
+ </row>
+ <row>
<entry>Size of Visual Editor Pane 0 – 100% </entry>
<entry>With the help of this scroll bar you can adjust the percentage rating
between the Source and Visual modes of the Visual/Source view</entry>
17 years, 2 months
JBoss Tools SVN: r15257 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-05-14 12:54:53 -0400 (Thu, 14 May 2009)
New Revision: 15257
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-414 - VPE preferences page described in more details.
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2009-05-14 15:51:13 UTC (rev 15256)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2009-05-14 16:54:53 UTC (rev 15257)
@@ -1310,9 +1310,25 @@
</imageobject>
</mediaobject>
</figure>
+
+ <para>The available preferences are as follows:</para>
+ <itemizedlist>
+ <listitem><para>Show Border for Unknown Tags</para></listitem>
+ <listitem><para>Show Non-Visual Tags</para></listitem>
+ <listitem><para>Show Resource Bundles Usage as EL Expressions</para></listitem>
+ <listitem><para>Always Prompt for Tag Attributes During Tag Insert</para></listitem>
+ <listitem><para>Show Selection Tag Bar</para></listitem>
+ <listitem><para>Always Hide Selection Bar without Prompt</para></listitem>
+ <listitem><para>Default Editor Tab: <emphasis>Visual/Source</emphasis>, <emphasis>Source</emphasis> or <emphasis>Preview</emphasis></para></listitem>
+ <listitem><para>Size of Visual Editor Pane 0-100%</para></listitem>
+ </itemizedlist> <para>Click on the <emphasis><property>Apply</property></emphasis> button to apply the changes or on the <emphasis><property>Restore Defaults</property></emphasis> button to cancel the changes and set the default preferences.</para>
+
</listitem>
+
+
<listitem>
+
<para>Clicking on <emphasis>
<property>Refresh</property>
</emphasis> button
17 years, 2 months
JBoss Tools SVN: r15256 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-14 11:51:13 -0400 (Thu, 14 May 2009)
New Revision: 15256
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectCreationOperation.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java 2009-05-14 15:50:38 UTC (rev 15255)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectAdoptOperation.java 2009-05-14 15:51:13 UTC (rev 15256)
@@ -30,6 +30,7 @@
import org.jboss.tools.jsf.web.JSFTemplate;
import org.jboss.tools.jsf.web.helpers.context.AdoptJSFProjectFinisher;
import org.jboss.tools.jst.web.context.IImportWebProjectContext;
+import org.jboss.tools.jst.web.kb.IKbProject;
import org.jboss.tools.jst.web.ui.operation.WebProjectAdoptOperation;
public class JSFProjectAdoptOperation extends WebProjectAdoptOperation {
@@ -100,6 +101,11 @@
});
}
}
+ try {
+ EclipseResourceUtil.addNatureToProject(getProject(), IKbProject.NATURE_ID);
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectCreationOperation.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectCreationOperation.java 2009-05-14 15:50:38 UTC (rev 15255)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/operation/JSFProjectCreationOperation.java 2009-05-14 15:51:13 UTC (rev 15256)
@@ -35,6 +35,7 @@
import org.jboss.tools.jsf.web.JSFTemplate;
import org.jboss.tools.jst.web.WebUtils;
import org.jboss.tools.jst.web.context.RegisterServerContext;
+import org.jboss.tools.jst.web.kb.IKbProject;
import org.jboss.tools.jst.web.project.helpers.IWebProjectTemplate;
import org.jboss.tools.jst.web.project.helpers.NewWebProjectContext;
import org.jboss.tools.jst.web.ui.operation.WebProjectCreationOperation;
@@ -140,6 +141,12 @@
projectFile = null;
}
model.getProperties().put(XModelConstants.AUTOLOAD, new JSFAutoLoad());
+
+ try {
+ EclipseResourceUtil.addNatureToProject(getProject(), IKbProject.NATURE_ID);
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
}
}
17 years, 2 months
JBoss Tools SVN: r15255 - in trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf: project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-14 11:50:38 -0400 (Thu, 14 May 2009)
New Revision: 15255
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RemoveJSFNatureContribution.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/facet/PostInstallJsfFacetDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RemoveJSFNatureContribution.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RemoveJSFNatureContribution.java 2009-05-14 15:50:04 UTC (rev 15254)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/handlers/RemoveJSFNatureContribution.java 2009-05-14 15:50:38 UTC (rev 15255)
@@ -1,10 +1,15 @@
package org.jboss.tools.jsf.model.handlers;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.common.meta.action.SpecialWizard;
import org.jboss.tools.common.meta.action.impl.handlers.DefaultRemoveHandler;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.model.JSFConstants;
+import org.jboss.tools.jst.web.kb.IKbProject;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
public class RemoveJSFNatureContribution implements SpecialWizard {
@@ -38,6 +43,15 @@
DefaultRemoveHandler.removeFromParent(params[i]);
}
}
+
+ IProject project = EclipseResourceUtil.getProject(model.getRoot());
+ if(project != null) {
+ try {
+ EclipseResourceUtil.removeNatureFromProject(project, IKbProject.NATURE_ID);
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
+ }
return 0;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/facet/PostInstallJsfFacetDelegate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/facet/PostInstallJsfFacetDelegate.java 2009-05-14 15:50:04 UTC (rev 15254)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/project/facet/PostInstallJsfFacetDelegate.java 2009-05-14 15:50:38 UTC (rev 15255)
@@ -17,6 +17,8 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.jboss.tools.common.model.XModelConstants;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.project.JSFNature;
+import org.jboss.tools.jst.web.kb.IKbProject;
/**
*
@@ -33,7 +35,8 @@
writeXModel(project);
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- EclipseResourceUtil.addNatureToProject(project, "org.jboss.tools.jsf.jsfnature");
+ EclipseResourceUtil.addNatureToProject(project, JSFNature.NATURE_ID);
+ EclipseResourceUtil.addNatureToProject(project, IKbProject.NATURE_ID);
}
private void writeXModel(IProject project) {
17 years, 2 months
JBoss Tools SVN: r15254 - in trunk/jst/plugins/org.jboss.tools.jst.web: src/org/jboss/tools/jst/web/kb and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-14 11:50:04 -0400 (Thu, 14 May 2009)
New Revision: 15254
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-14 15:20:00 UTC (rev 15253)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-14 15:50:04 UTC (rev 15254)
@@ -272,4 +272,29 @@
</extension>
+ <extension
+ id="kbbuilder"
+ name="KB Builder"
+ point="org.eclipse.core.resources.builders">
+ <builder
+ hasNature="false">
+ <run
+ class="org.jboss.tools.jst.web.kb.internal.KbBuilder">
+ </run>
+ </builder>
+ </extension>
+ <extension
+ id="kbnature"
+ name="KB Project Nature"
+ point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run
+ class="org.jboss.tools.jst.web.kb.internal.KbProject">
+ </run>
+ </runtime>
+ <builder
+ id="org.jboss.tools.jst.web.kbbuilder">
+ </builder>
+ </extension>
+
</plugin>
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java 2009-05-14 15:50:04 UTC (rev 15254)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb;
+
+import org.eclipse.core.resources.IProjectNature;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ *
+ * @author V.Kabanovich
+ *
+ */
+public interface IKbProject extends IProjectNature {
+ public static String NATURE_ID = "org.jboss.tools.jst.web.kbnature"; //$NON-NLS-1$
+
+ public ITagLibrary[] getTagLibraries();
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/IKbProject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java 2009-05-14 15:50:04 UTC (rev 15254)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ *
+ * @author V.Kabanovich
+ *
+ */
+public class KbBuilder extends IncrementalProjectBuilder {
+ public static String BUILDER_ID = "org.jboss.tools.jst.web.kbbuilder"; //$NON-NLS-1$
+
+ protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
+ throws CoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbProject.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2009-05-14 15:50:04 UTC (rev 15254)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import org.eclipse.core.resources.ICommand;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
+
+/**
+ *
+ * @author V.Kabanovich
+ *
+ */
+public class KbProject implements IKbProject {
+ IProject project;
+
+ ITagLibrary[] tagLibraries = new ITagLibrary[0];
+
+ public ITagLibrary[] getTagLibraries() {
+ return tagLibraries;
+ }
+
+ public void configure() throws CoreException {
+ addToBuildSpec(KbBuilder.BUILDER_ID);
+ }
+
+ public void deconfigure() throws CoreException {
+ removeFromBuildSpec(KbBuilder.BUILDER_ID);
+ }
+
+ public IProject getProject() {
+ return project;
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+ /**
+ *
+ * @param builderID
+ * @throws CoreException
+ */
+ protected void addToBuildSpec(String builderID) throws CoreException {
+ IProjectDescription description = getProject().getDescription();
+ ICommand command = null;
+ ICommand commands[] = description.getBuildSpec();
+ for (int i = 0; i < commands.length && command == null; ++i) {
+ if (commands[i].getBuilderName().equals(builderID))
+ command = commands[i];
+ }
+ if (command == null) {
+ command = description.newCommand();
+ command.setBuilderName(builderID);
+ ICommand[] oldCommands = description.getBuildSpec();
+ ICommand[] newCommands = new ICommand[oldCommands.length + 1];
+ System.arraycopy(oldCommands, 0, newCommands, 0, oldCommands.length);
+ newCommands[oldCommands.length] = command;
+ description.setBuildSpec(newCommands);
+ getProject().setDescription(description, null);
+ }
+ }
+
+ static String EXTERNAL_TOOL_BUILDER = "org.eclipse.ui.externaltools.ExternalToolBuilder";
+ static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle";
+
+ /**
+ *
+ * @param builderID
+ * @throws CoreException
+ */
+ protected void removeFromBuildSpec(String builderID) throws CoreException {
+ IProjectDescription description = getProject().getDescription();
+ ICommand[] commands = description.getBuildSpec();
+ for (int i = 0; i < commands.length; ++i) {
+ String builderName = commands[i].getBuilderName();
+ if (!builderName.equals(builderID)) {
+ if(!builderName.equals(EXTERNAL_TOOL_BUILDER)) continue;
+ Object handle = commands[i].getArguments().get(LAUNCH_CONFIG_HANDLE);
+ if(handle == null || handle.toString().indexOf(builderID) < 0) continue;
+ }
+ ICommand[] newCommands = new ICommand[commands.length - 1];
+ System.arraycopy(commands, 0, newCommands, 0, i);
+ System.arraycopy(commands, i + 1, newCommands, i, commands.length - i - 1);
+ description.setBuildSpec(newCommands);
+ getProject().setDescription(description, null);
+ return;
+ }
+ }
+
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15253 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-05-14 11:20:00 -0400 (Thu, 14 May 2009)
New Revision: 15253
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4315
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-14 14:43:47 UTC (rev 15252)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-14 15:20:00 UTC (rev 15253)
@@ -17,6 +17,7 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
@@ -24,6 +25,7 @@
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.refactoring.RenameComponentProcessor;
@@ -54,17 +56,21 @@
IProject project = file.getProject();
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
- ISeamComponent component=null;
if (seamProject != null) {
Set<ISeamComponent> components = seamProject.getComponentsByPath(file.getFullPath());
- if (!components.isEmpty()) {
- // This is a component which we want to rename.
- component = components.iterator().next();
+ for(ISeamComponent component : components){
+ ISeamJavaComponentDeclaration declaration = component.getJavaDeclaration();
+ if(declaration != null){
+ IResource resource = declaration.getResource();
+ if(resource != null && resource.getFullPath().equals(file.getFullPath())){
+ if(declaration.getName().equals(component.getName())){
+ invokeRenameWizard(component, activeShell);
+ return null;
+ }
+ }
+ }
}
}
-
- invokeRenameWizard(component, activeShell);
-
}
return null;
}
17 years, 2 months
JBoss Tools SVN: r15252 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-05-14 10:43:47 -0400 (Thu, 14 May 2009)
New Revision: 15252
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4313
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-14 14:42:10 UTC (rev 15251)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-14 14:43:47 UTC (rev 15252)
@@ -417,14 +417,15 @@
Set<ISeamFactory> factorySet = seamProject.getFactoriesByName(component.getName());
for(ISeamFactory factory : factorySet){
- ISeamTextSourceReference location = factory.getLocationFor(SeamAnnotations.FACTORY_ANNOTATION_TYPE);
- if(location != null){
- IFile file = (IFile)factory.getResource();
-
- if(file.getFileExtension().equalsIgnoreCase(XML_EXT))
+ IFile file = (IFile)factory.getResource();
+ if(file.getFileExtension().equalsIgnoreCase(JAVA_EXT)){
+ ISeamTextSourceReference location = factory.getLocationFor(SeamAnnotations.FACTORY_ANNOTATION_TYPE);
+ if(location != null)
+ changeAnnotation(location, file);
+ }else{
+ ISeamTextSourceReference location = factory.getLocationFor(ISeamXmlComponentDeclaration.NAME);
+ if(location != null)
changeXMLNode(location, file);
- else
- changeAnnotation(location, file);
}
}
}
17 years, 2 months
JBoss Tools SVN: r15251 - in trunk/hibernatetools/plugins: org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-05-14 10:42:10 -0400 (Thu, 14 May 2009)
New Revision: 15251
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/CriteriaQuickAssistProcessor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLQuickAssistProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4285 - code review - make code more readable: rename/create functions where it was necessary, use proper interfaces, reduce code size, add code comments; functionality remains the same
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java 2009-05-14 14:10:06 UTC (rev 15250)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenFileActionUtils.java 2009-05-14 14:42:10 UTC (rev 15251)
@@ -23,180 +23,268 @@
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.VisitorSupport;
+import org.dom4j.io.SAXReader;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.core.PackageFragmentRoot;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.texteditor.ITextEditor;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
+import org.hibernate.tool.hbm2x.Cfg2HbmTool;
import org.hibernate.util.StringHelper;
import org.hibernate.util.XMLHelper;
+import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
+/**
+ * Utility class for useful open mapping file action functions.
+ *
+ * @author Dmitry Geraskov
+ * @author Vitali Yemialyanchyk
+ */
public class OpenFileActionUtils {
- private static XMLHelper helper = new XMLHelper();
+
+ public static final String HIBERNATE_TAG_CLASS = "class"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_TABLE = "table"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_SUBCLASS = "subclass"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_JOINED_SUBCLASS = "joined-subclass"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_UNION_SUBCLASS = "union-subclass"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_NAME = "name"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_ENTITY_NAME = "entity-name"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_SESSION_FACTORY = "session-factory"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_MAPPING = "mapping"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_RESOURCE = "resource"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_CATALOG = "catalog"; //$NON-NLS-1$
+ public static final String HIBERNATE_TAG_SCHEMA = "schema"; //$NON-NLS-1$
+ public static final String EJB_TAG_ENTITY = "entity"; //$NON-NLS-1$
+ public static final String EJB_TAG_CLASS = "class"; //$NON-NLS-1$
+
+ //prohibit constructor call
+ private OpenFileActionUtils() {}
- private static final String HIBERNATE_TAG_CLASS = "class"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_TABLE = "table"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_SUBCLASS = "subclass"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_JOINED_SUBCLASS = "joined-subclass"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_UNION_SUBCLASS = "union-subclass"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_NAME = "name"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_ENTITY_NAME = "entity-name"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_SESSION_FACTORY = "session-factory"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_MAPPING = "mapping"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_RESOURCE = "resource"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_CATALOG = "catalog"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_SCHEMA = "schema"; //$NON-NLS-1$
-
- private OpenFileActionUtils() {
+ /**
+ * Get name of a persistent class.
+ * @param rootClass
+ * @return
+ */
+ public static String getPersistentClassName(PersistentClass rootClass) {
+ if (rootClass == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return rootClass.getEntityName() != null ? rootClass.getEntityName() : rootClass.getClassName();
}
- public static IEditorPart openEditor(IWorkbenchPage page, IResource resource) throws PartInitException {
- return IDE.openEditor(page, (IFile) resource);
+ /**
+ * Formulate a full table name.
+ * @param catalog
+ * @param schema
+ * @param name
+ * @return
+ */
+ public static String getTableName(String catalog, String schema, String name) {
+ return (catalog != null ? catalog + '.' : "") + (schema != null ? schema + '.' : "") + name; //$NON-NLS-1$ //$NON-NLS-2$
}
+ /**
+ * Get a full table name.
+ * @param table
+ * @return
+ */
+ public static String getTableName(Table table) {
+ return getTableName(table.getCatalog(), table.getSchema(), table.getName());
+ }
- public static boolean rootClassHasAnnotations(ConsoleConfiguration consoleConfiguration, PersistentClass rootClass) {
+ /**
+ * Check has consoleConfiguration config.xml file a mapping class for provided rootClass.
+ * @param consoleConfiguration
+ * @param rootClass
+ * @return
+ */
+ public static boolean hasConfigXMLMappingClassAnnotation(ConsoleConfiguration consoleConfiguration, PersistentClass rootClass) {
java.io.File configXMLFile = consoleConfiguration.getPreferences().getConfigXMLFile();
if (configXMLFile == null) {
return true;
}
- Document doc = getDocument(consoleConfiguration, configXMLFile);
+ EntityResolver entityResolver = consoleConfiguration.getConfiguration().getEntityResolver();
+ Document doc = getDocument(configXMLFile, entityResolver);
return getElements(doc, HIBERNATE_TAG_MAPPING, HIBERNATE_TAG_CLASS, getPersistentClassName(rootClass)).hasNext();
}
- static String getPersistentClassName(PersistentClass rootClass) {
- if (rootClass == null) {
- return ""; //$NON-NLS-1$
- } else {
- return rootClass.getEntityName() != null ? rootClass.getEntityName() : rootClass.getClassName();
- }
- }
-
- private static String getTableName(String catalog, String schema, String name) {
- return (catalog != null ? catalog + '.' : "") + (schema != null ? schema + '.' : "") + name; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- private static String getTableName(Table table) {
- return getTableName(table.getCatalog(), table.getSchema(), table.getName());
- }
-
-
- private static boolean elementInResource(ConsoleConfiguration consoleConfiguration, IResource resource, Object element) {
+ /**
+ * Check has this particular element correspondence in the file.
+ * @param consoleConfiguration
+ * @param file
+ * @param element
+ * @return
+ */
+ public static boolean elementInFile(ConsoleConfiguration consoleConfiguration, IFile file, Object element) {
boolean res = false;
if (element instanceof RootClass) {
- res = rootClassInResource(consoleConfiguration, resource, (RootClass)element);
+ res = rootClassInFile(consoleConfiguration, file, (RootClass)element);
} else if (element instanceof Subclass) {
- res = subclassInResource(consoleConfiguration, resource, (Subclass)element);
+ res = subclassInFile(consoleConfiguration, file, (Subclass)element);
} else if (element instanceof Table) {
- res = tableInResource(consoleConfiguration, resource, (Table)element);
+ res = tableInFile(consoleConfiguration, file, (Table)element);
}
return res;
}
+
+ private static String[][] classPairs = {
+ { HIBERNATE_TAG_CLASS, HIBERNATE_TAG_NAME, },
+ { HIBERNATE_TAG_CLASS, HIBERNATE_TAG_ENTITY_NAME, },
+ { EJB_TAG_ENTITY, HIBERNATE_TAG_CLASS, },
+ { EJB_TAG_ENTITY, HIBERNATE_TAG_NAME, },
+ };
- // TODO: this is *extremely* inefficient - no need to scan the whole tree again and again.
- private static boolean rootClassInResource(ConsoleConfiguration consoleConfiguration, IResource resource, RootClass persistentClass) {
- Document doc = getDocument(consoleConfiguration, resource.getLocation().toFile());
- return getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS, HIBERNATE_TAG_NAME, StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS, HIBERNATE_TAG_NAME, getPersistentClassName(persistentClass)).hasNext() ||
- getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS, HIBERNATE_TAG_ENTITY_NAME, StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS, HIBERNATE_TAG_ENTITY_NAME, getPersistentClassName(persistentClass)).hasNext();
+ /**
+ * Check has this particular rootClass correspondence in the file.
+ * @param consoleConfiguration
+ * @param file
+ * @param rootClass
+ * @return
+ */
+ public static boolean rootClassInFile(ConsoleConfiguration consoleConfiguration, IFile file, RootClass rootClass) {
+ EntityResolver entityResolver = consoleConfiguration.getConfiguration().getEntityResolver();
+ Document doc = getDocument(file.getLocation().toFile(), entityResolver);
+ final String clName = getPersistentClassName(rootClass);
+ final String clNameUnq = StringHelper.unqualify(clName);
+ boolean res = false;
+ // TODO: getElements - this is *extremely* inefficient - no need to scan the whole tree again and again.
+ for (int i = 0; i < classPairs.length; i++) {
+ res = getElements(doc, classPairs[i][0], classPairs[i][1], clNameUnq).hasNext();
+ if (res) break;
+ res = getElements(doc, classPairs[i][0], classPairs[i][1], clName).hasNext();
+ if (res) break;
+ }
+ return res;
}
+
+ private static String[][] subClassPairs = {
+ { HIBERNATE_TAG_SUBCLASS, HIBERNATE_TAG_NAME, },
+ { HIBERNATE_TAG_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME, },
+ { HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_NAME, },
+ { HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME, },
+ { HIBERNATE_TAG_UNION_SUBCLASS, HIBERNATE_TAG_NAME, },
+ { HIBERNATE_TAG_UNION_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME, },
+ { EJB_TAG_ENTITY, HIBERNATE_TAG_CLASS, },
+ { EJB_TAG_ENTITY, HIBERNATE_TAG_NAME, },
+ };
- // TODO: this is *extremely* inefficient - no need to scan the whole tree again and again.
- private static boolean subclassInResource(ConsoleConfiguration consoleConfiguration, IResource resource, Subclass persistentClass) {
- Document doc = getDocument(consoleConfiguration, resource.getLocation().toFile());
- return getElements(doc, HIBERNATE_TAG_SUBCLASS, HIBERNATE_TAG_NAME, StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, HIBERNATE_TAG_SUBCLASS, HIBERNATE_TAG_NAME, getPersistentClassName(persistentClass)).hasNext() ||
- getElements(doc, HIBERNATE_TAG_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME, StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, HIBERNATE_TAG_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME, getPersistentClassName(persistentClass)).hasNext() ||
-
- getElements(doc, HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_NAME, StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_NAME, getPersistentClassName(persistentClass)).hasNext() ||
- getElements(doc, HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME, StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, HIBERNATE_TAG_JOINED_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME, getPersistentClassName(persistentClass)).hasNext() ||
-
- getElements(doc, HIBERNATE_TAG_UNION_SUBCLASS, HIBERNATE_TAG_NAME, StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, HIBERNATE_TAG_UNION_SUBCLASS, HIBERNATE_TAG_NAME, getPersistentClassName(persistentClass)).hasNext() ||
- getElements(doc, HIBERNATE_TAG_UNION_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME, StringHelper.unqualify(getPersistentClassName(persistentClass))).hasNext() ||
- getElements(doc, HIBERNATE_TAG_UNION_SUBCLASS, HIBERNATE_TAG_ENTITY_NAME, getPersistentClassName(persistentClass)).hasNext();
+ /**
+ * Check has this particular subclass correspondence in the file.
+ * @param consoleConfiguration
+ * @param file
+ * @param subclass
+ * @return
+ */
+ public static boolean subclassInFile(ConsoleConfiguration consoleConfiguration, IFile file, Subclass subclass) {
+ EntityResolver entityResolver = consoleConfiguration.getConfiguration().getEntityResolver();
+ Document doc = getDocument(file.getLocation().toFile(), entityResolver);
+ final String clName = getPersistentClassName(subclass);
+ final String clNameUnq = StringHelper.unqualify(clName);
+ boolean res = false;
+ // TODO: getElements - this is *extremely* inefficient - no need to scan the whole tree again and again.
+ for (int i = 0; i < subClassPairs.length; i++) {
+ res = getElements(doc, subClassPairs[i][0], subClassPairs[i][1], clNameUnq).hasNext();
+ if (res) break;
+ res = getElements(doc, subClassPairs[i][0], subClassPairs[i][1], clName).hasNext();
+ if (res) break;
+ }
+ return res;
}
- private static boolean tableInResource(ConsoleConfiguration consoleConfiguration, IResource resource, Table table) {
- Document doc = getDocument(consoleConfiguration, resource.getLocation().toFile());
-
- Iterator classes = getElements(doc, OpenFileActionUtils.HIBERNATE_TAG_CLASS);
+ /**
+ * Check has this particular table correspondence in the file.
+ * @param consoleConfiguration
+ * @param file
+ * @param table
+ * @return
+ */
+ public static boolean tableInFile(ConsoleConfiguration consoleConfiguration, IFile file, Table table) {
+ EntityResolver entityResolver = consoleConfiguration.getConfiguration().getEntityResolver();
+ Document doc = getDocument(file.getLocation().toFile(), entityResolver);
+ Iterator<Element> classes = getElements(doc, HIBERNATE_TAG_CLASS);
+ boolean res = false;
while (classes.hasNext()) {
- Element element = (Element) classes.next();
-
- Attribute tableAttr = element.attribute( HIBERNATE_TAG_TABLE );
+ Element element = (Element)classes.next();
+ Attribute tableAttr = element.attribute(HIBERNATE_TAG_TABLE);
if (tableAttr != null) {
- Attribute catalogAttr = element.attribute( HIBERNATE_TAG_CATALOG );
- if (catalogAttr == null) catalogAttr = doc.getRootElement().attribute(HIBERNATE_TAG_CATALOG);
- Attribute schemaAttr = element.attribute( HIBERNATE_TAG_SCHEMA );
- if (schemaAttr == null) schemaAttr = doc.getRootElement().attribute(HIBERNATE_TAG_SCHEMA);
- if (
- getTableName(
- (catalogAttr != null ? catalogAttr.getValue() : null),
- (schemaAttr != null ? schemaAttr.getValue() : null),
- tableAttr.getValue()
- ).equals(getTableName(table))
- ) {
- return true;
+ Attribute catalogAttr = element.attribute(HIBERNATE_TAG_CATALOG);
+ if (catalogAttr == null) {
+ catalogAttr = doc.getRootElement().attribute(HIBERNATE_TAG_CATALOG);
}
+ Attribute schemaAttr = element.attribute(HIBERNATE_TAG_SCHEMA);
+ if (schemaAttr == null) {
+ schemaAttr = doc.getRootElement().attribute(HIBERNATE_TAG_SCHEMA);
+ }
+ String catalog = catalogAttr != null ? catalogAttr.getValue() : null;
+ String schema = schemaAttr != null ? schemaAttr.getValue() : null;
+ String name = tableAttr.getValue();
+ if (getTableName(catalog, schema, name).equals(getTableName(table))) {
+ res = true;
+ break;
+ }
}
-
- Attribute classNameAttr = element.attribute( HIBERNATE_TAG_NAME );
- if (classNameAttr == null) classNameAttr = element.attribute( HIBERNATE_TAG_ENTITY_NAME);
+ Attribute classNameAttr = element.attribute(HIBERNATE_TAG_NAME);
+ if (classNameAttr == null) {
+ classNameAttr = element.attribute(HIBERNATE_TAG_ENTITY_NAME);
+ }
if (classNameAttr != null) {
String physicalTableName = consoleConfiguration.getConfiguration().getNamingStrategy().classToTableName(classNameAttr.getValue());
if (table.getName().equals(physicalTableName)) {
- return true;
+ res = true;
+ break;
}
}
}
-
- if (getElements(doc, HIBERNATE_TAG_TABLE, table.getName()).hasNext()) {
- return true;
+ if (!res && getElements(doc, HIBERNATE_TAG_TABLE, table.getName()).hasNext()) {
+ res = true;
}
-
- return false;
+ return res;
}
- private static Iterator getElements(Document doc, String elementName) {
+ private static Iterator<Element> getElements(Document doc, String elementName) {
return getElements(doc, elementName, null, null);
}
- private static Iterator getElements(Document doc, String attrName, String attrValue) {
+ private static Iterator<Element> getElements(Document doc, String attrName, String attrValue) {
return getElements(doc, null, attrName, attrValue);
}
- private static Iterator getElements(Document doc, String elementName, String attrName, String attrValue) {
+ private static Iterator<Element> getElements(Document doc, String elementName, String attrName, String attrValue) {
LVS visitor = new LVS(elementName, attrName, attrValue);
- doc.accept( visitor );
+ doc.accept(visitor);
return visitor.iterator();
}
- static class LVS extends VisitorSupport {
+ private static class LVS extends VisitorSupport {
private String nodeName;
private String attrName;
private String attrValue;
- private List ret = new ArrayList();
+ private List<Element> ret = new ArrayList<Element>();
public LVS(String nodeName, String attrName, String attrValue) {
super();
@@ -208,14 +296,14 @@
public void visit(Element element) {
if (nodeName == null) {
if (attrName != null && attrValue != null) {
- if (attrIsCorrect(element, attrName, attrValue)) {
+ if (inspectAttributeForValue(element, attrName, attrValue)) {
ret.add(element);
}
}
} else {
if (nodeName.equals(element.getName())) {
if (attrName != null) {
- if (attrIsCorrect(element, attrName, attrValue)) {
+ if (inspectAttributeForValue(element, attrName, attrValue)) {
ret.add(element);
}
} else {
@@ -223,111 +311,402 @@
}
}
}
-
}
- public Iterator iterator() {
+ public Iterator<Element> iterator() {
return ret.iterator();
}
- }
- private static boolean attrIsCorrect(Element element, String attrName, String attrValue) {
- Attribute attr = element.attribute(attrName);
- if (attr != null && attrValue.equals(attr.getValue())) {
- return attrValue.equals(attr.getValue());
+ protected boolean inspectAttributeForValue(Element element, String attrName, String checkValue) {
+ Attribute attr = element.attribute(attrName);
+ if (attr != null && checkValue.equals(attr.getValue())) {
+ return checkValue.equals(attr.getValue());
+ }
+ return false;
}
- return false;
}
- public static Document getDocument(ConsoleConfiguration consoleConfiguration, java.io.File configXMLFile) {
+ /**
+ * Trying to find hibernate console config mapping file,
+ * which is corresponding to provided element.
+ *
+ * @param configXMLFile
+ * @param entityResolver
+ * @return
+ */
+ public static Document getDocument(java.io.File configXMLFile, EntityResolver entityResolver) {
Document doc = null;
- if (consoleConfiguration != null && configXMLFile != null) {
- InputStream stream = null;
- try {
- stream = new FileInputStream( configXMLFile );
- } catch (FileNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Configuration file not found", e); //$NON-NLS-1$
+ if (configXMLFile == null) {
+ return doc;
+ }
+ InputStream stream = null;
+ try {
+ stream = new FileInputStream(configXMLFile);
+ } catch (FileNotFoundException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Configuration file not found", e); //$NON-NLS-1$
+ }
+ try {
+ List errors = new ArrayList();
+ XMLHelper helper = new XMLHelper();
+ SAXReader saxReader = helper.createSAXReader(configXMLFile.getPath(), errors, entityResolver);
+ doc = saxReader.read(new InputSource( stream));
+ if (errors.size() != 0) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("invalid configuration", (Throwable)null); //$NON-NLS-1$
}
+ }
+ catch (DocumentException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("Could not parse configuration", e); //$NON-NLS-1$
+ }
+ finally {
try {
- List errors = new ArrayList();
- doc = helper.createSAXReader( configXMLFile.getPath(), errors, consoleConfiguration.getConfiguration().getEntityResolver() )
- .read( new InputSource( stream ) );
- if ( errors.size() != 0 ) {
- HibernateConsolePlugin.getDefault().logErrorMessage("invalid configuration", (Throwable)null); //$NON-NLS-1$
- }
+ stream.close();
}
- catch (DocumentException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage("Could not parse configuration", e); //$NON-NLS-1$
+ catch (IOException ioe) {
+ HibernateConsolePlugin.getDefault().logErrorMessage("could not close input stream for", ioe); //$NON-NLS-1$
}
- finally {
- try {
- stream.close();
- }
- catch (IOException ioe) {
- HibernateConsolePlugin.getDefault().logErrorMessage("could not close input stream for", ioe); //$NON-NLS-1$
- }
- }
}
return doc;
}
- public static IResource getResource(ConsoleConfiguration consoleConfiguration, IJavaProject proj, Object element) {
- IResource resource = null;
- if (consoleConfiguration == null) {
- return resource;
+ /**
+ * Trying to find hibernate console config mapping file,
+ * which is corresponding to provided element.
+ *
+ * @param consoleConfiguration
+ * @param proj
+ * @param element
+ * @return
+ */
+ public static IFile searchInMappingFiles(ConsoleConfiguration consoleConfiguration, IJavaProject proj, Object element) {
+ IFile file = null;
+ if (consoleConfiguration == null || proj == null) {
+ return file;
}
java.io.File configXMLFile = consoleConfiguration.getPreferences().getConfigXMLFile();
- Document doc = getDocument(consoleConfiguration, configXMLFile);
- if (proj != null && doc != null) {
- Element sfNode = doc.getRootElement().element( HIBERNATE_TAG_SESSION_FACTORY );
- Iterator elements = sfNode.elements(HIBERNATE_TAG_MAPPING).iterator();
- while (elements.hasNext() && resource == null) {
- Element subelement = (Element) elements.next();
- Attribute file = subelement.attribute( HIBERNATE_TAG_RESOURCE );
- if (file != null) {
- try {
- IPackageFragmentRoot[] packageFragmentRoots =
- proj.getAllPackageFragmentRoots();
- for (int i = 0; i < packageFragmentRoots.length; i++) {
- //search in source folders.
- if (packageFragmentRoots[i].getClass() == PackageFragmentRoot.class) {
- IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[i];
- IPath path = packageFragmentRoot.getPath().append(file.getValue());
- resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
- if (resource != null) {
- if (resource.exists() && elementInResource(consoleConfiguration, resource, element)) {
- break;
- }
- else {
- resource = null;
- }
- }
- }
- }
- } catch (JavaModelException e) {
- resource = null;
- HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenFileActionUtils_problems_while_get_project_package_fragment_roots, e);
- }
+ EntityResolver entityResolver = consoleConfiguration.getConfiguration().getEntityResolver();
+ Document doc = getDocument(configXMLFile, entityResolver);
+ if (doc == null) {
+ return file;
+ }
+ Element sfNode = doc.getRootElement().element(HIBERNATE_TAG_SESSION_FACTORY);
+ Iterator elements = sfNode.elements(HIBERNATE_TAG_MAPPING).iterator();
+ while (elements.hasNext() && file == null) {
+ Element subelement = (Element)elements.next();
+ Attribute resourceAttr = subelement.attribute(HIBERNATE_TAG_RESOURCE);
+ if (resourceAttr == null) {
+ continue;
+ }
+ IPackageFragmentRoot[] packageFragmentRoots = new IPackageFragmentRoot[0];
+ try {
+ packageFragmentRoots = proj.getAllPackageFragmentRoots();
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenFileActionUtils_problems_while_get_project_package_fragment_roots, e);
+ }
+ for (int i = 0; i < packageFragmentRoots.length; i++) {
+ //search in source folders.
+ if (packageFragmentRoots[i].getClass() != PackageFragmentRoot.class) {
+ continue;
}
+ IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[i];
+ IPath path = packageFragmentRoot.getPath().append(resourceAttr.getValue());
+ file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (file == null) {
+ continue;
+ }
+ if (file.exists() && elementInFile(consoleConfiguration, file, element)) {
+ break;
+ }
+ file = null;
}
}
- if (resource == null) {
- java.io.File[] files = consoleConfiguration.getPreferences().getMappingFiles();
- for (int i = 0; i < files.length; i++) {
- java.io.File file = files[i];
- if (file != null) {
- resource = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(file.getPath()));
- if (resource != null) {
- if (resource.exists() && elementInResource(consoleConfiguration, resource, element)) {
- break;
- }
- else {
- resource = null;
- }
- }
+ return file;
+ }
+
+ /**
+ * Trying to find console configuration additional mapping file,
+ * which is corresponding to provided element.
+ *
+ * @param consoleConfiguration
+ * @param element
+ * @return
+ */
+ public static IFile searchInAdditionalMappingFiles(ConsoleConfiguration consoleConfiguration, Object element) {
+ IFile file = null;
+ if (consoleConfiguration == null) {
+ return file;
+ }
+ java.io.File[] files = consoleConfiguration.getPreferences().getMappingFiles();
+ for (int i = 0; i < files.length; i++) {
+ java.io.File fileTmp = files[i];
+ if (fileTmp == null) {
+ continue;
+ }
+ file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(fileTmp.getPath()));
+ if (file == null) {
+ continue;
+ }
+ if (file.exists() && elementInFile(consoleConfiguration, file, element)) {
+ break;
+ }
+ file = null;
+ }
+ return file;
+ }
+
+ /**
+ * This function is trying to find hibernate console config file,
+ * which is corresponding to provided element.
+ *
+ * @param consoleConfiguration
+ * @param proj
+ * @param element
+ * @return
+ */
+ public static IFile searchFileToOpen(ConsoleConfiguration consoleConfiguration, IJavaProject proj, Object element) {
+ IFile file = searchInMappingFiles(consoleConfiguration, proj, element);
+ if (file == null) {
+ file = searchInAdditionalMappingFiles(consoleConfiguration, element);
+ }
+ //if (file == null) {
+ // file = searchInEjb3MappingFiles(consoleConfiguration, proj, element);
+ //}
+ return file;
+ }
+
+ /**
+ * Creates FindReplaceDocumentAdapter for provided text editor.
+ *
+ * @param textEditor
+ * @return
+ */
+ public static FindReplaceDocumentAdapter createFindDocAdapter(ITextEditor textEditor) {
+ IDocument document = null;
+ if (textEditor.getDocumentProvider() != null){
+ document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+ }
+ if (document == null) {
+ return null;
+ }
+ return new FindReplaceDocumentAdapter(document);
+ }
+
+ /**
+ * Opens an editor on the given file resource.
+ * @param file the editor input
+ * @return an open editor or <code>null</code> if an external editor was opened
+ * @exception PartInitException if the editor could not be initialized
+ */
+ public static IEditorPart openFileInEditor(IFile file) throws PartInitException {
+ IWorkbenchPage page =
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ return IDE.openEditor(page, file);
+ }
+
+ /**
+ * Finds a document region, which corresponds of given selection object.
+ * @param findAdapter
+ * @param selection
+ * @return a proper document region
+ */
+ public static IRegion findSelectRegion(FindReplaceDocumentAdapter findAdapter, Object selection) {
+ IRegion selectRegion = null;
+ if (selection instanceof RootClass || selection instanceof Subclass) {
+ selectRegion = findSelectRegion(findAdapter, (PersistentClass)selection);
+ } else if (selection instanceof Property){
+ selectRegion = findSelectRegion(findAdapter, (Property)selection);
+ }
+ return selectRegion;
+ }
+
+ /**
+ * Finds a document region, which corresponds of given property.
+ * @param findAdapter
+ * @param property
+ * @return a proper document region
+ */
+ public static IRegion findSelectRegion(FindReplaceDocumentAdapter findAdapter, Property property) {
+ Assert.isNotNull(property.getPersistentClass());
+ IRegion classRegion = findSelectRegion(findAdapter, property.getPersistentClass());
+ if (classRegion == null) {
+ return null;
+ }
+ final Cfg2HbmTool tool = new Cfg2HbmTool();
+ final String tagName = tool.getTag(property.getPersistentClass());
+ IRegion finalRegion = null;
+ IRegion propRegion = null;
+ int startOffset = classRegion.getOffset() + classRegion.getLength();
+ try {
+ String tagClose = "</" + tagName; //$NON-NLS-1$
+ finalRegion = findAdapter.find(startOffset, tagClose, true, true, false, false);
+ if (finalRegion == null) {
+ tagClose = "</" + EJB_TAG_ENTITY; //$NON-NLS-1$
+ finalRegion = findAdapter.find(startOffset, tagClose, true, true, false, false);
+ }
+ propRegion = findAdapter.find(startOffset, generateHbmPropertyPattern(property), true, true, false, true);
+ if (propRegion == null) {
+ propRegion = findAdapter.find(startOffset, generateEjbPropertyPattern(property), true, true, false, true);
+ }
+ } catch (BadLocationException e) {
+ //ignore
+ }
+ IRegion res = null;
+ if (propRegion != null) {
+ int length = property.getName().length();
+ int offset = propRegion.getOffset() + propRegion.getLength() - length - 1;
+ res = new Region(offset, length);
+ if (finalRegion != null && propRegion.getOffset() > finalRegion.getOffset()) {
+ res = null;
+ }
+ }
+ return res;
+ }
+
+ /**
+ * Finds a document region, which corresponds of given persistent class.
+ * @param findAdapter
+ * @param persistentClass
+ * @return a proper document region
+ */
+ public static IRegion findSelectRegion(FindReplaceDocumentAdapter findAdapter, PersistentClass persistentClass) {
+ IRegion res = null;
+ String[] classPatterns = generatePersistentClassPatterns(persistentClass);
+ IRegion classRegion = null;
+ try {
+ for (int i = 0; (classRegion == null) && (i < classPatterns.length); i++){
+ classRegion = findAdapter.find(0, classPatterns[i], true, true, false, true);
+ }
+ } catch (BadLocationException e) {
+ //ignore
+ }
+ if (classRegion != null) {
+ int length = persistentClass.getNodeName().length();
+ int offset = classRegion.getOffset() + classRegion.getLength() - length - 1;
+ res = new Region(offset, length);
+ }
+ return res;
+ }
+
+ /**
+ * Creates a xml tag search pattern with given tag name which should contains
+ * proper name-value pair.
+ *
+ * @param tagName
+ * @param name
+ * @param value
+ * @return a result search pattern
+ */
+ public static String createPattern(String tagName, String name, String value) {
+ StringBuffer pattern = new StringBuffer("<"); //$NON-NLS-1$
+ pattern.append(tagName);
+ pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
+ pattern.append(name);
+ pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
+ pattern.append(value);
+ pattern.append('\"');
+ return pattern.toString();
+ }
+
+ private static String[][] persistentClassPairs = {
+ { HIBERNATE_TAG_CLASS, HIBERNATE_TAG_NAME, },
+ { HIBERNATE_TAG_CLASS, HIBERNATE_TAG_ENTITY_NAME, },
+ { EJB_TAG_ENTITY, HIBERNATE_TAG_NAME, },
+ { EJB_TAG_ENTITY, EJB_TAG_CLASS, },
+ };
+
+ /**
+ * Generates a persistent class xml tag search patterns.
+ *
+ * @param persClass
+ * @return an arrays of search patterns
+ */
+ public static String[] generatePersistentClassPatterns(PersistentClass persClass){
+ String fullClassName = null;
+ String shortClassName = null;
+ if (persClass.getEntityName() != null){
+ fullClassName = persClass.getEntityName();
+ } else {
+ fullClassName = persClass.getClassName();
+ }
+ shortClassName = fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
+ final Cfg2HbmTool tool = new Cfg2HbmTool();
+ final String tagName = tool.getTag(persClass);
+ persistentClassPairs[0][0] = tagName;
+ persistentClassPairs[1][0] = tagName;
+ List<String> patterns = new ArrayList<String>();
+ for (int i = 0; i < persistentClassPairs.length; i++) {
+ patterns.add(createPattern(persistentClassPairs[i][0], persistentClassPairs[i][1], shortClassName));
+ patterns.add(createPattern(persistentClassPairs[i][0], persistentClassPairs[i][1], fullClassName));
+ }
+ return patterns.toArray(new String[0]);
+ }
+
+ /**
+ * Generates a property xml tag search pattern, which corresponds hibernate hbm syntax.
+ *
+ * @param property
+ * @return a search patterns
+ */
+ public static String generateHbmPropertyPattern(Property property) {
+ final Cfg2HbmTool tool = new Cfg2HbmTool();
+ String toolTag = ""; //$NON-NLS-1$
+ PersistentClass pc = property.getPersistentClass();
+ if (pc != null && pc.getIdentifierProperty() == property) {
+ if (property.isComposite()) {
+ toolTag = "composite-id"; //$NON-NLS-1$
+ } else {
+ toolTag = "id"; //$NON-NLS-1$
+ }
+ } else {
+ toolTag = tool.getTag(property);
+ if ("component".equals(toolTag) && "embedded".equals(property.getPropertyAccessorName())) { //$NON-NLS-1$//$NON-NLS-2$
+ toolTag = "properties"; //$NON-NLS-1$
+ }
+ }
+ return createPattern(toolTag, HIBERNATE_TAG_NAME, property.getName());
+ }
+
+ /**
+ * Generates a property xml tag search pattern, which corresponds ejb3 syntax.
+ *
+ * @param property
+ * @return a search patterns
+ */
+ public static String generateEjbPropertyPattern(Property property) {
+ String toolTag = ""; //$NON-NLS-1$
+ PersistentClass pc = property.getPersistentClass();
+ if (pc != null && pc.getIdentifierProperty() == property) {
+ if (property.isComposite()) {
+ toolTag = "composite-id"; //$NON-NLS-1$
+ } else {
+ toolTag = "id"; //$NON-NLS-1$
+ }
+ } else {
+ toolTag = "basic"; //$NON-NLS-1$
+ }
+ return createPattern(toolTag, HIBERNATE_TAG_NAME, property.getName());
+ }
+
+ /**
+ * Method gets all ITextEditors from IEditorPart. Shouldn't returns null value.
+ *
+ * @param editorPart
+ * @return
+ */
+ public static ITextEditor[] getTextEditors(IEditorPart editorPart) {
+ // if EditorPart is MultiPageEditorPart then get ITextEditor from it.
+ ITextEditor[] res = new ITextEditor[0];
+ if (editorPart instanceof MultiPageEditorPart) {
+ List<ITextEditor> testEditors = new ArrayList<ITextEditor>();
+ IEditorPart[] editors = ((MultiPageEditorPart)editorPart).findEditors(editorPart.getEditorInput());
+ for (int i = 0; i < editors.length; i++) {
+ if (editors[i] instanceof ITextEditor){
+ testEditors.add((ITextEditor)editors[i]);
}
}
+ res = (ITextEditor[])testEditors.toArray(res);
+ } else if (editorPart instanceof ITextEditor){
+ res = new ITextEditor[]{(ITextEditor) editorPart};
}
- return resource;
+ return res;
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-05-14 14:10:06 UTC (rev 15250)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2009-05-14 14:42:10 UTC (rev 15251)
@@ -11,17 +11,12 @@
package org.hibernate.eclipse.console.actions;
import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.List;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.FindReplaceDocumentAdapter;
-import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -31,7 +26,6 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.SelectionListenerAction;
-import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.texteditor.ITextEditor;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
@@ -41,53 +35,53 @@
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
-import org.hibernate.mapping.Subclass;
-import org.hibernate.tool.hbm2x.Cfg2HbmTool;
/**
+ * Open Mapping File action
+ *
* @author Dmitry Geraskov
+ * @author Vitali Yemialyanchyk
*/
-
public class OpenMappingAction extends SelectionListenerAction {
- private static final String HIBERNATE_TAG_NAME = "name"; //$NON-NLS-1$
- private static final String HIBERNATE_TAG_ENTITY_NAME = "entity-name"; //$NON-NLS-1$
- private String imageFilePath = "icons/images/mapping.gif"; //$NON-NLS-1$
+ private final String imageFilePath = "icons/images/mapping.gif"; //$NON-NLS-1$
public OpenMappingAction() {
super(HibernateConsoleMessages.OpenMappingAction_open_mapping_file);
setToolTipText(HibernateConsoleMessages.OpenMappingAction_open_mapping_file);
- setEnabled( true );
+ setEnabled(true);
setImageDescriptor(HibernateConsolePlugin.getImageDescriptor(imageFilePath ));
}
public void run() {
IStructuredSelection sel = getStructuredSelection();
- if (sel instanceof TreeSelection){
- for (int i = 0; i < ((TreeSelection)sel).getPaths().length; i++) {
- TreePath path = ((TreeSelection)sel).getPaths()[i];
- ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
- try {
- run(path, consoleConfiguration);
- } catch (JavaModelException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_cannot_find_mapping_file, e);
- } catch (PartInitException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_cannot_open_mapping_file, e);
- } catch (FileNotFoundException e) {
- HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_cannot_find_mapping_file, e);
- }
+ if (!(sel instanceof TreeSelection)) {
+ return;
+ }
+ TreePath[] paths = ((TreeSelection)sel).getPaths();
+ for (int i = 0; i < paths.length; i++) {
+ TreePath path = paths[i];
+ ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
+ try {
+ run(path, consoleConfiguration);
+ } catch (JavaModelException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_cannot_find_mapping_file, e);
+ } catch (PartInitException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_cannot_open_mapping_file, e);
+ } catch (FileNotFoundException e) {
+ HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.OpenMappingAction_cannot_find_mapping_file, e);
}
}
}
public static IEditorPart run(TreePath path, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException {
boolean isPropertySel = (path.getLastSegment().getClass() == Property.class);
- if (isPropertySel){
+ if (isPropertySel) {
Property propertySel = (Property)path.getLastSegment();
PersistentClass persClass = propertySel.getPersistentClass();
- if ( persClass == null
+ if (persClass == null
|| (RootClass.class.isAssignableFrom(persClass.getClass())
- && persClass.getClass() != RootClass.class)){
+ && persClass.getClass() != RootClass.class)) {
Property parentProp = (Property)path.getParentPath().getLastSegment();
return run(propertySel, parentProp, consoleConfiguration);
}
@@ -106,22 +100,22 @@
public static IEditorPart run(Object selection, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException {
IEditorPart editorPart = null;
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
- IResource resource = null;
+ IFile file = null;
if (selection instanceof Property) {
Property p = (Property)selection;
if (p.getPersistentClass() != null) {
//use PersistentClass to open editor
- resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, p.getPersistentClass());
+ file = OpenFileActionUtils.searchFileToOpen(consoleConfiguration, proj, p.getPersistentClass());
//editorPart = openMapping(p.getPersistentClass(), consoleConfiguration);
}
}
else {
- resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, selection);
+ file = OpenFileActionUtils.searchFileToOpen(consoleConfiguration, proj, selection);
//editorPart = openMapping(selection, consoleConfiguration);
}
- if (resource != null) {
- editorPart = openMapping(resource);
- applySelectionToEditor(selection, editorPart);
+ if (file != null) {
+ editorPart = OpenFileActionUtils.openFileInEditor(file);
+ updateEditorSelection(editorPart, selection);
}
if (editorPart == null) {
//try to find hibernate-annotations
@@ -136,9 +130,9 @@
}
}
if (rootClass != null){
- if (OpenFileActionUtils.rootClassHasAnnotations(consoleConfiguration, rootClass)) {
+ if (OpenFileActionUtils.hasConfigXMLMappingClassAnnotation(consoleConfiguration, rootClass)) {
String fullyQualifiedName = rootClass.getClassName();
- editorPart = OpenSourceAction.run(selection, proj, fullyQualifiedName);
+ editorPart = OpenSourceAction.run(selection, proj, fullyQualifiedName);
}
}
else {
@@ -150,38 +144,6 @@
}
/**
- * @param selection
- * @param editorPart
- */
- static public boolean applySelectionToEditor(Object selection, IEditorPart editorPart) {
- ITextEditor[] textEditors = getTextEditors(editorPart);
- if (textEditors.length == 0) {
- return false;
- }
- textEditors[0].selectAndReveal(0, 0);
- FindReplaceDocumentAdapter findAdapter = null;
- ITextEditor textEditor = null;
- for (int i = 0; i < textEditors.length && findAdapter == null; i++) {
- textEditor = textEditors[i];
- findAdapter = getFindDocAdapter(textEditor);
- }
- if (findAdapter == null) {
- return false;
- }
- IRegion selectRegion = null;
- if (selection instanceof RootClass || selection instanceof Subclass) {
- selectRegion = findSelection((PersistentClass)selection, findAdapter);
- } else if (selection instanceof Property){
- selectRegion = findSelection((Property)selection, findAdapter);
- }
- if (selectRegion != null){
- textEditor.selectAndReveal(selectRegion.getOffset(), selectRegion.getLength());
- return true;
- }
- return false;
- }
-
- /**
* @param compositeProperty
* @param parentProperty
* @param consoleConfiguration
@@ -193,14 +155,14 @@
public static IEditorPart run(Property compositeProperty, Property parentProperty, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException{
PersistentClass rootClass = parentProperty.getPersistentClass();
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
- IResource resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, rootClass);
+ IFile file = OpenFileActionUtils.searchFileToOpen(consoleConfiguration, proj, rootClass);
IEditorPart editorPart = null;
- if (resource != null){
- editorPart = openMapping(resource);
- updateEditorSelection(compositeProperty, parentProperty, editorPart);
+ if (file != null){
+ editorPart = OpenFileActionUtils.openFileInEditor(file);
+ updateEditorSelection(editorPart, compositeProperty, parentProperty);
}
if (editorPart == null && parentProperty.isComposite()) {
- if (OpenFileActionUtils.rootClassHasAnnotations(consoleConfiguration, rootClass)) {
+ if (OpenFileActionUtils.hasConfigXMLMappingClassAnnotation(consoleConfiguration, rootClass)) {
String fullyQualifiedName =((Component)((Property) parentProperty).getValue()).getComponentClassName();
editorPart = OpenSourceAction.run(compositeProperty, proj, fullyQualifiedName);
}
@@ -213,12 +175,39 @@
}
/**
+ * @param editorPart
+ * @param selection
+ */
+ public static boolean updateEditorSelection(IEditorPart editorPart, Object selection) {
+ ITextEditor[] textEditors = OpenFileActionUtils.getTextEditors(editorPart);
+ if (textEditors.length == 0) {
+ return false;
+ }
+ textEditors[0].selectAndReveal(0, 0);
+ FindReplaceDocumentAdapter findAdapter = null;
+ ITextEditor textEditor = null;
+ for (int i = 0; i < textEditors.length && findAdapter == null; i++) {
+ textEditor = textEditors[i];
+ findAdapter = OpenFileActionUtils.createFindDocAdapter(textEditor);
+ }
+ if (findAdapter == null) {
+ return false;
+ }
+ IRegion selectRegion = OpenFileActionUtils.findSelectRegion(findAdapter, selection);
+ if (selectRegion != null) {
+ textEditor.selectAndReveal(selectRegion.getOffset(), selectRegion.getLength());
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @param editorPart
* @param compositeProperty
* @param parentProperty
- * @param editorPart
*/
- static public boolean updateEditorSelection(Property compositeProperty, Property parentProperty, IEditorPart editorPart) {
- ITextEditor[] textEditors = getTextEditors(editorPart);
+ public static boolean updateEditorSelection(IEditorPart editorPart, Property compositeProperty, Property parentProperty) {
+ ITextEditor[] textEditors = OpenFileActionUtils.getTextEditors(editorPart);
if (textEditors.length == 0) {
return false;
}
@@ -227,28 +216,30 @@
ITextEditor textEditor = null;
for (int i = 0; i < textEditors.length && findAdapter == null; i++) {
textEditor = textEditors[i];
- findAdapter = getFindDocAdapter(textEditor);
+ findAdapter = OpenFileActionUtils.createFindDocAdapter(textEditor);
}
if (findAdapter == null) {
return false;
}
- IRegion parentRegion = findSelection(parentProperty, findAdapter);
+ IRegion parentRegion = OpenFileActionUtils.findSelectRegion(findAdapter, parentProperty);
if (parentRegion == null) {
return false;
}
+ int startOffset = parentRegion.getOffset() + parentRegion.getLength();
IRegion propRegion = null;
try {
- propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), generatePattern(compositeProperty), true, true, false, true);
+ final String hbmPropertyPattern = OpenFileActionUtils.generateHbmPropertyPattern(compositeProperty);
+ propRegion = findAdapter.find(startOffset, hbmPropertyPattern, true, true, false, true);
PersistentClass rootClass = parentProperty.getPersistentClass();
if (propRegion == null && parentProperty.isComposite()
&& rootClass.getIdentifierProperty() == parentProperty) {
// try to use key-property
- String pattern = generatePattern(compositeProperty).replaceFirst("<property", "<key-property"); //$NON-NLS-1$ //$NON-NLS-2$
- propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), pattern, true, true, false, true);
+ String pattern = hbmPropertyPattern.replaceFirst("<property", "<key-property"); //$NON-NLS-1$ //$NON-NLS-2$
+ propRegion = findAdapter.find(startOffset, pattern, true, true, false, true);
if (propRegion == null) {
// try to use key-many-to-one
- pattern = generatePattern(compositeProperty).replaceFirst("<many-to-one", "<key-many-to-one"); //$NON-NLS-1$ //$NON-NLS-2$
- propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), pattern, true, true, false, true);
+ pattern = hbmPropertyPattern.replaceFirst("<many-to-one", "<key-many-to-one"); //$NON-NLS-1$ //$NON-NLS-2$
+ propRegion = findAdapter.find(startOffset, pattern, true, true, false, true);
}
}
} catch (BadLocationException e) {
@@ -263,181 +254,4 @@
textEditor.selectAndReveal(propRegion.getOffset(), propRegion.getLength());
return true;
}
-
- /**
- * @param textEditor
- * @return
- */
- private static FindReplaceDocumentAdapter getFindDocAdapter(
- ITextEditor textEditor) {
- IDocument document = null;
- if (textEditor.getDocumentProvider() != null){
- document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
- }
- if (document == null) {
- return null;
- }
- FindReplaceDocumentAdapter findAdapter = new FindReplaceDocumentAdapter(document);
- return findAdapter;
- }
-
- static public IEditorPart openMapping(IResource resource) {
- IEditorPart editorPart = null;
- if (resource != null && resource instanceof IFile){
- try {
- editorPart = OpenFileActionUtils.openEditor(HibernateConsolePlugin.getDefault().getActiveWorkbenchWindow().getActivePage(), (IFile) resource);
- } catch (PartInitException e) {
- // ignore
- }
- } else {
- HibernateConsolePlugin.getDefault().log(HibernateConsoleMessages.OpenMappingAction_cannot_open_mapping_file + resource);
- }
- return editorPart;
- }
-
- public static IRegion findSelection(Property property, FindReplaceDocumentAdapter findAdapter) {
- Assert.isNotNull(property.getPersistentClass());
- IRegion classRegion = findSelection(property.getPersistentClass(), findAdapter);
- if (classRegion == null) {
- return null;
- }
- IRegion finalRegion = null;
- IRegion propRegion = null;
- try {
- finalRegion = findAdapter.find(classRegion.getOffset()+classRegion.getLength(), "</class", true, true, false, false); //$NON-NLS-1$
- propRegion = findAdapter.find(classRegion.getOffset()+classRegion.getLength(), generatePattern(property), true, true, false, true);
- } catch (BadLocationException e) {
- //ignore
- }
- IRegion res = null;
- if (propRegion != null) {
- int length = property.getName().length();
- int offset = propRegion.getOffset() + propRegion.getLength() - length - 1;
- res = new Region(offset, length);
- if (finalRegion != null && propRegion.getOffset() > finalRegion.getOffset()) {
- res = null;
- }
- }
- return res;
- }
- public static IRegion findSelection(PersistentClass persClass,
- FindReplaceDocumentAdapter findAdapter) {
- IRegion res = null;
- try {
- String[] classPatterns = generatePatterns(persClass);
- IRegion classRegion = null;
- for (int i = 0; (classRegion == null) && (i < classPatterns.length); i++){
- classRegion = findAdapter.find(0, classPatterns[i], true, true, false, true);
- }
- if (classRegion != null) {
- int length = persClass.getNodeName().length();
- int offset = classRegion.getOffset() + classRegion.getLength() - length - 1;
- res = new Region(offset, length);
- }
- } catch (BadLocationException e) {
- //ignore
- }
- return res;
- }
-
- private static String[] generatePatterns(PersistentClass persClass){
- String fullClassName = null;
- String shortClassName = null;
- if (persClass.getEntityName() != null){
- fullClassName = persClass.getEntityName();
- } else {
- fullClassName = persClass.getClassName();
- }
- shortClassName = fullClassName.substring(fullClassName.lastIndexOf('.') + 1);
-
- Cfg2HbmTool tool = new Cfg2HbmTool();
- String[] patterns = new String[4];
- StringBuffer pattern = new StringBuffer("<"); //$NON-NLS-1$
- pattern.append(tool.getTag(persClass));
- pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
- pattern.append(HIBERNATE_TAG_NAME);
- pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
- pattern.append(shortClassName);
- pattern.append('\"');
- patterns[0] = pattern.toString();
-
- pattern = new StringBuffer("<"); //$NON-NLS-1$
- pattern.append(tool.getTag(persClass));
- pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
- pattern.append(HIBERNATE_TAG_NAME);
- pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
- pattern.append(fullClassName);
- pattern.append('\"');
- patterns[1] = pattern.toString();
-
- pattern = new StringBuffer("<"); //$NON-NLS-1$
- pattern.append(tool.getTag(persClass));
- pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
- pattern.append(HIBERNATE_TAG_ENTITY_NAME);
- pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
- pattern.append(shortClassName);
- pattern.append('\"');
- patterns[2] = pattern.toString();
-
- pattern = new StringBuffer("<"); //$NON-NLS-1$
- pattern.append(tool.getTag(persClass));
- pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
- pattern.append(HIBERNATE_TAG_ENTITY_NAME);
- pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
- pattern.append(fullClassName);
- pattern.append('\"');
- patterns[3] = pattern.toString();
- return patterns;
- }
-
- private static String generatePattern(Property property){
- Cfg2HbmTool tool = new Cfg2HbmTool();
- StringBuffer pattern = new StringBuffer("<"); //$NON-NLS-1$
- if(property.getPersistentClass() != null &&
- property.getPersistentClass().getIdentifierProperty()==property) {
- if (property.isComposite()){
- pattern.append("composite-id"); //$NON-NLS-1$
- } else {
- pattern.append("id"); //$NON-NLS-1$
- }
- } else{
- String toolTag = tool.getTag(property);
- if ("component".equals(toolTag) && "embedded".equals(property.getPropertyAccessorName())){ //$NON-NLS-1$//$NON-NLS-2$
- toolTag = "properties"; //$NON-NLS-1$
- }
- pattern.append(toolTag);
- }
- pattern.append("[\\s]+[.[^>]]*"); //$NON-NLS-1$
- pattern.append(HIBERNATE_TAG_NAME);
- pattern.append("[\\s]*=[\\s]*\""); //$NON-NLS-1$
- pattern.append(property.getName());
- pattern.append('\"');
- return pattern.toString();
- }
-
- /**
- * Method gets all ITextEditors from IEditorPart.
- * Never returns null.
- * @param editorPart
- * @return
- */
- public static ITextEditor[] getTextEditors(IEditorPart editorPart) {
- /*
- * if EditorPart is MultiPageEditorPart then get ITextEditor from it.
- */
- ITextEditor[] res = new ITextEditor[0];
- if (editorPart instanceof MultiPageEditorPart) {
- List testEditors = new ArrayList();
- IEditorPart[] editors = ((MultiPageEditorPart) editorPart).findEditors(editorPart.getEditorInput());
- for (int i = 0; i < editors.length; i++) {
- if (editors[i] instanceof ITextEditor){
- testEditors.add(editors[i]);
- }
- }
- res = (ITextEditor[])testEditors.toArray(res);
- } else if (editorPart instanceof ITextEditor){
- res = new ITextEditor[]{(ITextEditor) editorPart};
- }
- return res;
- }
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/CriteriaQuickAssistProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/CriteriaQuickAssistProcessor.java 2009-05-14 14:10:06 UTC (rev 15250)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/CriteriaQuickAssistProcessor.java 2009-05-14 14:42:10 UTC (rev 15251)
@@ -39,7 +39,7 @@
import org.eclipse.ui.texteditor.ITextEditor;
import org.hibernate.console.ImageConstants;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
-import org.hibernate.eclipse.console.actions.OpenMappingAction;
+import org.hibernate.eclipse.console.actions.OpenFileActionUtils;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.jdt.ui.Activator;
@@ -62,7 +62,7 @@
public void apply(IDocument target) {
//IEditorPart editorPart = HibernateConsolePlugin.getDefault().openCriteriaEditor(getName(), getContents());
IEditorPart editorPart = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ITextEditor[] textEditors = OpenMappingAction.getTextEditors(editorPart);
+ ITextEditor[] textEditors = OpenFileActionUtils.getTextEditors(editorPart);
if (textEditors.length == 0) return;
new SaveQueryEditorListener(textEditors[0], getName(), getContents(), position, SaveQueryEditorListener.CriteriaEditor);
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLQuickAssistProcessor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLQuickAssistProcessor.java 2009-05-14 14:10:06 UTC (rev 15250)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLQuickAssistProcessor.java 2009-05-14 14:42:10 UTC (rev 15251)
@@ -32,7 +32,7 @@
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.texteditor.ITextEditor;
import org.hibernate.console.ImageConstants;
-import org.hibernate.eclipse.console.actions.OpenMappingAction;
+import org.hibernate.eclipse.console.actions.OpenFileActionUtils;
import org.hibernate.eclipse.console.utils.EclipseImages;
import org.hibernate.eclipse.jdt.ui.Activator;
@@ -55,7 +55,7 @@
result[0] = new ExternalActionQuickAssistProposal(contents, EclipseImages.getImage(ImageConstants.HQL_EDITOR), JdtUiMessages.HQLQuickAssistProcessor_copy_to_hql_editor, context) {
public void apply(IDocument document) {
IEditorPart editorPart = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ITextEditor[] textEditors = OpenMappingAction.getTextEditors(editorPart);
+ ITextEditor[] textEditors = OpenFileActionUtils.getTextEditors(editorPart);
if (textEditors.length == 0) return;
Point position = new Point(stringLiteral.getStartPosition() + 1, stringLiteral.getLength() - 2);
new SaveQueryEditorListener(textEditors[0], getName(), getContents(), position, SaveQueryEditorListener.HQLEditor);
17 years, 2 months
JBoss Tools SVN: r15250 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-05-14 10:10:06 -0400 (Thu, 14 May 2009)
New Revision: 15250
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/fileUpload.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/fileUpload.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml
Log:
JUnit tests update for RichFaces UI.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml 2009-05-14 13:01:28 UTC (rev 15249)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml 2009-05-14 14:10:06 UTC (rev 15250)
@@ -7,6 +7,7 @@
xmlns:rich="http://richfaces.org/rich">
<head>
+ <link href="/WebContent/pages/components/main.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h1>columns</h1>
@@ -18,6 +19,29 @@
<h:outputText value="#{book.price}" />
</rich:columns>
</rich:dataTable>
+ <rich:panel id="columns1" styleClass="btn" style=" height : 138px;">
+ <f:facet name="header">
+ <h:outputText value="Columns" />
+ </f:facet>
+ <rich:dataTable value="#{dataTableScrollerBean.model}" var="model"
+ width="750"
+ style="text-align:center;color:Orchid;font-style:italic;font-size:x-large;border-style:dotted;background-color:Turquoise;
+ border-color:Cornsilk;text-decoration:overline;font-family:Agency FB,Arial,Arial Baltic,Arial Black,Arial CE,Arial CYR,Arial Cyr,Arial Greek,Arial Narrow,Arial Rounded MT Bold,Arial TUR,Blackadder ITC,Bodoni MT,Bodoni MT Black,Bodoni MT Condensed,Book Antiqua,Bookman Old Style,Bookshelf Symbol 7,Bradley Hand ITC,Calisto MT,Castellar,Century Gothic,Century Schoolbook,Comic Sans MS,Copperplate Gothic Bold,Copperplate Gothic Light,Courier,Courier New,Courier New Baltic,Courier New CE,Courier New CYR,Courier New Cyr,Courier New Greek,Courier New TUR,Curlz MT,Edwardian Script ITC,Elephant,Engravers MT,Eras Bold ITC,Eras Demi ITC,Eras Light ITC,Eras Medium ITC,Estrangelo Edessa,Felix Titling,Fixedsys,Forte,Franklin Gothic Book,Franklin Gothic Demi,Franklin Gothic Demi Cond,Franklin Gothic Heavy,Franklin Gothic Medium,Franklin Gothic Medium Cond,French Script MT,Garamond,Gautami,Georgia,Gigi,Gill Sans MT,Gill Sans MT Condensed,Gill Sans MT Ext Condensed Bold,Gill Sans !
Ultra Bold,Gill Sans Ultra Bold Condensed,Gloucester MT Extra Condensed,Goudy Old Style,Goudy Stout,Haettenschweiler,Impact,Imprint MT Shadow,Latha,Lucida Console,Lucida Sans,Lucida Sans Typewriter,Lucida Sans Unicode,MS Outlook,MS Reference Sans Serif,MS Reference Specialty,MS Sans Serif,MS Serif,MT Extra,MV Boli,Maiandra GD,Mangal,Marlett,Microsoft Sans Serif,Modern,Monotype Corsiva,OCR A Extended,Palace Script MT,Palatino Linotype,Papyrus,Perpetua,Perpetua Titling MT,Pristina,Raavi,Rage Italic,Rockwell,Rockwell Condensed,Rockwell Extra Bold,Roman,Script,Script MT Bold,Shruti,Small Fonts,Sylfaen,Symbol,System,Tahoma,Terminal,Times New Roman,Times New Roman Baltic,Times New Roman CE,Times New Roman CYR,Times New Roman Cyr,Times New Roman Greek,Times New Roman TUR,Trebuchet MS,Tunga,Tw Cen MT,Tw Cen MT Condensed,Tw Cen MT Condensed Extra Bold,Verdana,WST_Czec,WST_Engl,WST_Fren,WST_Germ,WST_Ital,WST_Span,WST_Swed,Webdings,Wingdings,Wingdings 2,Wingdings 3;border-width:thick;!
font-weight:bold;">
+ <f:facet name="header">
+ <h:outputText value="Cars Available"></h:outputText>
+ </f:facet>
+ <rich:columns value="#{dataTableScrollerBean.columns}" var="columns"
+ index="ind" sortBy="#{model[ind].price}">
+ <f:facet name="header">
+ <h:outputText value="#{columns.header}" />
+ </f:facet>
+ <h:outputText value="#{model[ind].model} " />
+ <h:outputText value="#{model[ind].mileage} miles " />
+ <h:outputText value="#{model[ind].price}$"
+ style="font-style:italic;" />
+ </rich:columns>
+ </rich:dataTable>
+ </rich:panel>
</h:form>
</body>
</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml.xml 2009-05-14 13:01:28 UTC (rev 15249)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml.xml 2009-05-14 14:10:06 UTC (rev 15250)
@@ -4,4 +4,66 @@
<SPAN> #{book.price}</SPAN>
</TD>
</test>
+ <test id="columns1">
+ <DIV CLASS="dr-pnl rich-panel btn" STYLE="height: 138px;">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/">
+ <SPAN CLASS="vpe-text">
+ Columns
+ </SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <TABLE WIDTH="750" VALUE="#{dataTableScrollerBean.model}" VAR="model"
+ STYLE="border: thick dotted Cornsilk; text-align: center; color: Orchid; font-style: italic; font-size: x-large; background-color: Turquoise; text-decoration: overline; font-weight: bold;"
+ CLASS="dr-table rich-table">
+ <COLGROUP SPAN="1">
+ </COLGROUP>
+ <THEAD>
+ <TR CLASS="dr-table-header rich-table-header"
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/">
+ <TD CLASS="dr-table-headercell rich-table-headercell" COLSPAN="100"
+ SCOPE="colgroup">
+ <SPAN CLASS="vpe-text">
+ Cars Available
+ </SPAN>
+ <BR _MOZ_DIRTY="" TYPE="_moz" />
+
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-subheader rich-table-subheader">
+ <TD CLASS="dr-table-subheadercell rich-table-subheadercell"
+ SCOPE="col">
+ <SPAN>
+ <SPAN CLASS="vpe-text">
+ #{columns.header}
+ </SPAN>
+ </SPAN>
+ <IMG
+ SRC="/.*resources/column/sortable.gif/"
+ STYLE="vertical-align: middle;" />
+ <BR _MOZ_DIRTY="" TYPE="_moz" />
+
+ </TD>
+ </TR>
+ </THEAD>
+ <TR CLASS="dr-table-firstrow rich-table-firstrow">
+ <TD VALUE="#{dataTableScrollerBean.columns}" VAR="columns"
+ INDEX="ind" SORTBY="#{model[ind].price}" CLASS="dr-table-cell rich-table-cell">
+ <SPAN CLASS="vpe-text">
+ #{model[ind].model}
+ </SPAN>
+ <SPAN CLASS="vpe-text">
+ #{model[ind].mileage} miles
+ </SPAN>
+ <SPAN STYLE="font-style: italic;">
+ #{model[ind].price}$
+ </SPAN>
+ <BR _MOZ_DIRTY="" TYPE="_moz" />
+
+ </TD>
+ </TR>
+ </TABLE>
+ </DIV>
+ </DIV>
+ </test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml 2009-05-14 13:01:28 UTC (rev 15249)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml 2009-05-14 14:10:06 UTC (rev 15250)
@@ -7,29 +7,51 @@
xmlns:rich="http://richfaces.org/rich">
<head>
- <style type="text/css">
- .red-text {
- color:red;
- }
- .blue-text {
- color:blue;
- }
- .yellow-background {
- background-color: yellow;
- }
- </style>
+<style type="text/css">
+.red-text {
+ color: red;
+}
+
+.blue-text {
+ color: blue;
+}
+
+.yellow-background {
+ background-color: yellow;
+}
+</style>
</head>
<body>
<f:view>
<rich:dataDefinitionList id="dataDefinitionList" rows="5"
- styleClass="yellow-background" rowClasses="red-text, blue-text">
- <f:facet name="term"><h:outputText value="TERM-VISIBLE"/></f:facet>
- <f:facet name="term"><h:outputText value="TERM-INVISIBLE"/></f:facet>
+ styleClass="yellow-background" rowClasses="red-text, blue-text">
+ <f:facet name="term">
+ <h:outputText value="TERM-VISIBLE" />
+ </f:facet>
+ <f:facet name="term">
+ <h:outputText value="TERM-INVISIBLE" />
+ </f:facet>
<h:outputText value="col1" />
<h:outputText value="col2" />
<h:outputText value="col3" />
<h:outputText value="col4" />
</rich:dataDefinitionList>
+ <rich:panel id="dataDefinitionList1">
+ <f:facet name="header">
+ <h:outputText value="Data Defenition list" />
+ </f:facet>
+ <h:form>
+ <rich:dataDefinitionList id="defList" rows="3" title="Book Store"
+ style="text-align:center;color:PaleVioletRed;font-style:oblique;font-size:x-large;border-style:dotted;background-color:Grey;border-color:Cornsilk;text-decoration:overline;font-family:Arial TUR;border-width:thick;font-weight:bolder;"
+ value="#{dataTableScrollerBean.columns}" var="columns">
+ <f:facet name="term">
+ <h:outputText value="Facet Term" />
+ </f:facet>
+ <h:outputText value="Price: "></h:outputText>
+ <h:outputText value="Number of copies:"></h:outputText>
+ </rich:dataDefinitionList>
+ </h:form>
+ </rich:panel>
</f:view>
</body>
</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml.xml 2009-05-14 13:01:28 UTC (rev 15249)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataDefinitionList.xhtml.xml 2009-05-14 14:10:06 UTC (rev 15250)
@@ -4,109 +4,172 @@
<DL CLASS="yellow-background">
<DT CLASS="headerClass">
<DIV>
- <SPAN>
+ <SPAN CLASS="vpe-text">
TERM-VISIBLE
-</SPAN>
+ </SPAN>
</DIV>
</DT>
<DD CLASS="columnClass red-text">
- <SPAN>
+ <SPAN CLASS="vpe-text">
col1
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col2
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col3
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col4
-</SPAN>
+ </SPAN>
</DD>
<DT CLASS="headerClass">
<DIV>
- <SPAN>
- TERM-VISIBLE
-</SPAN>
+ <SPAN CLASS="vpe-text">
+ TERM-VISIBLE
+ </SPAN>
</DIV>
</DT>
<DD CLASS="columnClass blue-text">
- <SPAN>
+ <SPAN CLASS="vpe-text">
col1
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col2
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col3
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col4
-</SPAN>
+ </SPAN>
</DD>
<DT CLASS="headerClass">
<DIV>
- <SPAN>
+ <SPAN CLASS="vpe-text">
TERM-VISIBLE
-</SPAN>
+ </SPAN>
</DIV>
</DT>
<DD CLASS="columnClass red-text">
- <SPAN>
+ <SPAN CLASS="vpe-text">
col1
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col2
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col3
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col4
-</SPAN>
+ </SPAN>
</DD>
<DT CLASS="headerClass">
<DIV>
- <SPAN>
+ <SPAN CLASS="vpe-text">
TERM-VISIBLE
-</SPAN>
+ </SPAN>
</DIV>
</DT>
<DD CLASS="columnClass blue-text">
- <SPAN>
+ <SPAN CLASS="vpe-text">
col1
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col2
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col3
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col4
-</SPAN>
+ </SPAN>
</DD>
<DT CLASS="headerClass">
<DIV>
- <SPAN>
+ <SPAN CLASS="vpe-text">
TERM-VISIBLE
-</SPAN>
+ </SPAN>
</DIV>
</DT>
<DD CLASS="columnClass red-text">
- <SPAN>
+ <SPAN CLASS="vpe-text">
col1
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col2
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col3
-</SPAN>
- <SPAN>
+ </SPAN>
+ <SPAN CLASS="vpe-text">
col4
-</SPAN>
+ </SPAN>
</DD>
</DL>
</test>
+ <test id="dataDefinitionList1">
+ <DIV CLASS="dr-pnl rich-panel">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="background-image: url(file:///D:/Java/WorkSpace/trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif);">
+ <SPAN CLASS="vpe-text">
+ Data Defenition list
+ </SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+ <DL
+ STYLE="border: thick dotted Cornsilk; text-align: center; color: PaleVioletRed; font-style: oblique; font-size: x-large; background-color: Grey; text-decoration: overline; font-family: Arial TUR; font-weight: bolder;"
+ CLASS="listClass">
+ <DT CLASS="headerClass">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ Facet Term
+ </SPAN>
+ </DIV>
+ </DT>
+ <DD CLASS="columnClass">
+ <SPAN CLASS="vpe-text">
+ Price:
+ </SPAN>
+ <SPAN CLASS="vpe-text">
+ Number of copies:
+ </SPAN>
+ </DD>
+ <DT CLASS="headerClass">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ Facet Term
+ </SPAN>
+ </DIV>
+ </DT>
+ <DD CLASS="columnClass">
+ <SPAN CLASS="vpe-text">
+ Price:
+ </SPAN>
+ <SPAN CLASS="vpe-text">
+ Number of copies:
+ </SPAN>
+ </DD>
+ <DT CLASS="headerClass">
+ <DIV>
+ <SPAN CLASS="vpe-text">
+ Facet Term
+ </SPAN>
+ </DIV>
+ </DT>
+ <DD CLASS="columnClass">
+ <SPAN CLASS="vpe-text">
+ Price:
+ </SPAN>
+ <SPAN CLASS="vpe-text">
+ Number of copies:
+ </SPAN>
+ </DD>
+ </DL>
+ </FORM>
+ </DIV>
+ </DIV>
+ </test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/fileUpload.xhtml
===================================================================
(Binary files differ)
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/fileUpload.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/fileUpload.xhtml.xml 2009-05-14 13:01:28 UTC (rev 15249)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/fileUpload.xhtml.xml 2009-05-14 14:10:06 UTC (rev 15250)
@@ -32,4 +32,251 @@
</DIV>
</DIV>
</test>
+ <test id="fileUpload1">
+ <DIV CLASS="dr-pnl rich-panel">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/">
+ <SPAN CLASS="vpe-text">
+ File Upload
+ </SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+ <TABLE BORDER="0" STYLE="-moz-user-modify: read-write;">
+ <TBODY>
+ <TR>
+ <TD CLASS="top">
+ <DIV CLASS="rich-fileupload-list-decor" STYLE="width: 400px;">
+ <TABLE CLASS="rich-fileupload-toolbar-decor">
+ <TR>
+ <TD>
+ <DIV CLASS="rich-fileupload-button-border" STYLE="float: left;">
+ <DIV CLASS="rich-fileupload-button rich-fileupload-font btn"
+ STYLE="position: relative;">
+ <DIV
+ CLASS="rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-add btn">
+ Add...
+ </DIV>
+ </DIV>
+ </DIV>
+ <DIV CLASS="rich-fileupload-button-border" STYLE="float: left;">
+ <DIV CLASS="rich-fileupload-button rich-fileupload-font btn">
+ <DIV
+ CLASS="rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-start btn">
+ <B>
+ Upload
+ </B>
+ </DIV>
+ </DIV>
+ </DIV>
+ <DIV CLASS="rich-fileupload-button-border" STYLE="float: right;">
+ <DIV CLASS="rich-fileupload-button rich-fileupload-font btn">
+ <DIV
+ CLASS="rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-clear btn">
+ Clear All
+ </DIV>
+ </DIV>
+ </DIV>
+ </TD>
+ </TR>
+ </TABLE>
+ <DIV CLASS="rich-fileupload-list-overflow" STYLE="width: 100%; height: 210px;">
+ </DIV>
+ </DIV>
+ </TD>
+ <TD CLASS="top">
+ <SPAN STYLE="-moz-user-modify: read-write;">
+ <DIV CLASS="dr-pnl rich-panel">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/">
+ <SPAN CLASS="vpe-text">
+ Uploaded Files Info
+ </SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body info">
+ <SPAN CLASS="vpe-text">
+ No files currently uploaded
+ </SPAN>
+ <TABLE COLUMNS="1" VALUE="#{fileUploadBean.files}"
+ VAR="file" ROWKEYVAR="row" CLASS="dr-table rich-table">
+ <COLGROUP SPAN="1">
+ </COLGROUP>
+ <TBODY>
+ <TR CLASS="dr-table-row rich-table-row">
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <DIV CLASS="dr-pnl rich-panel">
+ <DIV
+ CLASS="dr-pnl-b rich-panel-body rich-laguna-panel-no-header">
+ <TABLE BORDER="0" STYLE="-moz-user-modify: read-write;">
+ <TBODY>
+ <TR>
+ <TD>
+ <IMG
+ SRC="/.*resources/mediaOutput/mediaOutput.jpg/"
+ STYLE="width: 50px; height: 50px;" />
+
+ </TD>
+ <TD>
+ <TABLE BORDER="0"
+ STYLE="-moz-user-modify: read-write;">
+ <TBODY>
+ <TR>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ File Name:
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ #{file.name}
+ </SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ File Length(bytes):
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ #{file.length}
+ </SPAN>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ </DIV>
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-row rich-table-row">
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <DIV CLASS="dr-pnl rich-panel">
+ <DIV
+ CLASS="dr-pnl-b rich-panel-body rich-laguna-panel-no-header">
+ <TABLE BORDER="0" STYLE="-moz-user-modify: read-write;">
+ <TBODY>
+ <TR>
+ <TD>
+ <IMG
+ SRC="/.*resources/mediaOutput/mediaOutput.jpg/"
+ STYLE="width: 50px; height: 50px;" />
+
+ </TD>
+ <TD>
+ <TABLE BORDER="0"
+ STYLE="-moz-user-modify: read-write;">
+ <TBODY>
+ <TR>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ File Name:
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ #{file.name}
+ </SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ File Length(bytes):
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ #{file.length}
+ </SPAN>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ </DIV>
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-row rich-table-row">
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <DIV CLASS="dr-pnl rich-panel">
+ <DIV
+ CLASS="dr-pnl-b rich-panel-body rich-laguna-panel-no-header">
+ <TABLE BORDER="0" STYLE="-moz-user-modify: read-write;">
+ <TBODY>
+ <TR>
+ <TD>
+ <IMG
+ SRC="/.*resources/mediaOutput/mediaOutput.jpg/"
+ STYLE="width: 50px; height: 50px;" />
+
+ </TD>
+ <TD>
+ <TABLE BORDER="0"
+ STYLE="-moz-user-modify: read-write;">
+ <TBODY>
+ <TR>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ File Name:
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ #{file.name}
+ </SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ File Length(bytes):
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ #{file.length}
+ </SPAN>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ </DIV>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ </DIV>
+ <IMG WIDTH="1" HEIGHT="3"
+ SRC="/.*resources/spacer/spacer.gif/"
+ CLASS="rich-spacer" />
+ <BR STYLE="-moz-user-modify: read-write;" />
+
+ <INPUT TYPE="button" VALUE="Clear Uploaded Data"
+ STYLE="-moz-user-modify: read-only;" />
+
+ </SPAN>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </FORM>
+ </DIV>
+ </DIV>
+ </test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml
===================================================================
(Binary files differ)
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml 2009-05-14 13:01:28 UTC (rev 15249)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/progressBar.xhtml.xml 2009-05-14 14:10:06 UTC (rev 15250)
@@ -7,9 +7,33 @@
STYLE="height: 13px; width: 60%;">
<DIV
STYLE="height: 13px; font-weight: bold; position: relative; text-align: center;">
- #{progressBarBean.currentValue} %
+ #{progressBarBean.currentValue} % </DIV>
+ </DIV>
</DIV>
-</DIV>
-</DIV>
- </test>
+ </test>
+ <test id="progressBar1">
+ <DIV CLASS="dr-pnl rich-panel">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/">
+ <SPAN CLASS="vpe-text">
+ Progress Bar
+ </SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <DIV
+ CLASS="rich-progress-bar-block rich-progress-bar-width rich-progress-bar-shell btn"
+ STYLE="color: red; text-align: left;">
+ <DIV CLASS="rich-progress-bar-height rich-progress-bar-uploaded null"
+ STYLE="color: red; width: 60%;">
+ </DIV>
+ </DIV>
+ <BUTTON STYLE="margin: 9px 0px 5px; -moz-user-modify: read-only;"
+ ID="button">
+ <SPAN CLASS="vpe-text">
+ Start Progress
+ </SPAN>
+ </BUTTON>
+ </DIV>
+ </DIV>
+ </test>
</tests>
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r15249 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-14 09:01:28 -0400 (Thu, 14 May 2009)
New Revision: 15249
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java 2009-05-14 13:01:28 UTC (rev 15249)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.taglib;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+import org.jboss.tools.jst.web.kb.taglib.IAttribute;
+
+/**
+ * Abstract implementation of IAttribute
+ * @author Alexey Kazakov
+ */
+public abstract class AbstractAttribute implements IAttribute {
+
+ protected String description;
+ protected String name;
+ protected boolean preferable;
+ protected boolean required;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IAttribute#getDescription()
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @param description the description to set
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IAttribute#getName()
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IAttribute#isPreferable()
+ */
+ public boolean isPreferable() {
+ return preferable;
+ }
+
+ /**
+ * @param preferable the preferable to set
+ */
+ public void setPreferable(boolean preferable) {
+ this.preferable = preferable;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.taglib.IAttribute#isRequired()
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /**
+ * @param required the required to set
+ */
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ public TextProposal[] getProposals(KbQuery query, IPageContext context) {
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ ELResolver[] resolvers = context.getElResolvers();
+ for (int i = 0; i < resolvers.length; i++) {
+ proposals.addAll(resolvers[i].getCompletions(query.getValue(), false, query.getValue().length(), context));
+ }
+ return proposals.toArray(new TextProposal[proposals.size()]);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r15248 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-14 08:45:12 -0400 (Thu, 14 May 2009)
New Revision: 15248
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/StripTagAction.java
Log:
Fixed Java 5.0 support
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/StripTagAction.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/StripTagAction.java 2009-05-14 11:46:04 UTC (rev 15247)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/StripTagAction.java 2009-05-14 12:45:12 UTC (rev 15248)
@@ -82,7 +82,7 @@
return false;
}
if (childrenLength == 1
- && children.item(0).getNodeValue().trim().isEmpty()) {
+ && children.item(0).getNodeValue().trim().length()==0) {
return false;
}
17 years, 2 months
JBoss Tools SVN: r15247 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-14 07:46:04 -0400 (Thu, 14 May 2009)
New Revision: 15247
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4312
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java 2009-05-14 08:03:37 UTC (rev 15246)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/PositionSearcher.java 2009-05-14 11:46:04 UTC (rev 15247)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.common.model.util;
+import java.util.StringTokenizer;
+
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.model.XModelObject;
@@ -67,7 +69,7 @@
if(xml == null || xml.length() == 0) return;
if(xml.indexOf(".") < 0) {
String s = text.substring(startPosition, endPosition);
- int i1 = s.indexOf(xml);
+ int i1 = findAttrPosition(s, xml);
if(selectAttributeName) {
if(i1 < 0) return;
startPosition = startPosition + i1;
@@ -102,6 +104,31 @@
}
}
}
+
+ private int findAttrPosition(String s, String name) {
+ int i = s.indexOf(name);
+ if(i < 0) {
+ return -1;
+ }
+ StringTokenizer st = new StringTokenizer(s, "\"", true);
+ int pos = 0;
+ boolean inValue = false;
+ while(st.hasMoreTokens()) {
+ String t = st.nextToken();
+ if(t.equals("\"")) {
+ inValue = !inValue;
+ } else {
+ if(!inValue) {
+ int k = t.indexOf(name);
+ if(k >= 0) {
+ return pos + k;
+ }
+ }
+ }
+ pos += t.length();
+ }
+ return -1;
+ }
public int getStartPosition() {
return startPosition;
17 years, 2 months
JBoss Tools SVN: r15246 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-05-14 04:03:37 -0400 (Thu, 14 May 2009)
New Revision: 15246
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-13 18:39:30 UTC (rev 15245)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/RenameComponentProcessor.java 2009-05-14 08:03:37 UTC (rev 15246)
@@ -429,7 +429,17 @@
}
}
+ private boolean isBadLocation(ISeamTextSourceReference location){
+ if(location.getStartPosition() == 0 && location.getLength() == 0)
+ return true;
+ else
+ return false;
+ }
+
private void changeXMLNode(ISeamTextSourceReference location, IFile file){
+ if(isBadLocation(location))
+ return;
+
String content = null;
try {
content = FileUtil.readStream(file.getContents());
@@ -456,6 +466,9 @@
}
private void changeAnnotation(ISeamTextSourceReference location, IFile file){
+ if(isBadLocation(location))
+ return;
+
String content = null;
try {
content = FileUtil.readStream(file.getContents());
17 years, 2 months
JBoss Tools SVN: r15245 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor/menu and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-05-13 14:39:30 -0400 (Wed, 13 May 2009)
New Revision: 15245
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/ComplexAction.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/EditAttributesAction.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SelectThisTagAction.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/StripTagAction.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/InsertAction2.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
issue JBIDE-4226: Two different implementations of the VPE context menu
https://jira.jboss.org/jira/browse/JBIDE-4226
- the implementations have been merged and some actions have been rewritten
- some bugs have been fixed
- cut/add/paste items have been added to the menu of parent tag
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-05-13 16:28:09 UTC (rev 15244)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -16,12 +16,10 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.bindings.Binding;
@@ -110,7 +108,7 @@
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
-import org.jboss.tools.vpe.editor.menu.MenuCreationHelper;
+import org.jboss.tools.vpe.editor.menu.VpeMenuCreator;
import org.jboss.tools.vpe.editor.mozilla.EditorDomEventListener;
import org.jboss.tools.vpe.editor.mozilla.MozillaDropInfo;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
@@ -246,8 +244,7 @@
domMapping = new VpeDomMapping(pageContext);
sourceBuilder = new VpeSourceDomBuilder(domMapping, this,
VpeTemplateManager.getInstance(), sourceEditor, pageContext);
- visualBuilder = new VpeVisualDomBuilder(domMapping, this, visualEditor,
- pageContext);
+ visualBuilder = new VpeVisualDomBuilder(domMapping, this, visualEditor, pageContext);
pageContext.setSourceDomBuilder(sourceBuilder);
pageContext.setVisualDomBuilder(visualBuilder);
IDOMModel sourceModel = (IDOMModel) getModel();
@@ -272,8 +269,7 @@
}
IDOMDocument sourceDocument = sourceModel.getDocument();
- // FIXED FOR JBIDE-3799 by sdzmitrovich, moved calling of
- // this method to buid dom
+ // FIXED FOR JBIDE-3799 by sdzmitrovich, moved calling of this method to buid dom
// visualBuilder.refreshExternalLinks();
visualBuilder.buildDom(sourceDocument);
@@ -284,8 +280,7 @@
// presShell = browser.getPresShell();
//initialization visual selection controller
- visualSelectionController = new VpeSelectionController(
- visualEditor.getEditor().getSelectionController());
+ visualSelectionController = new VpeSelectionController(visualEditor.getEditor().getSelectionController());
selectionBuilder = new VpeSelectionBuilder(domMapping, sourceBuilder,
visualBuilder, visualSelectionController);
@@ -350,8 +345,7 @@
vpeUpdateDelayTime = 400;
// pageContext.fireTaglibsChanged();
- // yradtsevich: we have to refresh VPE selection on init
- // (fix of JBIDE-4037)
+ // yradtsevich: we have to refresh VPE selection on init (fix of JBIDE-4037)
sourceSelectionChanged(true);
}
@@ -373,8 +367,7 @@
}
if (optionsListener != null) {
- XModelObject optionsObject = ModelUtilities.getPreferenceModel()
- .getByPath(VpePreference.EDITOR_PATH);
+ XModelObject optionsObject = ModelUtilities.getPreferenceModel().getByPath(VpePreference.EDITOR_PATH);
optionsObject.getModel().removeModelTreeListener(optionsListener);
optionsListener.dispose();
optionsListener = null;
@@ -463,7 +456,7 @@
if (PlatformUI.isWorkbenchRunning())
display = PlatformUI.getWorkbench().getDisplay();
- if (display != null && Thread.currentThread() == display.getThread()) {
+ if (display != null && (Thread.currentThread() == display.getThread())) {
getChangeEvents().addLast(
new VpeEventBean(notifier, eventType, feature, oldValue,
newValue, pos));
@@ -471,22 +464,18 @@
uiJob = new UIJob(VpeUIMessages.VPE_UPDATE_JOB_TITLE) {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
- monitor.beginTask(VpeUIMessages.VPE_UPDATE_JOB_TITLE,
- 100);
+ monitor.beginTask(VpeUIMessages.VPE_UPDATE_JOB_TITLE, 100);
while (getChangeEvents().size() > 0) {
- monitor.worked(
- (int) (100 / getChangeEvents().size()));
- VpeEventBean eventBean = getChangeEvents()
- .getFirst();
+ monitor.worked((int) (100 / getChangeEvents().size()));
+ VpeEventBean eventBean = getChangeEvents().getFirst();
if (monitor.isCanceled()) {
- /* Yahor Radtsevich: the following line is
- * commented as the fix of JBIDE-3758:
- * VPE autorefresh is broken in some cases.
- * Now if the change events queue should be
- * cleared, the programmer have to do it
- * explicitly.
+ /*
+ * Yahor Radtsevich: the following line is commented
+ * as fix of JBIDE-3758: VPE autorefresh is broken in some cases.
+ * Now if the change events queue should be cleared, the user have to do it explicitly.
*/
// getChangeEvents().clear();
+
return Status.CANCEL_STATUS;
}
try {
@@ -501,7 +490,8 @@
// JBIDE-675 we will get this exception if user
// close editor,
// when update visual editor job is running, we
- // should ignore this exception
+ // shoud ignore this
+ // exception
break;
} catch (NullPointerException ex) {
if (switcher != null) {
@@ -517,22 +507,18 @@
}
// cause is to lock calls others events
if (switcher != null &&
- switcher.startActiveEditor(ActiveEditorSwitcher
- .ACTIVE_EDITOR_SOURCE))
+ switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE))
try {
sourceSelectionChanged();
/*
* https://jira.jboss.org/jira/browse/JBIDE-3619
- * VpeViewUpdateJob takes place after toolbar
- * selection have been updated.
+ * VpeViewUpdateJob takes place after toolbar selection have been updated.
* New nodes haven't been put into dom mapping
* thus toolbar becomes desabled.
- * Updating toolbar state here takes into
- * account updated vpe nodes.
+ * Updating toolbar state here takes into account updated vpe nodes.
*/
if (toolbarFormatControllerManager != null) {
- toolbarFormatControllerManager
- .selectionChanged();
+ toolbarFormatControllerManager.selectionChanged();
}
} finally {
switcher.stopActiveEditor();
@@ -563,12 +549,11 @@
job = new UIJob("NotifyChangedJob") {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
- // we check if job was canceled and if is it true cancel the job
+ // we checks is job was canceled and if is it true we cancel job
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
} else {
- notifyChangedInUiThread(notifier, eventType, feature,
- oldValue, newValue, pos);
+ notifyChangedInUiThread(notifier, eventType, feature, oldValue, newValue, pos);
}
return Status.OK_STATUS;
}
@@ -580,14 +565,12 @@
public void notifyChangedInUiThread(INodeNotifier notifier, int eventType,
Object feature, Object oldValue, Object newValue, int pos) {
if (switcher == null ||
- !switcher.startActiveEditor(ActiveEditorSwitcher
- .ACTIVE_EDITOR_SOURCE)) {
+ !switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
try {
if (VpeDebug.PRINT_SOURCE_MUTATION_EVENT) {
- printSourceEvent(notifier, eventType, feature,
- oldValue, newValue, pos);
+ printSourceEvent(notifier, eventType, feature, oldValue, newValue, pos);
}
if (visualBuilder == null) {
return;
@@ -606,28 +589,25 @@
if (!update)
visualBuilder.updateNode((Node) notifier);
} else if (type == Node.COMMENT_NODE) {
- if ("yes".equals( //$NON-NLS-1$
- VpePreference.SHOW_COMMENTS.getValue())) {
+ if ("yes".equals(VpePreference.SHOW_COMMENTS.getValue())) { //$NON-NLS-1$
visualBuilder.setSelectionRectangle(null);
visualBuilder.updateNode((Node) notifier);
}
} else if (feature != null
- && ((Node)feature).getNodeType()==Node.ATTRIBUTE_NODE) {
+ && ((Node) feature).getNodeType() == Node.ATTRIBUTE_NODE) {
if (newValue != null) {
String attrName = ((Attr) feature).getName();
if ((Attr) feature == lastRemovedAttr
&& !attrName.equals(lastRemovedAttrName)) {
lastRemovedAttr = null;
- visualBuilder.removeAttribute((Element) notifier,
- lastRemovedAttrName);
+ visualBuilder.removeAttribute((Element) notifier, lastRemovedAttrName);
}
visualBuilder.setAttribute((Element) notifier,
((Attr) feature).getName(), (String) newValue);
} else {
lastRemovedAttr = (Attr) feature;
lastRemovedAttrName = ((Attr) feature).getName();
- visualBuilder.removeAttribute((Element) notifier,
- lastRemovedAttrName);
+ visualBuilder.removeAttribute((Element) notifier, lastRemovedAttrName);
}
}
visualEditor.showResizer();
@@ -651,8 +631,7 @@
case INodeNotifier.CONTENT_CHANGED:
if (!sourceChangeFlag) {
if (feature != null
- && ((Node) feature).getNodeType()
- == Node.TEXT_NODE) {
+ && ((Node) feature).getNodeType() == Node.TEXT_NODE) {
// if
// (((Node)notifier).getNodeName().equalsIgnoreCase(
// "style"))
@@ -681,8 +660,7 @@
// INodeSelectionListener implementation
public void nodeSelectionChanged(NodeSelectionChangedEvent event) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
try {
@@ -690,11 +668,8 @@
if (nodes != null && nodes.size() > 0) {
Node sourceNode = (Node) nodes.get(0);
if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
- System.out.println(">>>>>>>>>>>>>> " //$NON-NLS-1$
- + "nodeSelectionChanged " //$NON-NLS-1$
- + "sourceNode: " //$NON-NLS-1$
- + sourceNode.getNodeName()
- + " " + event.getCaretPosition()); //$NON-NLS-1$
+ System.out.println(">>>>>>>>>>>>>> nodeSelectionChanged sourceNode: " + //$NON-NLS-1$
+ sourceNode.getNodeName() + Constants.WHITE_SPACE + event.getCaretPosition());
}
if (event.getSource() instanceof IContentOutlinePage) {
sourceSelectionChanged();
@@ -708,15 +683,12 @@
// ITextSelectionListener implementation
// TODO Max Areshau looks like this method don't used
public void textSelectionChanged(TextSelectionChangedEvent event) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
try {
if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
- System.out.println(">>>>>>>>>>>>>> " //$NON-NLS-1$
- + "textSelectionChanged " //$NON-NLS-1$
- + event.getSource());
+ System.out.println(">>>>>>>>>>>>>> textSelectionChanged " + event.getSource()); //$NON-NLS-1$
}
// if (event.getSource() instanceof StyledText) {
sourceSelectionChanged();
@@ -728,14 +700,12 @@
// SelectionListener implementation
public void widgetSelected(SelectionEvent event) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
try {
if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
- System.out.println(">>>>>>>>>>>>>> " //$NON-NLS-1$
- + "widgetSelected"); //$NON-NLS-1$
+ System.out.println(">>>>>>>>>>>>>> widgetSelected"); //$NON-NLS-1$
}
if (event.getSource() instanceof StyledText) {
sourceSelectionChanged();
@@ -747,8 +717,7 @@
public void widgetDefaultSelected(SelectionEvent event) {
if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
- System.out.println(">>>>>>>>>>>>>> " //$NON-NLS-1$
- + "widgetDefaultSelected"); //$NON-NLS-1$
+ System.out.println(">>>>>>>>>>>>>> widgetDefaultSelected"); //$NON-NLS-1$
}
}
@@ -810,15 +779,9 @@
// if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
// System.out.println("sourceSelectionChanged"); //$NON-NLS-1$
// System.out
- // .println(" anchorNode: " //$NON-NLS-1$
- // + anchorNode.getNodeName()
- // + " anchorOffset: " //$NON-NLS-1$
- // + anchorOffset);
+ // .println(" anchorNode: " + anchorNode.getNodeName() + " anchorOffset: " + anchorOffset); //$NON-NLS-1$ //$NON-NLS-2$
// System.out
- // .println(" focusNode: " //$NON-NLS-1$
- // + focusNode.getNodeName()
- // + " focusOffset: " + focusOffset //$NON-NLS-1$
- // + " focusPosition: " + focusPosition); //$NON-NLS-1$
+ // .println(" focusNode: " + focusNode.getNodeName() + " focusOffset: " + focusOffset + " focusPosition: " + focusPosition); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
// }
// try {
// if (anchorNode.getNodeType() == Node.TEXT_NODE
@@ -856,8 +819,7 @@
}
public void sourceSelectionToVisualSelection(boolean showCaret) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
try {
@@ -872,17 +834,15 @@
}
public void processPostModelEvent(ModelLifecycleEvent event) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
try {
/*
* Added by Max Areshkau JBIDE-1457
- * ModelLifecycleEvent.MODEL_RELEASED is generated
- * when model in model calls methods releaseFromRead()
- * or releaseFromEdit(). When editor is open he has only
- * when href on model, so nothing can generated
+ * ModelLifecycleEvent.MODEL_RELEASED is generated when model in model
+ * calls methods releaseFromRead() or releaseFromEdit(). When editor
+ * is open he has only when href on model, so nothing can generated
* this event.When editor closes generation of this event depends
* from containing any service href on model or not. It's can be a
* reason of problems on reopen file.
@@ -891,12 +851,9 @@
*/
if (event.getType() == ModelLifecycleEvent.MODEL_RELEASED) {
if (VpeDebug.PRINT_SOURCE_MODEL_LIFECYCLE_EVENT) {
- System.out.println(">>> " //$NON-NLS-1$
- + "processPostModelEvent: " //$NON-NLS-1$
- + event.toString());
+ System.out.println(">>> processPostModelEvent: " + event.toString()); //$NON-NLS-1$
}
- // commented to fix org.mozilla.xpcom.XPCOMException: The
- // function "repaint" returned an error condition (0x8000ffff)
+ // commented to fix org.mozilla.xpcom.XPCOMException: The function "repaint" returned an error condition (0x8000ffff)
//visualBuilder.setSelectionRectangle(null);
IStructuredModel model = event.getModel();
model.removeModelLifecycleListener(this);
@@ -917,8 +874,7 @@
// EditorDomEventListener implementation
public void subtreeModified(nsIDOMMutationEvent mutationEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -931,8 +887,7 @@
}
public void nodeInserted(nsIDOMMutationEvent mutationEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -950,8 +905,7 @@
}
public void nodeRemoved(nsIDOMMutationEvent mutationEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -970,8 +924,7 @@
}
public void nodeRemovedFromDocument(nsIDOMMutationEvent mutationEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -984,8 +937,7 @@
}
public void nodeInsertedIntoDocument(nsIDOMMutationEvent mutationEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -998,8 +950,7 @@
}
public void attrModified(nsIDOMMutationEvent mutationEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -1012,8 +963,7 @@
}
public void characterDataModified(nsIDOMMutationEvent mutationEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -1028,13 +978,10 @@
}
}
- public void notifySelectionChanged(nsIDOMDocument doc,
- nsISelection selection, short reason) {
- if (switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ public void notifySelectionChanged(nsIDOMDocument doc, nsISelection selection, short reason) {
+ if (switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
try {
- mouseUpSelectionReasonFlag
- = (reason & nsISelectionListener.MOUSEUP_REASON) > 0;
+ mouseUpSelectionReasonFlag = (reason & nsISelectionListener.MOUSEUP_REASON) > 0;
if (mouseUpSelectionReasonFlag
// commited by Dzmitrovich - experimental
// TODO check selection and if are appear errors then
@@ -1042,11 +989,9 @@
// || reason == nsISelectionListener.NO_REASON
|| reason == nsISelectionListener.KEYPRESS_REASON
|| reason == nsISelectionListener.SELECTALL_REASON
- || (reason&nsISelectionListener.MOUSEDOWN_REASON) > 0) {
+ || (reason & nsISelectionListener.MOUSEDOWN_REASON) > 0) {
if (VpeDebug.PRINT_VISUAL_SELECTION_EVENT) {
- System.out.println("<<< " //$NON-NLS-1$
- + "notifySelectionChanged: " //$NON-NLS-1$
- + reason);
+ System.out.println("<<< notifySelectionChanged: " + reason); //$NON-NLS-1$
}
nsIDOMNode node = SelectionUtil.getSelectedNode(selection);
/*
@@ -1067,8 +1012,7 @@
}
public void mouseDown(nsIDOMMouseEvent mouseEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -1085,22 +1029,22 @@
// .getDragElement(mouseEvent);
if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
- System.out.println("<<< mouseDown targetNode: " //$NON-NLS-1$
- /* +visualNode.
- * getNodeName()
- * + " (" +
- * visualNode +
- * ") selectedElement: "
- * +(
- * visualDragElement
- * != null ?
- * visualDragElement
- * .
- * getNodeName()
- * + " (" +
- * visualDragElement
- * + ")" : null)
- */);
+ System.out.println("<<< mouseDown targetNode: " /* //$NON-NLS-1$
+ * +visualNode.
+ * getNodeName()
+ * + " (" +
+ * visualNode +
+ * ") selectedElement: "
+ * +(
+ * visualDragElement
+ * != null ?
+ * visualDragElement
+ * .
+ * getNodeName()
+ * + " (" +
+ * visualDragElement
+ * + ")" : null)
+ */);
}
//
// if (visualDragElement != null) {
@@ -1135,8 +1079,7 @@
}
public void mouseUp(nsIDOMMouseEvent mouseEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -1155,8 +1098,7 @@
}
public void mouseClick(nsIDOMMouseEvent mouseEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -1164,11 +1106,8 @@
if (visualNode != null) {
if (!mouseUpSelectionReasonFlag) {
if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
- System.out.println("<<< " //$NON-NLS-1$
- + "mouseClick visualNode: " //$NON-NLS-1$
- + visualNode.getNodeName()
- + " (" //$NON-NLS-1$
- + visualNode + ")"); //$NON-NLS-1$
+ System.out.println("<<< mouseClick visualNode: " + visualNode.getNodeName() + //$NON-NLS-1$
+ " (" + visualNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$
}
if (visualBuilder.isContentArea(visualNode)) {
// selectionBuilder.setClickContentAreaSelection();
@@ -1177,8 +1116,7 @@
mouseUpSelectionReasonFlag = false;
}
- if (visualBuilder.doToggle(
- VisualDomUtil.getTargetNode(mouseEvent))) {
+ if (visualBuilder.doToggle(VisualDomUtil.getTargetNode(mouseEvent))) {
// selectionBuilder.setClickContentAreaSelection();
}
}
@@ -1188,8 +1126,7 @@
}
public void mouseDblClick(nsIDOMMouseEvent mouseEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -1199,11 +1136,8 @@
sourceBuilder.openIncludeEditor(visualNode);
}
if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
- System.out.println("<<< " //$NON-NLS-1$
- + "mouseDblClick visualNode: " //$NON-NLS-1$
- + visualNode.getNodeName()
- + " (" //$NON-NLS-1$
- + visualNode + ")"); //$NON-NLS-1$
+ System.out.println("<<< mouseDblClick visualNode: " + visualNode.getNodeName() + //$NON-NLS-1$
+ " (" + visualNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
} finally {
@@ -1212,8 +1146,7 @@
}
public void mouseMove(nsIDOMMouseEvent mouseEvent) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -1233,15 +1166,11 @@
public void keyPress(nsIDOMKeyEvent keyEvent) {
if (VpeDebug.PRINT_VISUAL_KEY_EVENT) {
- System.out.println("<<< keyPress type: " //$NON-NLS-1$
- + keyEvent.getType()
- + " Ctrl: " + keyEvent.getCtrlKey()
- + " Shift: " + keyEvent.getShiftKey() //$NON-NLS-1$
- + " CharCode: " + keyEvent.getCharCode() //$NON-NLS-1$
- + " KeyCode: " + keyEvent.getKeyCode()); //$NON-NLS-1$
+ System.out.println("<<< keyPress type: " + keyEvent.getType() + //$NON-NLS-1$
+ " Ctrl: " + keyEvent.getCtrlKey() + " Shift: " + keyEvent.getShiftKey() + //$NON-NLS-1$ //$NON-NLS-2$
+ " CharCode: " + keyEvent.getCharCode() + " KeyCode: " + keyEvent.getKeyCode()); //$NON-NLS-1$ //$NON-NLS-2$
}
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
switcher.stopActiveEditor();
return;
}
@@ -1287,19 +1216,14 @@
KeySequence sequenceBeforeKeyStroke = KeySequence.getInstance();
- Iterator<KeyStroke> iterator = possibleKeyStrokes.iterator();
- while (iterator.hasNext()) {
+ for (Iterator<KeyStroke> iterator = possibleKeyStrokes.iterator(); iterator.hasNext();) {
KeySequence sequenceAfterKeyStroke =
- KeySequence.getInstance(sequenceBeforeKeyStroke,
- iterator.next());
- if (iBindingService.isPerfectMatch(
- sequenceAfterKeyStroke)) {
- final Binding binding = iBindingService
- .getPerfectMatch(sequenceAfterKeyStroke);
+ KeySequence.getInstance(sequenceBeforeKeyStroke, iterator.next());
+ if (iBindingService.isPerfectMatch(sequenceAfterKeyStroke)) {
+ final Binding binding = iBindingService.getPerfectMatch(sequenceAfterKeyStroke);
if ((binding != null)
&& (binding.getParameterizedCommand() != null)
- && (binding.getParameterizedCommand()
- .getCommand() != null)) {
+ && (binding.getParameterizedCommand().getCommand() != null)) {
keyBindingPressed = true;
}
}
@@ -1326,8 +1250,8 @@
* JBIDE-2670
*/
keyEvent.preventDefault();
-// switcher.startActiveEditor(
-// ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL);
+// switcher
+// .startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL);
// try {
/*
* Edward
@@ -1348,8 +1272,7 @@
public void elementResized(nsIDOMElement element, int constrains,
int top, int left, int width, int height) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_VISUAL)) {
return;
}
try {
@@ -1363,8 +1286,7 @@
public void dragGesture(nsIDOMEvent domEvent) {
nsIDOMMouseEvent mouseEvent =
- (nsIDOMMouseEvent) domEvent.queryInterface(
- nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
+ (nsIDOMMouseEvent) domEvent.queryInterface(nsIDOMMouseEvent.NS_IDOMMOUSEEVENT_IID);
boolean canDragFlag = canInnerDrag(mouseEvent);
// start drag sessionvpe-element
if (canDragFlag) {
@@ -1383,23 +1305,20 @@
* @param node
* where this event are occur
*/
- public void onShowContextMenu(long contextFlags, nsIDOMEvent event,
- nsIDOMNode node) {
+ public void onShowContextMenu(long contextFlags, nsIDOMEvent event, nsIDOMNode node) {
//FIXED FOR JBIDE-3072 by sdzmitrovich
// nsIDOMNode visualNode = VisualDomUtil.getTargetNode(event);
// if (visualNode != null) {
Node selectedSourceNode = null;
- VpeNodeMapping nodeMapping = SelectionUtil
- .getNodeMappingBySourceSelection(sourceEditor, domMapping);
+ VpeNodeMapping nodeMapping = SelectionUtil.getNodeMappingBySourceSelection(sourceEditor, domMapping);
if (nodeMapping != null) {
selectedSourceNode = nodeMapping.getSourceNode();
}
MenuManager menuManager = new MenuManager("#popup"); //$NON-NLS-1$
- final Menu contextMenu = menuManager.createContextMenu(visualEditor
- .getControl());
+ final Menu contextMenu = menuManager.createContextMenu(visualEditor.getControl());
contextMenu.addMenuListener(new MenuListener() {
Menu menu = contextMenu;
public void menuHidden(MenuEvent e) {
@@ -1414,14 +1333,11 @@
});
// create context menu
- MenuCreationHelper menuCreationHelper =
- new MenuCreationHelper(domMapping, pageContext,
- sourceEditor, visualEditor);
- menuCreationHelper.createMenuForNode(selectedSourceNode,
- menuManager, true);
-
+// MenuCreationHelper menuCreationHelper =
+// new MenuCreationHelper(domMapping, pageContext, sourceEditor, visualEditor);
+// menuCreationHelper.createMenuForNode(selectedSourceNode, menuManager, true);
+ new VpeMenuCreator(menuManager, selectedSourceNode).createMenu();
contextMenu.setVisible(true);
-// }
}
// VpeTemplateListener implementation
@@ -1437,21 +1353,18 @@
if (uiJob != null && uiJob.getState() != Job.NONE) {
return;
}
- if (visualRefreshJob == null
- || visualRefreshJob.getState() == Job.NONE) {
+ if (visualRefreshJob == null || visualRefreshJob.getState() == Job.NONE) {
visualRefreshJob = new UIJob(VpeUIMessages.VPE_VISUAL_REFRESH_JOB) {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
}
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return Status.CANCEL_STATUS;
}
try {
- monitor.beginTask(VpeUIMessages.VPE_VISUAL_REFRESH_JOB,
- IProgressMonitor.UNKNOWN);
+ monitor.beginTask(VpeUIMessages.VPE_VISUAL_REFRESH_JOB, IProgressMonitor.UNKNOWN);
visualRefreshImpl();
monitor.done();
setSynced(true);
@@ -1474,7 +1387,7 @@
return Status.OK_STATUS;
}
};
- visualRefreshJob.setRule(new VisualTreeChangingRule(this));
+
visualRefreshJob.setPriority(Job.SHORT);
visualRefreshJob.schedule();
}
@@ -1483,8 +1396,7 @@
void visualRefreshImpl() {
visualEditor.hideResizer();
- String currentDoctype = DocTypeUtil.getDoctype(
- visualEditor.getEditorInput());
+ String currentDoctype = DocTypeUtil.getDoctype(visualEditor.getEditorInput());
/*
* https://jira.jboss.org/jira/browse/JBIDE-3591
* Avoid using missing resource.
@@ -1519,38 +1431,30 @@
// for debug
private void printSourceEvent(INodeNotifier notifier, int eventType,
Object feature, Object oldValue, Object newValue, int pos) {
- System.out.println(">>> eventType: " //$NON-NLS-1$
- + INodeNotifier.EVENT_TYPE_STRINGS[eventType]
- + " pos: " + pos //$NON-NLS-1$
- + " notifier: " //$NON-NLS-1$
- + ((Node) notifier).getNodeName()
- + " hashCode: " + notifier.hashCode()); //$NON-NLS-1$
+ System.out.println(">>> eventType: " + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + //$NON-NLS-1$
+ " pos: " + pos + " notifier: " + ((Node) notifier).getNodeName() + //$NON-NLS-1$ //$NON-NLS-2$
+ " hashCode: " + notifier.hashCode()); //$NON-NLS-1$
if (feature != null) {
if (feature instanceof Node) {
- System.out.println(" feature: " //$NON-NLS-1$
- + ((Node) feature).getNodeType()
- + Constants.WHITE_SPACE + ((Node) feature).getNodeName()
- + " hashCode: " + feature.hashCode()); //$NON-NLS-1$
+ System.out.println(" feature: " + ((Node) feature).getNodeType() + //$NON-NLS-1$
+ Constants.WHITE_SPACE + ((Node) feature).getNodeName() +
+ " hashCode: " + feature.hashCode()); //$NON-NLS-1$
} else {
System.out.println(" feature: " + feature); //$NON-NLS-1$
}
}
if (oldValue != null) {
if (oldValue instanceof Node) {
- System.out.println(" oldValue: " //$NON-NLS-1$
- + ((Node) oldValue).getNodeName()
- + " hashCode: " + oldValue.hashCode());//$NON-NLS-1$
+ System.out.println(" oldValue: " + ((Node) oldValue).getNodeName() + //$NON-NLS-1$
+ " hashCode: " + oldValue.hashCode()); //$NON-NLS-1$
} else {
- System.out.println(" oldValue: " + oldValue);//$NON-NLS-1$
+ System.out.println(" oldValue: " + oldValue); //$NON-NLS-1$
}
}
if (newValue != null) {
if (newValue instanceof Node) {
- System.out.println(" newValue: " //$NON-NLS-1$
- + ((Node) newValue).getNodeName()
- + " hashCode: " + newValue.hashCode() //$NON-NLS-1$
- + Constants.WHITE_SPACE
- + ((Node) newValue).getNodeType());
+ System.out.println(" newValue: " + ((Node) newValue).getNodeName() + //$NON-NLS-1$
+ " hashCode: " + newValue.hashCode() + Constants.WHITE_SPACE + ((Node) newValue).getNodeType()); //$NON-NLS-1$
} else {
System.out.println(" newValue: " + newValue); //$NON-NLS-1$
}
@@ -1563,22 +1467,17 @@
if (event instanceof nsIDOMMutationEvent) {
nsIDOMMutationEvent mutationEvent = (nsIDOMMutationEvent) event;
- System.out.print(" EventPhase: " //$NON-NLS-1$
- + mutationEvent.getEventPhase());
+ System.out.print(" EventPhase: " + mutationEvent.getEventPhase()); //$NON-NLS-1$
nsIDOMNode relatedNode = mutationEvent.getRelatedNode();
- System.out.print(" RelatedNode: " //$NON-NLS-1$
- + (relatedNode == null ? null : relatedNode.getNodeName()));
+ System.out.print(" RelatedNode: " + (relatedNode == null ? null : relatedNode.getNodeName())); //$NON-NLS-1$
nsIDOMNode targetNode = VisualDomUtil.getTargetNode(mutationEvent);
String name = targetNode != null ? targetNode.getNodeName() : null;
- System.out.print(" TargetNode: " + name //$NON-NLS-1$
- + " (" + targetNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.print(" TargetNode: " + name + " (" + targetNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- System.out.print(" PrevValue: " //$NON-NLS-1$
- + mutationEvent.getPrevValue().trim());
- System.out.print(" NewValue: " //$NON-NLS-1$
- + mutationEvent.getNewValue().trim());
+ System.out.print(" PrevValue: " + mutationEvent.getPrevValue().trim()); //$NON-NLS-1$
+ System.out.print(" NewValue: " + mutationEvent.getNewValue().trim()); //$NON-NLS-1$
}
System.out.println();
}
@@ -1602,8 +1501,7 @@
private boolean startActiveEditor(int newType) {
if (type == ACTIVE_EDITOR_NONE) {
if (newType == ACTIVE_EDITOR_SOURCE
- && editPart.getVisualMode()
- == VpeEditorPart.SOURCE_MODE) {
+ && editPart.getVisualMode() == VpeEditorPart.SOURCE_MODE) {
return false;
}
type = newType;
@@ -1620,8 +1518,7 @@
}
// void refreshBundleValues() {
-// if (!switcher.startActiveEditor(
-// ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+// if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
// return;
// }
// try {
@@ -1646,8 +1543,7 @@
if (bundle != null) {
bundle.refresh();
if (pageContext != null) {
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
try {
@@ -1682,18 +1578,12 @@
// if (attrs != null) {
// for (int i = 0; i < attrs.getLength(); i++) {
// if (attrs.item(i) instanceof AttrImpl) {
-// AttrImpl attr = (AttrImpl)attrs.item(i);
-// if (getSourceAttributeOffset(attr,
-// offset) != -1) {
-// String[] atributeNames
-// = elementMapping
-// .getTemplate()
-// .getOutputAtributeNames();
+// AttrImpl attr = (AttrImpl) attrs.item(i);
+// if (getSourceAttributeOffset(attr, offset) != -1) {
+// String[] atributeNames = elementMapping.getTemplate().getOutputAtributeNames();
// if (atributeNames != null
// && atributeNames.length > 0
-// && attr.getName()
-// .equalsIgnoreCase(
-// atributeNames[0])) {
+// && attr.getName().equalsIgnoreCase(atributeNames[0])) {
// return attr;
// }
// }
@@ -1845,12 +1735,10 @@
selection = new VpeSelection(offset, length);
}
- public void addSelectionChangedListener(
- ISelectionChangedListener listener) {
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
}
- public void removeSelectionChangedListener(
- ISelectionChangedListener listener) {
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
}
public ISelection getSelection() {
@@ -1876,8 +1764,8 @@
if (length > 0) {
try {
- text = sourceEditor.getTextViewer().getDocument()
- .get(offset, length);
+ text = sourceEditor.getTextViewer().getDocument().get(
+ offset, length);
} catch (BadLocationException e) {
VpePlugin.getPluginLog().logError(e);
}
@@ -1889,8 +1777,8 @@
offset = region.getStartOffset();
length = region.getEndOffset() - offset;
try {
- text = sourceEditor.getTextViewer().getDocument()
- .get(offset, length);
+ text = sourceEditor.getTextViewer().getDocument().get(offset,
+ length);
} catch (BadLocationException ex) {
VpePlugin.reportProblem(ex);
}
@@ -1948,13 +1836,13 @@
public void dragEnter(nsIDOMEvent event) {
if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
- System.out.println("<<<<<<<<<<<<<<<<<<< DragEnter"); //$NON-NLS-1$
+ System.out.println("<<<<<<<<<<<<<<<<<<<< DragEnter"); //$NON-NLS-1$
}
}
public void dragExit(nsIDOMEvent event) {
if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
- System.out.println("<<<<<<<<<<<<<<<<<<< dragExit"); //$NON-NLS-1$
+ System.out.println("<<<<<<<<<<<<<<<<<<<< dragExit"); //$NON-NLS-1$
}
// TODO Sergey Vasilyev figure out with drag caret
// xulRunnerEditor.hideDragCaret();
@@ -1971,14 +1859,13 @@
}
try {
if (VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
- System.out.println("<<<<<<<<<<<<<<<<<<< dragOver");//$NON-NLS-1$
+ System.out.println("<<<<<<<<<<<<<<<<<<<< dragOver"); //$NON-NLS-1$
}
// browser.computeDropPosition(event);
boolean canDrop = !xulRunnerEditor.isMozillaDragFlavor();
if (canDrop) {
Clipboard clipboard = new Clipboard(Display.getCurrent());
- canDrop = clipboard.getContents(ModelTransfer.getInstance())
- != null;
+ canDrop = clipboard.getContents(ModelTransfer.getInstance()) != null;
}
if (canDrop) {
canDrop = VpeDndUtil
@@ -2027,9 +1914,8 @@
if (dragInfo != null) {
nsIDOMNode dragNode = dragInfo.getNode();
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print(" dragNode: " //$NON-NLS-1$
- + dragNode.getNodeName()
- + "(" + dragNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out
+ .print(" dragNode: " + dragNode.getNodeName() + "(" + dragNode + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
switch (dragNode.getNodeType()) {
case nsIDOMNode.ELEMENT_NODE:
@@ -2108,8 +1994,7 @@
+ "(" //$NON-NLS-1$
+ visualDropInfo.getDropContainer()
+ ") parent: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getParentNode()
- .getNodeName()
+ + visualDropInfo.getDropContainer().getParentNode().getNodeName()
+ "(" //$NON-NLS-1$
+ visualDropInfo.getDropContainer().getParentNode()
+ ") offset: " //$NON-NLS-1$
@@ -2152,17 +2037,16 @@
.getInnerDropInfo(event);
if (visualDropInfo.getDropContainer() != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.print(" container: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getNodeName()
- + "(" //$NON-NLS-1$
- + visualDropInfo.getDropContainer()
- + ")" //$NON-NLS-1$
- + " offset: " //$NON-NLS-1$
- + visualDropInfo.getDropOffset());
+ System.out
+ .print(" container: " + visualDropInfo.getDropContainer().getNodeName() + //$NON-NLS-1$
+ "(" + visualDropInfo.getDropContainer()
+ + ")" + //$NON-NLS-1$ //$NON-NLS-2$
+ " offset: "
+ + visualDropInfo.getDropOffset()); //$NON-NLS-1$
}
- VpeSourceInnerDragInfo sourceInnerDragInfo
- = visualBuilder.getSourceInnerDragInfo(innerDragInfo);
+ VpeSourceInnerDragInfo sourceInnerDragInfo = visualBuilder
+ .getSourceInnerDragInfo(innerDragInfo);
VpeSourceInnerDropInfo sourceDropInfo = visualBuilder
.getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
visualDropInfo, true);
@@ -2218,8 +2102,8 @@
dropWindow.flavor = flavor;
}
dropWindow.active = true;
- dropWindow.setEventPosition(mouseEvent.getScreenX(),
- mouseEvent.getScreenY());
+ dropWindow.setEventPosition(mouseEvent.getScreenX(), mouseEvent
+ .getScreenY());
dropWindow.setInitialTargetNode(sourceNode);
dropWindow.open();
mouseEvent.stopPropagation();
@@ -2244,9 +2128,7 @@
caretOffset = visualDropInfo.getDropOffset();
} else {
String tagname = getTagName(object);
- if (tagname.indexOf("taglib") >= 0) { //$NON-NLS-1$
- tagname = "taglib"; //$NON-NLS-1$
- }
+ if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
Node sourceDragNode = ((Document) getModel().getAdapter(
Document.class)).createElement(tagname);
VpeVisualInnerDropInfo visualDropInfo = selectionBuilder
@@ -2257,8 +2139,8 @@
visualDropInfo, true);
canDrop = sourceDropInfo.canDrop();
if (canDrop) {
- VpeVisualInnerDropInfo newVisualDropInfo
- = visualBuilder.getInnerDropInfo(
+ VpeVisualInnerDropInfo newVisualDropInfo = visualBuilder
+ .getInnerDropInfo(
sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
@@ -2281,15 +2163,11 @@
}
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println(" canDrop: " + canDrop //$NON-NLS-1$
- + (canDrop
- ? " container: " //$NON-NLS-1$
- + caretParent.getNodeName()
- + " offset: " //$NON-NLS-1$
- + caretOffset
- : "")); //$NON-NLS-1$
+ System.out
+ .println(" canDrop: " + canDrop + (canDrop ? " container: " + caretParent.getNodeName() + " offset: " + caretOffset : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
return new MozillaDropInfo(canDrop, caretParent, caretOffset);
+
}
public VpeSourceInnerDropInfo canExternalDropMacro(XModelObject object,
@@ -2326,15 +2204,10 @@
String tagname = object.getAttributeValue("name"); //$NON-NLS-1$
XModelObject parent = object.getParent();
- String uri = (parent == null)
- ? "" //$NON-NLS-1$
- : parent.getAttributeValue(URIConstants.LIBRARY_URI);
- String defaultPrefix = (parent == null)
- ? "" //$NON-NLS-1$
- : parent.getAttributeValue(URIConstants.DEFAULT_PREFIX);
+ String uri = (parent == null) ? "" : parent.getAttributeValue(URIConstants.LIBRARY_URI); //$NON-NLS-1$
+ String defaultPrefix = (parent == null) ? "" : parent.getAttributeValue(URIConstants.DEFAULT_PREFIX); //$NON-NLS-1$
- String[] texts = new String[] {
- "<" + tagname + ">" }; //$NON-NLS-1$ //$NON-NLS-2$
+ String[] texts = new String[] { "<" + tagname + ">" }; //$NON-NLS-1$ //$NON-NLS-2$
PaletteInsertHelper.applyPrefix(texts, sourceEditor, tagname, uri,
defaultPrefix);
tagname = texts[0].substring(1, texts[0].length() - 1);
@@ -2342,15 +2215,12 @@
return tagname;
}
- public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor,
- String data) {
+ public void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
onHideTooltip();
- VpeVisualInnerDropInfo visualDropInfo
- = selectionBuilder.getInnerDropInfo(mouseEvent);
- Point range = selectionBuilder.getSourceSelectionRangeAtVisualNode(
- visualDropInfo.getDropContainer(),
- (int) visualDropInfo.getDropOffset());
+ VpeVisualInnerDropInfo visualDropInfo = selectionBuilder.getInnerDropInfo(mouseEvent);
+ Point range = selectionBuilder.getSourceSelectionRangeAtVisualNode(visualDropInfo.getDropContainer(), (int) visualDropInfo
+ .getDropOffset());
VpeSourceInnerDropInfo sourceDropInfo = null;
// if (MODEL_FLAVOR.equals(flavor)) {
@@ -2361,8 +2231,7 @@
nsISupports aValue = DndUtil.getDnDValue(mouseEvent);
String aFlavor = ""; //$NON-NLS-1$
if (VpeDndUtil.isNsIFileInstance(aValue)) {
- nsIFile aFile
- = (nsIFile) aValue.queryInterface(nsIFile.NS_IFILE_IID);
+ nsIFile aFile = (nsIFile) aValue.queryInterface(nsIFile.NS_IFILE_IID);
if (aValue != null) {
data = aFile.getPath();
@@ -2370,15 +2239,11 @@
}
} else if (VpeDndUtil.isNsICStringInstance(aValue)) {
- nsISupportsCString aString
- = (nsISupportsCString) aValue.queryInterface(
- nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
+ nsISupportsCString aString = (nsISupportsCString) aValue.queryInterface(nsISupportsCString.NS_ISUPPORTSCSTRING_IID);
data = aString.getData();
aFlavor = DndUtil.kHTMLMime;
} else if (VpeDndUtil.isNsIStringInstance(aValue)) {
- nsISupportsString aString
- = (nsISupportsString) aValue.queryInterface(
- nsISupportsString.NS_ISUPPORTSSTRING_IID);
+ nsISupportsString aString = (nsISupportsString) aValue.queryInterface(nsISupportsString.NS_ISUPPORTSSTRING_IID);
data = aString.getData();
aFlavor = DndUtil.kURLMime;
}
@@ -2394,9 +2259,7 @@
// }
// } else {
// String tagname = getTagName(object);
- // if (tagname.indexOf("taglib") >= 0) {//$NON-NLS-1$
- // tagname = "taglib";//$NON-NLS-1$
- // }
+ // if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
// Node sourceDragNode = ((Document) getModel().getAdapter(
// Document.class)).createElement(tagname);
// if (visualDropInfo.getDropContainer() != null) {
@@ -2410,16 +2273,12 @@
if (visualDropInfo.getDropContainer() != null && data != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println(" drop! container: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getNodeName());
+ System.out.println(" drop! container: " + visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
}
- externalDropAny(aFlavor, data, range, sourceDropInfo == null
- ? null
- : sourceDropInfo.getContainer());
+ externalDropAny(aFlavor, data, range, sourceDropInfo == null ? null : sourceDropInfo.getContainer());
DropContext dropContext = new DropContext();
- IDNDTextEditor textEditor = (IDNDTextEditor)
- VpeController.this.editPart.getSourceEditor();
+ IDNDTextEditor textEditor = (IDNDTextEditor) VpeController.this.editPart.getSourceEditor();
// TypedEvent tEvent = new TypedEvent(mouseEvent);
// tEvent.data = data;
@@ -2466,8 +2325,8 @@
*/
String[] attributeString = formatText.split("\n"); //$NON-NLS-1$
/**
- * buffer string containing the attribute and
- * the value in the different succeding string
+ * buffer string containing the attribute and the value in the different
+ * succeding string
*/
String[] buffer = attributeString[0].split(" "); //$NON-NLS-1$
@@ -2502,19 +2361,12 @@
buffer = attributeString[i].split(" ", 2); //$NON-NLS-1$
if (i == 1) {
tempAttr.append(buffer[0] + " "); //$NON-NLS-1$
- tempValue.append(
- (buffer.length >= 2
- ? buffer[1]
- : "") //$NON-NLS-1$
- + " "); //$NON-NLS-1$
+ tempValue
+ .append((buffer.length >= 2 ? buffer[1] : "") + " "); //$NON-NLS-1$ //$NON-NLS-2$
} else {
- tempAttr.append(
- "\n" + buffer[0] + " "); //$NON-NLS-1$ //$NON-NLS-2$
- tempValue.append(" \n" //$NON-NLS-1$
- + (buffer.length >= 2
- ? buffer[1]
- : "") //$NON-NLS-1$
- + " "); //$NON-NLS-1$
+ tempAttr.append("\n" + buffer[0] + " "); //$NON-NLS-1$ //$NON-NLS-2$
+ tempValue
+ .append(" \n" + (buffer.length >= 2 ? buffer[1] : "") + " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
@@ -2562,8 +2414,8 @@
*/
Point point = display.getCursorLocation();
/*
- * Assuming cursor is 21x21 because this is
- * the size of the arrow cursor on Windows
+ * Assuming cursor is 21x21 because this is the size of the arrow cursor
+ * on Windows
*/
point.y += 21;
tip.setLocation(point);
@@ -2636,16 +2488,13 @@
toolbarFormatControllerManager.selectionChanged();
}
- if (!switcher.startActiveEditor(
- ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
try {
if (VpeDebug.PRINT_SOURCE_SELECTION_EVENT) {
- System.out.println(">>>>>>>>>>>>>> " //$NON-NLS-1$
- + "selectionChanged " //$NON-NLS-1$
- + event.getSource());
+ System.out.println(">>>>>>>>>>>>>> selectionChanged " + event.getSource()); //$NON-NLS-1$
}
sourceSelectionChanged();
} finally {
@@ -2654,8 +2503,7 @@
}
// nsIClipboardDragDropHooks implementation
- public void onPasteOrDrop(nsIDOMMouseEvent mouseEvent,
- String flavor, String data) {
+ public void onPasteOrDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
onHideTooltip();
VpeVisualInnerDropInfo visualDropInfo = selectionBuilder
@@ -2669,9 +2517,7 @@
.getModelBuffer().source();
String tagname = getTagName(object);
- if (tagname.indexOf("taglib") >= 0) { //$NON-NLS-1$
- tagname = "taglib"; //$NON-NLS-1$
- }
+ if (tagname.indexOf("taglib") >= 0)tagname = "taglib"; //$NON-NLS-1$ //$NON-NLS-2$
Node sourceDragNode = ((Document) getModel().getAdapter(Document.class))
.createElement(tagname);
if (visualDropInfo.getDropContainer() != null) {
@@ -2683,8 +2529,7 @@
if (visualDropInfo.getDropContainer() != null) {
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
- System.out.println(" drop! container: " //$NON-NLS-1$
- + visualDropInfo.getDropContainer().getNodeName());
+ System.out.println(" drop! container: " + visualDropInfo.getDropContainer().getNodeName()); //$NON-NLS-1$
}
final String finalFlavor = flavor;
final String finalData = data;
@@ -2819,7 +2664,6 @@
return Status.OK_STATUS;
}
};
- reinitJob.setRule(new VisualTreeChangingRule(this));
reinitJob.schedule();
}
@@ -2840,12 +2684,11 @@
}
//reinits selection controller+ controller
visualEditor.reinitDesignMode();
- visualSelectionController = new VpeSelectionController(
- visualEditor.getEditor().getSelectionController());
+ visualSelectionController = new VpeSelectionController(visualEditor.getEditor().getSelectionController());
- selectionBuilder = new VpeSelectionBuilder(domMapping,
- sourceBuilder, visualBuilder, visualSelectionController);
-
+ selectionBuilder = new VpeSelectionBuilder(domMapping, sourceBuilder,
+ visualBuilder, visualSelectionController);
+
selectionManager = new SelectionManager(pageContext,
sourceEditor, visualSelectionController);
@@ -2908,40 +2751,5 @@
public ISelectionManager getSelectionManager() {
return selectionManager;
}
-
- /**
- * Jobs with the same instances of {@code VisualTreeChangingRule}
- * but different {@code vpeController} are
- * never run concurrently. Any resource-changing rule can
- * be nested inside this rule.
- *
- * @author yradtsevich
- */
- private static final class VisualTreeChangingRule
- implements ISchedulingRule {
- private VpeController vpeController;
- public VisualTreeChangingRule(VpeController vpeController) {
- this.vpeController = vpeController;
- }
- public boolean contains(ISchedulingRule rule) {
- if (this == rule) {
- return true;
- } else if (rule instanceof IResource) {
- /* can contain any resource-changing rule
- * (it is needed during preferences-saving operations) */
- return true;
- } else {
- return false;
- }
- }
- public boolean isConflicting(ISchedulingRule rule) {
- if (rule instanceof VisualTreeChangingRule
- && ((VisualTreeChangingRule) rule).vpeController
- == this.vpeController) {
- return true;
- } else {
- return false;
- }
- }
- }
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java 2009-05-13 16:28:09 UTC (rev 15244)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/InsertContributionItem.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -60,18 +60,18 @@
.getController().getPageContext();
}
- public InsertContributionItem(StructuredTextEditor sourceEditor,
- VpePageContext pageContext) {
- this.sourceEditor = sourceEditor;
- this.pageContext = pageContext;
- }
-
@Override
public void fill(Menu menu, int index) {
for (final InsertType insertItem : InsertType.values()) {
+ final MenuItem item;
+ if (index < 0) {
+ item = new MenuItem(menu, SWT.CASCADE);
+ } else {
+ item = new MenuItem(menu, SWT.CASCADE,
+ index + insertItem.ordinal());
+ }
+
final String itemName = insertItem.getMessage();
- final MenuItem item = new MenuItem(menu,
- SWT.CASCADE, index + insertItem.ordinal());
item.setText(itemName);
final Menu paletteManu = new Menu(menu);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java 2009-05-13 16:28:09 UTC (rev 15244)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/MenuCreationHelper.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -17,8 +17,6 @@
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.text.TextUtilities;
-import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
@@ -66,6 +64,7 @@
* This is helper class is used to create context menu for VPE.
*
* @author Igor Zhukov (izhukov(a)exadel.com)
+ * @deprecated use {@link VpeMenuCreator} instead
*/
public class MenuCreationHelper {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java 2009-05-13 16:28:09 UTC (rev 15244)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/SetupTemplateContributionItem.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -25,7 +25,6 @@
import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
import org.jboss.tools.vpe.editor.menu.action.SetupTemplateAction;
import org.jboss.tools.vpe.editor.template.VpeHtmlTemplate;
-import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.w3c.dom.Element;
@@ -44,26 +43,15 @@
*/
public SetupTemplateContributionItem() {
super(new SetupTemplateAction());
- JSPMultiPageEditor editor = (JSPMultiPageEditor) PlatformUI
+ final JSPMultiPageEditor editor = (JSPMultiPageEditor) PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor();
this.sourceEditor = editor.getSourceEditor();
this.pageContext = ((VpeEditorPart) editor.getVisualEditor())
.getController().getPageContext();
- ((SetupTemplateAction) getAction()).setPageContext(pageContext);
+ getAction().setPageContext(pageContext);
}
- /**
- *
- */
- public SetupTemplateContributionItem(VpePageContext pageContext,
- StructuredTextEditor sourceEditor) {
- super(new SetupTemplateAction(pageContext));
- this.pageContext = pageContext;
- this.sourceEditor = sourceEditor;
-
- }
-
@Override
public void fill(Menu menu, int index) {
@@ -77,14 +65,14 @@
.getDomMapping().getNodeMapping(element);
if (elementMapping != null
&& elementMapping.getTemplate() != null
- && elementMapping.getTemplate().getType() == VpeHtmlTemplate.TYPE_ANY) {
+ && elementMapping.getTemplate().getType()
+ == VpeHtmlTemplate.TYPE_ANY) {
- ((SetupTemplateAction) getAction()).setText(NLS.bind(
+ getAction().setText(NLS.bind(
VpeUIMessages.SETUP_TEMPLATE_FOR_MENU,
element.getNodeName()));
- ((SetupTemplateAction) getAction()).setActionNode(element);
- ((SetupTemplateAction) getAction()).setData(elementMapping
- .getTemplate().getAnyData());
+ getAction().setActionNode(element);
+ getAction().setData(elementMapping.getTemplate().getAnyData());
MenuItem item = new MenuItem(menu, SWT.SEPARATOR, index );
super.fill(menu, index+1);
}
@@ -92,4 +80,8 @@
}
+ @Override
+ public SetupTemplateAction getAction() {
+ return (SetupTemplateAction) super.getAction();
+ }
}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -0,0 +1,282 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.menu;
+
+import java.text.MessageFormat;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.jboss.tools.vpe.VpeDebug;
+import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.jboss.tools.vpe.editor.menu.action.EditAttributesAction;
+import org.jboss.tools.vpe.editor.menu.action.SelectThisTagAction;
+import org.jboss.tools.vpe.editor.menu.action.StripTagAction;
+import org.jboss.tools.vpe.editor.menu.action.ComplexAction;
+import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.jboss.tools.vpe.editor.util.SelectionUtil;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * This class is used to create context menu for VPE.
+ *
+ * @author yradtsevich
+ * (based on the implementation of MenuCreationHelper)
+ */
+public class VpeMenuCreator {
+ private final MenuManager menuManager;
+ private final VpeMenuUtil vpeMenuUtil;
+ private final Node node;
+
+ public VpeMenuCreator(final MenuManager menuManager, final Node node) {
+ this.node = node;
+ this.menuManager = menuManager;
+ this.vpeMenuUtil = new VpeMenuUtil();
+ }
+
+ /**
+ * Inserts new menu items into {@link #menuManager}.
+ */
+ public void createMenu() {
+ createMenu(true);
+ }
+
+ /**
+ * Inserts new menu items into {@link #menuManager}.
+ *
+ * @param topLevelMenu if it is {@code true} then the menu will contain
+ * elements for the top level variant of the VPE menu, otherwise - elements
+ * for the sub menu variant.
+ *
+ * @see #addParentTagMenuItem(Element)
+ */
+ private void createMenu(boolean topLevelMenu) {
+ addIfEnabled(new EditAttributesAction(node));
+ menuManager.add(new SetupTemplateContributionItem());
+
+ if (!topLevelMenu) {
+ menuManager.add(new SelectThisTagAction(node));
+ }
+
+ final Node parent = node == null ? null : node.getParentNode();
+ if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
+ addParentTagMenuItem((Element) parent);
+ }
+ addSeparator();
+
+ menuManager.add(new InsertContributionItem());
+ addIfEnabled(new StripTagAction(node));
+ addSeparator();
+
+ if (topLevelMenu) {
+ addIfEnabled(new DumpSourceAction());
+ addIfEnabled(new DumpSelectedElementAction());
+ addIfEnabled(new DumpMappingAction());
+ addIfEnabled(new TestAction());
+ }
+ addSeparator();
+ addCutCopyPasteActions(topLevelMenu);
+ }
+
+ /**
+ * Creates the Cut, Copy and Paste actions.
+ */
+ private void addCutCopyPasteActions(boolean topLevelMenu) {
+ final IAction cutAction = getSourceEditorAction(ActionFactory.CUT);
+ final IAction copyAction = getSourceEditorAction(ActionFactory.COPY);
+ final IAction pasteAction = getSourceEditorAction(ActionFactory.PASTE);
+ if (topLevelMenu) {
+ if (node != null) {
+ menuManager.add(cutAction);
+ menuManager.add(copyAction);
+ }
+ menuManager.add(pasteAction);
+ } else {
+ final IAction selectAction = new SelectThisTagAction(node);
+ if (selectAction.isEnabled()) {
+ menuManager.add(new ComplexAction(cutAction.getText(),
+ selectAction, cutAction));
+ menuManager.add(new ComplexAction(copyAction.getText(),
+ selectAction, copyAction));
+ menuManager.add(new ComplexAction(pasteAction.getText(),
+ selectAction, pasteAction));
+ }
+ }
+ }
+
+ /**
+ * If the {@code action} is enabled, adds it to
+ * the {@link #menuManager}.
+ */
+ private void addIfEnabled(IAction action) {
+ if (action.isEnabled()) {
+ menuManager.add(action);
+ }
+ }
+
+ /**
+ * Adds a menu item for operations on {@code parent} element.
+ *
+ * @param parent the parent element
+ */
+ private void addParentTagMenuItem(final Element parent) {
+ final String itemName = MessageFormat.format(
+ VpeUIMessages.PARENT_TAG_MENU_ITEM, parent.getNodeName());
+
+ final MenuManager parentMenuManager = new MenuManager(itemName);
+ parentMenuManager.setParent(menuManager);
+ parentMenuManager.setRemoveAllWhenShown(true);
+ parentMenuManager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(final IMenuManager manager) {
+ new VpeMenuCreator(parentMenuManager, parent).createMenu(false);
+ }
+ });
+
+ menuManager.add(parentMenuManager);
+ }
+
+ /**
+ * Adds a separator. If {@link #menuManager} is empty or the last
+ * item already is a separator, does nothing.
+ */
+ private void addSeparator() {
+ final int size = menuManager.getSize();
+ if (size > 0) {
+ final IContributionItem lastItem = menuManager.getItems()[size - 1];
+ if (!lastItem.isSeparator()) {
+ menuManager.add(new Separator());
+ }
+ }
+ }
+
+ /**
+ * Returns an action of the source editor.
+ *
+ * @param actionFactory instance of {@link ActionFactory}
+ * which identifies the action of the item.
+ */
+ private IAction getSourceEditorAction(final ActionFactory actionFactory) {
+ final AbstractTextEditor sourceEditor = vpeMenuUtil.getSourceEditor();
+ final IAction action = sourceEditor.getAction(actionFactory.getId());
+ return action;
+ }
+
+
+ /**
+ * Test action. For the debugging purposes only.
+ */
+ public class TestAction extends Action {
+ public TestAction() {
+ setText("Test Action"); //$NON-NLS-1$
+ }
+
+ public void run() {
+ // test code
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return VpeDebug.VISUAL_CONTEXTMENU_TEST;
+ }
+ }
+
+ /**
+ * Action to dump source of VPE.
+ * For debugging purposes only.
+ */
+ public class DumpSourceAction extends Action {
+ public DumpSourceAction() {
+ setText("Dump Source"); //$NON-NLS-1$
+ }
+
+ @Override
+ public void run() {
+ final MozillaEditor visualEditor
+ = vpeMenuUtil.getMozillaEditor();
+ DOMTreeDumper dumper = new DOMTreeDumper(
+ VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ dumper.setIgnoredAttributes(
+ VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES);
+ dumper.dumpToStream(System.out, visualEditor.getDomDocument());
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return VpeDebug.VISUAL_CONTEXTMENU_DUMP_SOURCE;
+ }
+ }
+
+ /**
+ * Action to dump source of the selected VPE element.
+ * For debugging purposes only.
+ */
+ public class DumpSelectedElementAction extends Action {
+ public DumpSelectedElementAction() {
+ setText("Dump Selected Element"); //$NON-NLS-1$
+ }
+
+ @Override
+ public void run() {
+ final StructuredTextEditor sourceEditor
+ = vpeMenuUtil.getSourceEditor();
+ final VpeDomMapping domMapping
+ = vpeMenuUtil.getDomMapping();
+ final VpeNodeMapping nodeMapping
+ = SelectionUtil.getNodeMappingBySourceSelection(
+ sourceEditor, domMapping);
+ if (nodeMapping != null) {
+ DOMTreeDumper dumper = new DOMTreeDumper(
+ VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ dumper.setIgnoredAttributes(
+ VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES);
+ dumper.dumpNode(nodeMapping.getVisualNode());
+ }
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return VpeDebug.VISUAL_CONTEXTMENU_DUMP_SELECTED_ELEMENT;
+ }
+ }
+
+ /**
+ * Action to print the {@link #domMapping}.
+ * For debugging purposes only.
+ */
+ public class DumpMappingAction extends Action {
+ public DumpMappingAction() {
+ setText("Dump Mapping"); //$NON-NLS-1$
+ }
+
+ @Override
+ public void run() {
+ final VpeDomMapping domMapping
+ = vpeMenuUtil.getDomMapping();
+ domMapping.printMapping();
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return VpeDebug.VISUAL_CONTEXTMENU_DUMP_MAPPING;
+ }
+ }
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuUtil.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuUtil.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.menu;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeEditorPart;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
+import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.w3c.dom.Node;
+
+/**
+ * An utility class that allows easily and quickly get
+ * some environment variables.
+ * <P>IMPORTANT: If an environment variable changes
+ * between the constructor call and the variable's getter call, the method
+ * could return an incorrect result. You must create a new instance to
+ * get correct result!
+ * </P>
+ *
+ * @author yradtsevich
+ */
+public class VpeMenuUtil {
+ private JSPMultiPageEditor editor;
+ private boolean editorInitialized = false;
+ private StructuredTextEditor sourceEditor;
+ private boolean sourceEditorInitialized = false;
+ private VpeDomMapping domMapping;
+ private boolean domMappingInitialized = false;
+ private VpePageContext pageContext;
+ private boolean pageContextInitialized = false;
+ private Node selectedNode;
+ private boolean selectedNodeInitialized = false;
+ private IStructuredSelection selection;
+ private boolean selectionInitialized = false;
+ private MozillaEditor mozillaEditor;
+ private boolean mozillaEditorInitialized = false;
+
+ /**
+ * Returns active {@code JSPMultiPageEditor}
+ */
+ public JSPMultiPageEditor getEditor() {
+ if (!editorInitialized) {
+ editor = (JSPMultiPageEditor) PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow()
+ .getActivePage().getActiveEditor();
+ editorInitialized = true;
+ }
+ return editor;
+ }
+ /**
+ * Returns active {@code StructuredTextEditor}
+ */
+ public StructuredTextEditor getSourceEditor() {
+ if (!sourceEditorInitialized) {
+ sourceEditor = getEditor().getSourceEditor();
+ sourceEditorInitialized = true;
+ }
+ return sourceEditor;
+ }
+ /**
+ * Returns active {@code StructuredTextEditor}
+ */
+ public VpeDomMapping getDomMapping() {
+ if (!domMappingInitialized) {
+ domMapping = getPageContext().getDomMapping();
+ domMappingInitialized = true;
+ }
+ return domMapping;
+ }
+ /**
+ * Returns {@code VpePageContext} of
+ * the active editor
+ */
+ public VpePageContext getPageContext() {
+ if (!pageContextInitialized) {
+ pageContext = ((VpeEditorPart) getEditor().getVisualEditor())
+ .getController().getPageContext();
+ pageContextInitialized = true;
+ }
+ return pageContext;
+ }
+ /**
+ * Returns active source selection
+ */
+ public IStructuredSelection getSelection() {
+ if (!selectionInitialized) {
+ selection = (IStructuredSelection) getSourceEditor()
+ .getSelectionProvider().getSelection();
+ selectionInitialized = true;
+ }
+ return selection;
+ }
+ /**
+ * Returns selected node.
+ */
+ public Node getSelectedNode() {
+ if (!selectedNodeInitialized) {
+ selection = getSelection();
+ if (selection != null
+ && selection.getFirstElement() instanceof Node) {
+ selectedNode = (Node) selection.getFirstElement();
+ }
+ selectedNodeInitialized = true;
+ }
+ return selectedNode;
+ }
+ /**
+ * Returns active {@code MozillaEditor}
+ */
+ public MozillaEditor getMozillaEditor() {
+ if (!mozillaEditorInitialized) {
+ mozillaEditor = ((VpeEditorPart) getEditor().getVisualEditor())
+ .getVisualEditor();
+ mozillaEditorInitialized = true;
+ }
+ return mozillaEditor;
+ }
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/ComplexAction.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/ComplexAction.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/ComplexAction.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.menu.action;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+
+/**
+ * Allows to create an action which composed of multiple actions.
+ *
+ * @author yradtsevich
+ */
+public class ComplexAction extends Action {
+ private final IAction[] actions;
+
+ public ComplexAction(final String name, final IAction... actions) {
+ super(name);
+ this.actions = actions;
+ }
+
+ @Override
+ public void run() {
+ for (final IAction action : actions) {
+ action.run();
+ }
+ }
+}
\ No newline at end of file
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/EditAttributesAction.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/EditAttributesAction.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/EditAttributesAction.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.menu.action;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+
+import org.eclipse.jface.action.Action;
+import org.jboss.tools.common.model.ui.objecteditor.ExtendedProperties;
+import org.jboss.tools.common.model.ui.objecteditor.ExtendedPropertiesWizard;
+import org.jboss.tools.common.model.util.ModelFeatureFactory;
+import org.jboss.tools.vpe.VpePlugin;
+import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
+import org.jboss.tools.vpe.editor.menu.VpeMenuUtil;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.w3c.dom.Node;
+
+/**
+ * Action to edit attributes of the {@link #node}.
+ *
+ * @author yradtsevich
+ * (based on the implementation of MenuCreationHelper)
+ */
+public class EditAttributesAction extends Action {
+ final Node node;
+ final VpeMenuUtil menuUtil = new VpeMenuUtil();
+
+ public EditAttributesAction() {
+ this.node = menuUtil.getSelectedNode();
+ init();
+ }
+ public EditAttributesAction(final Node node) {
+ this.node = node;
+ init();
+ }
+
+ private void init() {
+ final String name = MessageFormat.format(
+ VpeUIMessages.ATTRIBUTES_MENU_ITEM,
+ node != null ? node.getNodeName() : "");
+ setText(name);
+ }
+
+ @Override
+ public void run() {
+ showProperties(node);
+ }
+
+ /**
+ * Indicates if editing of attributes of {@link #node}
+ * should be enabled.
+ */
+ @Override
+ public boolean isEnabled() {
+ final VpeDomMapping domMapping = menuUtil.getDomMapping();
+ if (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
+ final VpeElementMapping elementMapping
+ = (VpeElementMapping) domMapping.getNodeMapping(node);
+ if (elementMapping != null
+ && elementMapping.getTemplate() != null) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Method is used to show properties of the node.
+ *
+ * @param node the Node object
+ */
+ private void showProperties(Node node) {
+ ExtendedProperties p = createExtendedProperties(node);
+ if (p != null) {
+ ExtendedPropertiesWizard.run(p);
+ }
+ }
+
+ /**
+ * Create extended properties list for the node.
+ *
+ * @param node the Node to be processed
+ * @return an extended properties
+ */
+ private ExtendedProperties createExtendedProperties(Node node) {
+ final Class<?> c = ModelFeatureFactory.getInstance().getFeatureClass(
+ "org.jboss.tools.jst.jsp.outline.VpeProperties"); //$NON-NLS-1$
+ try {
+ return (ExtendedProperties) c.getDeclaredConstructor(
+ new Class[] {Node.class}).newInstance(new Object[] {node});
+ } catch (IllegalArgumentException e) {
+ VpePlugin.getPluginLog().logError(e);
+ } catch (SecurityException e) {
+ VpePlugin.getPluginLog().logError(e);
+ } catch (InstantiationException e) {
+ VpePlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ VpePlugin.getPluginLog().logError(e);
+ } catch (InvocationTargetException e) {
+ VpePlugin.getPluginLog().logError(e);
+ } catch (NoSuchMethodException e) {
+ VpePlugin.getPluginLog().logError(e);
+ }
+ return null;
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/InsertAction2.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/InsertAction2.java 2009-05-13 16:28:09 UTC (rev 15244)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/InsertAction2.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -14,9 +14,6 @@
import org.eclipse.jface.action.Action;
import org.eclipse.jface.text.IUndoManager;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.graphics.Point;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SelectThisTagAction.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SelectThisTagAction.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/SelectThisTagAction.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.menu.action;
+
+
+import org.eclipse.jface.action.Action;
+import org.jboss.tools.vpe.editor.menu.VpeMenuUtil;
+import org.jboss.tools.vpe.editor.util.NodesManagingUtil;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.w3c.dom.Node;
+
+/**
+ * Action to select {@link #node}.
+ *
+ * @author yradtsevich
+ * (based on the implementation of MenuCreationHelper)
+ */
+public class SelectThisTagAction extends Action {
+ final Node node;
+ final VpeMenuUtil menuUtil = new VpeMenuUtil();
+
+ public SelectThisTagAction() {
+ this.node = menuUtil.getSelectedNode();
+ init();
+ }
+ public SelectThisTagAction(final Node node) {
+ this.node = node;
+ init();
+ }
+
+ private void init() {
+ setText(VpeUIMessages.SELECT_THIS_TAG_MENU_ITEM);
+ }
+
+ @Override
+ public void run() {
+ final int start = NodesManagingUtil.getStartOffsetNode(node);
+ final int end = NodesManagingUtil.getEndOffsetNode(node);
+ menuUtil.getSourceEditor().getTextViewer().setSelectedRange(
+ start, end - start);
+ }
+
+ @Override
+ public boolean isEnabled() {
+ return node != null;
+ }
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/StripTagAction.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/StripTagAction.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/action/StripTagAction.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.menu.action;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.text.IUndoManager;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.jboss.tools.vpe.editor.menu.VpeMenuUtil;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Action to "strip tag" - replace the node by its children.
+ *
+ * @author yradtsevich
+ * (based on the implementation of MenuCreationHelper)
+ */
+public class StripTagAction extends Action {
+ final Node node;
+ final VpeMenuUtil menuUtil = new VpeMenuUtil();
+
+ public StripTagAction() {
+ this.node = menuUtil.getSelectedNode();
+ init();
+ }
+ public StripTagAction(final Node node) {
+ this.node = node;
+ init();
+ }
+
+ private void init() {
+ setText(VpeUIMessages.STRIP_TAG_MENU_ITEM);
+ }
+
+ @Override
+ public void run() {
+ final Node parent = node.getParentNode();
+ if (parent != null) {
+ final IUndoManager undoManager = menuUtil.getSourceEditor()
+ .getTextViewer().getUndoManager();
+ try {
+ undoManager.beginCompoundChange();
+ moveNodeChildrenInto(parent);
+ parent.removeChild(node);
+ } finally {
+ undoManager.endCompoundChange();
+ }
+ }
+ }
+
+ private void moveNodeChildrenInto(final Node parent) {
+ final NodeList children = node.getChildNodes();
+ final int childrenLength = children.getLength();
+ for (int i = 0; i < childrenLength; i++) {
+ final Node child = children.item(0);
+ node.removeChild(child);
+ parent.insertBefore(child, node);
+ }
+ }
+
+ @Override
+ public boolean isEnabled() {
+ if (node == null) {
+ return false;
+ }
+ if (node.getNodeType() != Node.ELEMENT_NODE) {
+ return false;
+ }
+
+ final NodeList children = node.getChildNodes();
+ final int childrenLength = children.getLength();
+ if (childrenLength <= 0) {
+ return false;
+ }
+ if (childrenLength == 1
+ && children.item(0).getNodeValue().trim().isEmpty()) {
+ return false;
+ }
+
+ return true;
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2009-05-13 16:28:09 UTC (rev 15244)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2009-05-13 18:39:30 UTC (rev 15245)
@@ -13,13 +13,18 @@
import org.eclipse.osgi.util.NLS;
public class VpeUIMessages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.vpe.messages.messages";//$NON-NLS-1$
+ private static final String BUNDLE_NAME
+ = "org.jboss.tools.vpe.messages.messages";//$NON-NLS-1$
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, VpeUIMessages.class);
}
private VpeUIMessages(){}
+ public static String ATTRIBUTES_MENU_ITEM;
+ public static String SELECT_THIS_TAG_MENU_ITEM;
+ public static String STRIP_TAG_MENU_ITEM;
+ public static String PARENT_TAG_MENU_ITEM;
public static String NAMESPACE_NOT_DEFINED;
public static String PREFERENCES;
public static String REFRESH;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-05-13 16:28:09 UTC (rev 15244)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-05-13 18:39:30 UTC (rev 15245)
@@ -1,3 +1,7 @@
+ATTRIBUTES_MENU_ITEM=<{0}> Attributes
+SELECT_THIS_TAG_MENU_ITEM=Select This Tag
+STRIP_TAG_MENU_ITEM=Strip Tag
+PARENT_TAG_MENU_ITEM=Parent Tag ({0})
NAMESPACE_NOT_DEFINED=Namespace is not defined. Template could not be edited.
PREFERENCES=Preferences
REFRESH=Refresh
17 years, 2 months
JBoss Tools SVN: r15244 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-13 12:28:09 -0400 (Wed, 13 May 2009)
New Revision: 15244
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4312
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2009-05-13 15:28:14 UTC (rev 15243)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/AbstractExtendedXMLFileImpl.java 2009-05-13 16:28:09 UTC (rev 15244)
@@ -197,9 +197,15 @@
m.fireStructureChanged(this);
if(!isOverlapped) getResourceMarkers().update();
} else if(isMergingChanges()) {
+ String oldBody = get("correctBody");
+ boolean changed = body != null && !body.equals(oldBody);
set("correctBody", body);
set("actualBodyTimeStamp", "0");
+ long ots = getTimeStamp();
mergeAll(f, update);
+ if(changed && ots == getTimeStamp()) {
+ changeTimeStamp();
+ }
set("actualBodyTimeStamp", "" + getTimeStamp());
if(errors1) m.fireStructureChanged(this);
if(!isOverlapped) constraintChecker.check();
17 years, 2 months
JBoss Tools SVN: r15243 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-05-13 11:28:14 -0400 (Wed, 13 May 2009)
New Revision: 15243
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2497, attributes were moved to separate class.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2009-05-13 14:33:34 UTC (rev 15242)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2009-05-13 15:28:14 UTC (rev 15243)
@@ -1,13 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
import java.util.List;
@@ -18,69 +18,216 @@
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMText;
-import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesDropDownMenuTemplate extends VpeAbstractTemplate {
-
+
+ /*
+ * rich:dropDownMenu constants
+ */
+ private static final String COMPONENT_NAME = "dropDownMenu"; //$NON-NLS-1$
+ private static final String STYLE_PATH = "dropDownMenu/dropDownMenu.css"; //$NON-NLS-1$
+ private static final String CHILD_GROUP_NAME = ":menuGroup"; //$NON-NLS-1$
+ private static final String CHILD_ITEM_NAME = ":menuItem"; //$NON-NLS-1$
+ private static final String LABEL_FACET_NAME = "label"; //$NON-NLS-1$
+ private static final String DEFAULT_DDM_TITLE = "rich:dropDownMenu"; //$NON-NLS-1$
+
+ /*
+ * Constants for drop down mechanism.
+ */
+ private static final String MENU_TOP_ID = "vpe-ddm-menu-title-ul"; //$NON-NLS-1$
+ private static final String MENU_TOP_ITEM_ID = "vpe-ddm-menu-title-li"; //$NON-NLS-1$
+ private static final String MENU_CHILDREN_LIST_ID = "vpe-ddm-menu-children-ul"; //$NON-NLS-1$
+
+ /*
+ * rich:dropDownMenu css styles names
+ */
+ private static final String CSS_RICH_DDMENU_LABEL = "rich-ddmenu-label"; //$NON-NLS-1$
+ private static final String CSS_RICH_DDMENU_LABEL_UNSELECT = "rich-ddmenu-label-unselect"; //$NON-NLS-1$
+ private static final String CSS_RICH_DDMENU_LABEL_SELECT = "rich-ddmenu-label-select"; //$NON-NLS-1$
+ private static final String CSS_RICH_DDMENU_LABEL_DISABLED = "rich-ddmenu-label-disabled"; //$NON-NLS-1$
+ private static final String CSS_RICH_LABEL_TEXT_DECOR = "rich-label-text-decor"; //$NON-NLS-1$
+ private static final String CSS_RICH_MENU_LIST_BORDER = "rich-menu-list-border"; //$NON-NLS-1$
+ private static final String CSS_RICH_MENU_LIST_BG = "rich-menu-list-bg"; //$NON-NLS-1$
+ private static final String CSS_RICH_DDEMENU_LIST_DIV_STYLE = ""; //$NON-NLS-1$
+ private static final String CSS_RICH_DDEMENU_BORDER_DIV_STYLE = ""; //$NON-NLS-1$
+ private static final String CSS_MENU_TOP_DIV = "dr-menu-top-div"; //$NON-NLS-1$
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+ VpeCreationData creationData = null;
+ Element sourceElement = (Element)sourceNode;
+
+ ComponentUtil.setCSSLink(pageContext, STYLE_PATH, COMPONENT_NAME);
+ final Attributes attrs = new Attributes(sourceElement);
+
/*
- * rich:dropDownMenu constants
+ * DropDownMenu component structure.
+ * In order of nesting.
*/
- private static final String COMPONENT_NAME = "dropDownMenu"; //$NON-NLS-1$
- private static final String STYLE_PATH = "dropDownMenu/dropDownMenu.css"; //$NON-NLS-1$
- private static final String CHILD_GROUP_NAME = ":menuGroup"; //$NON-NLS-1$
- private static final String CHILD_ITEM_NAME = ":menuItem"; //$NON-NLS-1$
- private static final String LABEL_FACET_NAME = "label"; //$NON-NLS-1$
- private static final String DEFAULT_DDM_TITLE = "ddm"; //$NON-NLS-1$
- private static final String EMPTY = ""; //$NON-NLS-1$
- private static final String SPACE = " "; //$NON-NLS-1$
+ nsIDOMElement ddmMainUL;
+ nsIDOMElement ddmMainLI;
+ nsIDOMElement ddmChildrenUL;
+ nsIDOMElement ddmLabelDiv;
+ nsIDOMElement ddmTextSpan;
+ nsIDOMText ddmLabelText;
+ nsIDOMElement ddmListDiv;
+ nsIDOMElement ddmListBorderDiv;
+ nsIDOMElement ddmListBgDiv;
/*
- * Constants for drop down mechanism.
+ * Creating visual elements
*/
- private static final String MENU_TOP_ID = "vpe-ddm-menu-title-ul"; //$NON-NLS-1$
- private static final String MENU_TOP_ITEM_ID = "vpe-ddm-menu-title-li"; //$NON-NLS-1$
- private static final String MENU_CHILDREN_LIST_ID = "vpe-ddm-menu-children-ul"; //$NON-NLS-1$
-
+ ddmMainUL = visualDocument.createElement(HTML.TAG_UL);
+ ddmMainLI = visualDocument.createElement(HTML.TAG_LI);
+ ddmChildrenUL = visualDocument.createElement(HTML.TAG_UL);
+ ddmLabelDiv = visualDocument.createElement(HTML.TAG_DIV);
+ ddmTextSpan = visualDocument.createElement(HTML.TAG_SPAN);
+ ddmLabelText = visualDocument.createTextNode(Constants.EMPTY);
+ ddmListDiv = visualDocument.createElement(HTML.TAG_DIV);
+ ddmListBorderDiv = visualDocument.createElement(HTML.TAG_DIV);
+ ddmListBgDiv = visualDocument.createElement(HTML.TAG_DIV);
+ creationData = new VpeCreationData(ddmMainUL);
+
/*
- * rich:dropDownMenu css styles names
+ * Nesting elements
*/
- private static final String CSS_RICH_DDMENU_LABEL = "rich-ddmenu-label"; //$NON-NLS-1$
- private static final String CSS_RICH_DDMENU_LABEL_UNSELECT = "rich-ddmenu-label-unselect"; //$NON-NLS-1$
- private static final String CSS_RICH_DDMENU_LABEL_SELECT = "rich-ddmenu-label-select"; //$NON-NLS-1$
- private static final String CSS_RICH_DDMENU_LABEL_DISABLED = "rich-ddmenu-label-disabled"; //$NON-NLS-1$
- private static final String CSS_RICH_LABEL_TEXT_DECOR = "rich-label-text-decor"; //$NON-NLS-1$
- private static final String CSS_RICH_MENU_LIST_BORDER = "rich-menu-list-border"; //$NON-NLS-1$
- private static final String CSS_RICH_MENU_LIST_BG = "rich-menu-list-bg"; //$NON-NLS-1$
- private static final String CSS_RICH_DDEMENU_LIST_DIV_STYLE = ""; //$NON-NLS-1$
- private static final String CSS_RICH_DDEMENU_BORDER_DIV_STYLE = ""; //$NON-NLS-1$
- private static final String CSS_MENU_TOP_DIV = "dr-menu-top-div"; //$NON-NLS-1$
+ ddmLabelDiv.appendChild(ddmTextSpan);
+// ddmTextSpan.appendChild(ddmLabelText);
+// ddmLabelDiv.appendChild(ddmListDiv);
+ ddmListDiv.appendChild(ddmListBorderDiv);
+ ddmListBorderDiv.appendChild(ddmListBgDiv);
+ ddmMainUL.appendChild(ddmMainLI);
+ ddmMainLI.appendChild(ddmLabelDiv);
/*
+ * Setting attributes for the drop-down mechanism
+ */
+ ddmMainUL.setAttribute(MENU_TOP_ID, Constants.EMPTY);
+ ddmMainLI.setAttribute(MENU_TOP_ITEM_ID, Constants.EMPTY);
+ ddmChildrenUL.setAttribute(MENU_CHILDREN_LIST_ID, Constants.EMPTY);
+
+ /*
+ * Setting css classes
+ */
+ String labelDivClass = Constants.EMPTY;
+ String listBorderDivClass = Constants.EMPTY;
+
+ labelDivClass += Constants.WHITE_SPACE + CSS_RICH_DDMENU_LABEL + Constants.WHITE_SPACE
+ + CSS_RICH_DDMENU_LABEL_UNSELECT;
+ listBorderDivClass += Constants.WHITE_SPACE + CSS_RICH_MENU_LIST_BORDER;
+
+ if (ComponentUtil.isNotBlank(attrs.getStyleClass())) {
+ labelDivClass += Constants.WHITE_SPACE + attrs.getStyleClass();
+ listBorderDivClass += Constants.WHITE_SPACE + attrs.getStyleClass();
+ }
+
+// ddmLabelDiv.setAttribute(HTML.ATTR_CLASS, labelDivClass);
+ ddmLabelDiv.setAttribute(HTML.ATTR_CLASS, CSS_MENU_TOP_DIV);
+ ddmMainLI.setAttribute(HTML.ATTR_CLASS, labelDivClass);
+ ddmTextSpan.setAttribute(HTML.ATTR_CLASS, CSS_RICH_LABEL_TEXT_DECOR);
+// ddmListBorderDiv.setAttribute(HTML.ATTR_CLASS, listBorderDivClass);
+// ddmListBgDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BG);
+ ddmChildrenUL.setAttribute(HTML.ATTR_CLASS, listBorderDivClass + Constants.WHITE_SPACE
+ + CSS_RICH_MENU_LIST_BG);
+ /*
+ * Setting css styles
+ */
+ String cssListDivStyle = Constants.EMPTY;
+ String cssListBorderDivStyle = Constants.EMPTY;
+ String cssLabelDivStyle = Constants.EMPTY;
+
+ cssListDivStyle += Constants.WHITE_SPACE + CSS_RICH_DDEMENU_LIST_DIV_STYLE;
+ cssListBorderDivStyle += Constants.WHITE_SPACE + CSS_RICH_DDEMENU_BORDER_DIV_STYLE;
+
+ if (ComponentUtil.isNotBlank(attrs.getStyle())) {
+ cssLabelDivStyle += Constants.WHITE_SPACE + attrs.getStyle();
+ }
+
+// ddmListDiv.setAttribute(HTML.ATTR_STYLE, cssListDivStyle);
+// ddmListBorderDiv.setAttribute(HTML.ATTR_STYLE, cssListBorderDivStyle);
+// ddmLabelDiv.setAttribute(HTML.ATTR_STYLE, cssLabelDivStyle);
+ ddmMainLI.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + Constants.WHITE_SPACE
+ + cssListBorderDivStyle + Constants.WHITE_SPACE + cssLabelDivStyle);
+ ddmChildrenUL.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + Constants.WHITE_SPACE
+ + cssListBorderDivStyle + Constants.WHITE_SPACE + cssLabelDivStyle);
+ /*
+ * Encoding label value
+ */
+ Element labelFacet = ComponentUtil.getFacet(sourceElement, LABEL_FACET_NAME);
+ if (null != labelFacet) {
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(ddmTextSpan);
+ childrenInfo.addSourceChild(labelFacet);
+ creationData.addChildrenInfo(childrenInfo);
+ } else {
+ String labelValue = DEFAULT_DDM_TITLE;
+ if (ComponentUtil.isNotBlank(attrs.getValue())) {
+ labelValue = attrs.getValue();
+ }
+ ddmLabelText.setNodeValue(labelValue);
+ ddmTextSpan.appendChild(ddmLabelText);
+ }
+
+ /*
+ * Adding child nodes:
+ * <rich:menuGroup> and <rich:menuItem> only.
+ */
+ List<Node> children = ComponentUtil.getChildren(sourceElement);
+ boolean missingChildContainer = true;
+ for (Node child : children) {
+ if (child.getNodeType() == Node.ELEMENT_NODE
+ && (child.getNodeName().endsWith(CHILD_GROUP_NAME) || child
+ .getNodeName().endsWith(CHILD_ITEM_NAME))) {
+ if (missingChildContainer) {
+ /*
+ * Add children <ul> tag.
+ */
+ ddmMainLI.appendChild(ddmChildrenUL);
+ missingChildContainer = false;
+ }
+ VpeChildrenInfo childDivInfo = new VpeChildrenInfo(
+ ddmChildrenUL);
+ childDivInfo.addSourceChild(child);
+ creationData.addChildrenInfo(childDivInfo);
+ }
+ }
+
+ return creationData;
+ }
+
+ @Override
+ public boolean recreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
+
+ class Attributes {
+ /*
* rich:dropDownMenu attributes names
*/
- private static final String DIRECTION = "direction"; //$NON-NLS-1$
- private static final String HORIZONTAL_OFFCET = "horizontalOffset"; //$NON-NLS-1$
- private static final String JOINT_POINT = "jontPoint"; //$NON-NLS-1$
- private static final String POPUP_WIDTH = "popupWidth"; //$NON-NLS-1$
- private static final String VERTICAL_OFFSET = "verticalOffset"; //$NON-NLS-1$
-
+ private String DIRECTION = "direction"; //$NON-NLS-1$
+ private String HORIZONTAL_OFFCET = "horizontalOffset"; //$NON-NLS-1$
+ private String JOINT_POINT = "jontPoint"; //$NON-NLS-1$
+ private String POPUP_WIDTH = "popupWidth"; //$NON-NLS-1$
+ private String VERTICAL_OFFSET = "verticalOffset"; //$NON-NLS-1$
+
/*
* rich:menuGroup css styles and classes attributes names
*/
- private static final String DISABLED_ITEM_CLASS = "disabledItemClass"; //$NON-NLS-1$
- private static final String DISABLED_ITEM_STYLE = "disabledItemStyle"; //$NON-NLS-1$
- private static final String DISABLED_LABEL_CLASS = "disabledLabelClass"; //$NON-NLS-1$
- private static final String ITEM_CLASS = "itemClass"; //$NON-NLS-1$
- private static final String ITEM_STYLE = "itemStyle"; //$NON-NLS-1$
- private static final String SELECED_LABEL_CLASS = "selectedLabelClass"; //$NON-NLS-1$
- private static final String SELECT_ITEM_CLASS = "selectItemClass"; //$NON-NLS-1$
-
+ private String DISABLED_ITEM_CLASS = "disabledItemClass"; //$NON-NLS-1$
+ private String DISABLED_ITEM_STYLE = "disabledItemStyle"; //$NON-NLS-1$
+ private String DISABLED_LABEL_CLASS = "disabledLabelClass"; //$NON-NLS-1$
+ private String ITEM_CLASS = "itemClass"; //$NON-NLS-1$
+ private String ITEM_STYLE = "itemStyle"; //$NON-NLS-1$
+ private String SELECED_LABEL_CLASS = "selectedLabelClass"; //$NON-NLS-1$
+ private String SELECT_ITEM_CLASS = "selectItemClass"; //$NON-NLS-1$
+
/*
* rich:dropDownMenu attributes
*/
@@ -103,180 +250,47 @@
private String ddm_selectItemClass;
private String ddm_style;
private String ddm_styleClass;
+ private String ddm_value;
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- VpeCreationData creationData = null;
- Element sourceElement = (Element)sourceNode;
+ public Attributes(final Element sourceElement) {
+ if (null == sourceElement) {
+ return;
+ }
+
+ ddm_direction = sourceElement.getAttribute(DIRECTION);
+ ddm_disabled = sourceElement.getAttribute(HTML.ATTR_DISABLED);
+ ddm_horizontalOffset = sourceElement.getAttribute(HORIZONTAL_OFFCET);
+ ddm_jointPoint = sourceElement.getAttribute(JOINT_POINT);
+ ddm_popupWidth = sourceElement.getAttribute(POPUP_WIDTH);
+ ddm_verticalOffset = sourceElement.getAttribute(VERTICAL_OFFSET);
- ComponentUtil.setCSSLink(pageContext, STYLE_PATH, COMPONENT_NAME);
- readDropDownMenuAttributes(sourceElement);
-
- /*
- * DropDownMenu component structure.
- * In order of nesting.
- */
- nsIDOMElement ddmMainUL;
- nsIDOMElement ddmMainLI;
- nsIDOMElement ddmChildrenUL;
- nsIDOMElement ddmLabelDiv;
- nsIDOMElement ddmTextSpan;
- nsIDOMText ddmLabelText;
- nsIDOMElement ddmListDiv;
- nsIDOMElement ddmListBorderDiv;
- nsIDOMElement ddmListBgDiv;
-
- /*
- * Creating visual elements
- */
- ddmMainUL = visualDocument.createElement(HTML.TAG_UL);
- ddmMainLI = visualDocument.createElement(HTML.TAG_LI);
- ddmChildrenUL = visualDocument.createElement(HTML.TAG_UL);
- ddmLabelDiv = visualDocument.createElement(HTML.TAG_DIV);
- ddmTextSpan = visualDocument.createElement(HTML.TAG_SPAN);
- ddmLabelText = visualDocument.createTextNode(EMPTY);
- ddmListDiv = visualDocument.createElement(HTML.TAG_DIV);
- ddmListBorderDiv = visualDocument.createElement(HTML.TAG_DIV);
- ddmListBgDiv = visualDocument.createElement(HTML.TAG_DIV);
- creationData = new VpeCreationData(ddmMainUL);
-
- /*
- * Nesting elements
- */
- ddmLabelDiv.appendChild(ddmTextSpan);
-// ddmTextSpan.appendChild(ddmLabelText);
-// ddmLabelDiv.appendChild(ddmListDiv);
- ddmListDiv.appendChild(ddmListBorderDiv);
- ddmListBorderDiv.appendChild(ddmListBgDiv);
- ddmMainUL.appendChild(ddmMainLI);
- ddmMainLI.appendChild(ddmLabelDiv);
-
- /*
- * Setting attributes for the drop-down mechanism
- */
- ddmMainUL.setAttribute(MENU_TOP_ID, EMPTY);
- ddmMainLI.setAttribute(MENU_TOP_ITEM_ID, EMPTY);
- ddmChildrenUL.setAttribute(MENU_CHILDREN_LIST_ID, EMPTY);
-
- /*
- * Setting css classes
- */
- String labelDivClass = EMPTY;
- String listBorderDivClass = EMPTY;
+ ddm_disabledItemClass = sourceElement.getAttribute(DISABLED_ITEM_CLASS);
+ ddm_disabledItemStyle = sourceElement.getAttribute(DISABLED_ITEM_STYLE);
+ ddm_disabledLabelClass = sourceElement.getAttribute(DISABLED_LABEL_CLASS);
+ ddm_itemClass = sourceElement.getAttribute(ITEM_CLASS);
+ ddm_itemStyle = sourceElement.getAttribute(ITEM_STYLE);
+ ddm_selectedLabelClass = sourceElement.getAttribute(SELECED_LABEL_CLASS);
+ ddm_selectItemClass = sourceElement.getAttribute(SELECT_ITEM_CLASS);
+ ddm_style = sourceElement.getAttribute(HTML.ATTR_STYLE);
+ ddm_styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+ ddm_value = sourceElement.getAttribute(HTML.ATTR_VALUE);
+ }
- labelDivClass += SPACE + CSS_RICH_DDMENU_LABEL + SPACE
- + CSS_RICH_DDMENU_LABEL_UNSELECT;
- listBorderDivClass += SPACE + CSS_RICH_MENU_LIST_BORDER;
-
- if (ComponentUtil.isNotBlank(ddm_styleClass)) {
- labelDivClass += SPACE + ddm_styleClass;
- listBorderDivClass += SPACE + ddm_styleClass;
- }
-
-// ddmLabelDiv.setAttribute(HTML.ATTR_CLASS, labelDivClass);
- ddmLabelDiv.setAttribute(HTML.ATTR_CLASS, CSS_MENU_TOP_DIV);
- ddmMainLI.setAttribute(HTML.ATTR_CLASS, labelDivClass);
- ddmTextSpan.setAttribute(HTML.ATTR_CLASS, CSS_RICH_LABEL_TEXT_DECOR);
-// ddmListBorderDiv.setAttribute(HTML.ATTR_CLASS, listBorderDivClass);
-// ddmListBgDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BG);
- ddmChildrenUL.setAttribute(HTML.ATTR_CLASS, listBorderDivClass + SPACE
- + CSS_RICH_MENU_LIST_BG);
- /*
- * Setting css styles
- */
- String cssListDivStyle = EMPTY;
- String cssListBorderDivStyle = EMPTY;
- String cssLabelDivStyle = EMPTY;
-
- cssListDivStyle += SPACE + CSS_RICH_DDEMENU_LIST_DIV_STYLE;
- cssListBorderDivStyle += SPACE + CSS_RICH_DDEMENU_BORDER_DIV_STYLE;
-
- if (ComponentUtil.isNotBlank(ddm_style)) {
- cssLabelDivStyle += SPACE + ddm_style;
- }
-
-// ddmListDiv.setAttribute(HTML.ATTR_STYLE, cssListDivStyle);
-// ddmListBorderDiv.setAttribute(HTML.ATTR_STYLE, cssListBorderDivStyle);
-// ddmLabelDiv.setAttribute(HTML.ATTR_STYLE, cssLabelDivStyle);
- ddmMainLI.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + SPACE
- + cssListBorderDivStyle + SPACE + cssLabelDivStyle);
- ddmChildrenUL.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + SPACE
- + cssListBorderDivStyle + SPACE + cssLabelDivStyle);
- /*
- * Encoding label value
- */
- Element labelFacet = ComponentUtil.getFacet(sourceElement, LABEL_FACET_NAME);
- if (null != labelFacet) {
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(ddmTextSpan);
- childrenInfo.addSourceChild(labelFacet);
- creationData.addChildrenInfo(childrenInfo);
- } else {
- Attr valueAttr = sourceElement.getAttributeNode(HTML.ATTR_VALUE);
- String labelValue = (valueAttr != null && valueAttr.getValue() != null)
- ? valueAttr.getValue()
- : DEFAULT_DDM_TITLE;
- ddmLabelText.setNodeValue(labelValue);
- ddmTextSpan.appendChild(ddmLabelText);
- }
+ public String getStyle() {
+ return ddm_style;
+ }
- /*
- * Adding child nodes:
- * <rich:menuGroup> and <rich:menuItem> only.
- */
- List<Node> children = ComponentUtil.getChildren(sourceElement);
- boolean missingChildContainer = true;
- for (Node child : children) {
- if (child.getNodeType() == Node.ELEMENT_NODE
- && (child.getNodeName().endsWith(CHILD_GROUP_NAME) || child
- .getNodeName().endsWith(CHILD_ITEM_NAME))) {
- if (missingChildContainer) {
- /*
- * Add children <ul> tag.
- */
- ddmMainLI.appendChild(ddmChildrenUL);
- missingChildContainer = false;
- }
- VpeChildrenInfo childDivInfo = new VpeChildrenInfo(
- ddmChildrenUL);
- childDivInfo.addSourceChild(child);
- creationData.addChildrenInfo(childDivInfo);
- }
- }
-
- return creationData;
+ public String getStyleClass() {
+ return ddm_styleClass;
}
-
- /**
- * Read attributes from the source element.
- *
- * @param sourceNode the source node
- */
- private void readDropDownMenuAttributes(Element sourceElement) {
- if (null == sourceElement) {
- return;
- }
-
- ddm_direction = sourceElement.getAttribute(DIRECTION);
- ddm_disabled = sourceElement.getAttribute(HTML.ATTR_DISABLED);
- ddm_horizontalOffset = sourceElement.getAttribute(HORIZONTAL_OFFCET);
- ddm_jointPoint = sourceElement.getAttribute(JOINT_POINT);
- ddm_popupWidth = sourceElement.getAttribute(POPUP_WIDTH);
- ddm_verticalOffset = sourceElement.getAttribute(VERTICAL_OFFSET);
- ddm_disabledItemClass = sourceElement.getAttribute(DISABLED_ITEM_CLASS);
- ddm_disabledItemStyle = sourceElement.getAttribute(DISABLED_ITEM_STYLE);
- ddm_disabledLabelClass = sourceElement.getAttribute(DISABLED_LABEL_CLASS);
- ddm_itemClass = sourceElement.getAttribute(ITEM_CLASS);
- ddm_itemStyle = sourceElement.getAttribute(ITEM_STYLE);
- ddm_selectedLabelClass = sourceElement.getAttribute(SELECED_LABEL_CLASS);
- ddm_selectItemClass = sourceElement.getAttribute(SELECT_ITEM_CLASS);
- ddm_style = sourceElement.getAttribute(HTML.ATTR_STYLE);
- ddm_styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
- }
-
- @Override
- public boolean recreateAtAttrChange(VpePageContext pageContext,
- Element sourceElement, nsIDOMDocument visualDocument,
- nsIDOMElement visualNode, Object data, String name, String value) {
- return true;
- }
+ public String getDisabled() {
+ return ddm_disabled;
+ }
+
+ public String getValue() {
+ return ddm_value;
+ }
+
+ }
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java 2009-05-13 14:33:34 UTC (rev 15242)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java 2009-05-13 15:28:14 UTC (rev 15243)
@@ -18,12 +18,12 @@
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMText;
-import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -42,8 +42,6 @@
private static final String CHILD_ITEM_NAME = ":menuItem"; //$NON-NLS-1$
private static final String ICON_FACET_NAME = "icon"; //$NON-NLS-1$
private static final String ICON_DISABLED_FACET_NAME = "iconDisabled"; //$NON-NLS-1$
- private static final String EMPTY = ""; //$NON-NLS-1$
- private static final String SPACE = " "; //$NON-NLS-1$
/*
* Constants for drop down mechanism.
@@ -72,61 +70,21 @@
private static final String CSS_RICH_LIST_BORDER_DIV_STYLE = ""; //$NON-NLS-1$
private static final String CSS_MENU_GROUP_TOP_DIV = "dr-menu-group-top-div"; //$NON-NLS-1$
- /*
- * rich:menuGroup attributes names
- */
- private static final String DIRECTION = "direction"; //$NON-NLS-1$
- private static final String ICON = "icon"; //$NON-NLS-1$
- private static final String ICON_DISABLED = "iconDisabled"; //$NON-NLS-1$
- private static final String ICON_FOLDER = "iconFolder"; //$NON-NLS-1$
- private static final String ICON_FOLDER_DISABLED = "iconFolderDisabled"; //$NON-NLS-1$
-
- /*
- * rich:menuGroup css styles and classes attributes names
- */
- private static final String ICON_CLASS = "iconClass"; //$NON-NLS-1$
- private static final String ICON_STYLE = "iconStyle"; //$NON-NLS-1$
- private static final String LABEL_CLASS = "labelClass"; //$NON-NLS-1$
- private static final String SELECT_CLASS = "selectClass"; //$NON-NLS-1$
- private static final String SELECT_STYLE = "selectStyle"; //$NON-NLS-1$
-
- /*
- * rich:menuGroup attributes
- */
- private String mg_direction;
- private String mg_disabled;
- private String mg_icon;
- private String mg_iconDisabled;
- private String mg_iconFolder;
- private String mg_iconFolderDisabled;
- private String mg_value;
-
- /*
- * rich:menuGroup css styles and classes attributes
- */
- private String mg_iconClass;
- private String mg_iconStyle;
- private String mg_labelClass;
- private String mg_selectClass;
- private String mg_selectStyle;
- private String mg_style;
- private String mg_styleClass;
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
VpeCreationData creationData = null;
Element sourceElement = (Element)sourceNode;
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, COMPONENT_NAME);
- readMenuGroupAttributes(sourceElement);
+ final Attributes attrs = new Attributes(sourceElement);
/*
* MenuGroup component structure.
* In order of nesting.
*/
nsIDOMElement ddmMainUL;
- nsIDOMElement grMainLI;
- nsIDOMElement grChildrenUL;
- nsIDOMElement ddmChildrenLI;
+ nsIDOMElement grMainLI;
+ nsIDOMElement grChildrenUL;
+ nsIDOMElement ddmChildrenLI;
nsIDOMElement grTopDiv;
nsIDOMElement grImgSpan;
@@ -141,14 +99,14 @@
/*
* Creating visual elements
*/
- grMainLI = visualDocument.createElement(HTML.TAG_LI);
- grChildrenUL = visualDocument.createElement(HTML.TAG_UL);
+ grMainLI = visualDocument.createElement(HTML.TAG_LI);
+ grChildrenUL = visualDocument.createElement(HTML.TAG_UL);
grTopDiv = visualDocument.createElement(HTML.TAG_DIV);
grImgSpan = visualDocument.createElement(HTML.TAG_SPAN);
grImg = visualDocument.createElement(HTML.TAG_IMG);
grFolderImg = visualDocument.createElement(HTML.TAG_IMG);
grLabelSpan = visualDocument.createElement(HTML.TAG_SPAN);
- grLabelText = visualDocument.createTextNode(EMPTY);
+ grLabelText = visualDocument.createTextNode(Constants.EMPTY);
grFolderImgSpan = visualDocument.createElement(HTML.TAG_SPAN);
grListBorderDiv = visualDocument.createElement(HTML.TAG_DIV);
grListBgDiv = visualDocument.createElement(HTML.TAG_DIV);
@@ -168,31 +126,31 @@
/*
* Setting attributes for the drop-down mechanism
*/
- grMainLI.setAttribute(MENU_CHILD_ID, EMPTY);
- grChildrenUL.setAttribute(MENU_PARENT_ID, EMPTY);
+ grMainLI.setAttribute(MENU_CHILD_ID, Constants.EMPTY);
+ grChildrenUL.setAttribute(MENU_PARENT_ID, Constants.EMPTY);
/*
* Setting css classes
*/
- String topDivClass = EMPTY;
- String imgSpanClass = EMPTY;
- String labelSpanClass = EMPTY;
- String folderDivClass = EMPTY;
+ String topDivClass = Constants.EMPTY;
+ String imgSpanClass = Constants.EMPTY;
+ String labelSpanClass = Constants.EMPTY;
+ String folderDivClass = Constants.EMPTY;
- topDivClass += SPACE + CSS_RICH_MENU_GROUP;
- imgSpanClass += SPACE + CSS_RICH_MENU_ITEM_ICON_ENABLED;
- labelSpanClass += SPACE + CSS_RICH_MENU_ITEM_LABEL + SPACE + CSS_RICH_MENU_GROUP_LABEL;
- folderDivClass += SPACE + CSS_RICH_MENU_ITEM_FOLDER + SPACE + CSS_RICH_MENU_GROUP_FOLDER;
+ topDivClass += Constants.WHITE_SPACE + CSS_RICH_MENU_GROUP;
+ imgSpanClass += Constants.WHITE_SPACE + CSS_RICH_MENU_ITEM_ICON_ENABLED;
+ labelSpanClass += Constants.WHITE_SPACE + CSS_RICH_MENU_ITEM_LABEL + Constants.WHITE_SPACE + CSS_RICH_MENU_GROUP_LABEL;
+ folderDivClass += Constants.WHITE_SPACE + CSS_RICH_MENU_ITEM_FOLDER + Constants.WHITE_SPACE + CSS_RICH_MENU_GROUP_FOLDER;
- if (ComponentUtil.isNotBlank(mg_styleClass)) {
- topDivClass += SPACE + mg_styleClass;
+ if (ComponentUtil.isNotBlank(attrs.getStyleClass())) {
+ topDivClass += Constants.WHITE_SPACE + attrs.getStyleClass();
}
- if (ComponentUtil.isNotBlank(mg_iconClass)) {
- imgSpanClass += SPACE + mg_iconClass;
- folderDivClass += SPACE + mg_iconClass;
+ if (ComponentUtil.isNotBlank(attrs.getIconClass())) {
+ imgSpanClass += Constants.WHITE_SPACE + attrs.getIconClass();
+ folderDivClass += Constants.WHITE_SPACE + attrs.getIconClass();
}
- if (ComponentUtil.isNotBlank(mg_labelClass)) {
- labelSpanClass += SPACE + mg_labelClass;
+ if (ComponentUtil.isNotBlank(attrs.getLabelClass())) {
+ labelSpanClass += Constants.WHITE_SPACE + attrs.getLabelClass();
}
// grTopDiv.setAttribute(HTML.ATTR_CLASS, topDivClass);
@@ -204,29 +162,30 @@
// grListBorderDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BORDER);
// grListBgDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BG);
grChildrenUL.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BORDER
- + SPACE + CSS_RICH_MENU_LIST_BG);
+ + Constants.WHITE_SPACE + CSS_RICH_MENU_LIST_BG);
/*
* Setting css styles
*/
- String topDivStyle = EMPTY;
+ String topDivStyle = Constants.EMPTY;
- if (ComponentUtil.isNotBlank(mg_style)) {
- topDivStyle += SPACE + mg_style;
+ if (ComponentUtil.isNotBlank(attrs.getStyle())) {
+ topDivStyle += Constants.WHITE_SPACE + attrs.getStyle();
}
grMainLI.setAttribute(HTML.ATTR_STYLE, topDivStyle);
grFolderImgSpan.setAttribute(HTML.ATTR_STYLE, CSS_RICH_LIST_FOLDER_DIV_STYLE);
// grListBorderDiv.setAttribute(HTML.ATTR_STYLE, CSS_RICH_LIST_BORDER_DIV_STYLE);
// grChildrenUL.setAttribute(HTML.ATTR_STYLE,
-// CSS_RICH_LIST_FOLDER_DIV_STYLE + SPACE
+// CSS_RICH_LIST_FOLDER_DIV_STYLE + Constants.WHITE_SPACE
// + CSS_RICH_LIST_BORDER_DIV_STYLE);
/*
* Encode label value
*/
- Attr valueAttr = sourceElement.getAttributeNode(HTML.ATTR_VALUE);
- String labelValue = valueAttr != null
- && valueAttr.getValue() != null ? valueAttr.getValue() : EMPTY;
+ String labelValue = Constants.EMPTY;
+ if (ComponentUtil.isNotBlank(attrs.getValue())) {
+ labelValue = attrs.getValue();
+ }
grLabelText.setNodeValue(labelValue);
/*
@@ -239,11 +198,11 @@
childInfo.addSourceChild(iconFacet);
creationData.addChildrenInfo(childInfo);
} else {
- if (ComponentUtil.isNotBlank(mg_icon)) {
+ if (ComponentUtil.isNotBlank(attrs.getIcon())) {
/*
* Add path to specified image
*/
- String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(mg_icon, pageContext, true);
+ String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(attrs.getIcon(), pageContext, true);
grImg.setAttribute(HTML.ATTR_SRC, imgFullPath);
} else {
/*
@@ -261,11 +220,11 @@
/*
* Add group folder icon
*/
- if (ComponentUtil.isNotBlank(mg_iconFolder)) {
+ if (ComponentUtil.isNotBlank(attrs.getIconFolder())) {
/*
* Add path to specified image
*/
- String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(mg_iconFolder, pageContext, true);
+ String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(attrs.getIconFolder(), pageContext, true);
grFolderImg.setAttribute(HTML.ATTR_SRC, imgFullPath);
} else {
/*
@@ -304,14 +263,58 @@
return creationData;
}
- /**
- * Read attributes from the source element.
- *
- * @param sourceNode the source node
- */
- private void readMenuGroupAttributes(Element sourceElement) {
+ @Override
+ public boolean recreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
+
+ class Attributes {
+
+ /*
+ * rich:menuGroup attributes names
+ */
+ private String DIRECTION = "direction"; //$NON-NLS-1$
+ private String ICON = "icon"; //$NON-NLS-1$
+ private String ICON_DISABLED = "iconDisabled"; //$NON-NLS-1$
+ private String ICON_FOLDER = "iconFolder"; //$NON-NLS-1$
+ private String ICON_FOLDER_DISABLED = "iconFolderDisabled"; //$NON-NLS-1$
+
+ /*
+ * rich:menuGroup css styles and classes attributes names
+ */
+ private String ICON_CLASS = "iconClass"; //$NON-NLS-1$
+ private String ICON_STYLE = "iconStyle"; //$NON-NLS-1$
+ private String LABEL_CLASS = "labelClass"; //$NON-NLS-1$
+ private String SELECT_CLASS = "selectClass"; //$NON-NLS-1$
+ private String SELECT_STYLE = "selectStyle"; //$NON-NLS-1$
+
+ /*
+ * rich:menuGroup attributes
+ */
+ private String mg_icon;
+ private String mg_iconFolder;
+ private String mg_direction;
+ private String mg_disabled;
+ private String mg_iconDisabled;
+ private String mg_iconFolderDisabled;
+ private String mg_value;
+
+ /*
+ * rich:menuGroup css styles and classes attributes
+ */
+ private String mg_iconClass;
+ private String mg_iconStyle;
+ private String mg_labelClass;
+ private String mg_selectClass;
+ private String mg_selectStyle;
+ private String mg_style;
+ private String mg_styleClass;
+
+ public Attributes(final Element sourceElement) {
if (null == sourceElement) {
- return;
+ return;
}
mg_direction = sourceElement.getAttribute(DIRECTION);
mg_disabled = sourceElement.getAttribute(HTML.ATTR_DISABLED);
@@ -328,13 +331,40 @@
mg_selectStyle = sourceElement.getAttribute(SELECT_STYLE);
mg_style = sourceElement.getAttribute(HTML.ATTR_STYLE);
mg_styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+ }
+
+ public String getIconClass() {
+ return mg_iconClass;
+ }
+
+ public String getLabelClass() {
+ return mg_labelClass;
+ }
+
+ public String getStyle() {
+ return mg_style;
+ }
+
+ public String getStyleClass() {
+ return mg_styleClass;
+ }
+
+ public String getIcon() {
+ return mg_icon;
+ }
+
+ public String getIconFolder() {
+ return mg_iconFolder;
+ }
+
+ public String getIconStyle() {
+ return mg_iconStyle;
+ }
+
+ public String getValue() {
+ return mg_value;
+ }
+
}
-
- @Override
- public boolean recreateAtAttrChange(VpePageContext pageContext,
- Element sourceElement, nsIDOMDocument visualDocument,
- nsIDOMElement visualNode, Object data, String name, String value) {
- return true;
- }
-
+
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java 2009-05-13 14:33:34 UTC (rev 15242)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java 2009-05-13 15:28:14 UTC (rev 15243)
@@ -24,12 +24,10 @@
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMText;
-import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesMenuItemTemplate extends VpeAbstractTemplate {
-
/*
* rich:menuItem constants
@@ -62,46 +60,12 @@
private static final String CSS_RICH_MENU_ITEM_ICON_SELECTED = "rich-menu-item-icon-selected"; //$NON-NLS-1$
private static final String CSS_MENU_ITEM_TOP_DIV = "dr-menu-item-top-div"; //$NON-NLS-1$
- /*
- * rich:menuItem attributes names
- */
- private static final String ICON = "icon"; //$NON-NLS-1$
-
- /*
- * rich:menuItem css styles and classes attributes names
- */
- private static final String ICON_CLASS = "iconClass"; //$NON-NLS-1$
- private static final String ICON_DISABLED = "iconDisabled"; //$NON-NLS-1$
- private static final String ICON_STYLE = "iconStyle"; //$NON-NLS-1$
- private static final String LABEL_CLASS = "labelClass"; //$NON-NLS-1$
- private static final String SELECT_STYLE = "selectStyle"; //$NON-NLS-1$
- private static final String SELECT_CLASS = "selectClass"; //$NON-NLS-1$
-
- /*
- * rich:menuItem attributes
- */
- private String mi_disabled;
- private String mi_icon;
- private String mi_value;
-
- /*
- * rich:menuItem css styles and classes attributes
- */
- private String mi_iconClass;
- private String mi_iconDisabled;
- private String mi_iconStyle;
- private String mi_labelClass;
- private String mi_selectClass;
- private String mi_selectStyle;
- private String mi_style;
- private String mi_styleClass;
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
VpeCreationData creationData = null;
Element sourceElement = (Element)sourceNode;
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, COMPONENT_NAME);
- readMenuItemAttributes(sourceElement);
+ final Attributes attrs = new Attributes(sourceElement);
/*
* MenuItem component structure.
@@ -150,14 +114,14 @@
iconImgSpanClass += Constants.WHITE_SPACE + CSS_RICH_MENU_ITEM_ICON;
labelSpanClass += Constants.WHITE_SPACE + CSS_RICH_MENU_ITEM_LABEL;
- if (ComponentUtil.isNotBlank(mi_styleClass)) {
- topDivClass += Constants.WHITE_SPACE + mi_styleClass;
+ if (ComponentUtil.isNotBlank(attrs.getStyleClass())) {
+ topDivClass += Constants.WHITE_SPACE + attrs.getStyleClass();
}
- if (ComponentUtil.isNotBlank(mi_iconClass)) {
- iconImgSpanClass += Constants.WHITE_SPACE + mi_iconClass;
+ if (ComponentUtil.isNotBlank(attrs.getIconClass())) {
+ iconImgSpanClass += Constants.WHITE_SPACE + attrs.getIconClass();
}
- if (ComponentUtil.isNotBlank(mi_labelClass)) {
- labelSpanClass += Constants.WHITE_SPACE + mi_labelClass;
+ if (ComponentUtil.isNotBlank(attrs.getLabelClass())) {
+ labelSpanClass += Constants.WHITE_SPACE + attrs.getLabelClass();
}
// itemTopDiv.setAttribute(HTML.ATTR_CLASS, topDivClass);
@@ -172,8 +136,8 @@
*/
String topDivStyle = Constants.EMPTY;
- if (ComponentUtil.isNotBlank(mi_style)) {
- topDivStyle += Constants.WHITE_SPACE + mi_style;
+ if (ComponentUtil.isNotBlank(attrs.getStyle())) {
+ topDivStyle += Constants.WHITE_SPACE + attrs.getStyle();
}
// itemTopDiv.setAttribute(HTML.ATTR_STYLE, topDivStyle);
@@ -189,12 +153,11 @@
childInfo.addSourceChild(iconFacet);
creationData.addChildrenInfo(childInfo);
} else {
- String iconPath = sourceElement.getAttribute(ICON);
- if (ComponentUtil.isNotBlank(iconPath)) {
+ if (ComponentUtil.isNotBlank(attrs.getIcon())) {
/*
* Add path to specified image
*/
- String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(iconPath, pageContext, true);
+ String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(attrs.getIcon(), pageContext, true);
itemIconImg.setAttribute(HTML.ATTR_SRC, imgFullPath);
} else {
/*
@@ -211,10 +174,10 @@
/*
* Encode label and icon value
*/
- Attr valueAttr = sourceElement.getAttributeNode(HTML.ATTR_VALUE);
- String labelValue = (valueAttr != null && valueAttr.getValue() != null)
- ? valueAttr.getValue()
- : Constants.EMPTY;
+ String labelValue = Constants.EMPTY;
+ if (ComponentUtil.isNotBlank(attrs.getValue())) {
+ labelValue = attrs.getValue();
+ }
itemLabelText.setNodeValue(labelValue);
/*
@@ -229,21 +192,58 @@
return creationData;
}
+
+ @Override
+ public boolean recreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
-
- /**
- * Read attributes from the source element.
- *
- * @param sourceNode the source node
- */
- private void readMenuItemAttributes(Element sourceElement) {
+ class Attributes {
+
+ /*
+ * rich:menuItem attributes names
+ */
+ private String ICON = "icon"; //$NON-NLS-1$
+
+ /*
+ * rich:menuItem css styles and classes attributes names
+ */
+ private String ICON_CLASS = "iconClass"; //$NON-NLS-1$
+ private String ICON_DISABLED = "iconDisabled"; //$NON-NLS-1$
+ private String ICON_STYLE = "iconStyle"; //$NON-NLS-1$
+ private String LABEL_CLASS = "labelClass"; //$NON-NLS-1$
+ private String SELECT_STYLE = "selectStyle"; //$NON-NLS-1$
+ private String SELECT_CLASS = "selectClass"; //$NON-NLS-1$
+
+ /*
+ * rich:menuItem attributes
+ */
+ private String mi_disabled;
+ private String mi_icon;
+ private String mi_value;
+
+ /*
+ * rich:menuItem css styles and classes attributes
+ */
+ private String mi_iconClass;
+ private String mi_iconDisabled;
+ private String mi_iconStyle;
+ private String mi_labelClass;
+ private String mi_selectClass;
+ private String mi_selectStyle;
+ private String mi_style;
+ private String mi_styleClass;
+
+ public Attributes(final Element sourceElement) {
if (null == sourceElement) {
- return;
+ return;
}
mi_disabled = sourceElement.getAttribute(HTML.ATTR_DISABLED);
mi_icon = sourceElement.getAttribute(ICON);
mi_value = sourceElement.getAttribute(HTML.ATTR_VALUE);
-
+
mi_iconClass = sourceElement.getAttribute(ICON_CLASS);
mi_iconDisabled = sourceElement.getAttribute(ICON_DISABLED);
mi_iconStyle = sourceElement.getAttribute(ICON_STYLE);
@@ -252,13 +252,32 @@
mi_selectStyle = sourceElement.getAttribute(SELECT_STYLE);
mi_style = sourceElement.getAttribute(HTML.ATTR_STYLE);
mi_styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
- }
+ }
- @Override
- public boolean recreateAtAttrChange(VpePageContext pageContext,
- Element sourceElement, nsIDOMDocument visualDocument,
- nsIDOMElement visualNode, Object data, String name, String value) {
- return true;
+ public String getIconClass() {
+ return mi_iconClass;
+ }
+
+ public String getLabelClass() {
+ return mi_labelClass;
+ }
+
+ public String getStyle() {
+ return mi_style;
+ }
+
+ public String getStyleClass() {
+ return mi_styleClass;
+ }
+
+ public String getIcon() {
+ return mi_icon;
+ }
+
+ public String getValue() {
+ return mi_value;
+ }
+
}
}
17 years, 2 months
JBoss Tools SVN: r15242 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-05-13 10:33:34 -0400 (Wed, 13 May 2009)
New Revision: 15242
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/main.css
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceInput.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceInput.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/pickList.xhtml.xml
Log:
Patch from Yura Zhishko (yzhishko) is applied: some JUnit tests are fixed.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml 2009-05-13 14:15:09 UTC (rev 15241)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml 2009-05-13 14:33:34 UTC (rev 15242)
@@ -7,6 +7,7 @@
xmlns:rich="http://richfaces.org/rich">
<head>
+ <link rel="stylesheet" href="main.css" type="text/css"/>
</head>
<body>
<h1>comboBox</h1>
@@ -48,5 +49,25 @@
<f:selectItem itemValue="suggestion 5" />
</rich:comboBox>
+<rich:panel styleClass="btn" id="complexCombo">
+ <f:facet name="header">
+ <h:outputText value="Combo Box"/>
+ </f:facet>
+ <form>
+ <rich:comboBox defaultLabel="Enter some value" width="150">
+ <f:selectItem itemValue="item 1"/>
+ <f:selectItem itemValue="item 2"/>
+ <f:selectItem itemValue="item 3"/>
+ <f:selectItem itemValue="item 4"/>
+ <f:selectItem itemValue="item 5" />
+ <f:selectItem itemValue="item 6" escape="false"/>
+ <f:selectItem itemValue="item 7" itemDisabled="true"/>
+ <f:selectItem itemValue="item 8" itemDescription="some descriprion"/>
+ <f:selectItem itemValue="item 10"/>
+ <f:selectItem itemValue="item 11"/>
+ <f:selectItem itemValue="item 12"/>
+ </rich:comboBox>
+ </form>
+</rich:panel>
</body>
</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml.xml 2009-05-13 14:15:09 UTC (rev 15241)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml.xml 2009-05-13 14:33:34 UTC (rev 15242)
@@ -34,7 +34,7 @@
<INPUT TYPE="text"
CLASS="rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"
READONLY="true" VPE-USER-TOGGLE-ID="0" />
- <DIV CLASS="rich-combobox-strut rich-combobox-font" STYLE="width: 140px;">
+ <DIV CLASS="rich-combobox-strut rich-combobox-font" STYLE="width: 140px;">
Struts</DIV>
</DIV>
</DIV>
@@ -83,4 +83,41 @@
</DIV>
</DIV>
</test>
+ <test id="complexCombo">
+ <DIV CLASS="dr-pnl rich-panel btn">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/">
+ <SPAN CLASS="vpe-text">
+ Combo Box
+ </SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <FORM STYLE="-moz-user-modify: read-write;">
+ <DIV STYLE="width: 150px;">
+ <DIV STYLE="position: static; z-index: 0;">
+ <DIV CLASS="rich-combobox-font rich-combobox" STYLE="position: static; z-index: 0;">
+ <DIV CLASS="rich-combobox-font rich-combobox-shell" STYLE="width: 150px; z-index: 1;">
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-disabled rich-combobox-input-inactive"
+ STYLE="width: 133px;" VALUE="Enter some value" />
+
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" STYLE="" />
+
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" STYLE="" />
+
+ <DIV CLASS="rich-combobox-strut rich-combobox-font" STYLE="width: 140px;">
+ Struts
+ </DIV>
+ </DIV>
+ </DIV>
+ </DIV>
+ </DIV>
+ </FORM>
+ </DIV>
+ </DIV>
+ </test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceInput.xhtml
===================================================================
(Binary files differ)
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceInput.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceInput.xhtml.xml 2009-05-13 14:15:09 UTC (rev 15241)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/inplaceInput.xhtml.xml 2009-05-13 14:33:34 UTC (rev 15242)
@@ -3,58 +3,83 @@
<SPAN VPE-USER-TOGGLE-ID="false" CLASS="rich-inplace rich-inplace-view"
STYLE="display: inline;"> click to enter your name</SPAN>
</test>
- <!-- test id="inplaceInputWithoutFacet">
- <SPAN VPE-USER-TOGGLE-ID="true" CLASS="rich-inplace rich-inplace-edit"
- STYLE="position: relative; display: inline;">
- <INPUT TYPE="text" VPE-USER-TOGGLE-ID="0" CLASS="rich-inplace-field" STYLE="top: 0px; width: 66px;"
- AUTOCOMPLETE="off" VALUE="Mama mila ram"/>
- <DIV CLASS="rich-inplace-input-controls-set" STYLE="position: absolute; top: 0px; left: 66px;">
- <DIV CLASS="rich-inplace-shadow">
- <TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0">
- <TBODY>
- <TR>
- <TD CLASS="rich-inplace-shadow-tl">
- <IMG WIDTH="10" HEIGHT="1" BORDER="0" SRC="/.*resources/inplaceInput/spacer.gif/"/>
- </TD>
- <TD CLASS="rich-inplace-shadow-tr">
- <IMG WIDTH="1" HEIGHT="10" BORDER="0" SRC="/.*resources/resources/inplaceInput/spacer.gif/"/>
- </TD>
- </TR>
- <TR>
- <TD CLASS="rich-inplace-shadow-bl">
- <IMG WIDTH="1" HEIGHT="10" BORDER="0" SRC="/.*resources/inplaceInput/spacer.gif/"/>
- </TD>
- <TD CLASS="rich-inplace-shadow-br">
- <IMG WIDTH="10" HEIGHT="1" BORDER="0" SRC="/.*resources/inplaceInput/spacer.gif/"/>
- </TD>
- </TR>
- </TBODY>
- </TABLE>
- </DIV>
- <DIV STYLE="position: relative; height: 18px;">
- <INPUT TYPE="image" CLASS="rich-inplace-control"
- SRC="/.*resources/inplaceInput/applyButton.gif/" VPE-USER-TOGGLE-ID="0"/>
- <INPUT TYPE="image" CLASS="rich-inplace-control"
- SRC="/.*resources/inplaceInput/cancelButton.gif/" VPE-USER-TOGGLE-ID="0"/>
- </DIV>
- </DIV>
- </SPAN>
+ <!--
+ test id="inplaceInputWithoutFacet"> <SPAN VPE-USER-TOGGLE-ID="true"
+ CLASS="rich-inplace rich-inplace-edit" STYLE="position: relative;
+ display: inline;"> <INPUT TYPE="text" VPE-USER-TOGGLE-ID="0"
+ CLASS="rich-inplace-field" STYLE="top: 0px; width: 66px;"
+ AUTOCOMPLETE="off" VALUE="Mama mila ram"/> <DIV
+ CLASS="rich-inplace-input-controls-set" STYLE="position: absolute;
+ top: 0px; left: 66px;"> <DIV CLASS="rich-inplace-shadow"> <TABLE
+ CELLSPACING="0" CELLPADDING="0" BORDER="0"> <TBODY> <TR> <TD
+ CLASS="rich-inplace-shadow-tl"> <IMG WIDTH="10" HEIGHT="1" BORDER="0"
+ SRC="/.*resources/inplaceInput/spacer.gif/"/> </TD> <TD
+ CLASS="rich-inplace-shadow-tr"> <IMG WIDTH="1" HEIGHT="10" BORDER="0"
+ SRC="/.*resources/resources/inplaceInput/spacer.gif/"/> </TD> </TR>
+ <TR> <TD CLASS="rich-inplace-shadow-bl"> <IMG WIDTH="1" HEIGHT="10"
+ BORDER="0" SRC="/.*resources/inplaceInput/spacer.gif/"/> </TD> <TD
+ CLASS="rich-inplace-shadow-br"> <IMG WIDTH="10" HEIGHT="1" BORDER="0"
+ SRC="/.*resources/inplaceInput/spacer.gif/"/> </TD> </TR> </TBODY>
+ </TABLE> </DIV> <DIV STYLE="position: relative; height: 18px;"> <INPUT
+ TYPE="image" CLASS="rich-inplace-control"
+ SRC="/.*resources/inplaceInput/applyButton.gif/"
+ VPE-USER-TOGGLE-ID="0"/> <INPUT TYPE="image"
+ CLASS="rich-inplace-control"
+ SRC="/.*resources/inplaceInput/cancelButton.gif/"
+ VPE-USER-TOGGLE-ID="0"/> </DIV> </DIV> </SPAN> </test> <test
+ id="inplaceInputWithFacet"> <SPAN VPE-USER-TOGGLE-ID="true"
+ CLASS="rich-inplace rich-inplace-edit" STYLE="position: relative;
+ display: inline;"> <INPUT TYPE="text" VPE-USER-TOGGLE-ID="0"
+ CLASS="rich-inplace-field" STYLE="top: 0px; width: 66px;"
+ AUTOCOMPLETE="off" VALUE="Mama mila ramu"/> <DIV
+ CLASS="rich-inplace-input-controls-set" STYLE="position: absolute;
+ top: 18px; left: 0px;"> <DIV STYLE="position: relative; height:
+ 18px;"> <DIV> <SPAN TITLE="h:panelGroup" STYLE="-moz-user-modify:
+ read-write;" CLASS=""> <INPUT TYPE="button" VALUE="Save"
+ STYLE="-moz-user-modify: read-only;"/> <INPUT TYPE="button"
+ VALUE="Cancel" STYLE="-moz-user-modify: read-only;"/> </SPAN> </DIV>
+ </DIV> </DIV> </SPAN> </test
+ -->
+ <test id="inplaceInput1">
+ <DIV CLASS="dr-pnl rich-panel oddRow" STYLE="width: 240px;">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="/background-image: url\(.*resources/common/background.gif\);/">
+ <SPAN CLASS="vpe-text">
+ Person Info
+ </SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <TABLE BORDER="0" STYLE="-moz-user-modify: read-write;">
+ <TBODY>
+ <TR>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ Name:
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN VPE-USER-TOGGLE-ID="false"
+ CLASS="rich-inplace rich-inplace-view btn" STYLE="display: inline;">
+ click to enter your NamE
+ </SPAN>
+ </TD>
+ </TR>
+ <TR>
+ <TD>
+ <SPAN CLASS="vpe-text">
+ Email:
+ </SPAN>
+ </TD>
+ <TD>
+ <SPAN VPE-USER-TOGGLE-ID="false"
+ CLASS="rich-inplace rich-inplace-view evenRow" STYLE="display: inline;">
+ click to enter your email
+ </SPAN>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ </DIV>
</test>
- <test id="inplaceInputWithFacet">
- <SPAN VPE-USER-TOGGLE-ID="true" CLASS="rich-inplace rich-inplace-edit"
- STYLE="position: relative; display: inline;">
- <INPUT TYPE="text" VPE-USER-TOGGLE-ID="0" CLASS="rich-inplace-field" STYLE="top: 0px; width: 66px;"
- AUTOCOMPLETE="off" VALUE="Mama mila ramu"/>
- <DIV CLASS="rich-inplace-input-controls-set" STYLE="position: absolute; top: 18px; left: 0px;">
- <DIV STYLE="position: relative; height: 18px;">
- <DIV>
- <SPAN TITLE="h:panelGroup" STYLE="-moz-user-modify: read-write;" CLASS="">
- <INPUT TYPE="button" VALUE="Save" STYLE="-moz-user-modify: read-only;"/>
- <INPUT TYPE="button" VALUE="Cancel" STYLE="-moz-user-modify: read-only;"/>
- </SPAN>
- </DIV>
- </DIV>
- </DIV>
- </SPAN>
- </test-->
</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/main.css
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/main.css (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/main.css 2009-05-13 14:33:34 UTC (rev 15242)
@@ -0,0 +1,40 @@
+.evenRow {
+ text-align: center;
+ background-color: green;
+ font-style: italic;
+
+}
+
+.oddRow{
+ text-align: right;
+ background-color: blue;
+ font-style: oblique;
+
+}
+
+.btn {
+ text-align: center;
+ color: DodgerBlue;
+ font-size: x-large;
+ font-style: italic;
+ background-color: Turquoise;
+ border-style: ridge;
+ border-color: DarkViolet;
+ text-decoration: overline;
+ font-weight: bolder;
+ border-width: thick;
+}
+
+
+.btn {
+
+}
+
+.vpe-text {
+ color:red;
+}
+
+#editor {
+ background-color: red;
+
+}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/pickList.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/pickList.xhtml.xml 2009-05-13 14:15:09 UTC (rev 15241)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/pickList.xhtml.xml 2009-05-13 14:33:34 UTC (rev 15242)
@@ -33,7 +33,8 @@
CLASS="rich-list-picklist-button">
<DIV CLASS="rich-list-picklist-button-content">
<IMG WIDTH="15" HEIGHT="15"
- SRC="/.*resources/pickList/arrow_copy.gif/"/> Copy
+ SRC="/.*resources/pickList/arrow_remove.gif/" />
+ Remove
</DIV>
</DIV>
</DIV>
@@ -43,7 +44,8 @@
CLASS="rich-list-picklist-button">
<DIV CLASS="rich-list-picklist-button-content">
<IMG WIDTH="15" HEIGHT="15"
- SRC="/.*resources/pickList/arrow_remove.gif/"/> Remove
+ SRC="/.*resources/pickList/arrow_copy_all.gif/" />
+ Copy all
</DIV>
</DIV>
</DIV>
@@ -53,7 +55,8 @@
CLASS="rich-list-picklist-button">
<DIV CLASS="rich-list-picklist-button-content">
<IMG WIDTH="15" HEIGHT="15"
- SRC="/.*resources/pickList/arrow_remove_all.gif/"/> Remove All
+ SRC="/.*resources/pickList/arrow_copy.gif/" />
+ Copy
</DIV>
</DIV>
</DIV>
@@ -63,7 +66,8 @@
CLASS="rich-list-picklist-button">
<DIV CLASS="rich-list-picklist-button-content">
<IMG WIDTH="15" HEIGHT="15"
- SRC="/.*resources/pickList/arrow_copy_all.gif/"/> Copy all
+ SRC="/.*resources/pickList/arrow_remove_all.gif/" />
+ Remove All
</DIV>
</DIV>
</DIV>
@@ -75,12 +79,12 @@
CLASS="rich-picklist-body">
<TR>
<TD STYLE="border: 0px none ; padding: 0px;">
- <BR _MOZ_DIRTY="" TYPE="_moz"/>
+ <BR _MOZ_DIRTY="" TYPE="_moz" />
</TD>
</TR>
</TABLE>
</DIV>
- <BR _MOZ_DIRTY="" TYPE="_moz"/>
+ <BR _MOZ_DIRTY="" TYPE="_moz" />
</TD>
</TR>
</TBODY>
17 years, 2 months
JBoss Tools SVN: r15241 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-13 10:15:09 -0400 (Wed, 13 May 2009)
New Revision: 15241
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java
Log:
JBIDE-4290
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java 2009-05-13 11:34:09 UTC (rev 15240)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java 2009-05-13 14:15:09 UTC (rev 15241)
@@ -25,17 +25,18 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
import org.eclipse.wst.xml.ui.internal.util.SharedXMLEditorPluginImageHelper;
+import org.jboss.tools.common.el.core.model.ELInstance;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.model.ELUtil;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.kb.KbException;
import org.jboss.tools.common.kb.KbProposal;
import org.jboss.tools.common.kb.KbQuery;
import org.jboss.tools.common.kb.wtp.WtpKbConnector;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.outline.ValueHelper;
-import org.jboss.tools.jst.web.tld.TaglibData;
-import org.jboss.tools.jst.web.tld.VpeTaglibManager;
-import org.w3c.dom.Attr;
import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
public class JSPDialogCellEditorContentAssistProcessor extends JavaPackageCompletionProcessor implements ISubjectControlContentAssistProcessor {
@@ -84,6 +85,18 @@
matchString = currentValue.substring(0, offset);
strippedValue = currentValue;
+ String elProposalPrefix = "";
+
+ ELParser p = ELParserUtil.getJbossFactory().createParser();
+ ELModel model = p.parse(matchString);
+ ELInstance is = ELUtil.findInstance(model, matchString.length());
+
+ ELParser p1 = ELParserUtil.getJbossFactory().createParser();
+ ELModel model1 = p1.parse(currentValue);
+ ELInstance is1 = ELUtil.findInstance(model1, matchString.length());
+
+ int elStartPosition = is == null ? -1 : is.getStartPosition();
+
boolean faceletJsfTag = false;
String htmlQuery = null;
@@ -119,12 +132,26 @@
}
if(kbProposal.getStart() >= 0) {
- String replacementString = kbProposal.getReplacementString();
- int replacementBeginPosition = 0/*contentAssistRequest.getReplacementBeginPosition()*/ + kbProposal.getStart();
+ String replacementString = kbProposal.getReplacementString().substring(2,kbProposal.getReplacementString().length() - 1);
+ int replacementBeginPosition = /*contentAssistRequest.getReplacementBeginPosition() + */kbProposal.getStart();
int replacementLength = kbProposal.getEnd() - kbProposal.getStart();
int cursorPositionDelta = 0;
+
+ // Add an EL-starting quotation characters if needed
+ if (elStartPosition == -1) {
+ replacementString = elProposalPrefix + replacementString;
+ cursorPositionDelta += elProposalPrefix.length();
+ }
+
+ if(is1 == null || is1.getCloseInstanceToken() == null) {
+ replacementString += "}";
+ }
+
int cursorPosition = kbProposal.getPosition() + cursorPositionDelta;
-
+ String displayString = elProposalPrefix == null || elProposalPrefix.length() == 0 ?
+ kbProposal.getReplacementString().substring(2,kbProposal.getReplacementString().length() - 1) :
+ elProposalPrefix + kbProposal.getReplacementString().substring(2,kbProposal.getReplacementString().length() - 1) + "}" ;
+
Image image = kbProposal.hasImage() ?
kbProposal.getImage() :
SharedXMLEditorPluginImageHelper.getImage(SharedXMLEditorPluginImageHelper.IMG_OBJ_ATTRIBUTE);
17 years, 2 months
JBoss Tools SVN: r15240 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-13 07:34:09 -0400 (Wed, 13 May 2009)
New Revision: 15240
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4274
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2009-05-13 10:37:36 UTC (rev 15239)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2009-05-13 11:34:09 UTC (rev 15240)
@@ -666,9 +666,23 @@
id="org.hibernate.eclipse.launch.core.refactoring.RenameResourceParticipant"
name="Launch Configurations resource rename updates">
<enablement>
- <with variable="element">
- <instanceof value="org.eclipse.core.resources.IResource"/>
- </with>
+ <and>
+ <or>
+ <with variable="processorIdentifier">
+ <equals
+ value="org.eclipse.jdt.ui.renameJavaProjectProcessor">
+ </equals>
+ </with>
+ <with variable="processorIdentifier">
+ <equals
+ value="org.eclipse.ltk.core.refactoring.renameResourceProcessor">
+ </equals>
+ </with>
+ </or>
+ <with variable="element">
+ <instanceof value="org.eclipse.core.resources.IResource"/>
+ </with>
+ </and>
</enablement>
</renameParticipant>
<renameParticipant
@@ -822,4 +836,4 @@
</colorDefinition>
</extension>
-->
-</plugin>
+</plugin>
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r15239 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors: datasource and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-13 06:37:36 -0400 (Wed, 13 May 2009)
New Revision: 15239
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/datasource/DirectUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java
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/xsl/TemplateUICreator.java
Log:
JBIDE-4298
write a method to group multiple attribute field editors.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/AttributeFieldEditPart.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -18,6 +18,8 @@
*/
public class AttributeFieldEditPart {
+ private Object attribute;
+
private IFieldMarker fieldMarker;
private Control contentControl;
@@ -49,4 +51,20 @@
public void setContentControl(Control contentControl) {
this.contentControl = contentControl;
}
+
+ /**
+ * @return the attribute
+ */
+ public Object getAttribute() {
+ return attribute;
+ }
+
+ /**
+ * @param attribute the attribute to set
+ */
+ public void setAttribute(Object attribute) {
+ this.attribute = attribute;
+ }
+
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/IPropertyUICreator.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
@@ -26,7 +28,7 @@
IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
SmooksMultiFormEditor formEditor);
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
Composite parent, Object model, SmooksMultiFormEditor formEditor);
public boolean ignoreProperty(EAttribute feature);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -11,6 +11,7 @@
package org.jboss.tools.smooks.configuration.editors;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -26,6 +27,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
@@ -33,6 +35,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.smooks.configuration.editors.uitls.FieldMarkerWrapper;
import org.jboss.tools.smooks.configuration.editors.uitls.IFieldDialog;
import org.jboss.tools.smooks.configuration.editors.uitls.IModelProcsser;
@@ -65,8 +68,9 @@
* org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
* org.eclipse.emf.ecore.EAttribute)
*/
- public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (isBeanIDRefFieldFeature(feature)) {
return createBeanIDRefFieldEditor(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
@@ -79,9 +83,9 @@
if (isFileSelectionFeature(feature)) {
return createFileSelectionFieldEditor(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
- if(isConditionSelectionFeature(feature)){
+ if (isConditionSelectionFeature(feature)) {
return SmooksUIUtils.createConditionsChoiceFieldEditor(parent, toolkit, propertyDescriptor, model);
-// return parent;
+ // return parent;
}
if (feature == SmooksPackage.eINSTANCE.getAbstractReader_TargetProfile()) {
@@ -125,16 +129,18 @@
return SmooksUIUtils.getJavaProject(model);
}
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
- SmooksMultiFormEditor formEditor) {
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return Collections.emptyList();
}
protected boolean isFileSelectionFeature(EAttribute attribute) {
return false;
}
- public AttributeFieldEditPart createFileSelectionFieldEditor(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createFileSelectionFieldEditor(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
IFieldDialog dialog = new IFieldDialog() {
public Object open(Shell shell) {
FileSelectionWizard wizard = new FileSelectionWizard();
@@ -160,16 +166,17 @@
}
};
- return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Browse", dialog, (EObject) model, true,
- getFileFiledEditorLinkListener());
+ return SmooksUIUtils.createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Browse", dialog,
+ (EObject) model, true, getFileFiledEditorLinkListener());
}
protected boolean isSelectorFeature(EAttribute attribute) {
return false;
}
- public AttributeFieldEditPart createSelectorFieldEditor(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createSelectorFieldEditor(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
SmooksGraphicsExtType ext = formEditor.getSmooksGraphicsExt();
if (ext != null) {
return SmooksUIUtils.createSelectorFieldEditor(toolkit, parent, propertyDescriptor, model, ext);
@@ -181,8 +188,9 @@
return false;
}
- public AttributeFieldEditPart createJavaTypeSearchEditor(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createJavaTypeSearchEditor(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (model instanceof EObject)
return SmooksUIUtils.createJavaTypeSearchFieldEditor(parent, toolkit, propertyDescriptor, (EObject) model);
return null;
@@ -192,15 +200,17 @@
return false;
}
- public AttributeFieldEditPart createBeanIDRefFieldEditor(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createBeanIDRefFieldEditor(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (model instanceof EObject) {
AttributeFieldEditPart editPart = new AttributeFieldEditPart();
SmooksResourceListType smooksResourceList = getSmooksResourceList((EObject) model);
if (smooksResourceList != null) {
- FieldMarkerWrapper wrapper = SmooksUIUtils.createFieldEditorLabel(null,parent, toolkit, propertyDescriptor, model, false);
+ FieldMarkerWrapper wrapper = SmooksUIUtils.createFieldEditorLabel(null, parent, toolkit,
+ propertyDescriptor, model, false);
editPart.setFieldMarker(wrapper.getMarker());
-
+
Composite tcom = toolkit.createComposite(parent);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
@@ -208,7 +218,7 @@
layout.marginRight = 0;
layout.horizontalSpacing = 0;
tcom.setLayout(layout);
-
+
FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
GridData gd = new GridData();
gd.heightHint = 8;
@@ -217,13 +227,13 @@
gd.verticalAlignment = GridData.BEGINNING;
notificationComposite.setLayoutData(gd);
editPart.setFieldMarker(notificationComposite);
-
+
final Combo combo = new Combo(tcom, SWT.BORDER);
editPart.setContentControl(combo);
gd = new GridData(GridData.FILL_HORIZONTAL);
combo.setLayoutData(gd);
tcom.setLayoutData(gd);
-
+
Object editValue = SmooksUIUtils.getEditValue(propertyDescriptor, model);
if (editValue != null) {
combo.setText(editValue.toString());
@@ -284,4 +294,45 @@
return false;
}
+ protected List<AttributeFieldEditPart> createElementSelectionSection(String sectionTitle,
+ AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
+ SmooksMultiFormEditor formEditor, IItemPropertyDescriptor createOnElementFeature,
+ IItemPropertyDescriptor createOnElementFeatureNS) {
+ Section section = toolkit.createSection(parent, Section.TITLE_BAR);
+ section.setText(sectionTitle);
+
+ FillLayout layout = new FillLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+
+ section.setLayout(layout);
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.heightHint = 100;
+ gd.horizontalSpan = 2;
+ section.setLayoutData(gd);
+
+ Composite container = toolkit.createComposite(section);
+
+ section.setClient(container);
+
+ GridLayout glayout = new GridLayout();
+ glayout.numColumns = 2;
+ container.setLayout(glayout);
+
+ AttributeFieldEditPart editPart1 = SmooksUIUtils.createSelectorFieldEditor("Name", toolkit, container,
+ createOnElementFeature, model, formEditor.getSmooksGraphicsExt());
+ editPart1.setAttribute(createOnElementFeature.getFeature(model));
+
+ AttributeFieldEditPart editPart2 = SmooksUIUtils.createStringFieldEditor("Namespace", container, editingdomain,
+ toolkit, createOnElementFeatureNS, model, false, false, false, 0, null, SmooksUIUtils.VALUE_TYPE_VALUE,
+ null);
+ editPart2.setAttribute(createOnElementFeatureNS.getFeature(model));
+
+ List<AttributeFieldEditPart> list = new ArrayList<AttributeFieldEditPart>();
+ list.add(editPart1);
+ list.add(editPart2);
+
+ return list;
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectorAttributes.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -16,7 +16,7 @@
public static final String IGNORE_ROOT = "ignore_root";
public static final String INCLUDE_PARENT = "include_parent";
- private String selectorSperator = " ";
+ private String selectorSperator = "/";
private String selectorPolicy = SelectorAttributes.FULL_PATH;
public String getSelectorSperator() {
return selectorSperator;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SelectoreSelectionDialog.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -24,7 +24,6 @@
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
@@ -32,6 +31,7 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
@@ -95,11 +95,11 @@
Label label = new Label(composite,SWT.NONE);
label.setText("Sperator Char : ");
- final CCombo speratorCombo = new CCombo(composite,SWT.BORDER);
+ final Combo speratorCombo = new Combo(composite,SWT.BORDER|SWT.READ_ONLY);
speratorCombo.add(" ");
speratorCombo.add("/");
- speratorCombo.select(0);
- speratorCombo.setEditable(false);
+ speratorCombo.select(1);
+// speratorCombo.setEditable(false);
gd = new GridData(GridData.FILL_HORIZONTAL);
speratorCombo.setLayoutData(gd);
speratorCombo.addModifyListener(new ModifyListener(){
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -139,8 +139,17 @@
}
}
if (creator != null) {
- creator.createExtendUI((AdapterFactoryEditingDomain) formEditor.getEditingDomain(), formToolkit,
+ List<AttributeFieldEditPart> list = creator.createExtendUI((AdapterFactoryEditingDomain) formEditor.getEditingDomain(), formToolkit,
detailsComposite, getModel(), getFormEditor());
+ if(list != null){
+ for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
+ AttributeFieldEditPart attributeFieldEditPart = (AttributeFieldEditPart) iterator.next();
+ Object attribute = attributeFieldEditPart.getAttribute();
+ if(attribute != null){
+ currentPropertyUIMap.put(attribute, attributeFieldEditPart);
+ }
+ }
+ }
}
formToolkit.paintBordersFor(detailsComposite);
detailsComposite.pack();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/datasource/DirectUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/datasource/DirectUICreator.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/datasource/DirectUICreator.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -10,8 +10,14 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.datasource;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.jboss.tools.smooks.configuration.editors.AttributeFieldEditPart;
@@ -33,8 +39,9 @@
* org.eclipse.emf.edit.provider.IItemPropertyDescriptor, java.lang.Object,
* org.eclipse.emf.ecore.EAttribute)
*/
- public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent, IItemPropertyDescriptor propertyDescriptor, Object model,
- EAttribute feature, SmooksMultiFormEditor formEditor) {
+ public AttributeFieldEditPart createPropertyUI(FormToolkit toolkit, Composite parent,
+ IItemPropertyDescriptor propertyDescriptor, Object model, EAttribute feature,
+ SmooksMultiFormEditor formEditor) {
if (feature == DatasourcePackage.eINSTANCE.getDirect_AutoCommit()) {
}
if (feature == DatasourcePackage.eINSTANCE.getDirect_BindOnElementNS()) {
@@ -50,7 +57,59 @@
return super.createPropertyUI(toolkit, parent, propertyDescriptor, model, feature, formEditor);
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#ignoreProperty
+ * (org.eclipse.emf.ecore.EAttribute)
+ */
@Override
+ public boolean ignoreProperty(EAttribute feature) {
+ if (feature == DatasourcePackage.eINSTANCE.getDirect_BindOnElementNS()) {
+ return true;
+ }
+ if (feature == DatasourcePackage.eINSTANCE.getDirect_BindOnElement()) {
+ return true;
+ }
+ return super.ignoreProperty(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.configuration.editors.PropertyUICreator#createExtendUI
+ * (org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain,
+ * org.eclipse.ui.forms.widgets.FormToolkit,
+ * org.eclipse.swt.widgets.Composite, java.lang.Object,
+ * org.jboss.tools.smooks.configuration.editors.SmooksMultiFormEditor)
+ */
+ @Override
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ IItemPropertySource itemPropertySource = (IItemPropertySource) editingdomain.getAdapterFactory().adapt(model,
+ IItemPropertySource.class);
+ List<IItemPropertyDescriptor> propertyDes = itemPropertySource.getPropertyDescriptors(model);
+ IItemPropertyDescriptor createOnElementFeature = null;
+ IItemPropertyDescriptor createOnElementFeatureNS = null;
+ for (Iterator<?> iterator = propertyDes.iterator(); iterator.hasNext();) {
+ IItemPropertyDescriptor itemPropertyDescriptor = (IItemPropertyDescriptor) iterator.next();
+ if (itemPropertyDescriptor.getFeature(model) == DatasourcePackage.eINSTANCE.getDirect_BindOnElement()) {
+ createOnElementFeature = itemPropertyDescriptor;
+ }
+ if (itemPropertyDescriptor.getFeature(model) == DatasourcePackage.eINSTANCE.getDirect_BindOnElementNS()) {
+ createOnElementFeatureNS = itemPropertyDescriptor;
+ }
+ }
+ if(createOnElementFeature == null || createOnElementFeatureNS == null){
+ return Collections.emptyList();
+ }
+ return this.createElementSelectionSection("Binding On Element", editingdomain, toolkit, parent, model, formEditor,
+ createOnElementFeature, createOnElementFeatureNS);
+ }
+
+ @Override
public boolean isJavaTypeFeature(EAttribute attribute) {
if (attribute == DatasourcePackage.eINSTANCE.getDirect_Driver()) {
return true;
@@ -60,12 +119,11 @@
@Override
public boolean isSelectorFeature(EAttribute attribute) {
- if (attribute == DatasourcePackage.eINSTANCE.getDirect_BindOnElement()) {
- return true;
- }
+ // if (attribute ==
+ // DatasourcePackage.eINSTANCE.getDirect_BindOnElement()) {
+ // return true;
+ // }
return super.isSelectorFeature(attribute);
}
-
-
}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/freemarker/TemplateUICreator.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.freemarker;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -48,7 +51,7 @@
}
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
OpenEditorEditInnerContentsAction openCDATAEditorAction = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_CDATA, "flt");
OpenEditorEditInnerContentsAction openCommentEditorAction = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_COMMENT, "flt");
@@ -60,6 +63,8 @@
openCDATAEditorAction.setRelateText((Text)cdatatext.getContentControl());
openCommentEditorAction.setRelateText((Text)commenttext.getContentControl());
+
+ return Collections.emptyList();
}
@Override
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/GroovyUICreator.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.groovy;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
@@ -61,8 +64,9 @@
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
Composite parent, Object model, SmooksMultiFormEditor formEditor) {
+ return Collections.emptyList();
// SmooksUIUtils.createCommentFieldEditor("Script Contents",editingdomain, toolkit, parent, model);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/groovy/ScriptUICreator.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.groovy;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -42,11 +45,12 @@
}
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
OpenEditorEditInnerContentsAction action2 = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_COMMENT, "groovy");
AttributeFieldEditPart editPart = SmooksUIUtils.createCommentFieldEditor("Script Contents", editingdomain, toolkit, parent, model, action2);
action2.setRelateText((Text)editPart.getContentControl());
+ return Collections.emptyList();
}
@Override
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/smooks/ParamTypeUICreator.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.smooks;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
@@ -45,9 +48,11 @@
}
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit,
Composite parent, Object model, SmooksMultiFormEditor formEditor) {
SmooksUIUtils.createMixedTextFieldEditor("Text Value", editingdomain, toolkit, parent, model , false , 500,false,false,null,null);
SmooksUIUtils.createCDATAFieldEditor("CDATA Value", editingdomain, toolkit, parent, model,null);
+
+ return Collections.emptyList();
}
}
\ No newline at end of file
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-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -151,10 +151,12 @@
String displayName = labelText;
if (itemPropertyDescriptor == null) {
} else {
- displayName = itemPropertyDescriptor.getDisplayName(model);
- EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(model);
- if (feature.isRequired()) {
- displayName = displayName + "*";
+ if (displayName == null) {
+ displayName = itemPropertyDescriptor.getDisplayName(model);
+ EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(model);
+ if (feature.isRequired()) {
+ displayName = displayName + "*";
+ }
}
}
Composite labelComposite = formToolKit.createComposite(parent);
@@ -344,7 +346,7 @@
label = itemPropertyDescriptor.getDisplayName(model);
EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(model);
if (feature.isRequired()) {
- label = "*" + label;
+ label = label + "*";
}
}
if (multiText) {
@@ -573,7 +575,13 @@
public static AttributeFieldEditPart createSelectorFieldEditor(FormToolkit toolkit, Composite parent,
final IItemPropertyDescriptor propertyDescriptor, Object model, final SmooksGraphicsExtType extType) {
- return createDialogFieldEditor(parent, toolkit, propertyDescriptor, "Browse", new IFieldDialog() {
+ return createSelectorFieldEditor(null, toolkit, parent, propertyDescriptor, model, extType);
+ }
+
+ public static AttributeFieldEditPart createSelectorFieldEditor(String labelText, FormToolkit toolkit,
+ Composite parent, final IItemPropertyDescriptor propertyDescriptor, Object model,
+ final SmooksGraphicsExtType extType) {
+ return createDialogFieldEditor(labelText, parent, toolkit, propertyDescriptor, "Browse", new IFieldDialog() {
public Object open(Shell shell) {
SelectoreSelectionDialog dialog = new SelectoreSelectionDialog(shell, extType);
if (dialog.open() == Dialog.OK) {
@@ -989,11 +997,26 @@
return createDialogFieldEditor(parent, toolkit, propertyDescriptor, buttonName, dialog, model, false, null);
}
+ public static AttributeFieldEditPart createDialogFieldEditor(String label, Composite parent, FormToolkit toolkit,
+ final IItemPropertyDescriptor propertyDescriptor, String buttonName, IFieldDialog dialog,
+ final EObject model) {
+ return createDialogFieldEditor(label, parent, toolkit, propertyDescriptor, buttonName, dialog, model, false,
+ null);
+ }
+
public static AttributeFieldEditPart createDialogFieldEditor(Composite parent, FormToolkit toolkit,
final IItemPropertyDescriptor propertyDescriptor, String buttonName, IFieldDialog dialog,
final EObject model, boolean labelLink, IHyperlinkListener listener) {
+ return createDialogFieldEditor(null, parent, toolkit, propertyDescriptor, buttonName, dialog, model, labelLink,
+ listener);
+ }
+
+ public static AttributeFieldEditPart createDialogFieldEditor(String labelText, Composite parent,
+ FormToolkit toolkit, final IItemPropertyDescriptor propertyDescriptor, String buttonName,
+ IFieldDialog dialog, final EObject model, boolean labelLink, IHyperlinkListener listener) {
AttributeFieldEditPart editpart = new AttributeFieldEditPart();
- FieldMarkerWrapper wrapper = createFieldEditorLabel(parent, toolkit, propertyDescriptor, model, labelLink);
+ FieldMarkerWrapper wrapper = createFieldEditorLabel(labelText, parent, toolkit, propertyDescriptor, model,
+ labelLink);
editpart.setFieldMarker(wrapper.getMarker());
Control label = wrapper.getLabelControl();
if (label instanceof Hyperlink && listener != null) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-05-13 10:02:54 UTC (rev 15238)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/xsl/TemplateUICreator.java 2009-05-13 10:37:36 UTC (rev 15239)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors.xsl;
+import java.util.Collections;
+import java.util.List;
+
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.xml.type.AnyType;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -64,7 +67,7 @@
}
@Override
- public void createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
+ public List<AttributeFieldEditPart> createExtendUI(AdapterFactoryEditingDomain editingdomain, FormToolkit toolkit, Composite parent, Object model,
SmooksMultiFormEditor formEditor) {
OpenEditorEditInnerContentsAction openCdataEditorAction = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_CDATA, "xsl");
OpenEditorEditInnerContentsAction openCommentEditorAction = new OpenEditorEditInnerContentsAction(editingdomain,(AnyType) model, SmooksUIUtils.VALUE_TYPE_COMMENT, "xsl");
@@ -74,6 +77,8 @@
AttributeFieldEditPart text2 = SmooksUIUtils.createCommentFieldEditor("Template Contents (Comment)", editingdomain, toolkit, parent, model, openCommentEditorAction);
openCdataEditorAction.setRelateText((Text)text1.getContentControl());
openCommentEditorAction.setRelateText((Text)text2.getContentControl());
+
+ return Collections.emptyList();
}
}
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r15238 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-05-13 06:02:54 -0400 (Wed, 13 May 2009)
New Revision: 15238
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4277
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java 2009-05-13 08:45:40 UTC (rev 15237)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/core/refactoring/LaunchConfigurationResourceNameChange.java 2009-05-13 10:02:54 UTC (rev 15238)
@@ -18,8 +18,8 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
@@ -95,8 +95,7 @@
IPath newLaunchPath = fNewPath.append(relativePath.removeFirstSegments(matchSegment));
IFile file = root.getFileForLocation(rootLoacation.append(newLaunchPath));
if (file != null){
- fLaunchConfiguration = fLaunchConfiguration.getWorkingCopy();
- ((ILaunchConfigurationWorkingCopy) fLaunchConfiguration).setContainer(file.getParent());
+ fLaunchConfiguration = DebugPlugin.getDefault().getLaunchManager().getLaunchConfiguration(file);
}
}
}
17 years, 2 months
JBoss Tools SVN: r15237 - in trunk/smooks/plugins: org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-13 04:45:40 -0400 (Wed, 13 May 2009)
New Revision: 15237
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/command/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/command/UnSetFeatureCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ClassFieldEditorValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksModelValidateListener.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/ISmooksModelValidateListener.java
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/META-INF/MANIFEST.MF
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/ValidateSmooksAction.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
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/SmooksMarkerHelper.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ValidateResultLabelDecorator.java
Log:
JBIDE-4232
Change problem's type name and add new validator to validate class name of BindingsType
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/META-INF/MANIFEST.MF 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/META-INF/MANIFEST.MF 2009-05-13 08:45:40 UTC (rev 15237)
@@ -76,7 +76,6 @@
org.jboss.tools.smooks.model.smooks.impl,
org.jboss.tools.smooks.model.smooks.provider,
org.jboss.tools.smooks.model.smooks.util,
- org.jboss.tools.smooks.model.validate,
org.jboss.tools.smooks.model.xsl,
org.jboss.tools.smooks.model.xsl.impl,
org.jboss.tools.smooks.model.xsl.provider,
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/ISmooksModelValidateListener.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/ISmooksModelValidateListener.java 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/ISmooksModelValidateListener.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -1,8 +0,0 @@
-package org.jboss.tools.smooks.model.validate;
-
-import org.eclipse.emf.common.util.Diagnostic;
-
-public interface ISmooksModelValidateListener {
- void validateStart();
- void validateEnd(Diagnostic diagnosticResult);
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -1,179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.model.validate;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.common.util.DiagnosticChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.Diagnostician;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * @author Dart (dpeng(a)redhat.com)
- * <p>
- * Apr 14, 2009
- */
-public class SmooksModelValidator {
-
- Collection<?> selectedObjects;
- EditingDomain domain;
- private boolean starting = false;
- private boolean waiting = false;
- private Object lock = new Object();
-
- private long watingTime = 300;
-
- private List<ISmooksModelValidateListener> listeners = new ArrayList<ISmooksModelValidateListener>();
-
- public SmooksModelValidator(Collection<?> selectedObjects, EditingDomain domain) {
- this.selectedObjects = selectedObjects;
- this.domain = domain;
- }
-
- public SmooksModelValidator() {
-
- }
-
- public void addValidateListener(ISmooksModelValidateListener l) {
- if (!listeners.contains(l))
- listeners.add(l);
- }
-
- public void removeValidateListener(ISmooksModelValidateListener l) {
- listeners.remove(l);
- }
-
- public Diagnostic validate(Collection<?> selectedObjects, EditingDomain editingDomain) {
- this.selectedObjects = selectedObjects;
- domain = editingDomain;
- return validate(new NullProgressMonitor());
- }
-
- public Diagnostic validate(final IProgressMonitor progressMonitor) {
- EObject eObject = (EObject) selectedObjects.iterator().next();
- int count = 0;
- for (Iterator<?> i = eObject.eAllContents(); i.hasNext(); i.next()) {
- ++count;
- }
-
- progressMonitor.beginTask("", count);
-
- final AdapterFactory adapterFactory = domain instanceof AdapterFactoryEditingDomain ? ((AdapterFactoryEditingDomain) domain)
- .getAdapterFactory()
- : null;
-
- Diagnostician diagnostician = new Diagnostician() {
- @Override
- public String getObjectLabel(EObject eObject) {
- if (adapterFactory != null && !eObject.eIsProxy()) {
- IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(eObject,
- IItemLabelProvider.class);
- if (itemLabelProvider != null) {
- return itemLabelProvider.getText(eObject);
- }
- }
-
- return super.getObjectLabel(eObject);
- }
-
- @Override
- public boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics,
- Map<Object, Object> context) {
- progressMonitor.worked(1);
- return super.validate(eClass, eObject, diagnostics, context);
- }
- };
-
- progressMonitor.setTaskName("Validating...");
-
- return diagnostician.validate(eObject);
- }
-
- public void startValidate(final Collection<?> selectedObjects, final EditingDomain editingDomain) {
- if (starting) {
- synchronized (lock) {
- waiting = true;
- }
- return;
- }
- Thread thread = new Thread() {
- public void run() {
- synchronized (lock) {
- starting = true;
- waiting = true;
- }
- while (waiting) {
- try {
- waiting = false;
- Thread.sleep(watingTime);
- Thread.yield();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- try {
- for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
- final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
- Display.getDefault().syncExec(new Runnable() {
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- l.validateStart();
- }
-
- });
-
- }
-
- final Diagnostic d = validate(selectedObjects, editingDomain);
-
- for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
- final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
- Display.getDefault().syncExec(new Runnable() {
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- l.validateEnd(d);
- }
-
- });
- }
- } finally {
- waiting = false;
- starting = false;
- }
- }
- };
- thread.setName("Validate Smooks model");
- thread.start();
- }
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-05-13 08:45:40 UTC (rev 15237)
@@ -66,5 +66,19 @@
</enablement>
</decorator>
</extension>
+ <extension
+ id="problem"
+ name="Smooks Problem"
+ point="org.eclipse.core.resources.markers">
+ <persistent
+ value="true">
+ </persistent>
+ <super
+ type="org.eclipse.core.resources.problemmarker">
+ </super>
+ <attribute
+ name="uri">
+ </attribute>
+ </extension>
</plugin>
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/ValidateSmooksAction.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/ValidateSmooksAction.java 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/actions/ValidateSmooksAction.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -11,6 +11,8 @@
package org.jboss.tools.smooks.configuration.actions;
import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -31,7 +33,7 @@
import org.eclipse.ui.part.ISetSelectionTarget;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.validate.SmooksMarkerHelper;
-import org.jboss.tools.smooks.model.validate.SmooksModelValidator;
+import org.jboss.tools.smooks.configuration.validate.SmooksModelValidator;
/**
* @author Dart (dpeng(a)redhat.com)
@@ -54,16 +56,24 @@
public void run(final IProgressMonitor progressMonitor) throws InvocationTargetException,
InterruptedException {
try {
- final Diagnostic diagnostic = validate(progressMonitor);
- shell.getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (progressMonitor.isCanceled()) {
- handleDiagnostic(Diagnostic.CANCEL_INSTANCE);
- } else {
- handleDiagnostic(diagnostic);
+ List<Diagnostic> lists = validate(progressMonitor);
+ Resource resource = editingDomain.getResourceSet().getResources().get(0);
+ if (resource != null) {
+ markerHelper.deleteMarkers(resource);
+ }
+ for (Iterator<?> iterator = lists.iterator(); iterator.hasNext();) {
+ final Diagnostic diagnostic = (Diagnostic) iterator.next();
+ shell.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ if (progressMonitor.isCanceled()) {
+ handleDiagnostic(Diagnostic.CANCEL_INSTANCE);
+ } else {
+ handleDiagnostic(diagnostic);
+ }
}
- }
- });
+ });
+ }
+
} finally {
progressMonitor.done();
}
@@ -85,67 +95,28 @@
}
protected void handleDiagnostic(Diagnostic diagnostic) {
- int severity = diagnostic.getSeverity();
- String title = null;
- String message = null;
-
- if (severity == Diagnostic.ERROR || severity == Diagnostic.WARNING) {
- title = "Error";
- message = "Validate Messages";
- } else {
- title = "Information";
- message = "Validate success";
- }
-
- int result = 0;
+
if (diagnostic.getSeverity() == Diagnostic.OK) {
-// MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title,
-// message);
-// result = Window.CANCEL;
return;
} else {
- result = DiagnosticDialog.open(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title,
- message, diagnostic);
}
if (markerHelper != null) {
- Resource resource = editingDomain.getResourceSet().getResources().get(0);
- if (resource != null) {
- markerHelper.deleteMarkers(resource);
- }
- if (result == Window.OK) {
- if (!diagnostic.getChildren().isEmpty()) {
- List<?> data = (diagnostic.getChildren().get(0)).getData();
- if (!data.isEmpty() && data.get(0) instanceof EObject) {
- Object part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
- .getActivePart();
- if (part instanceof ISetSelectionTarget) {
- ((ISetSelectionTarget) part).selectReveal(new StructuredSelection(data.get(0)));
- } else if (part instanceof IViewerProvider) {
- Viewer viewer = ((IViewerProvider) part).getViewer();
- if (viewer != null) {
- viewer.setSelection(new StructuredSelection(data.get(0)), true);
- }
- }
- }
+ if (resource != null) {
+ for (Diagnostic childDiagnostic : diagnostic.getChildren()) {
+ markerHelper.createMarkers(resource, childDiagnostic);
}
-
- if (resource != null) {
- for (Diagnostic childDiagnostic : diagnostic.getChildren()) {
- markerHelper.createMarkers(resource, childDiagnostic);
- }
- }
}
}
}
- protected Diagnostic validate(IProgressMonitor progressMonitor) {
+ protected List<Diagnostic> validate(IProgressMonitor progressMonitor) {
if (resource != null && editingDomain != null) {
validator = new SmooksModelValidator(resource.getContents(), editingDomain);
return validator.validate(progressMonitor);
}
- return Diagnostic.OK_INSTANCE;
+ return Collections.emptyList();
}
public Resource getResource() {
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/command/UnSetFeatureCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/command/UnSetFeatureCommand.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/command/UnSetFeatureCommand.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.command;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ *
+ */
+public class UnSetFeatureCommand extends AbstractCommand implements Command {
+
+ private EObject model;
+
+ private EStructuralFeature attribute;
+
+ private Object oldValue;
+
+ public UnSetFeatureCommand(EObject model, EStructuralFeature attribute) {
+ super();
+ this.model = model;
+ this.attribute = attribute;
+ this.setLabel("UnSet attribute \"" + this.attribute.getName() + "\"");
+ }
+
+ public UnSetFeatureCommand(String label, String description) {
+ super(label, description);
+ }
+
+ public UnSetFeatureCommand(String label) {
+ super(label);
+ }
+
+ public UnSetFeatureCommand(IItemPropertyDescriptor pd, Object model) {
+ this((EObject) model, (EStructuralFeature) pd.getFeature(model));
+ }
+
+ public void execute() {
+ if (model != null && attribute != null) {
+ oldValue = model.eGet(attribute);
+ model.eUnset(attribute);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.common.command.AbstractCommand#prepare()
+ */
+ @Override
+ protected boolean prepare() {
+ if (model != null && attribute != null)
+ return true;
+ return false;
+ }
+
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.emf.common.command.AbstractCommand#canUndo()
+ */
+ @Override
+ public boolean canUndo() {
+ return prepare() && (oldValue != null);
+ }
+
+ public void redo() {
+ execute();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.common.command.AbstractCommand#undo()
+ */
+ @Override
+ public void undo() {
+ if (model != null && attribute != null) {
+ if (oldValue != null) {
+ model.eSet(attribute, oldValue);
+ }
+ }
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/command/UnSetFeatureCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -44,12 +44,12 @@
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.editors.wizard.IStructuredDataSelectionWizard;
import org.jboss.tools.smooks.configuration.editors.wizard.StructuredDataSelectionWizard;
+import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
import org.jboss.tools.smooks.model.graphics.ext.InputType;
import org.jboss.tools.smooks.model.graphics.ext.ParamType;
import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphicsExtFactory;
import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphicsExtType;
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
-import org.jboss.tools.smooks.model.validate.ISmooksModelValidateListener;
import org.jboss.tools.smooks10.model.smooks.util.SmooksModelUtils;
/**
@@ -286,7 +286,7 @@
}
}
- public void validateEnd(Diagnostic diagnosticResult) {
+ public void validateEnd(List<Diagnostic> diagnosticResult) {
}
public void validateStart() {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -61,6 +61,9 @@
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.SmooksConstants;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
+import org.jboss.tools.smooks.configuration.validate.SmooksMarkerHelper;
+import org.jboss.tools.smooks.configuration.validate.SmooksModelValidator;
import org.jboss.tools.smooks.configuration.wizards.SmooksConfigurationFileNewWizard;
import org.jboss.tools.smooks.model.calc.provider.CalcItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.common.provider.CommonItemProviderAdapterFactory;
@@ -78,8 +81,6 @@
import org.jboss.tools.smooks.model.json.provider.JsonItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.medi.provider.MEdiItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.smooks.provider.SmooksItemProviderAdapterFactory;
-import org.jboss.tools.smooks.model.validate.ISmooksModelValidateListener;
-import org.jboss.tools.smooks.model.validate.SmooksModelValidator;
import org.jboss.tools.smooks.model.xsl.provider.XslItemProviderAdapterFactory;
import org.jboss.tools.smooks10.model.smooks.util.SmooksResourceFactoryImpl;
@@ -87,7 +88,7 @@
*
* @author Dart Peng (dpeng(a)redhat.com) Date Apr 1, 2009
*/
-public class SmooksMultiFormEditor extends FormEditor implements IEditingDomainProvider , ISmooksModelValidateListener{
+public class SmooksMultiFormEditor extends FormEditor implements IEditingDomainProvider, ISmooksModelValidateListener {
public static final String EDITOR_ID = "org.jboss.tools.smooks.configuration.editors.MultiPageEditor";
@@ -102,15 +103,17 @@
private PropertySheetPage propertySheetPage = null;
private SmooksGraphicsExtType smooksGraphicsExt = null;
-
+
private SmooksModelValidator validator = null;
private EObject smooksModel;
private boolean handleEMFModelChange;
-
- private Diagnostic diagnostic;
+ private SmooksMarkerHelper markerHelper = new SmooksMarkerHelper();
+
+ private List<Diagnostic> diagnosticList;
+
public SmooksMultiFormEditor() {
super();
initEditingDomain();
@@ -161,9 +164,9 @@
int length = oldEndIndex - startIndex + 1;
handleEMFModelChange = true;
document.replace(startIndex, length, replacement);
-
+
validator.startValidate(smooksModel.eResource().getContents(), editingDomain);
-
+
} catch (Exception exception) {
SmooksConfigurationActivator.getDefault().log(exception);
}
@@ -225,12 +228,12 @@
configurationPage.setSelectionToViewer(newList);
}
}
-
- public void addValidateListener(ISmooksModelValidateListener listener){
+
+ public void addValidateListener(ISmooksModelValidateListener listener) {
validator.addValidateListener(listener);
}
-
- public void removeValidateListener(ISmooksModelValidateListener listener){
+
+ public void removeValidateListener(ISmooksModelValidateListener listener) {
validator.removeValidateListener(listener);
}
@@ -331,7 +334,7 @@
SmooksConfigurationActivator.getDefault().log(e);
}
configurationPage.setSmooksModel(this.smooksModel);
-
+
validator.startValidate(smooksModel.eResource().getContents(), editingDomain);
}
@@ -398,11 +401,11 @@
}
editingDomain.getResourceSet().getResources().add(smooksResource);
super.init(site, input);
-
+
validator = new SmooksModelValidator();
addValidateListener(this);
- setDiagnostic(validator.validate(smooksModel.eResource().getContents(), editingDomain));
-
+ setDiagnosticList(validator.validate(smooksModel.eResource().getContents(), editingDomain));
+
// if success to open editor , check if there isn't ext file and create
// a new one
String extFileName = file.getName() + SmooksConstants.SMOOKS_GRAPHICSEXT_EXTENTION_NAME_WITHDOT;
@@ -462,15 +465,31 @@
/**
* @return the diagnostic
*/
- public Diagnostic getDiagnostic() {
- return diagnostic;
+ public List<Diagnostic> getDiagnosticList() {
+ return diagnosticList;
}
/**
- * @param diagnostic the diagnostic to set
+ * @param diagnosticList
+ * the diagnostic to set
*/
- public void setDiagnostic(Diagnostic diagnostic) {
- this.diagnostic = diagnostic;
+ public void setDiagnosticList(List<Diagnostic> d) {
+ this.diagnosticList = d;
+
+ if (markerHelper != null) {
+ Resource resource = editingDomain.getResourceSet().getResources().get(0);
+ if (resource != null) {
+ markerHelper.deleteMarkers(resource);
+ }
+ for (Iterator<?> iterator = d.iterator(); iterator.hasNext();) {
+ Diagnostic diagnostic = (Diagnostic) iterator.next();
+ if (resource != null && diagnostic.getSeverity() != Diagnostic.OK) {
+ for (Diagnostic childDiagnostic : diagnostic.getChildren()) {
+ markerHelper.createMarkers(resource, childDiagnostic);
+ }
+ }
+ }
+ }
}
/*
@@ -482,12 +501,12 @@
return false;
}
- public void validateEnd(Diagnostic diagnosticResult) {
- setDiagnostic(diagnosticResult);
+ public void validateEnd(List<Diagnostic> diagnosticResult) {
+ setDiagnosticList(diagnosticResult);
}
public void validateStart() {
-
+
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -45,8 +45,8 @@
import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.smooks.configuration.editors.uitls.IModelProcsser;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
import org.jboss.tools.smooks.model.common.AbstractAnyType;
-import org.jboss.tools.smooks.model.validate.ISmooksModelValidateListener;
/**
*
@@ -146,20 +146,23 @@
detailsComposite.pack();
propertyMainComposite.layout();
- markPropertyUI(formEditor.getDiagnostic());
+ markPropertyUI(formEditor.getDiagnosticList());
} catch (Exception e) {
e.printStackTrace();
}
}
- protected void markPropertyUI(Diagnostic diagnostic) {
+ protected void markPropertyUI(List<Diagnostic> diagnosticList) {
for (Iterator<?> iterator = currentPropertyUIMap.values().iterator(); iterator.hasNext();) {
AttributeFieldEditPart editPart = (AttributeFieldEditPart) iterator.next();
if (editPart.getFieldMarker() != null) {
editPart.getFieldMarker().clean();
}
}
- markErrorWarningPropertyUI(diagnostic);
+ for (Iterator<?> iterator = diagnosticList.iterator(); iterator.hasNext();) {
+ Diagnostic diagnostic = (Diagnostic) iterator.next();
+ markErrorWarningPropertyUI(diagnostic);
+ }
}
protected void markErrorWarningPropertyUI(Diagnostic diagnostic) {
@@ -183,15 +186,20 @@
IFieldMarker marker = editPart.getFieldMarker();
if (marker == null)
return;
- marker.setMessage(diagnostic.getMessage());
+
if (diagnostic.getSeverity() == Diagnostic.ERROR) {
- if (marker.getMarkerType() != IFieldMarker.TYPE_ERROR)
+ if (marker.getMarkerType() != IFieldMarker.TYPE_ERROR) {
marker.setMarkerType(IFieldMarker.TYPE_ERROR);
+ marker.setMessage(diagnostic.getMessage());
+ }
}
-
if (diagnostic.getSeverity() == Diagnostic.WARNING) {
- if (marker.getMarkerType() != IFieldMarker.TYPE_WARINING)
+ // if there is error already , don't mark warning
+ if (marker.getMarkerType() != IFieldMarker.TYPE_WARINING
+ && marker.getMarkerType() != IFieldMarker.TYPE_ERROR) {
marker.setMarkerType(IFieldMarker.TYPE_WARINING);
+ marker.setMessage(diagnostic.getMessage());
+ }
}
}
}
@@ -469,7 +477,7 @@
this.isStale = isStale;
}
- public void validateEnd(Diagnostic diagnosticResult) {
+ public void validateEnd(List<Diagnostic> diagnosticResult) {
markPropertyUI(diagnosticResult);
}
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-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -33,6 +33,7 @@
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor.PropertyValueWrapper;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaElement;
@@ -78,6 +79,7 @@
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.actions.OpenEditorEditInnerContentsAction;
+import org.jboss.tools.smooks.configuration.command.UnSetFeatureCommand;
import org.jboss.tools.smooks.configuration.editors.AttributeFieldEditPart;
import org.jboss.tools.smooks.configuration.editors.ClassPathFileProcessor;
import org.jboss.tools.smooks.configuration.editors.CurrentProjecViewerFilter;
@@ -152,17 +154,17 @@
displayName = itemPropertyDescriptor.getDisplayName(model);
EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(model);
if (feature.isRequired()) {
- displayName = displayName + "*";
+ displayName = displayName + "*";
}
}
Composite labelComposite = formToolKit.createComposite(parent);
-// GridLayout layout = new GridLayout();
-// layout.numColumns = 2;
-// layout.marginLeft = 0;
-// layout.marginRight = 0;
-// layout.horizontalSpacing = 0;
+ // GridLayout layout = new GridLayout();
+ // layout.numColumns = 2;
+ // layout.marginLeft = 0;
+ // layout.marginRight = 0;
+ // layout.horizontalSpacing = 0;
labelComposite.setLayout(new FillLayout());
-// GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ // GridData gd = new GridData(GridData.FILL_HORIZONTAL);
Control labelControl = null;
if (!isLink) {
@@ -173,19 +175,20 @@
Hyperlink link = formToolKit.createHyperlink(labelComposite, displayName + " :", SWT.NONE);
labelControl = link;
}
-// gd = new GridData();
-// labelControl.setLayoutData(gd);
+ // gd = new GridData();
+ // labelControl.setLayoutData(gd);
-// FieldMarkerComposite notificationComposite = new FieldMarkerComposite(labelComposite, SWT.NONE);
-// gd = new GridData();
-// gd.heightHint = 8;
-// gd.widthHint = 8;
-// gd.horizontalAlignment = GridData.BEGINNING;
-// gd.verticalAlignment = GridData.BEGINNING;
-// notificationComposite.setLayoutData(gd);
+ // FieldMarkerComposite notificationComposite = new
+ // FieldMarkerComposite(labelComposite, SWT.NONE);
+ // gd = new GridData();
+ // gd.heightHint = 8;
+ // gd.widthHint = 8;
+ // gd.horizontalAlignment = GridData.BEGINNING;
+ // gd.verticalAlignment = GridData.BEGINNING;
+ // notificationComposite.setLayoutData(gd);
wrapper.setLabelControl(labelControl);
-// wrapper.setMarker(notificationComposite);
+ // wrapper.setMarker(notificationComposite);
return wrapper;
}
@@ -436,7 +439,7 @@
layout.marginRight = 0;
layout.horizontalSpacing = 0;
tcom.setLayout(layout);
-
+
FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
gd = new GridData();
gd.heightHint = 8;
@@ -445,16 +448,16 @@
gd.verticalAlignment = GridData.BEGINNING;
notificationComposite.setLayoutData(gd);
fieldEditPart.setFieldMarker(notificationComposite);
-
+
final Text valueText = toolkit.createText(tcom, "", textType);
gd = new GridData(GridData.FILL_HORIZONTAL);
if (multiText && height > 0) {
gd.heightHint = height;
}
valueText.setLayoutData(gd);
-
+
tcom.setLayoutData(gd);
-
+
toolkit.paintBordersFor(textContainer);
if (openFile) {
Button fileBrowseButton = toolkit.createButton(textContainer, "Browse", SWT.NONE);
@@ -480,7 +483,11 @@
});
}
- if (editValue != null) {
+ boolean valueIsSet = true;
+ if (model != null && model instanceof EObject && itemPropertyDescriptor != null) {
+ valueIsSet = ((EObject) model).eIsSet((EAttribute) itemPropertyDescriptor.getFeature(model));
+ }
+ if (editValue != null && valueIsSet) {
valueText.setText(editValue);
if (editValue.length() > 0 && section != null) {
section.setExpanded(true);
@@ -639,7 +646,7 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
-
+
Composite tcom = toolkit.createComposite(classTextComposite);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
@@ -647,7 +654,7 @@
layout.marginRight = 0;
layout.horizontalSpacing = 0;
tcom.setLayout(layout);
-
+
FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
gd = new GridData();
gd.heightHint = 8;
@@ -656,10 +663,9 @@
gd.verticalAlignment = GridData.BEGINNING;
notificationComposite.setLayoutData(gd);
editpart.setFieldMarker(notificationComposite);
-
-
- final SearchComposite searchComposite = new SearchComposite(tcom, toolkit,
- "Search Class", dialog, SWT.NONE);
+
+ final SearchComposite searchComposite = new SearchComposite(tcom, toolkit, "Search Class", dialog,
+ SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
searchComposite.setLayoutData(gd);
Object editValue = getEditValue(propertyDescriptor, model);
@@ -886,7 +892,7 @@
if (readOnly) {
style = style | SWT.READ_ONLY;
}
-
+
Composite tcom = formToolkit.createComposite(parent);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
@@ -894,7 +900,7 @@
layout.marginRight = 0;
layout.horizontalSpacing = 0;
tcom.setLayout(layout);
-
+
FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
GridData gd = new GridData();
gd.heightHint = 8;
@@ -903,13 +909,17 @@
gd.verticalAlignment = GridData.BEGINNING;
notificationComposite.setLayoutData(gd);
fieldEditPart.setFieldMarker(notificationComposite);
-
+
final Combo combo = new Combo(tcom, style);
+ boolean valueIsSet = false;
+ if (model instanceof EObject) {
+ valueIsSet = ((EObject) model).eIsSet((EAttribute) itemPropertyDescriptor.getFeature(model));
+ }
combo.add("");
if (items != null) {
for (int i = 0; i < items.length; i++) {
combo.add(items[i]);
- if (items[i].equals(editValue)) {
+ if (valueIsSet && items[i].equals(editValue)) {
currentSelect = i + 1;
}
}
@@ -917,25 +927,27 @@
gd = new GridData(GridData.FILL_HORIZONTAL);
tcom.setLayoutData(gd);
combo.setLayoutData(gd);
-
+
if (currentSelect != -1) {
combo.select(currentSelect);
}
final Object fm = model;
- final IItemPropertyDescriptor fipd = itemPropertyDescriptor;
+ final ItemPropertyDescriptor fipd = (ItemPropertyDescriptor) itemPropertyDescriptor;
final IModelProcsser fp = processer;
combo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
String text = combo.getText();
if (text == null || text.length() == 0) {
- fipd.setPropertyValue(fm, null);
+ UnSetFeatureCommand command = new UnSetFeatureCommand(fipd, fm);
+ EditingDomain domain = fipd.getEditingDomain(fm);
+ domain.getCommandStack().execute(command);
return;
}
Object setValue = text;
if (fp != null) {
setValue = fp.wrapValue(text);
}
- if (setValue.equals(getEditValue(fipd, fm))) {
+ if (((EObject) fm).eIsSet((EAttribute) fipd.getFeature(fm)) && setValue.equals(getEditValue(fipd, fm))) {
return;
}
fipd.setPropertyValue(fm, setValue);
@@ -994,7 +1006,7 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
-
+
Composite tcom = toolkit.createComposite(classTextComposite);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
@@ -1002,7 +1014,7 @@
layout.marginRight = 0;
layout.horizontalSpacing = 0;
tcom.setLayout(layout);
-
+
FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
gd = new GridData();
gd.heightHint = 8;
@@ -1011,12 +1023,11 @@
gd.verticalAlignment = GridData.BEGINNING;
notificationComposite.setLayoutData(gd);
editpart.setFieldMarker(notificationComposite);
-
- final SearchComposite searchComposite = new SearchComposite(tcom, toolkit, buttonName, dialog,
- SWT.NONE);
+
+ final SearchComposite searchComposite = new SearchComposite(tcom, toolkit, buttonName, dialog, SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
searchComposite.setLayoutData(gd);
-
+
Object editValue = getEditValue(propertyDescriptor, model);
if (editValue != null) {
searchComposite.getText().setText(editValue.toString());
@@ -1038,8 +1049,7 @@
}
}
});
-
-
+
toolkit.paintBordersFor(classTextComposite);
editpart.setContentControl(classTextComposite);
return editpart;
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ClassFieldEditorValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ClassFieldEditorValidator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ClassFieldEditorValidator.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.validate;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.smooks.configuration.editors.uitls.ProjectClassLoader;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.model.javabean.BindingsType;
+import org.jboss.tools.smooks.model.javabean.JavabeanPackage;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ *
+ */
+public class ClassFieldEditorValidator implements ISmooksValidator {
+
+ private ProjectClassLoader classLoader;
+
+ /**
+ * @return the classLoader
+ */
+ public ProjectClassLoader getClassLoader(EObject obj) {
+ if (classLoader != null) {
+ return classLoader;
+ }
+ IResource resource = SmooksUIUtils.getResource(obj);
+ try {
+ classLoader = new ProjectClassLoader(JavaCore.create(resource.getProject()));
+ } catch (JavaModelException e) {
+ e.printStackTrace();
+ }
+ return classLoader;
+ }
+
+ public List<Diagnostic> validate(Collection<?> selectionObjects) {
+ List<Diagnostic> list = new ArrayList<Diagnostic>();
+ for (Iterator<?> iterator = selectionObjects.iterator(); iterator.hasNext();) {
+ Object object = (Object) iterator.next();
+ if (object instanceof BindingsType) {
+ BindingsType bindings = (BindingsType) object;
+ classLoader = getClassLoader(bindings);
+ String clazz = bindings.getClass_();
+ Class<?> clazz1 = null;
+ if (clazz != null && classLoader != null) {
+ try {
+ clazz1 = classLoader.loadClass(clazz);
+ } catch (ClassNotFoundException e) {
+ // ignore
+ }
+ }
+ String message = "Can't find class : \"" + clazz + "\"";
+ if (clazz1 == null) {
+ list.add(new BasicDiagnostic(Diagnostic.WARNING, "org.jboss.tools", 0, message, new Object[] {
+ bindings, JavabeanPackage.Literals.BINDINGS_TYPE__CLASS }));
+ }
+ }
+
+ if (object instanceof EObject) {
+ List<Diagnostic> dd = validate(((EObject) object).eContents());
+ if (dd != null) {
+ list.addAll(dd);
+ }
+ }
+ }
+ return list;
+ }
+
+ public List<Diagnostic> validate(Collection<?> selectedObjects, EditingDomain editingDomain) {
+ return validate(selectedObjects);
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ClassFieldEditorValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksModelValidateListener.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksModelValidateListener.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksModelValidateListener.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -0,0 +1,10 @@
+package org.jboss.tools.smooks.configuration.validate;
+
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+
+public interface ISmooksModelValidateListener {
+ void validateStart();
+ void validateEnd(List<Diagnostic> diagnosticResult);
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksModelValidateListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksValidator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksValidator.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.validate;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.edit.domain.EditingDomain;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ *
+ */
+public interface ISmooksValidator {
+ public List<Diagnostic> validate(Collection<?> selectedObjects, EditingDomain editingDomain);
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ISmooksValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksMarkerHelper.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksMarkerHelper.java 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksMarkerHelper.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -31,13 +31,15 @@
*/
public class SmooksMarkerHelper extends EditUIMarkerHelper {
+ public static final String MARKER_ID = "org.jboss.tools.smooks.ui.problem";
+
public IRunnableWithProgress getWorkspaceModifyOperation(IRunnableWithProgress runnableWithProgress) {
return new WorkspaceModifyDelegatingOperation(runnableWithProgress);
}
@Override
protected String getMarkerID() {
- return EValidator.MARKER;
+ return MARKER_ID;
}
public void createMarkers(Resource resource, Diagnostic diagnostic) {
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.validate;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.util.BasicDiagnostic;
+import org.eclipse.emf.common.util.Diagnostic;
+import org.eclipse.emf.common.util.DiagnosticChain;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.Diagnostician;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Dart (dpeng(a)redhat.com)
+ * <p>
+ * Apr 14, 2009
+ */
+public class SmooksModelValidator implements ISmooksValidator{
+
+ Collection<?> selectedObjects;
+ EditingDomain domain;
+ private boolean starting = false;
+ private boolean waiting = false;
+ private Object lock = new Object();
+
+ private long watingTime = 300;
+
+ private List<ISmooksModelValidateListener> listeners = new ArrayList<ISmooksModelValidateListener>();
+
+ private List<ISmooksValidator> validatorList = new ArrayList<ISmooksValidator>();
+
+ public SmooksModelValidator(Collection<?> selectedObjects, EditingDomain domain) {
+ this();
+ this.selectedObjects = selectedObjects;
+ this.domain = domain;
+ }
+
+ public SmooksModelValidator() {
+ validatorList.add(new ClassFieldEditorValidator());
+ }
+
+ public void addValidateListener(ISmooksModelValidateListener l) {
+ if (!listeners.contains(l))
+ listeners.add(l);
+ }
+
+ public void removeValidateListener(ISmooksModelValidateListener l) {
+ listeners.remove(l);
+ }
+
+ public List<Diagnostic> validate(Collection<?> selectedObjects, EditingDomain editingDomain) {
+ this.selectedObjects = selectedObjects;
+ domain = editingDomain;
+ return validate(new NullProgressMonitor());
+ }
+
+ public List<Diagnostic> validate(final IProgressMonitor progressMonitor) {
+ EObject eObject = (EObject) selectedObjects.iterator().next();
+ int count = 0;
+ for (Iterator<?> i = eObject.eAllContents(); i.hasNext(); i.next()) {
+ ++count;
+ }
+
+ progressMonitor.beginTask("", count);
+
+ final AdapterFactory adapterFactory = domain instanceof AdapterFactoryEditingDomain ? ((AdapterFactoryEditingDomain) domain)
+ .getAdapterFactory()
+ : null;
+
+ Diagnostician diagnostician = new Diagnostician() {
+ @Override
+ public String getObjectLabel(EObject eObject) {
+ if (adapterFactory != null && !eObject.eIsProxy()) {
+ IItemLabelProvider itemLabelProvider = (IItemLabelProvider) adapterFactory.adapt(eObject,
+ IItemLabelProvider.class);
+ if (itemLabelProvider != null) {
+ return itemLabelProvider.getText(eObject);
+ }
+ }
+
+ return super.getObjectLabel(eObject);
+ }
+
+ @Override
+ public boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics,
+ Map<Object, Object> context) {
+ progressMonitor.worked(1);
+ return super.validate(eClass, eObject, diagnostics, context);
+ }
+ };
+
+ progressMonitor.setTaskName("Validating...");
+
+ Diagnostic diagnostic = diagnostician.validate(eObject);
+
+ List<Diagnostic> list = new ArrayList<Diagnostic>();
+ list.add(diagnostic);
+ for (Iterator<?> iterator = this.validatorList.iterator(); iterator.hasNext();) {
+ ISmooksValidator validator = (ISmooksValidator) iterator.next();
+ List<Diagnostic> d = validator.validate(selectedObjects, domain);
+ for (Iterator<?> iterator2 = d.iterator(); iterator2.hasNext();) {
+ Diagnostic diagnostic2 = (Diagnostic) iterator2.next();
+ ((BasicDiagnostic)diagnostic).add(diagnostic2);
+ }
+ }
+ return list;
+ }
+
+ public void startValidate(final Collection<?> selectedObjects, final EditingDomain editingDomain) {
+ if (starting) {
+ synchronized (lock) {
+ waiting = true;
+ }
+ return;
+ }
+ Thread thread = new Thread() {
+ public void run() {
+ synchronized (lock) {
+ starting = true;
+ waiting = true;
+ }
+ while (waiting) {
+ try {
+ waiting = false;
+ Thread.sleep(watingTime);
+ Thread.yield();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ try {
+ for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
+ final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
+ Display.getDefault().syncExec(new Runnable() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ l.validateStart();
+ }
+
+ });
+
+ }
+
+ final List<Diagnostic> d = validate(selectedObjects, editingDomain);
+
+ for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
+ final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
+ Display.getDefault().syncExec(new Runnable() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ l.validateEnd(d);
+ }
+
+ });
+ }
+ } finally {
+ waiting = false;
+ starting = false;
+ }
+ }
+ };
+ thread.setName("Validate Smooks model");
+ thread.start();
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/SmooksModelValidator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ValidateResultLabelDecorator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ValidateResultLabelDecorator.java 2009-05-12 20:02:47 UTC (rev 15236)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/validate/ValidateResultLabelDecorator.java 2009-05-13 08:45:40 UTC (rev 15237)
@@ -144,7 +144,8 @@
}
SmooksMultiFormEditor editor = (SmooksMultiFormEditor) window.getActivePage().findEditor(
new FileEditorInput((IFile) resource));
- int type = markErrorWarningPropertyUI(editor.getDiagnostic(), element);
+ int type = -1;
+// int type = markErrorWarningPropertyUI(editor.getDiagnosticList(), element);
decoration.addOverlay(null, IDecoration.BOTTOM_RIGHT);
if (type == Diagnostic.ERROR) {
decoration.addOverlay(SmooksConfigurationActivator.getDefault().getImageRegistry().getDescriptor(
17 years, 2 months
JBoss Tools SVN: r15236 - in trunk/examples/plugins/org.jboss.tools.project.examples: schema and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-05-12 16:02:47 -0400 (Tue, 12 May 2009)
New Revision: 15236
Added:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/IProjectExampleSite.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleSite.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencePage.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencesInitializer.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/plugin.properties
trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
trunk/examples/plugins/org.jboss.tools.project.examples/schema/projectExamplesXml.exsd
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4292 Users should be able to add example sites without adding a plugin (externalized)
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/plugin.properties
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/plugin.properties 2009-05-12 19:14:40 UTC (rev 15235)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/plugin.properties 2009-05-12 20:02:47 UTC (rev 15236)
@@ -4,4 +4,7 @@
JBoss_Tools_category = JBoss Tools
Project_Examples_wizard = Project Examples
Project_Examples_command =Project Examples...
-ProjectExamples=Project Examples file
\ No newline at end of file
+ProjectExamples=Project Examples file
+JBoss_Developer_Studio_Examples = JBoss Developer Studio Examples
+JBoss_Tools_Community_Examples = JBoss Tools Community Examples
+Project_Examples = Project Examples
\ No newline at end of file
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2009-05-12 19:14:40 UTC (rev 15235)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2009-05-12 20:02:47 UTC (rev 15236)
@@ -42,8 +42,30 @@
</menuContribution>
</extension>
<extension
- point="org.jboss.tools.project.examples.projectExamplesXml">
+ point="org.jboss.tools.project.examples.projectExamplesXml"
+ name="%JBoss_Developer_Studio_Examples">
<url>http://download.jboss.org/jbosstools/examples/project-examples-3.0.xml</url>
+ <experimental>false</experimental>
</extension>
+
+ <extension
+ point="org.jboss.tools.project.examples.projectExamplesXml"
+ name="%JBoss_Tools_Community_Examples">
+ <url>http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exam... </url>
+ <experimental>true</experimental>
+ </extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.jboss.tools.common.model.ui.MainPreferencePage"
+ class="org.jboss.tools.project.examples.preferences.ProjectExamplesPreferencePage"
+ id="org.jboss.tools.project.examples.preferences.projectExamplesPreferencePage"
+ name="%Project_Examples"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.jboss.tools.project.examples.preferences.ProjectExamplesPreferencesInitializer"/>
+ </extension>
</plugin>
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/schema/projectExamplesXml.exsd
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/schema/projectExamplesXml.exsd 2009-05-12 19:14:40 UTC (rev 15235)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/schema/projectExamplesXml.exsd 2009-05-12 20:02:47 UTC (rev 15236)
@@ -2,9 +2,9 @@
<!-- Schema file written by PDE -->
<schema targetNamespace="org.jboss.tools.project.examples" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
- <appinfo>
+ <appInfo>
<meta.schema plugin="org.jboss.tools.project.examples" id="projectExamplesXml" name="Project Examples file"/>
- </appinfo>
+ </appInfo>
<documentation>
Adds a new Project Examples xml file
</documentation>
@@ -12,13 +12,14 @@
<element name="extension">
<annotation>
- <appinfo>
+ <appInfo>
<meta.element />
- </appinfo>
+ </appInfo>
</annotation>
<complexType>
<sequence>
- <element ref="url" minOccurs="1" maxOccurs="unbounded"/>
+ <element ref="url"/>
+ <element ref="experimental"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
@@ -39,9 +40,9 @@
<documentation>
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute translatable="true"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -50,19 +51,22 @@
<element name="url" type="string">
</element>
+ <element name="experimental" type="string">
+ </element>
+
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="since"/>
- </appinfo>
+ </appInfo>
<documentation>
3.0.0
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="examples"/>
- </appinfo>
+ </appInfo>
<documentation>
<extension
point="org.jboss.tools.project.examples.projectExamplesXml">
@@ -72,27 +76,27 @@
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="apiinfo"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter API information here.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="implementation"/>
- </appinfo>
+ </appInfo>
<documentation>
[Enter information about supplied implementation of this extension point.]
</documentation>
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="copyright"/>
- </appinfo>
+ </appInfo>
<documentation>
JBoss, a division of Red Hat
</documentation>
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java 2009-05-12 19:14:40 UTC (rev 15235)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -22,7 +22,6 @@
public static String ECFExamplesTransport_Loading;
public static String ECFExamplesTransport_ReceivedSize_Of_FileSize_At_RatePerSecond;
public static String ECFExamplesTransport_Server_redirected_too_many_times;
- public static String ECFExamplesTransport_Unexpected_interrupt_while_waiting_on_ECF_transfer;
public static String MarkerDialog_Description;
public static String MarkerDialog_Finish;
public static String MarkerDialog_Markers;
@@ -46,13 +45,29 @@
public static String NewProjectExamplesWizardPage_Projects;
public static String NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog;
public static String NewProjectExamplesWizardPage_URL;
- public static String Project_JBoss_Tools_Team_from_jboss_org;
- public static String Project_Local;
public static String Project_Unknown;
public static String ProjectExamplesActivator_All;
public static String ProjectExamplesActivator_Waiting;
+ public static String ProjectExamplesPreferencePage_Add;
+ public static String ProjectExamplesPreferencePage_Edit;
+ public static String ProjectExamplesPreferencePage_Remove;
+ public static String ProjectExamplesPreferencePage_Show_experimental_sites;
+ public static String ProjectExamplesPreferencePage_Sites;
+ public static String ProjectUtil_Invalid_preferences;
public static String ProjectUtil_Invalid_URL;
public static String ProjectUtil_Invalid_welcome_element;
+ public static String ProjectUtil_Test;
+ public static String SiteDialog_Add_Project_Example_Site;
+ public static String SiteDialog_Browse;
+ public static String SiteDialog_Edit_Project_Example_Site;
+ public static String SiteDialog_Invalid_URL;
+ public static String SiteDialog_Name;
+ public static String SiteDialog_The_name_field_is_required;
+ public static String SiteDialog_The_site_already_exists;
+ public static String SiteDialog_The_url_field_is_required;
+ public static String SiteDialog_URL;
+ public static String Sites_Plugin_provided_sites;
+ public static String Sites_User_sites;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2009-05-12 19:14:40 UTC (rev 15235)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -36,6 +36,9 @@
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.project.examples"; //$NON-NLS-1$
public static final String ALL_SITES = Messages.ProjectExamplesActivator_All;
+ public static final String SHOW_EXPERIMENTAL_SITES = "showExperimentalSites"; //$NON-NLS-1$
+ public static final String USER_SITES = "userSites"; //$NON-NLS-1$
+ public static final boolean SHOW_EXPERIMENTAL_SITES_VALUE = false;
// The shared instance
private static ProjectExamplesActivator plugin;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties 2009-05-12 19:14:40 UTC (rev 15235)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties 2009-05-12 20:02:47 UTC (rev 15236)
@@ -9,7 +9,6 @@
# eg 241.73 KB of 30.95 MB (at 34.18 KB/s)
ECFExamplesTransport_ReceivedSize_Of_FileSize_At_RatePerSecond={0} of {1} (at {2}/s)
ECFExamplesTransport_Server_redirected_too_many_times=Server redirected too many times
-ECFExamplesTransport_Unexpected_interrupt_while_waiting_on_ECF_transfer=Unexpected interrupt while waiting on ECF transfer
MarkerDialog_Description=Description
MarkerDialog_Finish=Finish
MarkerDialog_Markers=Markers:
@@ -33,11 +32,27 @@
NewProjectExamplesWizardPage_Projects=Projects:
NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog=Show the Quick Fix dialog
NewProjectExamplesWizardPage_URL=URL:
-Project_JBoss_Tools_Team_from_jboss_org=JBoss Tools Team from jboss.org
-Project_Local=Local
Project_Unknown=Unknown
ProjectExamplesActivator_All=All
ProjectExamplesActivator_Waiting=Waiting...
+ProjectExamplesPreferencePage_Add=Add
+ProjectExamplesPreferencePage_Edit=Edit
+ProjectExamplesPreferencePage_Remove=Remove
+ProjectExamplesPreferencePage_Show_experimental_sites=Show experimental sites
+ProjectExamplesPreferencePage_Sites=Sites
+ProjectUtil_Invalid_preferences=Invalid preferences.
ProjectUtil_Invalid_URL=Invalid URL\: {0}
ProjectUtil_Invalid_welcome_element=The welcome element has invalid the url attribute
-NewProjectExamplesWizardPage_Site=Site\:
\ No newline at end of file
+ProjectUtil_Test=Test
+NewProjectExamplesWizardPage_Site=Site\:
+SiteDialog_Add_Project_Example_Site=Add Project Example Site
+SiteDialog_Browse=Browse...
+SiteDialog_Edit_Project_Example_Site=Edit Project Example Site
+SiteDialog_Invalid_URL=Invalid url.
+SiteDialog_Name=Name:
+SiteDialog_The_name_field_is_required=The name field is required.
+SiteDialog_The_site_already_exists=The site already exists.
+SiteDialog_The_url_field_is_required=The url field is required.
+SiteDialog_URL=URL:
+Sites_Plugin_provided_sites=Plugin provided sites
+Sites_User_sites=User sites
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/IProjectExampleSite.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/IProjectExampleSite.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/IProjectExampleSite.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -0,0 +1,5 @@
+package org.jboss.tools.project.examples.model;
+
+public interface IProjectExampleSite {
+ public String getName();
+}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2009-05-12 19:14:40 UTC (rev 15235)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -13,9 +13,6 @@
import java.math.BigDecimal;
import java.util.List;
-import org.jboss.tools.project.examples.Messages;
-import org.jboss.tools.project.examples.ProjectExamplesActivator;
-
/**
* @author snjeza
*
@@ -139,7 +136,7 @@
}
public String getSite() {
- if (site == null) {
+ /*if (site == null) {
if (getUrl().startsWith("http://anonsvn.jboss.org")) { //$NON-NLS-1$
site = Messages.Project_JBoss_Tools_Team_from_jboss_org;
} else if (getUrl().startsWith("file:")) { //$NON-NLS-1$
@@ -147,7 +144,7 @@
} else {
site = Messages.Project_Unknown;
}
- }
+ }*/
return site;
}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleSite.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleSite.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectExampleSite.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -0,0 +1,76 @@
+package org.jboss.tools.project.examples.model;
+
+import java.net.URL;
+
+public class ProjectExampleSite implements IProjectExampleSite {
+ private URL url;
+ private String name;
+ private boolean experimental;
+ private boolean editable = false;
+
+ public ProjectExampleSite() {
+ }
+
+ public URL getUrl() {
+ return url;
+ }
+
+ public void setUrl(URL url) {
+ this.url = url;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isExperimental() {
+ return experimental;
+ }
+
+ public void setExperimental(boolean experimental) {
+ this.experimental = experimental;
+ }
+
+ public boolean isEditable() {
+ return editable;
+ }
+
+ public void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ProjectExampleSite other = (ProjectExampleSite) obj;
+ if (name == null) {
+ if (other.name != null)
+ return false;
+ } else if (!name.equals(other.name))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "ProjectExampleSite [name=" + name + ", url=" + url + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2009-05-12 19:14:40 UTC (rev 15235)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -11,19 +11,33 @@
package org.jboss.tools.project.examples.model;
import java.io.BufferedOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import java.util.StringTokenizer;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
@@ -32,6 +46,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
@@ -40,6 +55,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.xml.sax.helpers.DefaultHandler;
/**
* @author snjeza
@@ -47,21 +63,34 @@
*/
public class ProjectUtil {
+ private static final String URL = "url"; //$NON-NLS-1$
+
+ private static final String NAME = "name"; //$NON-NLS-1$
+
+ private static final String SITES = "sites"; //$NON-NLS-1$
+
+ private static final String SITE = "site"; //$NON-NLS-1$
+
private static final String EDITOR = "editor"; //$NON-NLS-1$
public static final String CHEATSHEETS = "cheatsheets"; //$NON-NLS-1$
- private static final String PROTOCOL_FILE = "file"; //$NON-NLS-1$
+ public static final String PROTOCOL_FILE = "file"; //$NON-NLS-1$
private static final String PROJECT_EXAMPLES_XML_EXTENSION_ID = "org.jboss.tools.project.examples.projectExamplesXml"; //$NON-NLS-1$
- private static List<URL> URLs;
+
+ private static String URL_EXT = URL;
+
+ private static String EXPERIMENTAL_EXT = "experimental"; //$NON-NLS-1$
+ private static Set<ProjectExampleSite> pluginSites;
+
private ProjectUtil() {
}
- private static List<URL> getURLs() {
- if (URLs == null) {
- URLs = new ArrayList<URL>();
+ public static Set<ProjectExampleSite> getPluginSites() {
+ if (pluginSites == null) {
+ pluginSites = new HashSet<ProjectExampleSite>();
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint extensionPoint = registry
.getExtensionPoint(PROJECT_EXAMPLES_XML_EXTENSION_ID);
@@ -70,23 +99,101 @@
IExtension extension = extensions[i];
IConfigurationElement[] configurationElements = extension
.getConfigurationElements();
+ ProjectExampleSite site = new ProjectExampleSite();
+ site.setName(extension.getLabel());
for (int j = 0; j < configurationElements.length; j++) {
IConfigurationElement configurationElement = configurationElements[j];
- String urlString = configurationElement.getValue();
- URL url = getURL(urlString);
- if (url != null) {
- URLs.add(url);
+ if (URL_EXT.equals(configurationElement.getName())) {
+ String urlString = configurationElement.getValue();
+ URL url = getURL(urlString);
+ if (url != null) {
+ site.setUrl(url);
+ }
+ } else if (EXPERIMENTAL_EXT.equals(configurationElement.getName())) {
+ String experimental = configurationElement.getValue();
+ if ("true".equals(experimental)) { //$NON-NLS-1$
+ site.setExperimental(true);
+ }
}
}
+ if (site.getUrl() != null) {
+ pluginSites.add(site);
+ }
}
- URL url = getURL(getProjectExamplesXml());
- if (url != null) {
- URLs.add(url);
+
+ }
+ return pluginSites;
+ }
+
+ public static Set<ProjectExampleSite> getUserSites() {
+ Set<ProjectExampleSite> sites = new HashSet<ProjectExampleSite>();
+ ProjectExampleSite site = getSite(getProjectExamplesXml());
+ if (site != null) {
+ sites.add(site);
+ }
+ IPreferenceStore store = ProjectExamplesActivator.getDefault().getPreferenceStore();
+ String sitesAsXml = store.getString(ProjectExamplesActivator.USER_SITES);
+ if (sitesAsXml != null && sitesAsXml.trim().length() > 0) {
+ Element rootElement = parseDocument(sitesAsXml);
+ if (!rootElement.getNodeName().equals(SITES)) {
+ ProjectExamplesActivator.log(Messages.ProjectUtil_Invalid_preferences);
+ return sites;
}
+ NodeList list = rootElement.getChildNodes();
+ int length = list.getLength();
+ for (int i = 0; i < length; ++i) {
+ Node node = list.item(i);
+ short type = node.getNodeType();
+ if (type == Node.ELEMENT_NODE) {
+ Element entry = (Element) node;
+ if(entry.getNodeName().equals(SITE)){
+ String name = entry.getAttribute(NAME);
+ String urlString = entry.getAttribute(URL);
+ if (name != null && name.trim().length() > 0 && urlString != null && urlString.trim().length() > 0) {
+ URL url = null;
+ try {
+ url = new URL(urlString);
+ } catch (MalformedURLException e) {
+ ProjectExamplesActivator.log(Messages.ProjectUtil_Invalid_preferences);
+ continue;
+ }
+ site = new ProjectExampleSite();
+ site.setName(name);
+ site.setUrl(url);
+ site.setExperimental(true);
+ site.setEditable(true);
+ sites.add(site);
+ }
+ }
+ }
+ }
}
- return URLs;
+ return sites;
}
+
+ private static Set<ProjectExampleSite> getSites() {
+ Set<ProjectExampleSite> sites = new HashSet<ProjectExampleSite>();
+ sites.addAll(getPluginSites());
+ sites.addAll(getUserSites());
+ return sites;
+ }
+ private static ProjectExampleSite getSite(String url) {
+ if (url != null) {
+ ProjectExampleSite site = new ProjectExampleSite();
+ try {
+ site.setUrl(new URL(url));
+ } catch (MalformedURLException e) {
+ ProjectExamplesActivator.log(e);
+ return null;
+ }
+ site.setExperimental(true);
+ site.setName(Messages.ProjectUtil_Test);
+ return site;
+ }
+ return null;
+ }
+
private static URL getURL(String urlString) {
if (urlString != null && urlString.trim().length() > 0) {
urlString = urlString.trim();
@@ -101,15 +208,19 @@
}
public static List<Category> getProjects() {
- getURLs();
+ Set<ProjectExampleSite> sites = getSites();
List<Category> list = new ArrayList<Category>();
Category other = Category.OTHER;
try {
- for (URL url : URLs) {
- File file = getProjectExamplesFile(url,
+ for (ProjectExampleSite site : sites) {
+ boolean showExperimentalSites = ProjectExamplesActivator.getDefault().getPreferenceStore().getBoolean(ProjectExamplesActivator.SHOW_EXPERIMENTAL_SITES);
+ if (!showExperimentalSites && site.isExperimental()) {
+ continue;
+ }
+ File file = getProjectExamplesFile(site.getUrl(),
"projectExamples", ".xml", null); //$NON-NLS-1$ //$NON-NLS-2$
if (file == null || !file.exists() || !file.isFile()) {
- ProjectExamplesActivator.log(NLS.bind(Messages.ProjectUtil_Invalid_URL,url.toString()));
+ ProjectExamplesActivator.log(NLS.bind(Messages.ProjectUtil_Invalid_URL,site.getUrl().toString()));
continue;
}
DocumentBuilderFactory dbf = DocumentBuilderFactory
@@ -147,7 +258,7 @@
}
project.setCategory(category);
}
- if (nodeName.equals("name")) { //$NON-NLS-1$
+ if (nodeName.equals(NAME)) { //$NON-NLS-1$
project.setName(getContent(child));
}
if (nodeName.equals("site")) { //$NON-NLS-1$
@@ -160,7 +271,7 @@
if (nodeName.equals("description")) { //$NON-NLS-1$
project.setDescription(getContent(child));
}
- if (nodeName.equals("url")) { //$NON-NLS-1$
+ if (nodeName.equals(URL)) { //$NON-NLS-1$
project.setUrl(getContent(child));
}
if (nodeName.equals("size")) { //$NON-NLS-1$
@@ -195,7 +306,7 @@
} else {
project.setType(EDITOR);
}
- attribute = child.getAttribute("url"); //$NON-NLS-1$
+ attribute = child.getAttribute(URL); //$NON-NLS-1$
if (attribute == null || attribute.trim().length() <= 0) {
project.setWelcome(false);
ProjectExamplesActivator.log(Messages.ProjectUtil_Invalid_welcome_element);
@@ -206,6 +317,13 @@
}
}
}
+ if (project.getSite() == null) {
+ String siteName = site.getName();
+ if (siteName == null) {
+ siteName = Messages.Project_Unknown;
+ }
+ project.setSite(siteName);
+ }
category.getProjects().add(project);
}
}
@@ -273,4 +391,59 @@
private static ECFExamplesTransport getTransport() {
return ECFExamplesTransport.getInstance();
}
+
+ public static Document getDocument() throws ParserConfigurationException {
+ DocumentBuilderFactory dfactory= DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder= dfactory.newDocumentBuilder();
+ Document doc= docBuilder.newDocument();
+ return doc;
+ }
+
+ public static String getAsXML(Set<ProjectExampleSite> sites)
+ throws ParserConfigurationException, TransformerException,
+ UnsupportedEncodingException {
+ if (sites == null || sites.size() == 0) {
+ return ""; //$NON-NLS-1$
+ }
+ Document doc = getDocument();
+ Element sitesElement = doc.createElement(SITES); //$NON-NLS-1$
+ doc.appendChild(sitesElement);
+ for (ProjectExampleSite site : sites) {
+ Element siteElement = doc.createElement(SITE);
+ siteElement.setAttribute(NAME, site.getName());
+ siteElement.setAttribute(URL, site.getUrl().toString());
+ sitesElement.appendChild(siteElement);
+ }
+ ByteArrayOutputStream s = new ByteArrayOutputStream();
+ TransformerFactory factory = TransformerFactory.newInstance();
+ Transformer transformer = factory.newTransformer();
+ transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+ DOMSource source = new DOMSource(doc);
+ StreamResult outputTarget = new StreamResult(s);
+ transformer.transform(source, outputTarget);
+ return s.toString("UTF8"); //$NON-NLS-1$
+ }
+
+ public static Element parseDocument(String document) {
+ Element root = null;
+ InputStream stream = null;
+ try{
+ DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ parser.setErrorHandler(new DefaultHandler());
+ stream = new ByteArrayInputStream(document.getBytes("UTF8")); //$NON-NLS-1$
+ root = parser.parse(stream).getDocumentElement();
+ } catch (Exception e) {
+ ProjectExamplesActivator.log(e);
+ } finally {
+ try{
+ if (stream != null) {
+ stream.close();
+ }
+ } catch(IOException e) {
+ ProjectExamplesActivator.log(e);
+ }
+ }
+ return root;
+ }
}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -0,0 +1,25 @@
+package org.jboss.tools.project.examples.model;
+
+import java.util.Set;
+
+public class SiteCategory implements IProjectExampleSite {
+
+ private String name;
+ private Set<ProjectExampleSite> sites;
+
+ public SiteCategory(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Set<ProjectExampleSite> getSites() {
+ return sites;
+ }
+
+ public void setSites(Set<ProjectExampleSite> sites) {
+ this.sites = sites;
+ }
+}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencePage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencePage.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencePage.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -0,0 +1,249 @@
+package org.jboss.tools.project.examples.preferences;
+
+import java.net.URL;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.jboss.tools.project.examples.Messages;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.model.IProjectExampleSite;
+import org.jboss.tools.project.examples.model.ProjectExampleSite;
+import org.jboss.tools.project.examples.model.ProjectUtil;
+import org.jboss.tools.project.examples.model.SiteCategory;
+
+public class ProjectExamplesPreferencePage extends PreferencePage implements
+ IWorkbenchPreferencePage {
+
+ private Button button;
+ private Sites sites;
+ private TreeViewer viewer;
+ private ProjectExampleSite selectedSite;
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ composite.setLayout(layout);
+
+ button = new Button(composite,SWT.CHECK);
+ button.setText(Messages.ProjectExamplesPreferencePage_Show_experimental_sites);
+ IPreferenceStore store = ProjectExamplesActivator.getDefault().getPreferenceStore();
+ button.setSelection(store.getBoolean(ProjectExamplesActivator.SHOW_EXPERIMENTAL_SITES));
+ Group sitesGroup = new Group(composite,SWT.NONE);
+ sitesGroup.setText(Messages.ProjectExamplesPreferencePage_Sites);
+ GridLayout gl = new GridLayout(2,false);
+ sitesGroup.setLayout(gl);
+ sitesGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ viewer = new TreeViewer(sitesGroup,SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ viewer.setContentProvider(new SitesContentProvider());
+ viewer.setLabelProvider(new SitesLabelProvider());
+ sites = new Sites();
+ viewer.setInput(sites);
+ viewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.expandAll();
+
+ Composite buttonComposite = new Composite(sitesGroup, SWT.NONE);
+ buttonComposite.setLayout(new GridLayout(1,false));
+ buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+
+ Button addButton = new Button(buttonComposite, SWT.PUSH);
+ addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ addButton.setText(Messages.ProjectExamplesPreferencePage_Add);
+ addButton.addSelectionListener(new SelectionListener(){
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ SiteDialog dialog = new SiteDialog(getShell(),null,sites);
+ int ok = dialog.open();
+ if (ok == Window.OK) {
+ String name = dialog.getName();
+ if (name != null) {
+ URL url = dialog.getURL();
+ ProjectExampleSite site = new ProjectExampleSite();
+ site.setUrl(url);
+ site.setName(name);
+ site.setEditable(true);
+ sites.add(site);
+ viewer.refresh();
+ }
+ }
+ }
+
+
+ });
+ final Button editButton = new Button(buttonComposite, SWT.PUSH);
+ editButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ editButton.setText(Messages.ProjectExamplesPreferencePage_Edit);
+ editButton.setEnabled(false);
+ editButton.addSelectionListener(new SelectionListener(){
+
+ public void widgetSelected(SelectionEvent e) {
+ if (selectedSite == null) {
+ return;
+ }
+ SiteDialog dialog = new SiteDialog(getShell(),selectedSite,sites);
+ int ok = dialog.open();
+ if (ok == Window.OK) {
+ String name = dialog.getName();
+ if (name != null) {
+ URL url = dialog.getURL();
+ ProjectExampleSite site = selectedSite;
+ site.setUrl(url);
+ site.setName(name);
+ site.setEditable(true);
+ viewer.refresh();
+ }
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ });
+ final Button removeButton = new Button(buttonComposite, SWT.PUSH);
+ removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ removeButton.setText(Messages.ProjectExamplesPreferencePage_Remove);
+ removeButton.setEnabled(false);
+
+ removeButton.addSelectionListener(new SelectionListener(){
+
+ public void widgetSelected(SelectionEvent e) {
+ if (selectedSite != null) {
+ sites.remove(selectedSite);
+ viewer.refresh();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ });
+
+ viewer.addSelectionChangedListener(new ISelectionChangedListener(){
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ editButton.setEnabled(false);
+ removeButton.setEnabled(false);
+ selectedSite = null;
+ ISelection selection = event.getSelection();
+ if (selection instanceof ITreeSelection) {
+ ITreeSelection treeSelection = (ITreeSelection) selection;
+ Object object = treeSelection.getFirstElement();
+ if (object instanceof ProjectExampleSite) {
+ selectedSite = (ProjectExampleSite) object;
+ boolean editable = ((ProjectExampleSite) object).isEditable();
+ editButton.setEnabled(editable);
+ removeButton.setEnabled(editable);
+ }
+ }
+ }
+ });
+
+ return composite;
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ @Override
+ protected void performDefaults() {
+ button.setSelection(ProjectExamplesActivator.SHOW_EXPERIMENTAL_SITES_VALUE);
+ sites.getUserSites().clear();
+ storeSites();
+ super.performDefaults();
+ }
+
+ @Override
+ public boolean performOk() {
+ storeSites();
+ return super.performOk();
+ }
+
+ private void storeSites() {
+ IPreferenceStore store = ProjectExamplesActivator.getDefault().getPreferenceStore();
+ store.setValue(ProjectExamplesActivator.SHOW_EXPERIMENTAL_SITES, button.getSelection());
+ try {
+ String userSites = ProjectUtil.getAsXML(sites.getUserSites());
+ store.setValue(ProjectExamplesActivator.USER_SITES, userSites);
+ } catch (Exception e) {
+ ProjectExamplesActivator.log(e);
+ }
+ }
+
+ class SitesContentProvider implements ITreeContentProvider {
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof Sites) {
+ return ((Sites)parentElement).getSiteCategories();
+ }
+ if (parentElement instanceof SiteCategory) {
+ return ((SiteCategory) parentElement).getSites().toArray();
+ }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return element instanceof Sites || element instanceof SiteCategory;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ }
+
+ class SitesLabelProvider extends LabelProvider {
+
+ @Override
+ public Image getImage(Object element) {
+ return super.getImage(element);
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof IProjectExampleSite) {
+ return ((IProjectExampleSite) element).getName();
+ }
+ return super.getText(element);
+ }
+
+ }
+
+}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencesInitializer.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencesInitializer.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencesInitializer.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -0,0 +1,21 @@
+package org.jboss.tools.project.examples.preferences;
+
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.core.runtime.preferences.DefaultScope;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
+
+public class ProjectExamplesPreferencesInitializer extends
+ AbstractPreferenceInitializer {
+
+ @Override
+ public void initializeDefaultPreferences() {
+ IEclipsePreferences node = new DefaultScope().getNode("org.jboss.tools.project.examples"); //$NON-NLS-1$
+
+ node.putBoolean(
+ ProjectExamplesActivator.SHOW_EXPERIMENTAL_SITES,
+ ProjectExamplesActivator.SHOW_EXPERIMENTAL_SITES_VALUE);
+ }
+
+}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -0,0 +1,208 @@
+package org.jboss.tools.project.examples.preferences;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Set;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.project.examples.Messages;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.model.ProjectExampleSite;
+
+public class SiteDialog extends TitleAreaDialog {
+
+ private static final String ADD_PROJECT_EXAMPLE_SITE = Messages.SiteDialog_Add_Project_Example_Site;
+ private static final String EDIT_PROJECT_EXAMPLE_SITE = Messages.SiteDialog_Edit_Project_Example_Site;
+ private Image dlgTitleImage;
+ private ProjectExampleSite selectedSite;
+ private String name;
+ private URL url;
+ private Text nameText;
+ private Text urlText;
+ private Button okButton;
+ private Sites sites;
+
+ protected SiteDialog(Shell parentShell, ProjectExampleSite site, Sites sites) {
+ super(parentShell);
+ this.selectedSite = site;
+ this.sites = sites;
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+
+ Control contents = super.createContents(parent);
+ if (selectedSite == null) {
+ setTitle(ADD_PROJECT_EXAMPLE_SITE);
+ setMessage(ADD_PROJECT_EXAMPLE_SITE);
+ } else {
+ setTitle(EDIT_PROJECT_EXAMPLE_SITE);
+ setMessage(EDIT_PROJECT_EXAMPLE_SITE);
+ }
+ ImageDescriptor descriptor = ProjectExamplesActivator
+ .imageDescriptorFromPlugin(ProjectExamplesActivator.PLUGIN_ID,
+ "icons/new_wiz.gif"); //$NON-NLS-1$
+ if(descriptor != null) {
+ dlgTitleImage = descriptor.createImage();
+ setTitleImage(dlgTitleImage);
+ }
+
+ return contents;
+ }
+
+ @Override
+ public boolean close() {
+ if (dlgTitleImage != null) {
+ dlgTitleImage.dispose();
+ }
+ return super.close();
+ }
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite parentComposite = (Composite) super.createDialogArea(parent);
+ Composite composite = new Composite(parentComposite, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ composite.setFont(parentComposite.getFont());
+
+ Composite container = new Composite(parentComposite, SWT.FILL);
+ layout = new GridLayout(3,false);
+ layout.marginWidth = layout.marginHeight = 5;
+ container.setLayout(layout);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ container.setLayoutData(gd);
+
+ Label nameLabel = new Label(container, SWT.NONE);
+ nameLabel.setText(Messages.SiteDialog_Name);
+ nameText = new Text(container, SWT.SINGLE|SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan=2;
+ nameText.setLayoutData(gd);
+ nameText.addModifyListener(new ModifyListener(){
+
+ public void modifyText(ModifyEvent e) {
+ validatePage();
+ }
+ });
+
+ Label urlLabel = new Label(container, SWT.NONE);
+ urlLabel.setText(Messages.SiteDialog_URL);
+ urlText = new Text(container, SWT.SINGLE|SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ urlText.setLayoutData(gd);
+ urlText.addModifyListener(new ModifyListener(){
+
+ public void modifyText(ModifyEvent e) {
+ validatePage();
+ }
+
+ });
+ if (selectedSite != null) {
+ urlText.setText(selectedSite.getUrl().toString());
+ nameText.setText(selectedSite.getName());
+ }
+ Button browse = new Button(container,SWT.PUSH);
+ browse.setText(Messages.SiteDialog_Browse);
+ browse.addSelectionListener(new SelectionListener(){
+
+ public void widgetSelected(SelectionEvent e) {
+
+
+ FileDialog dialog = new FileDialog(getShell(), SWT.SINGLE);
+ dialog.setFilterExtensions(new String[] { "*.xml" }); //$NON-NLS-1$;
+
+ String result = dialog.open();
+ if (result == null || result.trim().length() == 0) {
+ return;
+ }
+ urlText.setText("file:/" + result); //$NON-NLS-1$
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+ });
+
+ return parentComposite;
+ }
+
+ private boolean validatePage() {
+ name = null;
+ url = null;
+ if (nameText.getText().trim().length() <= 0) {
+ setErrorMessage(Messages.SiteDialog_The_name_field_is_required);
+ return updateButton(false);
+ }
+ Set<ProjectExampleSite> siteList = sites.getSites();
+ for(ProjectExampleSite site:siteList) {
+ if (site != selectedSite && nameText.getText().equals(site.getName())) {
+ setErrorMessage(Messages.SiteDialog_The_site_already_exists);
+ return updateButton(false);
+ }
+ }
+ if (urlText.getText().trim().length() <= 0) {
+ setErrorMessage(Messages.SiteDialog_The_url_field_is_required);
+ return updateButton(false);
+ }
+ try {
+ @SuppressWarnings("unused")
+ URL url = new URL(urlText.getText());
+ } catch (MalformedURLException e) {
+ setErrorMessage(Messages.SiteDialog_Invalid_URL);
+ return updateButton(false);
+ }
+ setErrorMessage(null);
+ name = nameText.getText();
+ try {
+ url = new URL(urlText.getText());
+ } catch (MalformedURLException ignore) {}
+ return updateButton(true);
+ }
+
+ private boolean updateButton(boolean enabled) {
+ if (okButton != null) {
+ okButton.setEnabled(enabled);
+ }
+ return false;
+ }
+
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ okButton = createButton(parent, IDialogConstants.OK_ID,
+ IDialogConstants.OK_LABEL, true);
+ okButton.setEnabled(selectedSite != null);
+ createButton(parent, IDialogConstants.CANCEL_ID,
+ IDialogConstants.CANCEL_LABEL, false);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public URL getURL() {
+ return url;
+ }
+
+}
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -0,0 +1,51 @@
+package org.jboss.tools.project.examples.preferences;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.tools.project.examples.Messages;
+import org.jboss.tools.project.examples.model.ProjectExampleSite;
+import org.jboss.tools.project.examples.model.ProjectUtil;
+import org.jboss.tools.project.examples.model.SiteCategory;
+
+public class Sites {
+ private SiteCategory[] siteCategories;
+ private SiteCategory userSite;
+ private Set<ProjectExampleSite> sites;
+
+ public SiteCategory[] getSiteCategories() {
+ if (siteCategories == null) {
+ siteCategories = new SiteCategory[2];
+ userSite = new SiteCategory(Messages.Sites_User_sites);
+ Set<ProjectExampleSite> userSites = ProjectUtil.getUserSites();
+ userSite.setSites(userSites);
+ siteCategories[0]=userSite;
+ SiteCategory pluginSite = new SiteCategory(Messages.Sites_Plugin_provided_sites);
+ Set<ProjectExampleSite> pluginSites = ProjectUtil.getPluginSites();
+ pluginSite.setSites(pluginSites);
+ siteCategories[1]=pluginSite;
+ sites = new HashSet<ProjectExampleSite>();
+ sites.addAll(pluginSites);
+ sites.addAll(userSites);
+ }
+ return siteCategories;
+ }
+
+ public void remove(ProjectExampleSite site) {
+ userSite.getSites().remove(site);
+ sites.remove(site);
+ }
+
+ public void add(ProjectExampleSite site) {
+ userSite.getSites().add(site);
+ sites.add(site);
+ }
+
+ public Set<ProjectExampleSite> getSites() {
+ return sites;
+ }
+
+ public Set<ProjectExampleSite> getUserSites() {
+ return userSite.getSites();
+ }
+}
\ No newline at end of file
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2009-05-12 19:14:40 UTC (rev 15235)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2009-05-12 20:02:47 UTC (rev 15236)
@@ -100,7 +100,7 @@
final ProjectExamplesPatternFilter filter = new ProjectExamplesPatternFilter();
int styleBits = SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
- final FilteredTree filteredTree = new FilteredTree(composite, styleBits, filter);
+ final FilteredTree filteredTree = new FilteredTree(composite, styleBits, filter,true);
filteredTree.setBackground(parent.getDisplay().getSystemColor(
SWT.COLOR_WIDGET_BACKGROUND));
final TreeViewer viewer = filteredTree.getViewer();
17 years, 2 months
JBoss Tools SVN: r15235 - trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-05-12 15:14:40 -0400 (Tue, 12 May 2009)
New Revision: 15235
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java
Log:
JUnit tests errors fix for:
- junit.framework.AssertionFailedError: org.jboss.tools.jst.web.debug failed to load.
at org.jboss.tools.tests.PlugInLoadTest.isPluginResolved(PlugInLoadTest.java:36)
- junit.framework.AssertionFailedError: org.jboss.tools.struts.debug failed to load.
at org.jboss.tools.tests.PlugInLoadTest.isPluginResolved(PlugInLoadTest.java:36)
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java 2009-05-12 17:20:07 UTC (rev 15234)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/tests/PlugInLoadTest.java 2009-05-12 19:14:40 UTC (rev 15235)
@@ -85,8 +85,6 @@
assertPluginsResolved(new String[] {
rhdsNS + "jst.jsp", //$NON-NLS-1$
rhdsNS + "jst.web", //$NON-NLS-1$
- rhdsNS + "jst.web.debug", //$NON-NLS-1$
- rhdsNS + "jst.web.debug.ui", //$NON-NLS-1$
rhdsNS + "jst.web.tiles", //$NON-NLS-1$
rhdsNS + "jst.web.tiles.ui", //$NON-NLS-1$
rhdsNS + "jst.web.ui", //$NON-NLS-1$
@@ -103,7 +101,6 @@
public void testStrutsPluginsResolved() {
assertPluginsResolved(new String[] {
rhdsNS + "struts", //$NON-NLS-1$
- rhdsNS + "struts.debug", //$NON-NLS-1$
rhdsNS + "struts.text.ext", //$NON-NLS-1$
rhdsNS + "struts.ui", //$NON-NLS-1$
rhdsNS + "struts.validator.ui", //$NON-NLS-1$
17 years, 2 months
JBoss Tools SVN: r15234 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2009-05-12 13:20:07 -0400 (Tue, 12 May 2009)
New Revision: 15234
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-414 - added info about the option available in the Preferences of VPE
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2009-05-12 17:19:00 UTC (rev 15233)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2009-05-12 17:20:07 UTC (rev 15234)
@@ -882,6 +882,14 @@
</mediaobject>
</figure>
+ <para>You can also switch on this option in the VPE preferences, having clicked on the <emphasis><property>Preferences</property>
+ </emphasis> button
+ (<inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/visual_page/icon_1.png"/>
+ </imageobject>
+ </inlinemediaobject>).</para>
+
<section id="comments">
<title>Commenting out Code</title>
17 years, 2 months
JBoss Tools SVN: r15232 - trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-05-12 10:10:31 -0400 (Tue, 12 May 2009)
New Revision: 15232
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlAllTests.java
Log:
Test Suite title was corrected.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlAllTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlAllTests.java 2009-05-12 13:59:22 UTC (rev 15231)
+++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlAllTests.java 2009-05-12 14:10:31 UTC (rev 15232)
@@ -35,7 +35,7 @@
public static Test suite() {
- TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); //$NON-NLS-1$
+ TestSuite suite = new TestSuite("Tests for Vpe HTML components"); //$NON-NLS-1$
// $JUnit-BEGIN$
suite.addTestSuite(JBIDE3280Test.class);
suite.addTestSuite(HtmlComponentTest.class);
17 years, 2 months
JBoss Tools SVN: r15231 - in trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb: taglib and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-05-12 09:59:22 -0400 (Tue, 12 May 2009)
New Revision: 15231
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/IAttribute.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-05-12 13:22:57 UTC (rev 15230)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-05-12 13:59:22 UTC (rev 15231)
@@ -195,8 +195,25 @@
* @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
*/
public TextProposal[] getProposals(KbQuery query, IPageContext context) {
- // TODO Auto-generated method stub
- return null;
+ List<TextProposal> proposals = new ArrayList<TextProposal>();
+ IAttribute[] attributes = getAttributes(query, context);
+ if(query.getType() == KbQuery.Type.ATTRIBUTE_NAME) {
+ for (int i = 0; i < attributes.length; i++) {
+ TextProposal proposal = new TextProposal();
+ proposal.setContextInfo(attributes[i].getDescription());
+ proposal.setReplacementString(attributes[i].getName());
+ proposal.setLabel(attributes[i].getName());
+ proposals.add(proposal);
+ }
+ } else if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE) {
+ for (int i = 0; i < attributes.length; i++) {
+ TextProposal[] attributeProposals = attributes[i].getProposals(query, context);
+ for (int j = 0; j < attributeProposals.length; j++) {
+ proposals.add(attributeProposals[j]);
+ }
+ }
+ }
+ return proposals.toArray(new TextProposal[proposals.size()]);
}
/**
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/IAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/IAttribute.java 2009-05-12 13:22:57 UTC (rev 15230)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/kb/taglib/IAttribute.java 2009-05-12 13:59:22 UTC (rev 15231)
@@ -25,7 +25,7 @@
/**
* @return description
*/
- String getDesription();
+ String getDescription();
/**
* @return true if the attribute is required.
17 years, 2 months
JBoss Tools SVN: r15230 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-05-12 09:22:57 -0400 (Tue, 12 May 2009)
New Revision: 15230
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4271, sash switching logic was corrected.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java 2009-05-12 12:58:09 UTC (rev 15229)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/xpl/CustomSashForm.java 2009-05-12 13:22:57 UTC (rev 15230)
@@ -77,7 +77,21 @@
public int[][] sashLocs; // There is one entry for each arrow, It is arrowType/arrowDrawn/x/y/height/width of the arrow area.
// There may not be a second entry, in which case we have only one arrow.
public SashInfo(Sash sash) {
- this.sash = sash;
+ this.sash = sash;
+ /*
+ * Init the sash weight with the default value.
+ */
+ String defaultWeightString = VpePreference.SOURCE_VISUAL_EDITORS_WEIGHTS.getValue();
+ try {
+ int defaultWeight = Integer.parseInt(defaultWeightString);
+ if (defaultWeight > 0) {
+ weight = defaultWeight;
+ }
+ } catch (NumberFormatException e) {
+ /*
+ * Do nothing
+ */
+ }
}
};
@@ -113,6 +127,15 @@
WIDTH_INDEX = 4,
HEIGHT_INDEX = 5;
+ /*
+ * Flag indicating that one part of the sash form is maximized.
+ */
+ private boolean maximized = false;
+ /*
+ * Flag indicating the necessity to store the new sash weight.
+ */
+ private boolean storeWeight = true;
+
/**
* Constructor for CustomSashForm.
* @param parent
@@ -167,11 +190,13 @@
* Call to set to max up
*/
public void maxUp() {
- if (noMaxUp)
- return;
+ if (noMaxUp) {
+ return;
+ }
- if (currentSashInfo == null)
- currentSashInfo = new SashInfo(null);
+ if (currentSashInfo == null){
+ currentSashInfo = new SashInfo(null);
+ }
upMaxClicked(currentSashInfo);
}
@@ -184,25 +209,28 @@
public void upClicked() {
- if (currentSashInfo != null && currentSashInfo.weight >= 0)
- upClicked(currentSashInfo);
+ if (currentSashInfo != null && currentSashInfo.weight >= 0) {
+ upClicked(currentSashInfo);
+ }
}
public void downClicked() {
- if (currentSashInfo != null && currentSashInfo.weight >= 0)
- downClicked(currentSashInfo);
+ if (currentSashInfo != null && currentSashInfo.weight >= 0) {
+ downClicked(currentSashInfo);
+ }
}
/**
* Call to set to max down
*/
public void maxDown() {
- if (noMaxDown)
- return;
+ if (noMaxDown) {
+ return;
+ }
- if (currentSashInfo == null)
- currentSashInfo = new SashInfo(null);
-
+ if (currentSashInfo == null) {
+ currentSashInfo = new SashInfo(null);
+ }
downMaxClicked(currentSashInfo);
}
@@ -231,11 +259,13 @@
public void layout(boolean changed) {
super.layout(changed);
- if (noMaxUp && noMaxDown)
- return; // No arrows to handle in this case.
+ if (noMaxUp && noMaxDown) {
+ return; // No arrows to handle in this case.
+ }
- if (getMaximizedControl() != null)
- return; // We have a maximized control, so we don't need to worry about the sash.
+ if (getMaximizedControl() != null) {
+ return; // We have a maximized control, so we don't need to worry about the sash.
+ }
// Let's get the list of all sashes the sash form now has. If there is more than one then just disable the sashinfo.
// If there is no current sash, and there is only one sash, then create the sashinfo for it.
@@ -247,32 +277,33 @@
newSash = (Sash) children[i];
else {
// We have more than one sash, so need to disable current sash, if we have one.
- if (currentSashInfo != null)
- currentSashInfo.enabled = false;
+ if (currentSashInfo != null) {
+ currentSashInfo.enabled = false;
+ }
return; // Don't go on.
}
}
- if (newSash == null)
- return; // We have no sashes at all.
+ if (newSash == null) {
+ return; // We have no sashes at all.
+ }
// Now we need to see if this is a new sash.
if (currentSashInfo == null || currentSashInfo.sash == null) {
- if (currentSashInfo == null)
- currentSashInfo = new SashInfo(newSash);
- else
- currentSashInfo.sash = newSash;
+ if (currentSashInfo == null) {
+ currentSashInfo = new SashInfo(newSash);
+ } else {
+ currentSashInfo.sash = newSash;
+ }
newSash.addPaintListener(new PaintListener() {
/**
* @see org.eclipse.swt.events.PaintListener#paintControl(PaintEvent)
*/
public void paintControl(PaintEvent e) {
// Need to find the index of the sash we're interested in.
-
GC gc = e.gc;
Color oldFg = gc.getForeground();
Color oldBg = gc.getBackground();
-
/*
* Draw first arrow
*/
@@ -284,11 +315,12 @@
drawArrow(gc, currentSashInfo.sashLocs[1], currentSashInfo.cursorOver == 1);
}
- if (currentSashInfo.sashBorderLeft)
- drawSashBorder(gc, currentSashInfo.sash, true);
- if (currentSashInfo.sashBorderRight)
- drawSashBorder(gc, currentSashInfo.sash, false);
-
+ if (currentSashInfo.sashBorderLeft) {
+ drawSashBorder(gc, currentSashInfo.sash, true);
+ }
+ if (currentSashInfo.sashBorderRight) {
+ drawSashBorder(gc, currentSashInfo.sash, false);
+ }
gc.setForeground(oldFg);
gc.setBackground(oldBg);
}
@@ -305,14 +337,14 @@
// String text = s.getToolTipText();
// if(text.equalsIgnoreCase(anotherString))
// }
- recomputeSashInfo();
+ recomputeSashInfo(false);
}
/**
* @see org.eclipse.swt.events.ControlAdapter#controlResized(ControlEvent)
*/
public void controlResized(ControlEvent e) {
- recomputeSashInfo();
+ recomputeSashInfo(false);
}
@@ -388,7 +420,6 @@
currentSashInfo.sash.setToolTipText(null);
}
}
-
});
// Need to know when we leave so that we can clear the cursor feedback if set.
@@ -416,7 +447,11 @@
@Override
public void mouseDown(MouseEvent e) {
inMouseClick = true;
- // If we're within a button, then redraw to wipe out stipple and get button push effect.
+ /*
+ * If we're within a button,
+ * then redraw to wipe out stipple
+ * and get button push effect.
+ */
int x = e.x;
int y = e.y;
for (int i=0; i<currentSashInfo.sashLocs.length; i++) {
@@ -437,7 +472,9 @@
*/
@Override
public void mouseUp(MouseEvent e) {
- // See if within one of the arrows.
+ /*
+ * See if within one of the arrows.
+ */
inMouseClick = false; // No longer in down click
int x = e.x;
int y = e.y;
@@ -463,29 +500,37 @@
downMaxClicked(currentSashInfo);
break;
}
+ recomputeSashInfo(true); // apply arrow click
break;
}
}
currentSashInfo.sash.redraw(); // Make sure stipple goes away from the mouse up if not over an arrow button.
fireDividerMoved();
}
-
});
- recomputeSashInfo(); // Get initial setting
+ recomputeSashInfo(true); // Get initial setting
}
}
-
- protected void recomputeSashInfo() {
+ /**
+ * Recomputes the sash data: arrows, widths, sizes.
+ *
+ * @param arrowClicked if the sash arrow was clicked.
+ */
+ protected void recomputeSashInfo(boolean arrowClicked) {
/*
* Don't process because we are in the down mouse button on an arrow.
*/
- if (inMouseClick && currentSashInfo.cursorOver != NO_WEIGHT) {
+ if (inMouseClick) {
return;
}
/*
+ * By default we should save a new sash width.
+ */
+ storeWeight = true;
+ /*
* We need to refigure size for the sash arrows.
*/
int[] addArrows = null;
@@ -499,7 +544,6 @@
* Current sash orientation.
*/
int orientation = getOrientation();
-
if (noMaxUp) {
addArrows = new int[1];
drawArrows = new int[1];
@@ -521,7 +565,7 @@
* Since we are in the middle, there is no weight.
* We've could of been dragged here.
*/
- currentSashInfo.weight = NO_WEIGHT;
+ maximized = false;
currentSashInfo.sashBorderLeft = sashBorders != null ? sashBorders[0] : false;
currentSashInfo.sashBorderRight = sashBorders != null ? sashBorders[1] : false;
}
@@ -546,7 +590,7 @@
* Since we are in the middle, there is no weight.
* We've could of been dragged here.
*/
- currentSashInfo.weight = NO_WEIGHT;
+ maximized = false;
currentSashInfo.sashBorderLeft = sashBorders != null ? sashBorders[0] : false;
currentSashInfo.sashBorderRight = sashBorders != null ? sashBorders[1] : false;
}
@@ -557,7 +601,7 @@
Rectangle clientArea = getClientArea();
final int DRAG_MINIMUM = 20; // TODO: kludge see SashForm.DRAG_MINIMUM
if (weights[0] == 0
- || ((currentSashInfo.weight != NO_WEIGHT)
+ || (!maximized
&& ((orientation == SWT.VERTICAL) && (sashBounds.y <= DRAG_MINIMUM)
|| (orientation == SWT.HORIZONTAL) && (sashBounds.x <= DRAG_MINIMUM)))) {
/*
@@ -578,9 +622,9 @@
currentSashInfo.sashBorderRight = sashBorders != null ? sashBorders[1] : false;
} else if ((weights[1] == 0)
- || ((currentSashInfo.weight != NO_WEIGHT)
+ || (!maximized
&& (((orientation == SWT.VERTICAL) && (sashBounds.y + sashBounds.height >= clientArea.height - DRAG_MINIMUM))
- || ((orientation == SWT.HORIZONTAL) && (sashBounds.x + sashBounds.width >= clientArea.width - DRAG_MINIMUM))))) {
+ || ((orientation == SWT.HORIZONTAL) && (sashBounds.x + sashBounds.width >= clientArea.width - DRAG_MINIMUM))))) {
/*
* When maximized to the bottom or to the right
*/
@@ -597,8 +641,9 @@
}
currentSashInfo.sashBorderLeft = sashBorders != null ? sashBorders[0] : false;
currentSashInfo.sashBorderRight = false;
- } else {
+ } else if (arrowClicked) {
/*
+ * After an arrow have been clicked.
* Not slammed
*/
addArrows[0] = UP_MAX_ARROW;
@@ -609,12 +654,79 @@
* Since we are in the middle, there is no weight.
* We've could of been dragged here.
*/
- currentSashInfo.weight = NO_WEIGHT;
+ maximized = false;
currentSashInfo.sashBorderLeft = sashBorders != null ? sashBorders[0] : false;
currentSashInfo.sashBorderRight = sashBorders != null ? sashBorders[1] : false;
+ } else {
+ /*
+ * When sash is dragged or clicked in maximized state
+ * Not slammed.
+ */
+ if (maximized) {
+ /*
+ * if the sash is in the top or to the left
+ */
+ if(weights[1] > weights[0]) {
+ if (orientation == SWT.VERTICAL) {
+ addArrows[0] = DOWN_MAX_ARROW;
+ drawArrows[0] = DOWN_MAX_ARROW;
+ addArrows[1] = DOWN_ARROW;
+ drawArrows[1] = DOWN_ARROW;
+ } else {
+ addArrows[0] = DOWN_ARROW;
+ drawArrows[0] = DOWN_ARROW;
+ addArrows[1] = DOWN_MAX_ARROW;
+ drawArrows[1] = DOWN_MAX_ARROW;
+ }
+ }
+ /*
+ * if the sash is in the bottom or to the right
+ */
+ if(weights[0] > weights[1]) {
+ if (orientation == SWT.VERTICAL) {
+ addArrows[0] = UP_ARROW;
+ drawArrows[0] = UP_ARROW;
+ addArrows[1] = UP_MAX_ARROW;
+ drawArrows[1] = UP_MAX_ARROW;
+ } else {
+ addArrows[0] = UP_MAX_ARROW;
+ drawArrows[0] = UP_MAX_ARROW;
+ addArrows[1] = UP_ARROW;
+ drawArrows[1] = UP_ARROW;
+ }
+ }
+ maximized = false;
+ /*
+ * Do not store sash weight because
+ * this is temporary state of the sash
+ * after clicking on it from maximized state.
+ */
+ storeWeight = false;
+
+ } else {
+ /*
+ * Not maximized, general behavior.
+ */
+ if (orientation == SWT.VERTICAL) {
+ addArrows[0] = DOWN_MAX_ARROW;
+ drawArrows[0] = DOWN_ARROW;
+ addArrows[1] = UP_MAX_ARROW;
+ drawArrows[1] = UP_ARROW;
+ } else {
+ addArrows[0] = UP_MAX_ARROW;
+ drawArrows[0] = UP_ARROW;
+ addArrows[1] = DOWN_MAX_ARROW;
+ drawArrows[1] = DOWN_ARROW;
+ }
+ }
+ if (storeWeight) {
+ currentSashInfo.weight = weights[1];
+ }
}
+ currentSashInfo.sashBorderLeft = sashBorders != null ? sashBorders[0] : false;
+ currentSashInfo.sashBorderRight = sashBorders != null ? sashBorders[1] : false;
}
- getNewSashArray(currentSashInfo, addArrows, drawArrows);
+ setNewSashLocs(currentSashInfo, addArrows, drawArrows);
/*
* Need to schedule a redraw
* because it has already drawn the old ones
@@ -624,86 +736,93 @@
}
protected void upClicked(SashInfo sashinfo) {
- /*
- * This means restore just the sash below weight
- * and reduce the above weight by the right amount.
- */
+ /*
+ * This means restore just the sash below weight
+ * and reduce the above weight by the right amount.
+ */
+ if (sashinfo.weight > 0) {
int[] weights = getWeights();
- if (sashinfo.weight != NO_WEIGHT) {
- weights[0] = 1000-sashinfo.weight; // Assume weights are always in units of 1000
- weights[1] = sashinfo.weight;
- sashinfo.weight = NO_WEIGHT; // Set '-1' to weight to show that sash is not slammed.
- setWeights(weights);
- fireDividerMoved();
- }
+ weights[0] = 1000-sashinfo.weight; // Assume weights are always in units of 1000
+ weights[1] = sashinfo.weight;
+ maximized = false;
+ setWeights(weights);
+ fireDividerMoved();
+ }
}
protected void upMaxClicked(SashInfo sashinfo) {
- int[] weights = getWeights();
- /*
- * Up max, so save the current weight of 1 into the sash info,
- * and move to the top.
- */
- if (currentSashInfo.weight == NO_WEIGHT) {
- currentSashInfo.weight = weights[1]; // Not currently maxed, save position.
- }
-
- weights[1] = 1000;
- weights[0] = 0;
-
- /*
- * If the upper panel has focus,
- * flip focus to the lower panel
- * because the upper panel is now hidden.
- */
- Control[] children = getChildren();
- boolean upperFocus = isFocusAncestorA(children[0]);
- setWeights(weights);
- if (upperFocus) {
- children[1].setFocus();
- }
- recomputeSashInfo();
- fireDividerMoved();
+ /*
+ * Up max, so save the current weight of 1 into the sash info,
+ * and move to the top.
+ */
+ int[] weights = getWeights();
+ /*
+ * Store previous sash width only when
+ * it's not maximized and there is a flag to store
+ */
+ if (!maximized && storeWeight) {
+ currentSashInfo.weight = weights[1];
+ }
+ maximized = true;
+ weights[1] = 1000;
+ weights[0] = 0;
+ /*
+ * If the upper panel has focus,
+ * flip focus to the lower panel
+ * because the upper panel is now hidden.
+ */
+ Control[] children = getChildren();
+ boolean upperFocus = isFocusAncestorA(children[0]);
+ setWeights(weights);
+ if (upperFocus) {
+ children[1].setFocus();
+ }
+ fireDividerMoved();
}
protected void downClicked(SashInfo sashinfo) {
- /*
- * This means restore just the sash below weight
- * and increase the above weight by that amount.
- */
+ /*
+ * This means restore just the sash below weight
+ * and increase the above weight by that amount.
+ */
+ if (sashinfo.weight > 0) {
int[] weights = getWeights();
- if (sashinfo.weight != NO_WEIGHT) {
- weights[0] = 1000-sashinfo.weight; // Assume weights are always in units of 1000
- weights[1] = sashinfo.weight;
- sashinfo.weight = NO_WEIGHT; // Set '-1' to weight to show that sash is not slammed.
- setWeights(weights);
- fireDividerMoved();
- }
+ weights[0] = 1000-sashinfo.weight; // Assume weights are always in units of 1000
+ weights[1] = sashinfo.weight;
+ maximized = false;
+ setWeights(weights);
+ fireDividerMoved();
+ }
}
protected void downMaxClicked(SashInfo sashinfo) {
- int[] weights = getWeights();
- /*
- * Down max, so save the current weight of 1 into the sash info, and move to the bottom.
- */
- if (currentSashInfo.weight == NO_WEIGHT) {
- currentSashInfo.weight = weights[1]; // Not currently maxed, save current weight.
- }
- weights[0] = 1000;
- weights[1] = 0;
- /*
- * If the lower panel has focus,
- * flip focus to the upper panel
- * because the lower panel is now hidden.
- */
- Control[] children = getChildren();
- boolean lowerFocus = isFocusAncestorA(children[1]);
- setWeights(weights);
- if (lowerFocus) {
- children[0].setFocus();
- }
- recomputeSashInfo();
- fireDividerMoved();
+ /*
+ * Down max, so save the current weight of 1 into the sash info,
+ * and move to the bottom.
+ */
+ int[] weights = getWeights();
+ /*
+ * Store previous sash width only when
+ * it's not maximized and there is a flag to store
+ */
+ if (!maximized && storeWeight) {
+ currentSashInfo.weight = weights[1];
+ }
+ maximized = true;
+ weights[0] = 1000;
+ weights[1] = 0;
+ /*
+ * If the lower panel has focus,
+ * flip focus to the upper panel
+ * because the lower panel is now hidden.
+ */
+ Control[] children = getChildren();
+ boolean lowerFocus = isFocusAncestorA(children[1]);
+ setWeights(weights);
+ if (lowerFocus) {
+ children[0].setFocus();
+ }
+ fireDividerMoved();
}
/*
@@ -719,11 +838,19 @@
return control == focusControl;
}
- protected void getNewSashArray(SashInfo sashInfo, int[] addArrowTypes, int[] drawArrowTypes) {
+ /**
+ * Sets new sash arrows' locations and types.
+ *
+ * @param sashInfo the SashInfo
+ * @param addArrowTypes types of the arrows
+ * @param drawArrowTypes icons of the arrows
+ */
+ protected void setNewSashLocs(SashInfo sashInfo, int[] addArrowTypes, int[] drawArrowTypes) {
int[][] thisSash = sashInfo.sashLocs;
- if (thisSash == null)
- thisSash = sashInfo.sashLocs = new int[addArrowTypes.length][];
+ if (thisSash == null) {
+ thisSash = sashInfo.sashLocs = new int[addArrowTypes.length][];
+ }
int aSize = ARROW_SIZE; // Width of arrow
int tSize = aSize+2*ARROW_MARGIN; // Total Width (arrow + margin)
@@ -761,12 +888,15 @@
thisSash[j][WIDTH_INDEX] = width;
thisSash[j][HEIGHT_INDEX] = height;
}
- if (vertical)
- x+=tSize;
- else
- y+=tSize;
+ if (vertical) {
+ x+=tSize;
+ }
+ else {
+ y+=tSize;
+ }
}
}
+
protected void drawSashBorder(GC gc, Sash sash, boolean leftBorder) {
gc.setForeground(borderColor);
if (getOrientation() == SWT.VERTICAL) {
@@ -989,7 +1119,7 @@
public void setCurrentSavedWeight(int weight) {
if (weight>=0 && currentSashInfo!=null) {
- recomputeSashInfo();
+ recomputeSashInfo(false);
currentSashInfo.weight=weight;
}
}
17 years, 2 months
JBoss Tools SVN: r15229 - trunk/documentation/jboss-tools-docs.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-05-12 08:58:09 -0400 (Tue, 12 May 2009)
New Revision: 15229
Modified:
trunk/documentation/jboss-tools-docs/all-guides.xml
trunk/documentation/jboss-tools-docs/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-451 - adding Guvnor Tools Ref guide;
Modified: trunk/documentation/jboss-tools-docs/all-guides.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/all-guides.xml 2009-05-12 12:51:40 UTC (rev 15228)
+++ trunk/documentation/jboss-tools-docs/all-guides.xml 2009-05-12 12:58:09 UTC (rev 15229)
@@ -301,6 +301,20 @@
</fileSet>
<fileSet>
+ <directory>../../drools/docs/guvnor_ref/target/docbook/publish/en-US</directory>
+ <outputDirectory>/guvnor_tools_ref_guide</outputDirectory>
+ <filtered>false</filtered>
+ <lineEnding>keep</lineEnding>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ <useStrictFiltering>false</useStrictFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <fileMode>0644</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
+
+ <fileSet>
<directory>../../smooks/docs/reference/target/docbook/publish/en-US</directory>
<outputDirectory>/jboss_smooks_plugin_ref_guide</outputDirectory>
<filtered>false</filtered>
Modified: trunk/documentation/jboss-tools-docs/pom.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/pom.xml 2009-05-12 12:51:40 UTC (rev 15228)
+++ trunk/documentation/jboss-tools-docs/pom.xml 2009-05-12 12:58:09 UTC (rev 15229)
@@ -29,6 +29,7 @@
<module>../../portlet/docs/reference</module>
<module>../../birt/docs</module>
<module>../../drools/docs/reference</module>
+ <module>../../drools/docs/guvnor_ref</module>
<module>../../smooks/docs/reference</module>
<module>../../jbpm/docs/converter_ref</module>
<module>../../jmx/docs/reference</module>
17 years, 2 months
JBoss Tools SVN: r15228 - trunk/documentation/jboss-tools-docs/index/en.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-05-12 08:51:40 -0400 (Tue, 12 May 2009)
New Revision: 15228
Modified:
trunk/documentation/jboss-tools-docs/index/en/master.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-451 - adding Guvnor Tools Ref guide into index page;
Modified: trunk/documentation/jboss-tools-docs/index/en/master.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/index/en/master.xml 2009-05-12 12:50:47 UTC (rev 15227)
+++ trunk/documentation/jboss-tools-docs/index/en/master.xml 2009-05-12 12:51:40 UTC (rev 15228)
@@ -126,7 +126,7 @@
<indexentry>
- <primaryie>JBoss Birt Plugin Reference Guide <ulink
+ <primaryie>Birt Plugin Integration Reference Guide<ulink
url="en/jboss_birt_plugin_ref_guide/html/index.html">(html)</ulink>
<ulink url="en/jboss_birt_plugin_ref_guide/html_single/index.html">(html single)</ulink>
<ulink url="en/jboss_birt_plugin_ref_guide/pdf/Birt_Reference_Guide.pdf"
@@ -143,8 +143,15 @@
</primaryie>
</indexentry>
-
<indexentry>
+ <primaryie>Eclipse Guvnor Tools Reference Guide<ulink
+ url="en/guvnor_tools_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/guvnor_tools_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/guvnor_tools_ref_guide/pdf/Drools_Tools_Reference_Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
<primaryie>Exadel Studio Migration Guide <ulink
url="en/Exadel-migration/html/index.html">(html)</ulink>
<ulink url="en/Exadel-migration/html_single/index.html">(html single)</ulink>
@@ -154,7 +161,7 @@
</indexentry>
<indexentry>
- <primaryie>Smooks Reference Guide <ulink
+ <primaryie>Smooks Reference Guide<ulink
url="en/jboss_smooks_plugin_ref_guide/html/index.html">(html)</ulink>
<ulink url="en/jboss_smooks_plugin_ref_guide/html_single/index.html">(html single)</ulink>
<ulink url="en/jboss_smooks_plugin_ref_guide/pdf/Smooks_Reference_Guide.pdf"
17 years, 2 months
JBoss Tools SVN: r15227 - in trunk/drools/docs: guvnor_ref and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-05-12 08:50:47 -0400 (Tue, 12 May 2009)
New Revision: 15227
Added:
trunk/drools/docs/guvnor_ref/
trunk/drools/docs/guvnor_ref/en/
trunk/drools/docs/guvnor_ref/en/images/
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/add_toGuvnor_wizard.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/association_details.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/compare_with_version.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/compare_with_version2.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/compare_with_version3.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/confirm_delete.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/delete_connection_button.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/do_into_button.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_back_button.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_home_button.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_into_button.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_into_defaultPackage.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_connection_button.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_connection_wizard.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_preferences.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_repository.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnorinfo.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/open_guvnor_perspectine.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/repository_files_properties.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_from_guvnor.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_from_guvnor2.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_from_guvnor3.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_history_view.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_history_view2.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_history_view3.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/select_target_folder.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/start_guvnor_connection1.png
trunk/drools/docs/guvnor_ref/en/images/functionality_overview/start_guvnor_connection2.png
trunk/drools/docs/guvnor_ref/en/images/guvnor_preferences/
trunk/drools/docs/guvnor_ref/en/images/guvnor_preferences/guvnor_preferences.png
trunk/drools/docs/guvnor_ref/en/master.xml
trunk/drools/docs/guvnor_ref/en/modules/
trunk/drools/docs/guvnor_ref/en/modules/conclusion.xml
trunk/drools/docs/guvnor_ref/en/modules/functionality_overview.xml
trunk/drools/docs/guvnor_ref/en/modules/guvnor_preferences.xml
trunk/drools/docs/guvnor_ref/en/modules/introduction.xml
trunk/drools/docs/guvnor_ref/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-451 - adding Guvnor Tools Reference guide;
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/add_toGuvnor_wizard.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/add_toGuvnor_wizard.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/association_details.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/association_details.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/compare_with_version.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/compare_with_version.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/compare_with_version2.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/compare_with_version2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/compare_with_version3.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/compare_with_version3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/confirm_delete.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/confirm_delete.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/delete_connection_button.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/delete_connection_button.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/do_into_button.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/do_into_button.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_back_button.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_back_button.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_home_button.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_home_button.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_into_button.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_into_button.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_into_defaultPackage.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/go_into_defaultPackage.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_connection_button.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_connection_button.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_connection_wizard.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_connection_wizard.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_preferences.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_preferences.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_repository.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnor_repository.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnorinfo.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/guvnorinfo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/open_guvnor_perspectine.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/open_guvnor_perspectine.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/repository_files_properties.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/repository_files_properties.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_from_guvnor.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_from_guvnor.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_from_guvnor2.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_from_guvnor2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_from_guvnor3.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_from_guvnor3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_history_view.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_history_view.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_history_view2.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_history_view2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_history_view3.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/resource_history_view3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/select_target_folder.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/select_target_folder.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/start_guvnor_connection1.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/start_guvnor_connection1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/start_guvnor_connection2.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/functionality_overview/start_guvnor_connection2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/images/guvnor_preferences/guvnor_preferences.png
===================================================================
(Binary files differ)
Property changes on: trunk/drools/docs/guvnor_ref/en/images/guvnor_preferences/guvnor_preferences.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/drools/docs/guvnor_ref/en/master.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/en/master.xml (rev 0)
+++ trunk/drools/docs/guvnor_ref/en/master.xml 2009-05-12 12:50:47 UTC (rev 15227)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.docbook.org/xsd/4.3/docbook.xsd"
+
+[<!ENTITY introduction SYSTEM "modules/introduction.xml">
+<!ENTITY functionality_overview SYSTEM "modules/functionality_overview.xml">
+<!ENTITY guvnor_preferences SYSTEM "modules/guvnor_preferences.xml">
+<!ENTITY conclusion SYSTEM "modules/conclusion.xml">
+
+<!ENTITY seamlink "../../seam/html_single/index.html">
+<!ENTITY aslink "../../as/html_single/index.html">
+<!ENTITY esblink "../../esb_ref_guide/html_single/index.html">
+<!ENTITY gsglink "../../GettingStartedGuide/html_single/index.html">
+<!ENTITY hibernatelink "../../hibernatetools/html_single/index.html">
+<!ENTITY jbpmlink "../../jbpm/html_single/index.html">
+<!ENTITY jsflink "../../jsf/html_single/index.html">
+<!ENTITY jsfreflink "../../jsf_tools_ref_guide/html_single/index.html">
+<!ENTITY jsftutoriallink "../../jsf_tools_tutorial/html_single/index.html">
+<!ENTITY strutsreflink "../../struts_tools_ref_guide/html_single/index.html">
+<!ENTITY strutstutoriallink "../../struts_tools_tutorial/html_single/index.html">
+
+]>
+
+<book>
+
+ <bookinfo>
+ <title>Eclipse Guvnor Tools Reference Guide</title>
+
+ <author><firstname>John</firstname><surname>Graham</surname><email>jgraham(a)redhat.com</email></author>
+ <author><firstname>Olga</firstname><surname>Chikvina</surname></author>
+
+ <pubdate>April 2008</pubdate>
+ <copyright>
+ <year>2009</year>
+ <holder>JBoss, a division of Red Hat</holder>
+ </copyright>
+ <!--releaseinfo>
+ Version: 5.0.0.M5
+ </releaseinfo-->
+<abstract>
+ <title/>
+ <para>
+ <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/guvnor/pdf/Eclipse_G...">PDF version</ulink>
+ </para>
+ </abstract>
+
+ </bookinfo>
+
+
+ <toc/>
+ &introduction;
+ &functionality_overview;
+ &guvnor_preferences;
+ &conclusion;
+
+</book>
Added: trunk/drools/docs/guvnor_ref/en/modules/conclusion.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/en/modules/conclusion.xml (rev 0)
+++ trunk/drools/docs/guvnor_ref/en/modules/conclusion.xml 2009-05-12 12:50:47 UTC (rev 15227)
@@ -0,0 +1,22 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter id="conclusion" xreflabel="conclusion">
+ <?dbhtml filename="conclusion.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Eclipse Guvnor Tools</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Conclusion</title>
+
+ <para>As stated at the beginning of this document, the key goal of the <property>EGT</property>
+ is to provide a way of interacting with Guvnor repository resources in a local Eclipse
+ workspace. While clearly there is a lot more that could be done, and no doubt there will be
+ aspects of the current tooling that require revision going forward, we feel that the current
+ state of the <property>EGT</property> is sufficient for the major use cases.</para>
+
+ <para>If you have some questions, 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>.</para>
+</chapter>
Added: trunk/drools/docs/guvnor_ref/en/modules/functionality_overview.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/en/modules/functionality_overview.xml (rev 0)
+++ trunk/drools/docs/guvnor_ref/en/modules/functionality_overview.xml 2009-05-12 12:50:47 UTC (rev 15227)
@@ -0,0 +1,727 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter id="functionality_overview" xreflabel="functionality_overview">
+ <?dbhtml filename="functionality_overview.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Eclipse Guvnor Tools</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Functionality Overview</title>
+
+ <para>This chapter will introduce you to the <property>Guvnor Repository Exploring
+ perspective</property> and give an overview on all functionality the <property>Guvnor Tools</property> provides.</para>
+
+ <section id="guvnor_perspective">
+ <title>Guvnor Perspective</title>
+
+ <para>The <property>Guvnor Repository Exploring perspective</property> contains two views
+ supplied by <property>EGT</property> – <property>Repository Explorer</property> and
+ <property>Version History</property>, that will be the center of most interaction
+ with Guvnor, and Eclipse standard views such as <property>Properties</property> and
+ <property>Resource Navigator</property> that are also useful.</para>
+
+ <para>While each of these views can be opened and positioned independently within an Eclipse
+ workbench, the <property>Guvnor perspective</property> provides a convenient method of
+ getting a suggested layout. In the Eclipse workbench menu, choose <emphasis>
+ <property>Window > Open Perspective > Other</property>
+ </emphasis> to get the perspective list:</para>
+
+ <figure>
+ <title>Enabling the Guvnor Repository Perspective</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/open_guvnor_perspectine.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>And then choose <emphasis>
+ <property>Guvnor Repository Exploring</property>.</emphasis> This opens the
+ <property>Guvnor perspective</property>.</para>
+ </section>
+
+ <section id="connection_wizard">
+ <title>Guvnor Connection Wizard</title>
+
+ <para>After opening the <property>Guvnor perspective</property>, the first task is to make a
+ connection to a Guvnor repository. This is handled by the <property>Guvnor Connection
+ wizard</property>. This wizard appears in a number of places within the
+ <property>EGT</property> (as detailed below), but in this section we will cover only
+ the two most basic entry points.</para>
+
+ <para>The <property>Guvnor Connection wizard</property> can be started in the following
+ ways:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>using the Eclipse menu <emphasis>
+ <property>File > New > Other > Guvnor > Guvnor
+ repository location</property>
+ </emphasis></para>
+
+ <figure>
+ <title>New Guvnor Repository Location</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/start_guvnor_connection1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+
+ <listitem>
+ <para>in the <property>Guvnor Repositories view</property> using the drop-down menu</para>
+
+ <figure>
+ <title>Adding New Guvnor Connection</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/start_guvnor_connection2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+
+ <listitem>
+ <para>using the menu button
+ ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/guvnor_connection_button.png"/>
+ </imageobject>
+ </inlinemediaobject> )
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Choosing either of these will start the <property>Guvnor Connection
+ wizard</property>.</para>
+
+ <figure id="guvnor_connection_wizard">
+ <title>Guvnor Connection Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/guvnor_connection_wizard.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Default values appear in the <emphasis>
+ <property>Location</property>,</emphasis>
+ <emphasis>
+ <property>Port</property>,</emphasis> and <emphasis>
+ <property>Repository</property>
+ </emphasis> fields (See the <link linkend="guvnor_preferences">“Guvnor Preferences”</link> section below for details about how to
+ change these default values.) Of course, any of these fields can be edited by typing in
+ the corresponding text box. Drag-and-drop or paste into the <emphasis>
+ <property>Location</property>
+ </emphasis> field of a typical Guvnor repository URL such as:</para>
+
+ <para>
+ <emphasis>
+ <property>http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav</property>
+ </emphasis>
+ </para>
+
+ <para>Results in the URL being parsed into the respective fields as well. The authentication
+ information (user name and password) can optionally be stored in the Eclipse
+ workbench's key-ring file based on the selection of <emphasis>
+ <property>Save user name and password</property>.</emphasis></para>
+
+ <note>
+ <title>Note:</title>
+ <para>If the authentication information is not stored in the key-ring, then the
+ <property>EGT</property> uses a session authentication, what means that the
+ credentials supplied are used only for the lifetime of the Eclipse workbench
+ instance.</para>
+ </note>
+
+ <para>If authentication information is not stored in the key-ring or the authentication
+ information (key-ring or session) is not valid, the <property>EGT</property> will prompt
+ for authentication information when it has to access the Guvnor repository.</para>
+
+ <para>If authentication fails, the <property>EGT</property> will retry once and then issue
+ an authentication failure error.</para>
+
+ <tip>
+ <title>Tip:</title>
+ <para>If an authentication failure error occurs, you can retry the same operation and
+ supply different authentication information.</para>
+ </tip>
+
+ <para>Note that the <property>EGT</property> calls the Guvnor repository at various times,
+ such as when determining if resource updates are available. Thus if you use session
+ authentication, the authentication dialog will appear at different times during the
+ Eclipse workbench session, depending on what actions you take. For ease of use, we
+ recommend saving the authentication information in the Eclipse key-ring.</para>
+
+ <note>
+ <title>Note:</title>
+ <para>The Eclipse key-ring file is distinct from key-ring files found in some platforms
+ such as Mac OS X and many forms of Linux. Thus, sometimes if you access a Guvnor
+ repository outside the <property>EGT</property>, the key-ring files might become
+ unsynchronized and you will be unexpectedly prompted for authentication in Eclipse.
+ This is nuisance, but your usual credentials should apply in this case.</para>
+ </note>
+ </section>
+
+ <section id="guvnor_repositories_view">
+ <title>Guvnor Repositories View</title>
+
+ <para>The <property>Guvnor Repositories view</property> contains tree structures for Guvnor
+ repository contents.</para>
+
+ <figure>
+ <title>Guvnor Repositories View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/guvnor_repository.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>You can perform the following actions under the resources in the
+ <property>Guvnor Repositories view</property>:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>create a new Guvnor repository connection. How to do this is describe above in the <link linkend="connection_wizard">"Guvnor Connection Wizard"</link> section.</para>
+ </listitem>
+
+ <listitem>
+ <para>remove a Guvnor repository connection. Use the Delete button
+ ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/delete_connection_button.png"/>
+ </imageobject>
+ </inlinemediaobject> ) in the tool-bar or the <emphasis>
+ <property>Delete</property></emphasis> option in the context menu to remove a repository connection.</para>
+ </listitem>
+
+ <listitem>
+ <para>refresh Guvnor repository resorces. Use the <emphasis>
+ <property>Refresh</property></emphasis> context menu item to reload a tree content for the selected node.</para>
+ </listitem>
+
+ <listitem>
+ <para>make use of "drill-into" functionality. It's represented by a number of tool-bar/context menu items such as <emphasis><property>Go Home</property></emphasis>
+ ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/go_home_button.png"/>
+ </imageobject>
+ </inlinemediaobject> ), <emphasis><property>Go Back</property></emphasis>
+ ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/go_back_button.png"/>
+ </imageobject>
+ </inlinemediaobject> ) and <emphasis>
+ <property>Go Into</property></emphasis>
+ ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/go_into_button.png"/>
+ </imageobject>
+ </inlinemediaobject> ).</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Drill-down is useful when working with deeply nested tree structures and when you wish to concentrate on only branch of the tree. For example, drilling into the <emphasis>
+ <property>"defaultPackage"</property></emphasis> node changes the tree view to:</para>
+
+ <figure>
+ <title>Going Into the <emphasis>"defaultPackage"</emphasis></title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/go_into_defaultPackage.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Clicking on the Go Home button ( <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/go_home_button.png"/>
+ </imageobject>
+ </inlinemediaobject> ) or selecting <emphasis>
+ <property>Go Home</property></emphasis> in the context menu returns the tree to the top-level structure shown in the previous picture above.
+ </para>
+
+ <para>There are a number of operations that can be performed on Guvnor repository files. Selecting a file in
+the Guvnor repository causes the Eclipse <property>Properties view</property> to update with details about that file:
+</para>
+
+ <figure>
+ <title>Guvnor Repository Files Properties</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/repository_files_properties.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para></para>
+ </section>
+
+ <section id="local_copies">
+ <title>Local Copies of Guvnor Files</title>
+
+ <para>As mentioned in the <link linkend="introduction">"Introduction"</link>, the main purpose
+ of the <property>EGT</property> is to allow development using resources held in a Guvnor
+ repository. There are two method of getting local copies of Guvnor repository
+ resources:</para>
+
+ <orderedlist>
+ <listitem>
+ <para>Drag-and-drop from the <property>Guvnor Repositories view</property></para>
+ </listitem>
+ <listitem>
+ <para>Using the <link linkend="resources_from_guvnor">Import from Guvnor
+ wizard</link>, as described further in this document</para>
+ </listitem>
+ </orderedlist>
+
+ <para>When local copies of Guvnor repository files are created, the <property>EGT</property>
+ sets an association between the local copy and the master file in the repository. This
+ information is kept in the (normally) hidden <emphasis>
+ <property>.guvnorinfo</property>
+ </emphasis> folder in the local project and, like all metadata, should not be changed by
+ end users.</para>
+
+ <figure>
+ <title>.guvnorinfo metadata</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/guvnorinfo.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The association allows for operations such as update and commit in
+ synchronization with the master copy held in the Guvnor repository.</para>
+
+ <para>The <property>EGT</property> decorates local resources associated with Guvnor
+ repository master copies. This decoration appears in Eclipse views conforming to the
+ Eclipse Common Navigator framework, such as the Eclipse <property>Resource
+ Navigator</property> and the Java <property>Package Explorer</property>. On the image
+ above you can see the <emphasis>
+ <property>Dummy rule.drl</property></emphasis> file with the decoration in the <property>Resource Navigator</property>. The Guvnor icon decorator is on the top right of the file image, and the Guvnor
+ revision details are appended to the file name. (The presence/location of these can be
+ changed the <link linkend="resource_decoration_preferences">Guvnor
+ Preferences</link>.)</para>
+
+ <para>Here we see that, <emphasis><property>Dummy role.drl</property></emphasis> is associated with a Guvnor repository
+ resource and the local copy is based on revision 0, with a <code>02-10-2008, 4:21:53</code> date/time
+ stamp. The file <emphasis><property>Sample.drl</property>,</emphasis> however, is not associated with a Guvnor repository
+ file. Further details about the association can be found in the standard Eclipse
+ properties page, accessed via the <emphasis><property>Properties</property></emphasis> option in the context menu:</para>
+
+ <figure>
+ <title>Association Details</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/association_details.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The <property>EGT</property> contributes a property page to the standard Eclipse
+ properties dialog, the contents of which are shown above. It displays the specific Guvnor
+ repository, the location within the repository, the version (date/time stamp) and
+ the revision number.</para>
+ </section>
+
+ <section id="actions">
+ <title>Actions for Local Guvnor Resources</title>
+
+ <para>The <property>EGT</property> provides a number of actions (available through the
+ <emphasis><property>Guvnor</property></emphasis> context menu on files) for working with files, both those associated with
+ Guvnor repository master copies and those not associated. The actions are:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <link linkend="update_action">Update</link>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <link linkend="add_action">Add</link>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <link linkend="commit_action">Commit</link>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <link linkend="show_history_action">Show History</link>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <link linkend="compare_with_version">Compare with Version</link>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <link linkend="switch_to_version">Switch to Version</link>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <link linkend="delete_action">Delete</link>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <link linkend="disconnect_action">Disconnect</link>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Each of these actions is described below.</para>
+
+ <section id="update_action">
+ <title>Update Action</title>
+
+ <para>The <emphasis>
+ <property>Update</property>
+ </emphasis> action is available for one or more Guvnor resources that are not in
+ synchronization with the Guvnor repository master copies. These resources would not
+ be in synchronization because either/both</para>
+
+ <orderedlist>
+ <listitem><para>There are local changes to these
+ resources</para></listitem>
+ <listitem><para>The master copies have been changed in the Guvnor repository</para></listitem>
+ </orderedlist>
+
+ <para>Performing the <emphasis>
+ <property>Update</property>
+ </emphasis> action replaces the local file contents with the current contents from
+ the Guvnor repository master copies (equivalent to <emphasis>
+ <link linkend="switch_to_version">Switch to version</link>
+ </emphasis> for the latest version).</para>
+ </section>
+
+ <section id="add_action">
+ <title>Add Action</title>
+
+ <para>The <emphasis>
+ <property>Add</property>
+ </emphasis> action is available for one or more local files that are not associated
+ with a Guvnor repository master copy. Choosing the <emphasis>
+ <property>Add</property>
+ </emphasis> action launches the <property>Add to Guvnor wizard</property>:</para>
+
+ <figure>
+ <title>Add to Guvnor Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/add_toGuvnor_wizard.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The first page of the wizard asks for the selection of the target Guvnor
+ repository and gives the choice to create a new Guvnor repository connection (in
+ which case the second page is the same as the <link linkend="guvnor_connection_wizard"
+ >Guvnor Connection wizard</link>). Once the target Guvnor repository is chosen,
+ the wizard then asks for the folder location to add the selection files:</para>
+
+ <figure>
+ <title>Selecting a Target Folder</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/select_target_folder.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Here the <emphasis>
+ <property>"defaultPackage"</property></emphasis> folder is selected as the destination
+ location.</para>
+
+ <note>
+ <title>Note:</title>
+ <para>Note that the <emphasis>
+ <property>"snapshot"</property></emphasis> folder in the Guvnor repository is read-only for
+ <property>EGT</property>, and hence not visible as a candidate location in
+ this wizard. The Guvnor repository web administration tools must be used to add
+ snapshot content.</para>
+ </note>
+
+ <para>Clicking on <emphasis>
+ <property>Finish</property>
+ </emphasis> adds the selected files to the Guvnor repository and creates an
+ association between the local and Guvnor repository files.</para>
+
+ <note>
+ <title>Note:</title>
+ <para>Note that the wizard will not allow for overwrite of existing Guvnor
+ repository files. Another target location must be chosen.</para>
+ </note>
+ </section>
+
+ <section id="commit_action">
+ <title>Commit Action</title>
+
+ <para>The <emphasis>
+ <property>Commit</property>
+ </emphasis> action is enabled for one or more Guvnor repository associated files
+ that have local changes. The <emphasis>
+ <property>Commit</property>
+ </emphasis> action will write the local changes back to the associated Guvnor
+ repository files and update the association for the new revision created.</para>
+
+ <para>If a local change is based on an older revision of a file that is currently in the
+ Guvnor repository (for example, someone else changed the same file), then the <emphasis>
+ <property>Commit</property>
+ </emphasis> action will<figure>
+ <title>Add to Guvnor Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/add_toGuvnor_wizard.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure> ask whether you wish to overwrite the current version in the
+ Guvnor repository with the local content. When such conflicts occur, however, you
+ should use the Eclipse Guvnor version tools, along with Eclipse standard tools, to
+ determine the differences and merge content based on the current version in the
+ Guvnor repository.</para>
+ </section>
+
+ <section id="show_history_action">
+ <title>Show History Action</title>
+
+ <para>The <emphasis>
+ <property>Show History</property>
+ </emphasis> action is enable for one Guvnor repository associated file and causes
+ the <link linkend="guvnor_history_view">Guvnor Resource History view</link> to be
+ populated with revision history for the selected file.</para>
+ </section>
+
+ <section id="compare_with_version">
+ <title>Compare with Version Action</title>
+
+ <para>The <emphasis>
+ <property>Compare with Version</property>
+ </emphasis> action is enabled for one Guvnor repository associated file. This action
+ first opens a wizard asking for the version for comparison (with the local file
+ contents):</para>
+
+ <figure>
+ <title>Compare with Version Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/compare_with_version.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Once the revision is selected, the action opens the Eclipse <property>Compare
+ editor</property> (read-only):</para>
+ <figure>
+ <title>Eclipse Compare Editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/compare_with_version2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>This editor uses Eclipse-standard comparison techniques to show the differences in
+ the two versions. In cases where there are no differences, the editor will not open,
+ rather a dialog saying that there are no differences will appear.</para>
+ <figure>
+ <title>Alert Dialog</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/compare_with_version3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <section id="switch_to_version">
+ <title>Switch to Version Action</title>
+
+ <para>The <emphasis>
+ <property>Switch to Version</property>
+ </emphasis> action is enabled for one Guvnor repository associated file.</para>
+ <para>First the <emphasis>
+ <property>Switch to Version</property>
+ </emphasis> action prompts for selection of version:</para>
+
+ <figure>
+ <title>Select Version Window</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/compare_with_version.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Once the version is selected, the <emphasis>
+ <property>Switch to Version</property>
+ </emphasis> action replaces the local file contents with those from the revision
+ selected.</para>
+ </section>
+
+ <section id="delete_action">
+ <title>Delete Action</title>
+
+ <para>The <emphasis>
+ <property>Delete</property>
+ </emphasis> action is enabled for one or more Guvnor repository associated files.
+ After confirmation via a dialog, the <emphasis>
+ <property>Delete</property>
+ </emphasis> action removes the files in the Guvnor repository and deletes local
+ metadata for the Guvnor repository association.</para>
+
+ <figure>
+ <title>Comfirm Delete Dialog</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/confirm_delete.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <section id="disconnect_action">
+ <title>Disconnect Action</title>
+
+ <para>The <emphasis>
+ <property>Disconnect</property>
+ </emphasis> action is enabled for one or more Guvnor repository associated files,
+ and removes local metadata for the Guvnor repository association.</para>
+ </section>
+ </section>
+
+ <section id="guvnor_history_view">
+ <title>Guvnor Resource History View</title>
+
+ <para>The <property>Guvnor Resource History view</property> should details about revision
+ history for selected files, both local and those in Guvnor repositories. The initial
+ state of this view is shown on the figure below.</para>
+
+ <figure>
+ <title>Initial State of the Guvnor Resource History View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/resource_history_view.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The <property>Guvnor Resource History view</property> is populated by <emphasis>
+ <property>Show History</property>
+ </emphasis> actions in either the local <emphasis>
+ <property>Guvnor</property></emphasis> context menu or in the context menu for
+ a Guvnor repository file in the <link linkend="guvnor_repositories_view">Guvnor
+ Repositories view</link>. Once this action is performed, the <property>Guvnor
+ Resource History view</property> updates to show the revision history:</para>
+
+ <figure>
+ <title>IGuvnor Resource History View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/resource_history_view2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Here we see that the file <emphasis>
+ <property>test.txt</property>
+ </emphasis> has three revisions. Double clicking on a revision row (or the context menu <emphasis>
+ <property>Open (Read only)</property>)</emphasis> opens an Eclipse read-only editor
+ with the revision contents.</para>
+
+ <figure>
+ <title>Eclipse Read-only Editor with the Revision Contents</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/resource_history_view3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <note>
+ <title>Note:</title>
+ <para>You can also use the <emphasis>
+ <property>Save As...</property>
+ </emphasis> option when a file is open in a read-only editor to save a local
+ writable copy of the contents. Doing so, however, will not associate the file
+ created with its Guvnor source.</para>
+ </note>
+
+ </section>
+
+ <section id="resources_from_guvnor">
+ <title>Importing Guvnor Repository Resources</title>
+
+ <para>In addition to the single file drag-and-drop from the <property>Guvnor Repositories
+ view</property>, the <property>EGT</property> also includes a wizard for copying one
+ or more files from a Guvnor repository to the local workspace (and setting the
+ association with the Guvnor repository). This wizard is available from the <emphasis>
+ <property>File > Import > Guvnor > Resource from
+ Guvnor</property>
+ </emphasis> and the <emphasis>
+ <property>File > New > Other > Guvnor > Resource from
+ Guvnor</property>
+ </emphasis> menu items.</para>
+ <note>
+ <title>Note:</title>
+
+ <para>Note that the wizard is identical but appears in both locations to accommodate
+ users who tend to view this functionality as being in either category.</para>
+ </note>
+
+ <para>The first page of the wizard asks for the selection of the source Guvnor repository
+ and gives the choice to create a new Guvnor repository connection (in which case the
+ second page is the same as the <link linkend="guvnor_connection_wizard">Guvnor Connection wizard</link>).</para>
+
+ <figure>
+ <title>Resource from Guvnor Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/add_toGuvnor_wizard.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Once the source Guvnor repository is chosen, the wizard prompts for resource selection:</para>
+
+ <figure>
+ <title>Resource Selection</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/resource_from_guvnor.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Finally, the target location in the local workspace should be chosen:</para>
+ <figure>
+ <title>Choosing the Target Location</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/resource_from_guvnor2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>On completion the wizard copies the selected files from the Guvnor repository to the local workspace.
+ If a file with the same name already exists in the destination, the wizard uses the Eclipse standard
+ "prompt for rename" dialog:</para>
+
+ <figure>
+ <title>Prompt for Rename Dialog</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/functionality_overview/resource_from_guvnor3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+</chapter>
Added: trunk/drools/docs/guvnor_ref/en/modules/guvnor_preferences.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/en/modules/guvnor_preferences.xml (rev 0)
+++ trunk/drools/docs/guvnor_ref/en/modules/guvnor_preferences.xml 2009-05-12 12:50:47 UTC (rev 15227)
@@ -0,0 +1,90 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter id="guvnor_preferences" xreflabel="guvnor_preferences">
+ <?dbhtml filename="guvnor_preferences.html"?>
+ <chapterinfo>
+ <keywordset>
+ <keyword>JBoss Tools</keyword>
+ <keyword>Eclipse Guvnor Tools</keyword>
+ </keywordset>
+ </chapterinfo>
+
+ <title>Guvnor Preferences</title>
+
+ <para>The <property>EGT</property> provides a preference page in the <emphasis>
+ <property>Guvnor</property>
+ </emphasis> category:</para>
+
+ <figure>
+ <title>Resource Selection</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/guvnor_preferences/guvnor_preferences.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>The preferences cover two categories:</para>
+ <itemizedlist>
+ <listitem><para>Guvnor repository connections</para></listitem>
+
+ <listitem><para>Local Guvnor
+ repository resource decorations.</para></listitem>
+ </itemizedlist>
+
+ <section id="repo_connection_preferences">
+ <title>Guvnor Repository Connection Preferences</title>
+ <para>There are two preferences that can be set for Guvnor repository connections, that are
+ used when creating new connections:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>The first is a default Guvnor repository URL template, which can make it
+ easier to create multiple similar connections by simply changing part of the
+ field, such as the host name.</para>
+ </listitem>
+ <listitem>
+ <para>The second is whether saving of authentication information in the Eclipse
+ platform key-ring should be enabled by default.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>As with the Guvnor repository URL template, actually whether to save a specific
+ instance of authentication information in the Eclipse platform key-ring can be
+ determined when actually creating the connection. That is, both of these preferences are
+ simply convenience values set to reasonable defaults.</para>
+ </section>
+
+ <section id="resource_decoration_preferences">
+ <title>Local Guvnor Repository Resource Decoration Preferences</title>
+
+ <para>The second category of preferences provided by the <property>EGT</property> deals with how the decoration of
+ local resources associated with Guvnor repository resources is presented. Since the
+ Guvnor repository is not a substitute for a SCM, and since SCM tools in Eclipse tend to
+ decorate local resources, it is useful to be able to control just how the <property>EGT</property> decorate
+ its local resources to avoid messy conflicts with SCM packages.</para>
+
+ <para>In the <emphasis>
+ <property>File Decoration</property></emphasis>
+ section of the preference page, you can choose the location (Top right, Top left, Bottom right,
+ Bottom left) of the decoration icon, or you can choose not to display it. In
+ the <emphasis>
+ <property>Text</property></emphasis> section, you can format the Guvnor metadata that is appended to the file
+ names:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Whether to show an indicator (>) when the local file has changes not committed back to the
+ Guvnor repository</para>
+ </listitem>
+ <listitem>
+ <para>Whether to show the revision number</para>
+ </listitem>
+ <listitem>
+ <para>Whether to show the date/time stamp</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Any changes to these preferences take effect immediately upon clicking the <emphasis>
+ <property>Apply</property></emphasis> and then <emphasis>
+ <property>Ok</property></emphasis> buttons.</para>
+ </section>
+</chapter>
Added: trunk/drools/docs/guvnor_ref/en/modules/introduction.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/en/modules/introduction.xml (rev 0)
+++ trunk/drools/docs/guvnor_ref/en/modules/introduction.xml 2009-05-12 12:50:47 UTC (rev 15227)
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<chapter id="introduction" xreflabel="introduction">
+ <title>Introduction</title>
+
+ <para>The purpose of this document is to describe briefly the functionality present in the
+ <property>Eclipse Guvnor Tools</property> (EGT) for Drools 5. While not intended as a
+ comprehensive reference, there should be enough detail included for early adopters using
+ these tools.</para>
+
+ <para>The <property>Guvnor repository</property> is not intended as a Source Code Management
+ (SCM) solution, and the <property>EGT</property> are not intended to be Eclipse “team
+ provider” extensions or replacements. Rather, the Guvnor repository is a location where
+ certain artifacts (such as rules and SOA policy definitions) are controlled (“governed”) by
+ policies defined by the deployment environment. The purpose of the <property>EGT</property>
+ is then to enable access to resources held by the Guvnor repository, so
+ they can be used in development. Thus, limited capabilities for reading, writing, adding,
+ and removing Guvnor repository resources are provided in the
+ <property>EGT</property>.</para>
+
+ <section id="drools_key_features">
+ <title>Guvnor Tools Key Features</title>
+
+ <para>The following table lists all valuable features of the <property>Guvnor
+ Tools</property>.</para>
+ <table>
+ <title>Key Functionality of Guvnor Tools</title>
+ <tgroup cols="3">
+
+ <colspec colnum="1" align="left" colwidth="1*"/>
+ <colspec colnum="2" colwidth="5*"/>
+ <colspec colnum="3" align="left" colwidth="1*"/>
+
+ <thead>
+ <row>
+ <entry>Feature</entry>
+ <entry>Benefit</entry>
+ <entry>Chapter</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>
+ <para>Guvnor Repositories View</para>
+ </entry>
+ <entry>
+ <para>The purpose of the view is to enable access to Guvnor repository
+ resources in a standard tree format</para>
+ </entry>
+ <entry>
+ <link linkend="guvnor_repositories_view">Guvnor Repositories View</link>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>Guvnor Connection Wizard</para>
+ </entry>
+ <entry>
+ <para>The wizard helps to create a connection to a Guvnor
+ repository.</para>
+ </entry>
+ <entry>
+ <link linkend="connection_wizard">Guvnor Connection Wizard</link>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>Guvnor Resource History View</para>
+ </entry>
+ <entry>
+ <para>This view shows revisions of specific resources available in the
+ repository.</para>
+ </entry>
+ <entry>
+ <link linkend="guvnor_history_view">Guvnor Resource History View</link>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>Resources from Guvnor Wizard</para>
+ </entry>
+ <entry>
+ <para>The wizard helps to get local copies of Guvnor repository
+ resources.</para>
+ </entry>
+ <entry>
+ <link linkend="resources_from_guvnor">Importing Guvnor Repository
+ Resources</link>
+ </entry>
+ </row>
+
+ <row>
+ <entry>
+ <para>A number of actions for working with files</para>
+ </entry>
+ <entry>
+ <para>The Guvnor actions (available through the <emphasis>
+ <property>Guvnor</property>
+ </emphasis> context menu on files) are provided for working with
+ files, both those associated with Guvnor repository master copies
+ and those not associated.</para>
+ </entry>
+ <entry>
+ <link linkend="actions">Actions for Local Guvnor Resources</link>
+ </entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section id="how_to_start">
+ <title>How to start with Guvnor Tools</title>
+
+ <para><property>Guvnor Tools</property> is a part of the <property>JBoss Tools</property>
+ project. Thus to get started with <property>Guvnor Tools</property>, you should have the following:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Eclipse 3.4.x with Jboss Tools bundle of Eclipse plugins installed. How to
+ install JBoss Tools onto Eclipse you can find in the <ulink
+ url="&gsglink;#JBossToolsInstall">"JBoss Tools
+ Installation"</ulink> section.</para>
+ </listitem>
+
+ <listitem>
+ <para>JBoss Server 4.2 or higher with Guvnor repository deployed. Thus, you should
+ download <ulink
+ url="http://download.jboss.org/drools/release/5.0.0.25561.CR1/drools-5.0.0.CR1..."
+ >Guvnor CR1</ulink> and extract it to the deploy directory of the
+ server.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Now refer to the <link linkend="functionality_overview">"Functionality
+ Overview"</link> section to find out what you can do with Guvnor and
+ Eclipse synchronisation tool.</para>
+ </section>
+
+ <section>
+ <title>Other relevant resources on the topic</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>Guvnor <ulink url="http://www.jboss.org/community/wiki/Guvnor">wiki page</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para>Drools on <ulink url="http://www.jboss.org/drools/">JBoss.org</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://www.jboss.org/tools/">JBoss Tools Home Page</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">The latest
+ JBossTools/JBDS documentation builds</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="http://docs.jboss.org/tools/">JBossTools/JBDS
+ release documentation</ulink></para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+</chapter>
Added: trunk/drools/docs/guvnor_ref/pom.xml
===================================================================
--- trunk/drools/docs/guvnor_ref/pom.xml (rev 0)
+++ trunk/drools/docs/guvnor_ref/pom.xml 2009-05-12 12:50:47 UTC (rev 15227)
@@ -0,0 +1,107 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>guvnor-tools-ref-guide-${translation}</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jdocbook</packaging>
+ <name>Guvnor_Tools_Reference_Guide</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.0-200803311251UTC-MPJDOCBOOK-8</version>
+
+ <extensions>true</extensions>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${pom.basedir}/en</sourceDirectory>
+ <imageResource>
+ <directory>${pom.basedir}/en</directory>
+ <includes>
+ <include>images/**/*</include>
+ </includes>
+ </imageResource>
+ <cssResource>
+ <directory>${pom.basedir}/${cssdir}</directory>
+ </cssResource>
+
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/pdf.xsl</stylesheetResource>
+ <finalName>${pom.name}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/eclipse.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ </options>
+
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+ <id>repository.jboss.org</id>
+ <url>file://${maven.repository.root}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <properties>
+ <stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/org/css/</cssdir>
+ <translation>en-US</translation>
+ </properties>
+
+</project>
17 years, 2 months
JBoss Tools SVN: r15226 - trunk/jst/plugins/org.jboss.tools.jst.web/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-12 07:35:17 -0400 (Tue, 12 May 2009)
New Revision: 15226
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4303
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-05-12 10:54:15 UTC (rev 15225)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/META-INF/MANIFEST.MF 2009-05-12 11:35:17 UTC (rev 15226)
@@ -66,6 +66,5 @@
org.jboss.tools.jst.web.tld.model,
org.jboss.tools.jst.web.tld.model.handlers,
org.jboss.tools.jst.web.tld.model.helpers,
- org.jboss.tools.jst.web.tomcat,
org.jboss.tools.jst.web.webapp.model,
org.jboss.tools.jst.web.webapp.model.handlers
17 years, 2 months
JBoss Tools SVN: r15225 - in trunk/jst/plugins/org.jboss.tools.jst.web: resources/meta and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-12 06:54:15 -0400 (Tue, 12 May 2009)
New Revision: 15225
Added:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-4303
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/plugin.xml 2009-05-12 10:54:15 UTC (rev 15225)
@@ -191,8 +191,8 @@
class="org.jboss.tools.jst.web.tld.model.handlers.PaletteAdopt"/>
<xclass id="org.jboss.tools.jst.web.tld.model.handlers.ValidateTLDHandler"
class="org.jboss.tools.jst.web.tld.model.handlers.ValidateTLDHandler"/>
- <xclass id="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
- class="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"/>
+ <xclass id="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
+ class="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"/>
<xclass id="org.jboss.tools.jst.web.webapp.model.FileWebApp24Loader"
class="org.jboss.tools.jst.web.webapp.model.FileWebApp24Loader"/>
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/strutswebapp.meta 2009-05-12 10:54:15 UTC (rev 15225)
@@ -334,7 +334,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem HIDE="always"
@@ -490,7 +490,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/resources/meta/webapp24.meta 2009-05-12 10:54:15 UTC (rev 15225)
@@ -349,7 +349,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem HIDE="always"
@@ -523,7 +523,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
@@ -822,7 +822,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem HIDE="always"
@@ -996,7 +996,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
<XActionItem
- HandlerClassName="org.jboss.tools.jst.web.tomcat.ResetFileDateHandler"
+ HandlerClassName="org.jboss.tools.jst.web.model.handlers.ResetFileDateHandler"
ICON="action.save" displayName="Change Timestamp" kind="action" name="ChangeTimeStamp"/>
</XActionItem>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
Added: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/ResetFileDateHandler.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.model.handlers;
+
+import java.util.*;
+import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.filesystems.impl.*;
+import org.jboss.tools.common.meta.action.impl.*;
+
+public class ResetFileDateHandler extends AbstractHandler {
+
+ public boolean isEnabled(XModelObject object) {
+ return (object != null && getParentFolder(object) != null);
+ }
+
+ public void executeHandler(XModelObject object, Properties p) throws XModelException {
+ FolderImpl f = getParentFolder(object);
+ if(f != null) f.changeChildTimeStamp(object);
+ }
+
+ private FolderImpl getParentFolder(XModelObject o) {
+ XModelObject p = o.getParent();
+ if(!(p instanceof FolderImpl)) return null;
+ return (FolderImpl)p;
+ }
+
+}
+
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetFileDateHandler.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import java.util.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.filesystems.impl.*;
-import org.jboss.tools.common.meta.action.impl.*;
-
-public class ResetFileDateHandler extends AbstractHandler {
-
- public boolean isEnabled(XModelObject object) {
- return (object != null && getParentFolder(object) != null);
- }
-
- public void executeHandler(XModelObject object, Properties p) throws XModelException {
- FolderImpl f = getParentFolder(object);
- if(f != null) f.changeChildTimeStamp(object);
- }
-
- private FolderImpl getParentFolder(XModelObject o) {
- XModelObject p = o.getParent();
- if(!(p instanceof FolderImpl)) return null;
- return (FolderImpl)p;
- }
-
-}
-
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/ResetWebAppDateHandler.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.meta.action.impl.handlers.*;
-import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
-
-public class ResetWebAppDateHandler extends DefaultRedirectHandler {
-
- protected XModelObject getTrueSource(XModelObject source) {
- return WebAppHelper.getWebApp(source.getModel());
- }
-
-}
-
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatStateIcon.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.icons.impl.*;
-import org.jboss.tools.jst.web.WebModelPlugin;
-
-public class TomcatStateIcon implements ImageComponent {
-
- public TomcatStateIcon() {}
-
- public int getHash(XModelObject obj) {
- boolean b = false;//TomcatProcess.getInstance().isRunning();
- return (b) ? 72618 : 37156;
- }
-
- public Image getImage(XModelObject obj) {
- try {
- boolean b = false;//TomcatProcess.getInstance().isRunning();
- String s = (b) ? "struts.tomcat.running" : "struts.tomcat.stopped";
- return obj.getModelEntity().getMetaModel().getIconList().getImage(s, "default.unknown");
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- return null;
- }
- }
-
-}
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java 2009-05-12 10:38:43 UTC (rev 15224)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/tomcat/TomcatVMHelper.java 2009-05-12 10:54:15 UTC (rev 15225)
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.tomcat;
-
-import java.io.File;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.launching.*;
-import org.jboss.tools.common.model.XModelException;
-import org.jboss.tools.common.model.options.Preference;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.jst.web.*;
-
-public class TomcatVMHelper {
-
- static String TOOLS_JAR_SUFFIX = File.separator + "lib" + File.separator + "tools.jar";
-
- public static String findToolsJarInVM(String jvmPath) {
- if(jvmPath == null) return null;
- File jvmFile = new File(jvmPath);
- if(!jvmFile.exists()) return null;
- String path = jvmPath + TOOLS_JAR_SUFFIX;
- if(new File(path).exists()) return path;
- path = jvmFile.getParent() + TOOLS_JAR_SUFFIX;
- if(new File(path).exists()) return path;
- return null;
- }
-
- public static String createVM(String path) throws XModelException {
- String jvm = findVM(path);
- if(jvm == null) {
- jvm = new File(path).getName();
- if("jre".equals(jvm)) jvm = new File(path).getParentFile().getName();
- if(JavaRuntime.getDefaultVMInstall().getVMInstallType().findVMInstall(jvm) != null) {
- int i = 0;
- while(JavaRuntime.getDefaultVMInstall().getVMInstallType().findVMInstall(jvm + (++i)) != null);
- jvm = jvm + i;
- }
-
- IVMInstallType type = JavaRuntime.getVMInstallType("org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType");
- IVMInstall vm = type.createVMInstall(jvm);
- vm.setInstallLocation(new File(path));
- vm.setLibraryLocations(type.getDefaultLibraryLocations(new File(path)));
- vm.setName(jvm);
- try {
- JavaRuntime.saveVMConfiguration();
- } catch (CoreException e) {
- WebModelPlugin.getPluginLog().logError(e);
- }
-
- }
- if(!jvm.equals(JavaRuntime.getDefaultVMInstall().getName())) {
- getUseDefaultJVMPreference().setValue("no");
- }
- getJVMNamePreference().setValue(jvm);
- return jvm;
- }
-
- static String findVM(String path) {
- IVMInstallType[] ts = JavaRuntime.getVMInstallTypes();
- for (int i = 0; i < ts.length; i++) {
- IVMInstall[] js = ts[i].getVMInstalls();
- for (int j = 0; j < js.length; j++) {
- File installPath = js[j].getInstallLocation();
- if(installPath!=null && installPath.getAbsolutePath().equalsIgnoreCase(path)) {
- return js[j].getName();
- }
- }
- }
- return null;
- }
-
- public static IVMInstall getJVMInstall(String name) {
- IVMInstallType[] ts = JavaRuntime.getVMInstallTypes();
- for (int i = 0; i < ts.length; i++) {
- IVMInstall[] js = ts[i].getVMInstalls();
- for (int j = 0; j < js.length; j++) {
- if(js[j].getName().equals(name)) {
- return js[j];
- }
- }
- }
- return null;
- }
-
- public static IVMInstall getJVMInstallById(String id) {
- IVMInstallType[] ts = JavaRuntime.getVMInstallTypes();
- for (int i = 0; i < ts.length; i++) {
- IVMInstall[] js = ts[i].getVMInstalls();
- for (int j = 0; j < js.length; j++) {
- if(js[j].getId().equals(id)) {
- return js[j];
- }
- }
- }
- return null;
- }
-
- public static IVMInstall getJVMInstall() {
- if("no".equals(getUseDefaultJVMPreference().getValue())) {
- IVMInstallType[] jvmType = JavaRuntime.getVMInstallTypes();
- String selectedJVMName = getJVMNamePreference().getValue();
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("Finding selected JVM is " + selectedJVMName);
- }
- for (int i = 0; i < jvmType.length; i++) {
- IVMInstall[] jvmInstall = jvmType[i].getVMInstalls();
- for (int j = 0; j < jvmInstall.length; j++) {
-
- if(jvmInstall[j].getName().equals(selectedJVMName)) {
- return jvmInstall[j];
- }
- }
- }
- }
- return JavaRuntime.getDefaultVMInstall();
- }
-
- public static Preference getUseDefaultJVMPreference() {
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("SELECTED_SERVER_USE_DEFAULT_JVM = " + WebPreference.USE_DEFAULT_JVM.getValue());
- }
- return WebPreference.USE_DEFAULT_JVM;
- }
-
- public static Preference getJVMNamePreference() {
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("SELECTED_SERVER_JVM = " + WebPreference.SERVER_JVM.getValue());
- }
- return WebPreference.SERVER_JVM;
- }
-
- public static Preference getWarningPreference() {
- if(ModelPlugin.isDebugEnabled()) {
- WebModelPlugin.getPluginLog().logInfo("SELECTED_SERVER_WARNING = " + WebPreference.SERVER_WARNING.getValue());
- }
- return WebPreference.SERVER_WARNING;
- }
-
-}
17 years, 2 months
JBoss Tools SVN: r15223 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-12 06:37:20 -0400 (Tue, 12 May 2009)
New Revision: 15223
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
Log:
https://jira.jboss.org/jira/browse/JBIDE-4303
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF 2009-05-12 10:30:36 UTC (rev 15222)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/META-INF/MANIFEST.MF 2009-05-12 10:37:20 UTC (rev 15223)
@@ -28,7 +28,6 @@
org.jboss.tools.jst.web.ui.wizards.palette,
org.jboss.tools.jst.web.ui.wizards.process,
org.jboss.tools.jst.web.ui.wizards.project,
- org.jboss.tools.jst.web.ui.wizards.tomcatvm,
org.jboss.tools.vpe
Require-Bundle: org.jboss.tools.common,
org.eclipse.ui.ide,
17 years, 2 months
JBoss Tools SVN: r15222 - in trunk/jst/plugins/org.jboss.tools.jst.web.ui: src/org/jboss/tools/jst/web/ui/wizards/tomcatvm and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-05-12 06:30:36 -0400 (Tue, 12 May 2009)
New Revision: 15222
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizard.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizardView.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4303
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2009-05-12 09:32:44 UTC (rev 15221)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2009-05-12 10:30:36 UTC (rev 15222)
@@ -3,8 +3,6 @@
<plugin>
<extension point="org.jboss.tools.common.model.specialwizard">
- <specialwizard class="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard" id="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard">
- </specialwizard>
<specialwizard class="org.jboss.tools.jst.web.ui.wizards.appregister.AppRegisterWizard" id="org.jboss.tools.jst.web.ui.wizards.appregister.AppRegisterWizard">
</specialwizard>
<specialwizard class="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard" id="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard">
@@ -557,14 +555,10 @@
class="org.jboss.tools.jst.web.ui.wizards.project.AddProjectTemplateVelocityView"/>
<xclass id="org.jboss.tools.jst.web.ui.wizards.project.EditProjectTemplateView"
class="org.jboss.tools.jst.web.ui.wizards.project.EditProjectTemplateView"/>
- <xclass id="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"
- class="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"/>
<xclass id="org.jboss.tools.jst.web.ui.editors.forms.TLDFormLayoutData"
class="org.jboss.tools.jst.web.ui.editors.forms.TLDFormLayoutData"/>
<xclass id="org.jboss.tools.jst.web.ui.editors.webapp.form.WebAppFormLayoutData"
class="org.jboss.tools.jst.web.ui.editors.webapp.form.WebAppFormLayoutData"/>
- <xclass id="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"
- class="org.jboss.tools.jst.web.ui.wizards.tomcatvm.TomcatVMWizard"/>
<xclass id="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard"
class="org.jboss.tools.jst.web.ui.wizards.links.HiddenLinksWizard"/>
</extension>
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizard.java 2009-05-12 09:32:44 UTC (rev 15221)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizard.java 2009-05-12 10:30:36 UTC (rev 15222)
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.ui.wizards.tomcatvm;
-
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizard;
-
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
-
-public class TomcatVMWizard extends AbstractQueryWizard {
- public TomcatVMWizard() {
- setView(new TomcatVMWizardView());
- }
-
- public void setObject(Object object) {
- getView().setModel(PreferenceModelUtilities.getPreferenceModel());
- getView().setObject(object);
- getView().setWindowTitle(WebUIMessages.START_TOMCAT_SERVER);
- getView().setTitle(WebUIMessages.CHECK_JVM);
- }
-}
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizardView.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizardView.java 2009-05-12 09:32:44 UTC (rev 15221)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/tomcatvm/TomcatVMWizardView.java 2009-05-12 10:30:36 UTC (rev 15222)
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jst.web.ui.wizards.tomcatvm;
-
-import java.util.*;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.*;
-import org.jboss.tools.common.model.ui.attribute.XAttributeSupport;
-import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
-import org.jboss.tools.common.meta.action.*;
-import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
-import org.jboss.tools.jst.web.tomcat.TomcatVMHelper;
-
-public class TomcatVMWizardView extends AbstractQueryWizardView {
- XAttributeSupport support = new XAttributeSupport();
- Properties context;
-
- public TomcatVMWizardView() {
- XEntityData data = XEntityDataImpl.create(new String[][]{{"TomcatVMHelper", "yes"}, {"vm", "yes"}, /*{"ignore", "no"}*/}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- data.setValue("vm", TomcatVMHelper.getJVMInstall().getInstallLocation().getAbsolutePath()); //$NON-NLS-1$
-// data.setValue("ignore", "no");
- support.init(PreferenceModelUtilities.getPreferenceModel().getRoot(), data);
- }
-
- public void dispose() {
- super.dispose();
- if (support!=null) support.dispose();
- support = null;
- }
- public Control createControl(Composite parent) {
- Control c = support.createControl(parent);
- support.getPropertyEditorAdapterByName("vm").addValueChangeListener(new InputChangeListener()); //$NON-NLS-1$
- validate();
- return c;
- }
-
- private void validate() {
- String location = getLocation();
- String message = null;
- String errorMessage = null;
- if(location.length() == 0) {
- errorMessage = WebUIMessages.PATH_TO_JVM_IS_EMPTY;
- } else if(!new java.io.File(location).isDirectory()) {
- errorMessage = WebUIMessages.SPECIFIED_FOLDER_DOESNOT_EXIST;
- } else if(!new java.io.File(location + "/bin/java.exe").isFile()) { //$NON-NLS-1$
- errorMessage = WebUIMessages.SPECIFIED_FOLDER_ISNOT_JVMHOME;
- } else if(TomcatVMHelper.findToolsJarInVM(location) == null) {
- message = WebUIMessages.CANNOT_FIND_TOOLSJAR;
- }
- setErrorMessage(errorMessage);
- commandBar.setEnabled(OK, errorMessage == null);
- setMessage(message);
- }
-
- public void setObject(Object object) {
- context = (Properties)object;
- }
-
- class InputChangeListener implements java.beans.PropertyChangeListener {
- public void propertyChange(java.beans.PropertyChangeEvent evt) {
- validate();
- }
- }
-
- public void stopEditing() {
- support.save();
- context.setProperty("vm", getLocation()); //$NON-NLS-1$
- }
-
- private String getLocation() {
- return support.getValues().getProperty("vm"); //$NON-NLS-1$
- }
-
- public Point getPreferredSize() {
- return new Point(500, SWT.DEFAULT);
- }
-
-}
17 years, 2 months
JBoss Tools SVN: r15221 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-05-12 05:32:44 -0400 (Tue, 12 May 2009)
New Revision: 15221
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/UIUtil.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
Log:
JBIDE-3896 - implemented as shown
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/ClientAllRuntimeClasspathProvider.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.launching.JavaRuntime;
@@ -56,28 +57,26 @@
}
IPath loc = runtime.getLocation();
- String config = jbsrt.getJBossConfiguration();
+ IPath configPath = jbsrt.getConfigurationFullPath();
String rtID = runtime.getRuntimeType().getId();
- if(AS_32.equals(rtID)) return get32(loc, config);
- if(AS_40.equals(rtID)) return get40(loc,config);
- if(AS_42.equals(rtID)) return get42(loc,config);
- if(AS_50.equals(rtID)) return get50(loc,config);
- if(EAP_43.equals(rtID)) return getEAP43(loc,config);
+ if(AS_32.equals(rtID)) return get32(loc, configPath);
+ if(AS_40.equals(rtID)) return get40(loc,configPath);
+ if(AS_42.equals(rtID)) return get42(loc,configPath);
+ if(AS_50.equals(rtID)) return get50(loc,configPath);
+ if(EAP_43.equals(rtID)) return getEAP43(loc,configPath);
return null;
}
- protected IClasspathEntry[] get32(IPath location, String config) {
+ protected IClasspathEntry[] get32(IPath location, IPath configPath) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- IPath configPath = location.append(SERVER).append(config);
addEntries(location.append(CLIENT), list);
addEntries(location.append(LIB), list);
addEntries(configPath.append(LIB), list);
return list.toArray(new IClasspathEntry[list.size()]);
}
- protected IClasspathEntry[] get40(IPath location, String config) {
+ protected IClasspathEntry[] get40(IPath location, IPath configPath) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- IPath configPath = location.append(SERVER).append(config);
IPath deployPath = configPath.append(DEPLOY);
addEntries(location.append(CLIENT), list);
addEntries(location.append(LIB), list);
@@ -88,17 +87,16 @@
return list.toArray(new IClasspathEntry[list.size()]);
}
- protected IClasspathEntry[] get42(IPath location, String config) {
- return get40(location, config);
+ protected IClasspathEntry[] get42(IPath location, IPath configPath) {
+ return get40(location, configPath);
}
- protected IClasspathEntry[] getEAP43(IPath location, String config) {
- return get40(location, config);
+ protected IClasspathEntry[] getEAP43(IPath location, IPath configPath) {
+ return get40(location, configPath);
}
- protected IClasspathEntry[] get50(IPath location, String config) {
+ protected IClasspathEntry[] get50(IPath location, IPath configPath) {
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
- IPath configPath = location.append(SERVER).append(config);
IPath deployerPath = configPath.append(DEPLOYERS);
IPath deployPath = configPath.append(DEPLOY);
addEntries(location.append(CLIENT), list);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathModel.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -81,8 +81,7 @@
LocalJBossServerRuntime ajbsr = (LocalJBossServerRuntime)
server2.getRuntime().loadAdapter(LocalJBossServerRuntime.class, null);
if(ajbsr != null ) {
- IPath loc = server2.getRuntime().getLocation();
- IPath configFolder = loc.append(IJBossServerConstants.SERVER).append(ajbsr.getJBossConfiguration());
+ IPath configFolder = ajbsr.getConfigurationFullPath();
ArrayList<XPathCategory> defaults = loadDefaults(server2, configFolder.toOSString());
serverToCategories.put(server2.getId(), defaults);
save(server2);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerRuntime.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -12,6 +12,7 @@
import java.util.HashMap;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.wst.server.core.IRuntime;
@@ -32,9 +33,34 @@
public String getJBossConfiguration();
public void setJBossConfiguration(String config);
+
+ /**
+ * The folder this config is located in, for example:
+ * /home/rob/tmp/default_copy1 would return /home/rob/tmp/
+ * whereas /home/rob/apps/jboss/server/default_copy3 would return server
+ * @return
+ */
public String getConfigLocation();
+
+ /**
+ * The full path of the folder this config is located in, for example:
+ * /home/rob/tmp/default_copy1 would return
+ * /home/rob/tmp/
+ * whereas
+ * /home/rob/apps/jboss/server/default_copy3 would return
+ * /home/rob/apps/jboss/server
+ * @return
+ */
+ public IPath getConfigLocationFullPath();
+
public void setConfigLocation(String configLocation);
+ /**
+ * The full path of the configuration, ex:
+ * /home/rob/tmp/default_copy3 would return /home/rob/tmp/default_copy3
+ * @return
+ */
+ public IPath getConfigurationFullPath();
// for startup
public String getDefaultRunArgs();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -12,6 +12,7 @@
import java.util.HashMap;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
@@ -33,11 +34,6 @@
public class LocalJBossServerRuntime extends RuntimeDelegate implements IJBossServerRuntime {
public void setDefaults(IProgressMonitor monitor) {
- String location = Platform.getOS().equals(Platform.WS_WIN32)
- ? "c:/program files/jboss-" : "/usr/bin/jboss-"; //$NON-NLS-1$ //$NON-NLS-2$
- String version = getRuntime().getRuntimeType().getVersion();
- location += version + ".x"; //$NON-NLS-1$
- getRuntimeWorkingCopy().setLocation(new Path(location));
getRuntimeWorkingCopy().setName(getNextRuntimeName());
setAttribute(IJBossServerRuntime.PROPERTY_CONFIGURATION_NAME, IJBossServerConstants.DEFAULT_CONFIGURATION);
setVM(null);
@@ -150,10 +146,21 @@
}
public String getConfigLocation() {
- return getAttribute(PROPERTY_CONFIG_LOCATION, (String)null);
+ return getAttribute(PROPERTY_CONFIG_LOCATION, IConstants.SERVER);
}
public void setConfigLocation(String configLocation) {
setAttribute(PROPERTY_CONFIG_LOCATION, configLocation);
}
+
+ public IPath getConfigurationFullPath() {
+ return getConfigLocationFullPath().append(getJBossConfiguration());
+ }
+
+ public IPath getConfigLocationFullPath() {
+ String cl = getConfigLocation();
+ if( new Path(cl).isAbsolute())
+ return new Path(cl);
+ return getRuntime().getLocation().append(cl);
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/launch/JBossServerStartupLaunchConfiguration.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -46,6 +46,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
@@ -127,6 +128,15 @@
IJBossRuntimeConstants.STARTUP_ARG_CONFIG_SHORT,
IJBossRuntimeConstants.STARTUP_ARG_CONFIG_LONG, config);
+ try {
+ if( !runtime.getConfigLocation().equals(IConstants.SERVER)) {
+ args = ArgsUtil.setArg(args, null,
+ IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.JBOSS_SERVER_HOME_URL,
+ runtime.getConfigLocationFullPath().toFile().toURL().toString());
+ }
+ } catch( MalformedURLException murle) {}
+
+
vmArgs= ArgsUtil.setArg(vmArgs, null,
IJBossRuntimeConstants.SYSPROP + IJBossRuntimeConstants.ENDORSED_DIRS,
runtime.getRuntime().getLocation().append(
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -27,15 +27,21 @@
/* Standard and re-usable */
public static String browse;
public static String serverName;
-
+ public static String copy;
+ public static String delete;
+ public static String directory;
+
/* Server and Runtime Wizard Fragments */
public static String wf_BaseNameVersionReplacement;
public static String wf_NameLabel;
public static String wf_HomeDirLabel;
public static String wf_JRELabel;
public static String wf_ConfigLabel;
+
public static String JBAS_version;
public static String JBEAP_version;
+ public static String rwf_CopyConfigLabel;
+ public static String rwf_DestinationLabel;
public static String rwf_TitleCreate;
public static String rwf_TitleEdit;
public static String rwf_Explanation;
@@ -50,6 +56,7 @@
public static String swf_AuthorizationDescription;
public static String swf_Explanation;
public static String swf_Explanation2;
+ public static String swf_ConfigurationLocation;
public static String swf_AuthenticationGroup;
public static String swf_Username;
public static String swf_Password;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2009-05-12 09:32:44 UTC (rev 15221)
@@ -1,11 +1,15 @@
browse=Browse...
serverName=Server Name
-
+copy=Copy...
+delete=Delete...
+directory=Directory:
wf_BaseNameVersionReplacement=_VERSION_
wf_NameLabel=Name
wf_HomeDirLabel=Home Directory
wf_JRELabel=JRE
wf_ConfigLabel=Configuration
+rwf_CopyConfigLabel=Copy configuration "{0}" to a new destination from "{1}".
+rwf_DestinationLabel=Destination
rwf_TitleCreate=Create a new JBoss Runtime
rwf_TitleEdit=Edit a JBoss Runtime
rwf_Explanation=A JBoss Server runtime references a JBoss installation directory.\nIt can be used to set up classpaths for projects which depend on this runtime,\nas well as by a "server" which will be able to start and stop instances of JBoss.
@@ -21,6 +25,7 @@
swf_RuntimeInformation=Runtime Information
swf_Explanation=A JBoss Server manages starting and stopping instances of JBoss. \nIt manages command line arguments and keeps track of which modules have been deployed.
swf_Explanation2=If the runtime information below is incorrect, please press back, Installed Runtimes..., \nand then Add to create a new runtime from a different location.
+swf_ConfigurationLocation=Configuration Location
swf_AuthorizationDescription=Set the login and password for your server.\nThis will ensure it starts and stops properly.
swf_AuthenticationGroup=Login Credentials
swf_Username=User Name
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/UIUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/UIUtil.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/UIUtil.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -0,0 +1,39 @@
+package org.jboss.ide.eclipse.as.ui;
+
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.widgets.Control;
+
+public class UIUtil {
+
+ public static FormData createFormData2(Object topStart, int topOffset, Object bottomStart, int bottomOffset,
+ Object leftStart, int leftOffset, Object rightStart, int rightOffset) {
+ FormData data = new FormData();
+
+ if( topStart != null ) {
+ data.top = topStart instanceof Control ? new FormAttachment((Control)topStart, topOffset) :
+ new FormAttachment(((Integer)topStart).intValue(), topOffset);
+ }
+
+ if( bottomStart != null ) {
+ data.bottom = bottomStart instanceof Control ? new FormAttachment((Control)bottomStart, bottomOffset) :
+ new FormAttachment(((Integer)bottomStart).intValue(), bottomOffset);
+ }
+
+ if( leftStart != null ) {
+ data.left = leftStart instanceof Control ? new FormAttachment((Control)leftStart, leftOffset) :
+ new FormAttachment(((Integer)leftStart).intValue(), leftOffset);
+ }
+
+ if( rightStart != null ) {
+ data.right = rightStart instanceof Control ? new FormAttachment((Control)rightStart, rightOffset) :
+ new FormAttachment(((Integer)rightStart).intValue(), rightOffset);
+ }
+ return data;
+ }
+
+ public FormData createFormData(Object topStart, int topOffset, Object bottomStart, int bottomOffset,
+ Object leftStart, int leftOffset, Object rightStart, int rightOffset) {
+ return createFormData2(topStart, topOffset, bottomStart, bottomOffset, leftStart, leftOffset, rightStart, rightOffset);
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossConfigurationTableViewer.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -30,6 +30,7 @@
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
@@ -37,7 +38,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.wst.server.ui.wizard.WizardFragment;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
/**
@@ -46,8 +46,6 @@
public class JBossConfigurationTableViewer extends TableViewer {
// private String jbossHome;
private String selectedConfiguration;
- private WizardFragment fragment;
-
public JBossConfigurationTableViewer(Composite parent) {
super(parent);
init();
@@ -63,9 +61,8 @@
init();
}
- public void setJBossHome(String jbossHome) {
- // this.jbossHome = jbossHome;
- setInput(jbossHome);
+ public void setFolder(String folder) {
+ setInput(folder);
}
public String getSelectedConfiguration() {
@@ -73,20 +70,7 @@
}
public void setConfiguration(String defaultConfiguration) {
- int item = -1;
- TableItem items[] = getTable().getItems();
- for (int i = 0; i < items.length; i++) {
- if (items[i] != null && items[i].getText() != null
- && items[i].getText().equals(defaultConfiguration)) {
- item = i;
- break;
- }
- }
-
- if (item != -1) {
- getTable().setSelection(item);
- }
-
+ setSelection(new StructuredSelection(defaultConfiguration));
selectedConfiguration = defaultConfiguration;
}
@@ -114,10 +98,6 @@
protected void configurationSelected() {
selectedConfiguration = getCurrentlySelectedConfiguration();
-
- if (fragment != null) {
- fragment.updateChildFragments();
- }
}
protected class ConfigurationProvider implements
@@ -132,8 +112,7 @@
public Object[] getElements(Object inputElement) {
ArrayList<String> configList = new ArrayList<String>();
- File serverDirectory = new File(inputElement.toString()
- + File.separator + "server");
+ File serverDirectory = new File(inputElement.toString());
if (serverDirectory.exists()) {
@@ -181,8 +160,4 @@
return (String) element;
}
}
-
- public void setWizardFragment(WizardFragment fragment) {
- this.fragment = fragment;
- }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -25,18 +25,27 @@
import java.util.ArrayList;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.IVMInstallType;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.jface.preference.IPreferenceNode;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
@@ -46,13 +55,18 @@
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
@@ -66,6 +80,8 @@
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.internal.LocalJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.IConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.JBossServerType;
import org.jboss.ide.eclipse.as.core.util.ServerBeanLoader;
@@ -73,6 +89,7 @@
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.UIUtil;
/**
* @author Stryker
@@ -83,22 +100,29 @@
private boolean beenEntered = false;
- private Label nameLabel, homeDirLabel, installedJRELabel, configLabel,
- explanationLabel;
+ private Label nameLabel, homeDirLabel,
+ installedJRELabel, explanationLabel;
private Text nameText, homeDirText;
private Combo jreCombo;
private int jreComboIndex;
private Button homeDirButton, jreButton;
- private Composite nameComposite, homeDirComposite, jreComposite,
- configComposite, cloneComposite;
- private String name, homeDir, config;
+ private Composite nameComposite, homeDirComposite, jreComposite;
+ private String name, homeDir;
+ // Configuration stuff
+ private Composite configComposite;
+ private Group configGroup;
+ private Label configDirLabel;
+ private Text configDirText;
+ private JBossConfigurationTableViewer configurations;
+ private Button configCopy, configBrowse, configDelete;
+ private String configDirTextVal;
+
// jre fields
protected ArrayList<IVMInstall> installedJREs;
protected String[] jreNames;
protected int defaultVMIndex;
private IVMInstall selectedVM;
- private JBossConfigurationTableViewer configurations;
private String originalName;
public Composite createComposite(Composite parent, IWizardHandle handle) {
@@ -113,7 +137,6 @@
createHomeComposite(main);
createJREComposite(main);
createConfigurationComposite(main);
- createCloneComposite(main);
fillWidgets();
// make modifications to parent
@@ -163,14 +186,29 @@
originalName = rt.getRuntime().getName();
nameText.setText(originalName);
name = originalName;
- Preferences prefs = JBossServerUIPlugin.getDefault().getPluginPreferences();
- String value = prefs.getString(IPreferenceKeys.RUNTIME_HOME_PREF_KEY_PREFIX + rt.getRuntime().getRuntimeType().getId());
- homeDir = (value != null && value.length() != 0) ? value : rt.getRuntime().getLocation().toOSString();
+
+ if( rt.getRuntime().getLocation() == null ) {
+ // new runtime creation
+ Preferences prefs = JBossServerUIPlugin.getDefault().getPluginPreferences();
+ String value = prefs.getString(IPreferenceKeys.RUNTIME_HOME_PREF_KEY_PREFIX + rt.getRuntime().getRuntimeType().getId());
+
+ String locationDefault = Platform.getOS().equals(Platform.WS_WIN32)
+ ? "c:/program files/jboss-" : "/usr/bin/jboss-"; //$NON-NLS-1$ //$NON-NLS-2$
+ String version = rt.getRuntime().getRuntimeType().getVersion();
+ locationDefault += version + ".x"; //$NON-NLS-1$
+
+ homeDir = (value != null && value.length() != 0) ? value : locationDefault;
+ } else {
+ // old runtime, load from it
+ homeDir = rt.getRuntime().getLocation().toOSString();
+ }
homeDirText.setText(homeDir);
+
((IRuntimeWorkingCopy)rt.getRuntime()).setLocation(new Path(homeDir));
- config = rt.getJBossConfiguration();
- configurations.setConfiguration(config);
- configLabel.setText(Messages.wf_ConfigLabel);
+ String dirText = rt.getConfigLocation();
+ configDirText.setText(dirText == null ? IConstants.SERVER : dirText);
+ configurations.setConfiguration(rt.getJBossConfiguration() == null
+ ? IConstants.DEFAULT_CONFIGURATION : rt.getJBossConfiguration());
if (rt.isUsingDefaultJRE()) {
jreCombo.select(0);
@@ -382,107 +420,167 @@
}
private void createConfigurationComposite(Composite main) {
+ UIUtil u = new UIUtil(); // top bottom left right
configComposite = new Composite(main, SWT.NONE);
-
- FormData cData = new FormData();
- cData.left = new FormAttachment(0, 5);
- cData.right = new FormAttachment(100, -5);
- cData.top = new FormAttachment(jreComposite, 10);
- cData.bottom = new FormAttachment(100, -5);
- configComposite.setLayoutData(cData);
-
+ configComposite.setLayoutData(u.createFormData(
+ jreComposite, 10, 100, -5, 0, 5, 100, -5));
configComposite.setLayout(new FormLayout());
+
+ configGroup = new Group(configComposite, SWT.DEFAULT);
+ configGroup.setText(Messages.wf_ConfigLabel);
+ configGroup.setLayoutData(u.createFormData(
+ 0, 0, 100, 0, 0, 0, 100, 0));
+ configGroup.setLayout(new FormLayout());
+
+ configDirLabel = new Label(configGroup, SWT.NONE);
+ configDirLabel.setText(Messages.directory);
+ configDirText = new Text(configGroup, SWT.BORDER);
- configLabel = new Label(configComposite, SWT.NONE);
- configLabel.setText(Messages.wf_ConfigLabel);
-
- configurations = new JBossConfigurationTableViewer(configComposite,
- SWT.BORDER | SWT.SINGLE);
-
- FormData labelData = new FormData();
- labelData.left = new FormAttachment(0, 5);
- configLabel.setLayoutData(labelData);
-
- FormData viewerData = new FormData();
- viewerData.left = new FormAttachment(0, 5);
- viewerData.right = new FormAttachment(100, -5);
- viewerData.top = new FormAttachment(configLabel, 5);
- viewerData.bottom = new FormAttachment(100, -5);
-
- configurations.getTable().setLayoutData(viewerData);
-
- configurations.getTable().addSelectionListener(new SelectionListener() {
-
- public void widgetDefaultSelected(SelectionEvent e) {
+ configurations = new JBossConfigurationTableViewer(configGroup,
+ SWT.BORDER | SWT.SINGLE);
+
+ configBrowse = new Button(configGroup, SWT.DEFAULT);
+ configCopy = new Button(configGroup, SWT.DEFAULT);
+ configDelete = new Button(configGroup, SWT.DEFAULT);
+ configBrowse.setText(Messages.browse);
+ configCopy.setText(Messages.copy);
+ configDelete.setText(Messages.delete);
+
+ // Organize them
+ configDirLabel.setLayoutData(u.createFormData(
+ 2, 5, null, 0, 0, 5, null, 0));
+ configDirText.setLayoutData(u.createFormData(
+ 0, 5, null, 0, configDirLabel, 5, configBrowse, -5));
+ configBrowse.setLayoutData(u.createFormData(
+ 0, 5, null, 0, configurations.getTable(), 5, 100, -5));
+ configurations.getTable().setLayoutData(u.createFormData(
+ configDirText, 5, 100,-5, 0,5, 80, 0));
+ configCopy.setLayoutData(u.createFormData(
+ configBrowse, 5, null, 0, configurations.getTable(), 5, 100, -5));
+ configDelete.setLayoutData(u.createFormData(
+ configCopy, 5, null, 0, configurations.getTable(), 5, 100, -5));
+
+ configDirText.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
updatePage();
+ }
+ });
+
+ configBrowse.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ configBrowsePressed();
}
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+ configCopy.addSelectionListener(new SelectionListener(){
public void widgetSelected(SelectionEvent e) {
- updatePage();
+ configCopyPressed();
}
-
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
});
-
+ configDelete.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ configDeletePressed();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ configurations.addSelectionChangedListener(new ISelectionChangedListener(){
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateErrorMessage();
+ configDelete.setEnabled(!((IStructuredSelection)configurations.getSelection()).isEmpty());
+ configCopy.setEnabled(!((IStructuredSelection)configurations.getSelection()).isEmpty());
+ }
+ });
}
- private void createCloneComposite(Composite main) {
- IJBossServerRuntime rt = getRuntime();
- if (rt != null) {
+ protected void configBrowsePressed() {
+ String folder = new Path(configDirText.getText()).isAbsolute() ?
+ configDirText.getText() : new Path(homeDir).append(configDirText.getText()).toString();
+ File file = new File(folder);
+ if (!file.exists()) {
+ file = null;
+ }
- cloneComposite = new Composite(main, SWT.NONE);
- FormData cData = new FormData();
- cData.left = new FormAttachment(0, 5);
- cData.right = new FormAttachment(100, -5);
- cData.top = new FormAttachment(configComposite, 5);
- cData.bottom = new FormAttachment(100, -5);
- cloneComposite.setLayoutData(cData);
-
- cloneComposite.setLayout(new FormLayout());
- Button cloneButton = new Button(cloneComposite, SWT.CHECK);
- cloneButton.setSelection(false);
- cloneButton.setText("Clone this configuration");
- cData = new FormData();
- cData.left = new FormAttachment(0, 5);
- cData.right = new FormAttachment(100, -5);
- cData.top = new FormAttachment(0, 5);
- cData.bottom = new FormAttachment(100, -5);
- cloneButton.setLayoutData(cData);
+ File directory = getDirectory(file, homeDirComposite.getShell());
+ if (directory != null) {
+ if(directory.getAbsolutePath().startsWith(new Path(homeDir).toString())) {
+ String result = directory.getAbsolutePath().substring(homeDir.length());
+ configDirText.setText(new Path(result).makeRelative().toString());
+ } else {
+ configDirText.setText(directory.getAbsolutePath());
+ }
+ }
+ }
+ protected void configCopyPressed() {
+ CopyConfigurationDialog d = new CopyConfigurationDialog(configCopy.getShell(), homeDir, configDirText.getText(), configurations.getCurrentlySelectedConfiguration());
+ if(d.open() == 0 ) {
+ IPath source = new Path(configDirText.getText());
+ if( !source.isAbsolute())
+ source = new Path(homeDir).append(source);
+ source = source.append(configurations.getCurrentlySelectedConfiguration());
- Button intoConfigButton = new Button(cloneComposite, SWT.RADIO);
- Button intoLocationButton = new Button(cloneComposite, SWT.RADIO);
- Text newConfigName = new Text(cloneComposite, SWT.DEFAULT);
- Text newLocation = new Text(cloneComposite, SWT.DEFAULT);
-
-
- intoConfigButton.setText("new configuration name");
- intoLocationButton.setText("arbitrary location");
-
-
-
-
- } else {
- // TODO Display something useful in edit-runtime wizard
+ IPath dest = new Path(d.getNewDest());
+ if( !dest.isAbsolute())
+ dest = new Path(homeDir).append(dest);
+ dest = dest.append(d.getNewConfig());
+ dest.toFile().mkdirs();
+ org.jboss.tools.jmx.core.util.FileUtil.copyDir(source.toFile(), dest.toFile());
+ configDirText.setText(d.getNewDest());
+ configurations.setSelection(new StructuredSelection(d.getNewConfig()));
}
+
}
+ protected void configDeletePressed() {
+ MessageDialog dialog = new MessageDialog(configBrowse.getShell(),
+ "Delete Configuration?", null,
+ "Are you sure you want to delete this folder? This cannot be undone.",
+ MessageDialog.WARNING, new String[] { IDialogConstants.YES_LABEL,
+ IDialogConstants.NO_LABEL }, 0); // yes is the default
+ if(dialog.open() == 0) {
+ String config = configurations.getCurrentlySelectedConfiguration();
+ String configDir = configDirText.getText();
+ File folder;
+ if( !new Path(configDir).isAbsolute())
+ folder = new Path(homeDir).append(configDir).append(config).toFile();
+ else
+ folder = new Path(configDir).append(config).toFile();
+
+ FileUtil.completeDelete(folder);
+ configurations.refresh();
+ updatePage();
+ }
+ }
+ // Launchable only from UI thread
private void updatePage() {
- updateErrorMessage();
+ String folder;
if (!isHomeValid()) {
configurations.getControl().setEnabled(false);
- configurations.setJBossHome(homeDirText.getText());
+ folder = homeDirText.getText();
} else {
- configurations.getControl().setEnabled(true);
- if( !homeDirText.getText().equals(configurations.getInput())) {
- configurations.setJBossHome(homeDirText.getText());
- configurations.setConfiguration(IJBossServerConstants.DEFAULT_CONFIGURATION);
- }
+ IPath p = new Path(configDirText.getText());
+ if( p.isAbsolute())
+ folder = p.toString();
+ else
+ folder = new Path(homeDirText.getText()).append(p).toString();
}
+ configurations.setFolder(folder);
+ File f = new File(folder);
+ configurations.getControl().setEnabled(f.exists() && f.isDirectory());
+ configurations.setConfiguration(IJBossServerConstants.DEFAULT_CONFIGURATION);
int sel = jreCombo.getSelectionIndex();
if (sel > 0)
selectedVM = installedJREs.get(sel-1);
else
selectedVM = null;
+ configDirTextVal = configDirText.getText();
+ updateErrorMessage();
}
private void updateErrorMessage() {
@@ -518,6 +616,9 @@
if (jreComboIndex < 0)
return Messages.rwf_NoVMSelected;
+
+ if( configurations.getSelection().isEmpty())
+ return "User must select a valid configuration";
return null;
}
@@ -554,7 +655,7 @@
}
}
- protected File getDirectory(File startingDirectory, Shell shell) {
+ protected static File getDirectory(File startingDirectory, Shell shell) {
DirectoryDialog fileDialog = new DirectoryDialog(shell, SWT.OPEN);
if (startingDirectory != null) {
fileDialog.setFilterPath(startingDirectory.getPath());
@@ -638,6 +739,7 @@
IJBossServerRuntime.class, new NullProgressMonitor());
srt.setVM(selectedVM);
srt.setJBossConfiguration(configurations.getSelectedConfiguration());
+ srt.setConfigLocation(configDirTextVal);
getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtimeWC);
}
@@ -671,4 +773,156 @@
}
return null;
}
+
+
+ public static class CopyConfigurationDialog extends TitleAreaDialog {
+ private String origHome, origDest, origConfig;
+ private String newDest, newConfig;
+ private Text destText;
+ protected CopyConfigurationDialog(Shell parentShell, String home,
+ String dir, String config) {
+ super(new Shell(parentShell));
+ origHome = home;
+ origDest = dir;
+ origConfig = config;
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite c = (Composite) super.createDialogArea(parent);
+ Composite main = new Composite(c, SWT.NONE);
+ main.setLayoutData(new GridData(GridData.FILL_BOTH));
+ main.setLayout(new FormLayout());
+
+ setCleanMessage();
+
+ Label nameLabel = new Label(main, SWT.NONE);
+ nameLabel.setText(Messages.wf_NameLabel);
+
+ final Text nameText = new Text(main, SWT.BORDER);
+
+ Label destLabel = new Label(main, SWT.NONE);
+ destLabel.setText(Messages.rwf_DestinationLabel);
+
+ destText = new Text(main, SWT.BORDER);
+
+ Button browse = new Button(main, SWT.PUSH);
+ browse.setText(Messages.browse);
+
+ Point nameSize = new GC(nameLabel).textExtent(nameLabel.getText());
+ Point destSize = new GC(destLabel).textExtent(destLabel.getText());
+ Control wider = nameSize.x > destSize.x ? nameLabel : destLabel;
+
+ nameText.setLayoutData(UIUtil.createFormData2(
+ 0,13,null,0,wider,5,100,-5));
+ nameLabel.setLayoutData(UIUtil.createFormData2(
+ 0,15,null,0,0,5,null,0));
+ destText.setLayoutData(UIUtil.createFormData2(
+ nameText,5,null,0,wider,5,browse,-5));
+ destLabel.setLayoutData(UIUtil.createFormData2(
+ nameText,7,null,0,0,5,null,0));
+ browse.setLayoutData(UIUtil.createFormData2(
+ nameText,5,null,0,null,0,100,-5));
+
+ nameText.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ newConfig = nameText.getText();
+ validate();
+ }
+ });
+ destText.addModifyListener(new ModifyListener(){
+ public void modifyText(ModifyEvent e) {
+ newDest = destText.getText();
+ validate();
+ }
+ });
+ browse.addSelectionListener(new SelectionListener(){
+ public void widgetSelected(SelectionEvent e) {
+ IPath p = new Path(newDest);
+ if( !p.isAbsolute())
+ p = new Path(origHome).append(newDest);
+ File file = p.toFile();
+ if (!file.exists()) {
+ file = null;
+ }
+
+ File directory = getDirectory(file, getShell());
+ if (directory != null) {
+ IPath newP = new Path(directory.getAbsolutePath());
+ IPath result;
+ if( newP.toOSString().startsWith(new Path(origHome).toOSString()))
+ result = newP.removeFirstSegments(new Path(origHome).segmentCount());
+ else
+ result = newP;
+ destText.setText(result.toString());
+ }
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+
+
+ destText.setText(origDest);
+ nameText.setText(findNewest(origConfig + "_copy")); // TODO increment
+ return c;
+ }
+
+ public void validate() {
+ boolean valid = false;
+ IPath p = null;
+ if( newDest != null && newConfig != null ) {
+ p = new Path(newDest);
+ if( !p.isAbsolute())
+ p = new Path(origHome).append(newDest);
+ if( !p.append(newConfig).toFile().exists())
+ valid = true;
+
+ }
+ if( !valid ) {
+ if( newDest == null || newConfig == null ) {
+ setMessage("All fields must be completed.", IMessageProvider.ERROR);
+ } else {
+ setMessage("The output folder already exists: " + p.append(newConfig).toString(), IMessageProvider.ERROR);
+ }
+ } else {
+ setCleanMessage();
+ }
+ if( getOKButton() != null )
+ getOKButton().setEnabled(valid);
+ }
+
+ protected void setCleanMessage() {
+ setMessage(NLS.bind(Messages.rwf_CopyConfigLabel, origConfig, origDest));
+ }
+ // Only to be used in initializing dialog
+ protected String findNewest(String suggested) {
+ IPath p = new Path(origDest);
+ if( !p.isAbsolute())
+ p = new Path(origHome).append(origDest);
+ if( p.append(suggested).toFile().exists()) {
+ int i = 1;
+ while(p.append(suggested + i).toFile().exists())
+ i++;
+ return suggested + i;
+ }
+ return suggested;
+ }
+
+ protected Point getInitialSize() {
+ return new Point(500, super.getInitialSize().y);
+ }
+
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ newShell.setText("Copy a Configuration");
+ }
+
+ public String getNewDest() {
+ return newDest;
+ }
+
+ public String getNewConfig() {
+ return newConfig;
+ }
+ }
}
\ No newline at end of file
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-05-12 09:15:47 UTC (rev 15220)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossServerWizardFragment.java 2009-05-12 09:32:44 UTC (rev 15221)
@@ -63,7 +63,7 @@
private Label serverExplanationLabel,
runtimeExplanationLabel;
private Label homeDirLabel, installedJRELabel, configLabel;
- private Label homeValLabel, jreValLabel, configValLabel;
+ private Label homeValLabel, jreValLabel, configValLabel, configLocValLabel;
private Group runtimeGroup;
public Composite createComposite(Composite parent, IWizardHandle handle) {
@@ -151,6 +151,10 @@
d = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
jreValLabel.setLayoutData(d);
+ Label configLocationLabel = new Label(runtimeGroup, SWT.NONE);
+ configLocationLabel.setText(Messages.swf_ConfigurationLocation);
+ configLocValLabel = new Label(runtimeGroup, SWT.NONE);
+
configLabel = new Label(runtimeGroup, SWT.NONE);
configLabel.setText(Messages.wf_ConfigLabel);
configValLabel = new Label(runtimeGroup, SWT.NONE);
@@ -178,6 +182,7 @@
homeValLabel.setText(srt.getRuntime().getLocation().toOSString());
configValLabel.setText(srt.getJBossConfiguration());
jreValLabel.setText(srt.getVM().getInstallLocation().getAbsolutePath() + " (" + srt.getVM().getName() + ")");
+ configLocValLabel.setText(srt.getConfigLocation());
runtimeGroup.layout();
updateErrorMessage();
}
17 years, 2 months
JBoss Tools SVN: r15220 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-12 05:15:47 -0400 (Tue, 12 May 2009)
New Revision: 15220
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java
Log:
JBIDE-4232
change the tooltip of notification image
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12 07:54:28 UTC (rev 15219)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12 09:15:47 UTC (rev 15220)
@@ -119,7 +119,6 @@
}
Thread thread = new Thread() {
public void run() {
- long startTime = System.currentTimeMillis();
synchronized (lock) {
starting = true;
waiting = true;
@@ -171,8 +170,6 @@
} finally {
waiting = false;
starting = false;
- long engTime = System.currentTimeMillis();
- System.out.println(engTime - startTime);
}
}
};
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java 2009-05-12 07:54:28 UTC (rev 15219)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/FieldMarkerComposite.java 2009-05-12 09:15:47 UTC (rev 15220)
@@ -10,12 +10,20 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
+import org.eclipse.jface.window.DefaultToolTip;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.IFormColors;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
/**
@@ -28,15 +36,47 @@
private Image waringImage = null;
-// private Image informationImage = null;
+ // private Image informationImage = null;
private int type = TYPE_NONE;
+ private DefaultToolTip toolTip = null;
+
+
public FieldMarkerComposite(Composite parent, int style) {
super(parent, style);
- errorImage = SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_OVR_ERROR);
- waringImage = SmooksConfigurationActivator.getDefault().getImageRegistry().get(GraphicsConstants.IMAGE_OVR_WARING);
+ errorImage = SmooksConfigurationActivator.getDefault().getImageRegistry()
+ .get(GraphicsConstants.IMAGE_OVR_ERROR);
+ waringImage = SmooksConfigurationActivator.getDefault().getImageRegistry().get(
+ GraphicsConstants.IMAGE_OVR_WARING);
this.addPaintListener(this);
+ toolTip = new DefaultToolTip(this) {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.window.DefaultToolTip#createToolTipContentArea
+ * (org.eclipse.swt.widgets.Event,
+ * org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Composite createToolTipContentArea(Event event, Composite parent) {
+ return super.createToolTipContentArea(event, parent);
+ }
+
+ public Point getLocation(Point tipSize, Event event) {
+ Point point = super.getLocation(tipSize, event);
+ point.y = ((Control) getToolTipArea(null)).toDisplay(0,0).y - 24;
+ point.x = ((Control) getToolTipArea(null)).toDisplay(0,0).x;
+ return point;
+ }
+
+ };
+ ((DefaultToolTip)toolTip).setBackgroundColor(new Color(null,255,255,255));
+ FormColors colors = new FormColors(getDisplay());
+ ((DefaultToolTip)toolTip).setForegroundColor(colors.getColor(IFormColors.TITLE));
+ toolTip.setStyle(SWT.NONE);
}
/*
@@ -49,8 +89,8 @@
this.type = type;
this.redraw();
}
-
- public int getMarkerType(){
+
+ public int getMarkerType() {
return type;
}
@@ -61,10 +101,10 @@
* org.jboss.tools.smooks.configuration.editors.IFieldMarker#setMessage()
*/
public void setMessage(String message) {
- this.setToolTipText(message);
+ toolTip.setText(message);
}
-
- public String getMessage(){
+
+ public String getMessage() {
return getToolTipText();
}
17 years, 2 months
JBoss Tools SVN: r15219 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-12 03:54:28 -0400 (Tue, 12 May 2009)
New Revision: 15219
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
Log:
JBIDE-4232
change the notification image position
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12 07:02:01 UTC (rev 15218)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/validate/SmooksModelValidator.java 2009-05-12 07:54:28 UTC (rev 15219)
@@ -41,6 +41,8 @@
private boolean starting = false;
private boolean waiting = false;
private Object lock = new Object();
+
+ private long watingTime = 300;
private List<ISmooksModelValidateListener> listeners = new ArrayList<ISmooksModelValidateListener>();
@@ -109,64 +111,69 @@
}
public void startValidate(final Collection<?> selectedObjects, final EditingDomain editingDomain) {
+ if (starting) {
+ synchronized (lock) {
+ waiting = true;
+ }
+ return;
+ }
Thread thread = new Thread() {
public void run() {
- if (starting) {
- synchronized (lock) {
- waiting = true;
+ long startTime = System.currentTimeMillis();
+ synchronized (lock) {
+ starting = true;
+ waiting = true;
+ }
+ while (waiting) {
+ try {
+ waiting = false;
+ Thread.sleep(watingTime);
+ Thread.yield();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
}
- return;
- } else {
- synchronized (lock) {
- starting = true;
- waiting = true;
+ }
+ try {
+ for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
+ final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
+ Display.getDefault().syncExec(new Runnable() {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ l.validateStart();
+ }
+
+ });
+
}
- while (waiting) {
- try {
- waiting = false;
- Thread.sleep(700);
- Thread.yield();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- try {
- for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
- final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
- Display.getDefault().syncExec(new Runnable(){
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- public void run() {
- l.validateStart();
- }
-
- });
-
- }
-
- final Diagnostic d = validate(selectedObjects, editingDomain);
+ final Diagnostic d = validate(selectedObjects, editingDomain);
- for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
- final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
- Display.getDefault().syncExec(new Runnable(){
+ for (Iterator<?> iterator = listeners.iterator(); iterator.hasNext();) {
+ final ISmooksModelValidateListener l = (ISmooksModelValidateListener) iterator.next();
+ Display.getDefault().syncExec(new Runnable() {
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- public void run() {
- l.validateEnd(d);
- }
-
- });
- }
- } finally {
- waiting = false;
- starting = false;
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ l.validateEnd(d);
+ }
+
+ });
}
+ } finally {
+ waiting = false;
+ starting = false;
+ long engTime = System.currentTimeMillis();
+ System.out.println(engTime - startTime);
}
-
}
};
thread.setName("Validate Smooks model");
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-12 07:02:01 UTC (rev 15218)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/PropertyUICreator.java 2009-05-12 07:54:28 UTC (rev 15219)
@@ -27,6 +27,7 @@
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
@@ -199,10 +200,30 @@
if (smooksResourceList != null) {
FieldMarkerWrapper wrapper = SmooksUIUtils.createFieldEditorLabel(null,parent, toolkit, propertyDescriptor, model, false);
editPart.setFieldMarker(wrapper.getMarker());
- final Combo combo = new Combo(parent, SWT.BORDER);
+
+ Composite tcom = toolkit.createComposite(parent);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ GridData gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ editPart.setFieldMarker(notificationComposite);
+
+ final Combo combo = new Combo(tcom, SWT.BORDER);
editPart.setContentControl(combo);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
combo.setLayoutData(gd);
+ tcom.setLayoutData(gd);
+
Object editValue = SmooksUIUtils.getEditValue(propertyDescriptor, model);
if (editValue != null) {
combo.setText(editValue.toString());
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-05-12 07:02:01 UTC (rev 15218)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-05-12 07:54:28 UTC (rev 15219)
@@ -152,17 +152,17 @@
displayName = itemPropertyDescriptor.getDisplayName(model);
EAttribute feature = (EAttribute) itemPropertyDescriptor.getFeature(model);
if (feature.isRequired()) {
- displayName = "*" + displayName;
+ displayName = displayName + "*";
}
}
Composite labelComposite = formToolKit.createComposite(parent);
- GridLayout layout = new GridLayout();
- layout.numColumns = 2;
- layout.marginLeft = 0;
- layout.marginRight = 0;
- layout.horizontalSpacing = 0;
- labelComposite.setLayout(layout);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+// GridLayout layout = new GridLayout();
+// layout.numColumns = 2;
+// layout.marginLeft = 0;
+// layout.marginRight = 0;
+// layout.horizontalSpacing = 0;
+ labelComposite.setLayout(new FillLayout());
+// GridData gd = new GridData(GridData.FILL_HORIZONTAL);
Control labelControl = null;
if (!isLink) {
@@ -173,19 +173,19 @@
Hyperlink link = formToolKit.createHyperlink(labelComposite, displayName + " :", SWT.NONE);
labelControl = link;
}
- gd = new GridData();
- labelControl.setLayoutData(gd);
+// gd = new GridData();
+// labelControl.setLayoutData(gd);
- FieldMarkerComposite notificationComposite = new FieldMarkerComposite(labelComposite, SWT.NONE);
- gd = new GridData();
- gd.heightHint = 8;
- gd.widthHint = 8;
- gd.horizontalAlignment = GridData.BEGINNING;
- gd.verticalAlignment = GridData.BEGINNING;
- notificationComposite.setLayoutData(gd);
+// FieldMarkerComposite notificationComposite = new FieldMarkerComposite(labelComposite, SWT.NONE);
+// gd = new GridData();
+// gd.heightHint = 8;
+// gd.widthHint = 8;
+// gd.horizontalAlignment = GridData.BEGINNING;
+// gd.verticalAlignment = GridData.BEGINNING;
+// notificationComposite.setLayoutData(gd);
wrapper.setLabelControl(labelControl);
- wrapper.setMarker(notificationComposite);
+// wrapper.setMarker(notificationComposite);
return wrapper;
}
@@ -429,12 +429,32 @@
if (multiText) {
textType = SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL;
}
- final Text valueText = toolkit.createText(textContainer, "", textType);
+ Composite tcom = toolkit.createComposite(textContainer);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ fieldEditPart.setFieldMarker(notificationComposite);
+
+ final Text valueText = toolkit.createText(tcom, "", textType);
gd = new GridData(GridData.FILL_HORIZONTAL);
if (multiText && height > 0) {
gd.heightHint = height;
}
valueText.setLayoutData(gd);
+
+ tcom.setLayoutData(gd);
+
toolkit.paintBordersFor(textContainer);
if (openFile) {
Button fileBrowseButton = toolkit.createButton(textContainer, "Browse", SWT.NONE);
@@ -619,8 +639,29 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
- final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit,
+
+ Composite tcom = toolkit.createComposite(classTextComposite);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ editpart.setFieldMarker(notificationComposite);
+
+
+ final SearchComposite searchComposite = new SearchComposite(tcom, toolkit,
"Search Class", dialog, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ searchComposite.setLayoutData(gd);
Object editValue = getEditValue(propertyDescriptor, model);
if (editValue != null) {
searchComposite.getText().setText(editValue.toString());
@@ -845,7 +886,25 @@
if (readOnly) {
style = style | SWT.READ_ONLY;
}
- final Combo combo = new Combo(parent, style);
+
+ Composite tcom = formToolkit.createComposite(parent);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ GridData gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ fieldEditPart.setFieldMarker(notificationComposite);
+
+ final Combo combo = new Combo(tcom, style);
combo.add("");
if (items != null) {
for (int i = 0; i < items.length; i++) {
@@ -855,8 +914,10 @@
}
}
}
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ tcom.setLayoutData(gd);
combo.setLayoutData(gd);
+
if (currentSelect != -1) {
combo.select(currentSelect);
}
@@ -933,8 +994,29 @@
fillLayout.marginHeight = 0;
fillLayout.marginWidth = 0;
classTextComposite.setLayout(fillLayout);
- final SearchComposite searchComposite = new SearchComposite(classTextComposite, toolkit, buttonName, dialog,
+
+ Composite tcom = toolkit.createComposite(classTextComposite);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.marginLeft = 0;
+ layout.marginRight = 0;
+ layout.horizontalSpacing = 0;
+ tcom.setLayout(layout);
+
+ FieldMarkerComposite notificationComposite = new FieldMarkerComposite(tcom, SWT.NONE);
+ gd = new GridData();
+ gd.heightHint = 8;
+ gd.widthHint = 8;
+ gd.horizontalAlignment = GridData.BEGINNING;
+ gd.verticalAlignment = GridData.BEGINNING;
+ notificationComposite.setLayoutData(gd);
+ editpart.setFieldMarker(notificationComposite);
+
+ final SearchComposite searchComposite = new SearchComposite(tcom, toolkit, buttonName, dialog,
SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ searchComposite.setLayoutData(gd);
+
Object editValue = getEditValue(propertyDescriptor, model);
if (editValue != null) {
searchComposite.getText().setText(editValue.toString());
@@ -956,6 +1038,8 @@
}
}
});
+
+
toolkit.paintBordersFor(classTextComposite);
editpart.setContentControl(classTextComposite);
return editpart;
17 years, 2 months
JBoss Tools SVN: r15218 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-05-12 03:02:01 -0400 (Tue, 12 May 2009)
New Revision: 15218
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
Log:
JBIDE-4298
change some label text
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.properties 2009-05-12 00:52:12 UTC (rev 15217)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/plugin.properties 2009-05-12 07:02:01 UTC (rev 15218)
@@ -85,13 +85,13 @@
_UI_FeaturesType_type = Features
_UI_HandlersType_type = Handlers
_UI_HandlerType_type = Handler
-_UI_ImportType_type = Import
-_UI_ParamsType_type = Params
+_UI_ImportType_type = Import Smooks Configuration
+_UI_ParamsType_type = Global Parameters
_UI_ParamType_type = Param
_UI_ProfilesType_type = Profiles
_UI_ProfileType_type = Profile
_UI_ReaderType_type = Custome Reader
-_UI_ResourceConfigType_type = Resource Config
+_UI_ResourceConfigType_type = Custom Resource Configuration
_UI_ResourceType_type = Resource
_UI_SetOffType_type = Set Off
_UI_SetOnType_type = Set On
@@ -125,14 +125,14 @@
_UI_DocumentRoot_features_feature = Features
_UI_DocumentRoot_handler_feature = Handler
_UI_DocumentRoot_handlers_feature = Handlers
-_UI_DocumentRoot_import_feature = Import
+_UI_DocumentRoot_import_feature = Import Smooks Configuration
_UI_DocumentRoot_param_feature = Param
-_UI_DocumentRoot_params_feature = Params
+_UI_DocumentRoot_params_feature = Global Parameters
_UI_DocumentRoot_profile_feature = Profile
_UI_DocumentRoot_profiles_feature = Profiles
_UI_DocumentRoot_reader_feature = Reader
_UI_DocumentRoot_resource_feature = Resource
-_UI_DocumentRoot_resourceConfig_feature = Resource Config
+_UI_DocumentRoot_resourceConfig_feature = Custom Resource Configuration
_UI_DocumentRoot_setOff_feature = Set Off
_UI_DocumentRoot_setOn_feature = Set On
_UI_DocumentRoot_smooksResourceList_feature = Smooks Resource List
@@ -153,7 +153,7 @@
_UI_ProfileType_subProfiles_feature = Sub Profiles
_UI_ReaderType_handlers_feature = Handlers
_UI_ReaderType_features_feature = Features
-_UI_ReaderType_params_feature = Params
+_UI_ReaderType_params_feature = Global Parameters
_UI_ReaderType_class_feature = Class
_UI_ResourceConfigType_resource_feature = Resource
_UI_ResourceConfigType_condition_feature = Condition
@@ -165,7 +165,7 @@
_UI_ResourceType_type_feature = Type
_UI_SetOffType_feature_feature = Feature
_UI_SetOnType_feature_feature = Feature
-_UI_SmooksResourceListType_params_feature = Params
+_UI_SmooksResourceListType_params_feature = Global Parameters
_UI_SmooksResourceListType_conditions_feature = Conditions
_UI_SmooksResourceListType_profiles_feature = Profiles
_UI_SmooksResourceListType_abstractReaderGroup_feature = Abstract Reader Group
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-05-12 00:52:12 UTC (rev 15217)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-05-12 07:02:01 UTC (rev 15218)
@@ -55,6 +55,7 @@
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.actions.AddSmooksResourceAction;
import org.jboss.tools.smooks.configuration.actions.ValidateSmooksAction;
+import org.jboss.tools.smooks.model.calc.Counter;
import org.jboss.tools.smooks.model.datasource.DataSourceJndi;
import org.jboss.tools.smooks.model.datasource.Direct;
import org.jboss.tools.smooks.model.dbrouting.Executor;
@@ -647,59 +648,66 @@
}
protected void groupActions(MenuManager manager, Collection<?> createChildActions) {
- MenuManager readers = new MenuManager("Reader");
- manager.add(readers);
+ MenuManager readerMenu = new MenuManager("Reader");
+ manager.add(readerMenu);
- MenuManager templating = new MenuManager("Templating");
- manager.add(templating);
+ MenuManager templatingMenu = new MenuManager("Templating");
+ manager.add(templatingMenu);
- MenuManager jbinding = new MenuManager("Java Binding");
- manager.add(jbinding);
+ MenuManager jbindingMenu = new MenuManager("Java Binding");
+ manager.add(jbindingMenu);
- MenuManager datasources = new MenuManager("Datasources");
- manager.add(datasources);
+ MenuManager datasourcesMenu = new MenuManager("Datasources");
+ manager.add(datasourcesMenu);
- MenuManager scripting = new MenuManager("Scripting");
- manager.add(scripting);
+ MenuManager scriptingMenu = new MenuManager("Scripting");
+ manager.add(scriptingMenu);
- MenuManager fragmentRouting = new MenuManager("Fragment Routing");
- manager.add(fragmentRouting);
+ MenuManager fragmentRoutingMenu = new MenuManager("Fragment Routing");
+ manager.add(fragmentRoutingMenu);
- MenuManager database = new MenuManager("Database");
- manager.add(database);
+ MenuManager databaseMenu = new MenuManager("Database");
+ manager.add(databaseMenu);
+
+ MenuManager calcMenu = new MenuManager("Calc");
+ manager.add(calcMenu);
for (Iterator<?> iterator = createChildActions.iterator(); iterator.hasNext();) {
boolean added = false;
AddSmooksResourceAction action = (AddSmooksResourceAction) iterator.next();
Object descriptor = action.getDescriptor();
-
- if (isReader(descriptor)) {
- readers.add(action);
+ if (isCalcDescriptor(descriptor)) {
+ calcMenu.add(action);
added = true;
}
- if (isTemplate(descriptor)) {
- templating.add(action);
+
+ if (isReaderDescriptor(descriptor)) {
+ readerMenu.add(action);
added = true;
}
- if (isJavaBinding(descriptor)) {
- jbinding.add(action);
+ if (isTemplateDescriptor(descriptor)) {
+ templatingMenu.add(action);
added = true;
}
- if (isDatasources(descriptor)) {
- datasources.add(action);
+ if (isJavaBindingDescriptor(descriptor)) {
+ jbindingMenu.add(action);
added = true;
}
+ if (isDatasourcesDescriptor(descriptor)) {
+ datasourcesMenu.add(action);
+ added = true;
+ }
if(isDatabaseDescriptor(descriptor)){
- database.add(action);
+ databaseMenu.add(action);
added = true;
}
- if (isScripting(descriptor)) {
- scripting.add(action);
+ if (isScriptingDescriptor(descriptor)) {
+ scriptingMenu.add(action);
added = true;
}
- if (isFragmentRouting(descriptor)) {
- fragmentRouting.add(action);
+ if (isFragmentRoutingDescriptor(descriptor)) {
+ fragmentRoutingMenu.add(action);
added = true;
}
if (!added) {
@@ -707,15 +715,21 @@
}
}
- orderReaderAction(readers);
- orderTemplateAction(templating);
- orderJBindingAction(jbinding);
- orderDatasourceAction(datasources);
- orderScriptAction(scripting);
- orderFragmentAction(fragmentRouting);
- orderDatabaseAction(database);
+ orderReaderAction(readerMenu);
+ orderTemplateAction(templatingMenu);
+ orderJBindingAction(jbindingMenu);
+ orderDatasourceAction(datasourcesMenu);
+ orderScriptAction(scriptingMenu);
+ orderFragmentAction(fragmentRoutingMenu);
+ orderDatabaseAction(databaseMenu);
+ orderCalcAction(calcMenu);
}
+ protected void orderCalcAction(MenuManager database) {
+ // TODO Auto-generated method stub
+
+ }
+
protected void orderDatabaseAction(MenuManager database) {
// TODO Auto-generated method stub
@@ -771,6 +785,18 @@
}
}
}
+
+ protected boolean isCalcDescriptor(Object descriptor) {
+ if (descriptor instanceof CommandParameter) {
+ CommandParameter parameter = (CommandParameter) descriptor;
+ if (parameter.getValue() != null) {
+ if (AdapterFactoryEditingDomain.unwrap(parameter.getValue()) instanceof Counter) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
private boolean isDatabaseDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
@@ -784,7 +810,7 @@
return false;
}
- private boolean isFragmentRouting(Object descriptor) {
+ private boolean isFragmentRoutingDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -802,7 +828,7 @@
return false;
}
- private boolean isScripting(Object descriptor) {
+ private boolean isScriptingDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -814,7 +840,7 @@
return false;
}
- private boolean isDatasources(Object descriptor) {
+ private boolean isDatasourcesDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -829,7 +855,7 @@
return false;
}
- private boolean isJavaBinding(Object descriptor) {
+ private boolean isJavaBindingDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -841,7 +867,7 @@
return false;
}
- private boolean isTemplate(Object descriptor) {
+ private boolean isTemplateDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
@@ -856,7 +882,7 @@
return false;
}
- private boolean isReader(Object descriptor) {
+ private boolean isReaderDescriptor(Object descriptor) {
if (descriptor instanceof CommandParameter) {
CommandParameter parameter = (CommandParameter) descriptor;
if (parameter.getValue() != null) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-12 00:52:12 UTC (rev 15217)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksStuffPropertyDetailPage.java 2009-05-12 07:02:01 UTC (rev 15218)
@@ -24,6 +24,7 @@
import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor.PropertyValueWrapper;
@@ -90,7 +91,7 @@
public void createContents(Composite parent) {
parent.setLayout(new FillLayout());
- section = formToolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
+ section = formToolkit.createSection(parent, Section.TITLE_BAR);
Composite client = formToolkit.createComposite(section);
section.setLayout(new FillLayout());
@@ -187,7 +188,7 @@
if (marker.getMarkerType() != IFieldMarker.TYPE_ERROR)
marker.setMarkerType(IFieldMarker.TYPE_ERROR);
}
-
+
if (diagnostic.getSeverity() == Diagnostic.WARNING) {
if (marker.getMarkerType() != IFieldMarker.TYPE_WARINING)
marker.setMarkerType(IFieldMarker.TYPE_WARINING);
@@ -436,7 +437,12 @@
protected void refreshWhenSelectionChanged() {
Object model = getModel();
if (model instanceof EObject) {
- String text = ((EObject) model).eClass().getName();
+ IItemLabelProvider labelProvider = (IItemLabelProvider) this.editingDomain.getAdapterFactory().adapt(model,
+ IItemLabelProvider.class);
+ String text = labelProvider.getText(model);
+ if (text == null || text.length() == 0) {
+ text = ((EObject) model).eClass().getName();
+ }
section.setText(text);
section.setDescription("Details of " + text + ". Required fields are denoted by \"*\".");
section.layout();
17 years, 2 months
JBoss Tools SVN: r15217 - in trunk: jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist and 41 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-05-11 20:52:12 -0400 (Mon, 11 May 2009)
New Revision: 15217
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.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.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/FormatJSPActionDelegate.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/JSPFormatter.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesCompoundEditor.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesGuiEditor.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesElement.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java
trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesRecognizer.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/CustomCheckboxTreeAndListGroup.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizard.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebWarWizard.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/AdoptWebProjectContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/LayuotConstants.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderMoveChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/PagesCompoundCommand.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java
Log:
fix PMD violations after local build is finally up on Eclipse 3.5M7
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JSPBundleHyperlinkPartitioner.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -215,9 +215,6 @@
} catch (BadLocationException x) {
JSFExtensionsPlugin.log("", x);
return false;
- } catch (Exception x) {
- JSFExtensionsPlugin.log("", x);
- return false;
} finally {
smw.dispose();
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/ExtendedJSPContentAssistProcessor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -99,34 +99,30 @@
updateActiveContentAssistProcessor(document);
ICompletionProposal[] proposals = super.computeCompletionProposals(viewer, documentPosition);
// If proposal list from super is empty to try to get it from Red Hat dinamic jsp content assist processor.
- try {
- if(proposals.length == 0) {
- String partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition);
- IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(partitionType);
- if (!(p instanceof CSSContentAssistProcessor)) {
+ if(proposals.length == 0) {
+ String partitionType = getPartitionType((StructuredTextViewer) viewer, documentPosition);
+ IContentAssistProcessor p = (IContentAssistProcessor) fPartitionToProcessorMap.get(partitionType);
+ if (!(p instanceof CSSContentAssistProcessor)) {
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, documentPosition);
- Node node = (Node) treeNode;
-
- while (node != null && node.getNodeType() == Node.TEXT_NODE && node.getParentNode() != null)
- node = node.getParentNode();
- IDOMNode xmlnode = (IDOMNode) node;
- if(xmlnode!=null) {
- fTextViewer = viewer;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- ITextRegion completionRegion = getCompletionRegion(documentPosition, node);
- if(completionRegion!=null) {
- String matchString = getMatchString(sdRegion, completionRegion, documentPosition);
- ContentAssistRequest contentAssistRequest = computeCompletionProposals(documentPosition, matchString, completionRegion, (IDOMNode) treeNode, xmlnode);
- if(contentAssistRequest!=null) {
- proposals = contentAssistRequest.getCompletionProposals();
- }
+ IndexedRegion treeNode = ContentAssistUtils.getNodeAt((StructuredTextViewer) viewer, documentPosition);
+ Node node = (Node) treeNode;
+
+ while (node != null && node.getNodeType() == Node.TEXT_NODE && node.getParentNode() != null)
+ node = node.getParentNode();
+ IDOMNode xmlnode = (IDOMNode) node;
+ if(xmlnode!=null) {
+ fTextViewer = viewer;
+ IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
+ ITextRegion completionRegion = getCompletionRegion(documentPosition, node);
+ if(completionRegion!=null) {
+ String matchString = getMatchString(sdRegion, completionRegion, documentPosition);
+ ContentAssistRequest contentAssistRequest = computeCompletionProposals(documentPosition, matchString, completionRegion, (IDOMNode) treeNode, xmlnode);
+ if(contentAssistRequest!=null) {
+ proposals = contentAssistRequest.getCompletionProposals();
}
}
}
}
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(e);
}
proposals = getUniqProposals(proposals);
return proposals;
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-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -1115,9 +1115,18 @@
Boolean b = (Boolean) m.invoke(getSelectionProvider(),
new Object[0]);
return b.booleanValue();
- } catch (Exception e) {
+ } catch (NoSuchMethodException e) {
firingSelectionFailedCount++;
JspEditorPlugin.getPluginLog().logError(e);
+ } catch (IllegalArgumentException e) {
+ firingSelectionFailedCount++;
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ firingSelectionFailedCount++;
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (InvocationTargetException e) {
+ firingSelectionFailedCount++;
+ JspEditorPlugin.getPluginLog().logError(e);
}
return false;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPContentOutlineConfiguration.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -66,8 +66,12 @@
Class cls = b.loadClass("org.jboss.tools.vpe.editor.dnd.context.ViewerDropAdapterFactory");
dropAdapterFactory = (IViewerDropAdapterFactory)cls.newInstance();
}
- } catch (Exception e) {
+ } catch (IllegalAccessException e) {
JspEditorPlugin.getPluginLog().logError(e);
+ } catch (ClassNotFoundException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
+ } catch (InstantiationException e) {
+ JspEditorPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -19,22 +19,26 @@
import java.util.Set;
import java.util.Stack;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertySheetEntry;
import org.eclipse.ui.views.properties.IPropertySource;
import org.eclipse.ui.views.properties.IPropertySource2;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.eclipse.wst.sse.core.internal.provisional.*;
+import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
+import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
import org.eclipse.wst.sse.ui.views.properties.IPropertySourceExtension;
-import org.eclipse.wst.xml.core.internal.contentmodel.*;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMDataType;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
+import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
import org.eclipse.wst.xml.core.internal.document.DocumentTypeAdapter;
import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
import org.eclipse.wst.xml.ui.internal.properties.EnumeratedStringPropertyDescriptor;
+import org.jboss.tools.common.kb.AttributeDescriptor;
+import org.jboss.tools.common.kb.TagDescriptor;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
import org.jboss.tools.jst.jsp.editor.IVisualController;
@@ -45,10 +49,6 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.jboss.tools.common.kb.AttributeDescriptor;
-import org.jboss.tools.common.kb.TagDescriptor;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-
/**
* @author Kabanovich
* XMLPropertySourceAdapter extension that overrides
@@ -547,12 +547,8 @@
} else {
if (attr instanceof IDOMNode) {
((IDOMNode) attr).setValueSource(valueString);
- try {
- IVisualController controller = valueHelper.getController();
- if(controller != null) controller.visualRefresh();
- } catch (Exception e) {
- JspEditorPlugin.getPluginLog().logError(e);
- }
+ IVisualController controller = valueHelper.getController();
+ if(controller != null) controller.visualRefresh();
} else {
attr.setValue(valueString);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -256,8 +256,6 @@
}
/// wtpTextJspKbConnector.setTaglibManagerProvider(parentEditor);
}
- } catch(Exception x) {
- JspEditorPlugin.getPluginLog().logError("Error in activating prompting suppport", x);
} finally {
if(model != null) {
model.releaseFromRead();
@@ -277,7 +275,7 @@
try {
pageConnector = (WtpKbConnector)KbConnectorFactory.getIntstance().createConnector(KbConnectorType.JSP_WTP_KB_CONNECTOR, document);
registerTaglibs(pageConnector, document);
- } catch (Exception e) {
+ } catch (KbException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/FormatJSPActionDelegate.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/FormatJSPActionDelegate.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/FormatJSPActionDelegate.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -15,6 +15,7 @@
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
@@ -41,7 +42,7 @@
IDocument document = te.getTextViewer().getDocument();
try {
new JSPFormatter().format(document, textSelection);
- } catch (Exception e) {
+ } catch (BadLocationException e) {
JspEditorPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/JSPFormatter.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/JSPFormatter.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/ui/action/JSPFormatter.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -31,7 +31,7 @@
int start = -1;
int end = -1;
- public void format(IDocument document, TextSelection textSelection) throws Exception {
+ public void format(IDocument document, TextSelection textSelection) throws BadLocationException {
selectionStart = textSelection.getOffset();
selectionEnd = selectionStart + textSelection.getLength();
text = document.get();
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/AdoptWebProjectContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/AdoptWebProjectContext.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/AdoptWebProjectContext.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -111,15 +111,11 @@
String entity = support.getTarget().getModel().getEntityRecognizer().getEntityName("xml", body);
if(entity == null || !entity.startsWith("FileWebApp")) throw new XModelException("File " + location + "is not recognized as web descriptor file.");
XModelObject webxml = null;
- try {
- webxml = support.getTarget().getModel().createModelObject(entity, null);
- webxml.setAttributeValue("name", "web");
- XModelObjectLoaderUtil.setTempBody(webxml, body);
- XModelObjectLoaderUtil.getObjectLoader(webxml).load(webxml);
- webxml.getChildren();
- } catch (Exception e) {
- throw new XModelException("Cannot load web descriptor file " + location + ".");
- }
+ webxml = support.getTarget().getModel().createModelObject(entity, null);
+ webxml.setAttributeValue("name", "web");
+ XModelObjectLoaderUtil.setTempBody(webxml, body);
+ XModelObjectLoaderUtil.getObjectLoader(webxml).load(webxml);
+ webxml.getChildren();
if("yes".equals(webxml.getAttributeValue("isIncorrect")))
throw new XModelException("Web descriptor file " + location + "is corrupted.");
webxmlLocation = location;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/Items.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,9 +10,10 @@
******************************************************************************/
package org.jboss.tools.jst.web.model.helpers.autolayout;
-import java.util.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.jst.web.WebModelPlugin;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.jst.web.model.helpers.WebProcessStructureHelper;
import org.jboss.tools.jst.web.model.process.WebProcessConstants;
@@ -41,11 +42,7 @@
public void setProcess(XModelObject process) {
this.process = process;
- try {
- load();
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- }
+ load();
}
private void load() {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/LayuotConstants.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/LayuotConstants.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/helpers/autolayout/LayuotConstants.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -29,47 +29,39 @@
public int indentY = 16;
public void update() {
- try {
- XModel model = PreferenceModelUtilities.getPreferenceModel();
- XModelObject o = model.getByPath("%Options%/Struts Studio/Editors/Web Flow Diagram");
- String g = o.getAttributeValue("Grid Step");
- int step = Integer.parseInt(g);
- indentX = (step < 24) ? 24 : step;
- indentY = (step < 16) ? 16 : step;
- if(step == 16) {
- deltaX = 208;
- deltaY = 112;
- incX = 16;
- incY = 32;
- indentX = 32;
- } else if(step == 24) {
- deltaX = 240;
- deltaY = 120;
- incX = 24;
- incY = 24;
- } else if(step == 32) {
- deltaX = 256;
- deltaY = 128;
- incX = 32;
- incY = 32;
- } else if(step == 40) {
- deltaX = 240;
- deltaY = 120;
- incX = 40;
- incY = 40;
- } else {
- deltaX = DELTA_X;
- deltaY = DELTA_Y;
- incX = X_INC;
- incY = Y_INC;
- }
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
+ XModel model = PreferenceModelUtilities.getPreferenceModel();
+ XModelObject o = model.getByPath("%Options%/Struts Studio/Editors/Web Flow Diagram");
+ String g = o.getAttributeValue("Grid Step");
+ int step = Integer.parseInt(g);
+ indentX = (step < 24) ? 24 : step;
+ indentY = (step < 16) ? 16 : step;
+ if(step == 16) {
+ deltaX = 208;
+ deltaY = 112;
+ incX = 16;
+ incY = 32;
+ indentX = 32;
+ } else if(step == 24) {
+ deltaX = 240;
+ deltaY = 120;
+ incX = 24;
+ incY = 24;
+ } else if(step == 32) {
+ deltaX = 256;
+ deltaY = 128;
+ incX = 32;
+ incY = 32;
+ } else if(step == 40) {
+ deltaX = 240;
+ deltaY = 120;
+ incX = 40;
+ incY = 40;
+ } else {
deltaX = DELTA_X;
deltaY = DELTA_Y;
incX = X_INC;
incY = Y_INC;
- }
+ }
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -19,6 +19,7 @@
import org.eclipse.wst.server.core.*;
import org.eclipse.wst.server.core.internal.ServerType;
import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -92,22 +93,17 @@
IModule[] add = new IModule[]{m};
IModule[] remove = new IModule[0];
try {
- try {
- server.getRootModules(m, null);
- } catch (CoreException ce) {
- WebModelPlugin.getPluginLog().logError(ce);
- return ce.getStatus().getMessage();
- }
-
- IProgressMonitor monitor = new NullProgressMonitor();
- IServerWorkingCopy copy = server.createWorkingCopy();
- IStatus status = copy.canModifyModules(add, remove, monitor);
- if(status != null && !status.isOK()) return status.getMessage();
- return null;
- } catch (Exception e) {
- WebModelPlugin.getPluginLog().logError(e);
- return WebUIMessages.CANNOT_REGISTER_IN_THIS_SERVER;
+ server.getRootModules(m, null);
+ } catch (CoreException ce) {
+ WebModelPlugin.getPluginLog().logError(ce);
+ return ce.getStatus().getMessage();
}
+
+ IProgressMonitor monitor = new NullProgressMonitor();
+ IServerWorkingCopy copy = server.createWorkingCopy();
+ IStatus status = copy.canModifyModules(add, remove, monitor);
+ if(status != null && !status.isOK()) return status.getMessage();
+ return null;
}
public static void register(IProject project) {
@@ -131,7 +127,7 @@
if(canPublish(server)) {
server.publish(IServer.PUBLISH_INCREMENTAL, monitor);
}
- } catch (Exception e) {
+ } catch (CoreException e) {
WebModelPlugin.getPluginLog().logError(e);
}
}
@@ -167,7 +163,7 @@
if(canPublish(server)) {
server.publish(IServer.PUBLISH_INCREMENTAL, monitor);
}
- } catch (Exception e) {
+ } catch (CoreException e) {
WebModelPlugin.getPluginLog().logError(e);
}
return true;
@@ -238,7 +234,7 @@
} else {
ModelPlugin.getWorkspace().run(new WR(), monitor);
}
- } catch (Exception e) {
+ } catch (CoreException e) {
WebModelPlugin.getPluginLog().logError(e);
}
return Status.OK_STATUS;
@@ -248,7 +244,7 @@
public void run(IProgressMonitor monitor) throws CoreException {
try {
register(p, servers, contextRoot, monitor);
- } catch (Exception e) {
+ } catch (XModelException e) {
WebModelPlugin.getPluginLog().logError(e);
}
}
@@ -256,7 +252,7 @@
}
}
- private static void register(IProject p, IServer[] servers, String contextRoot, IProgressMonitor monitor) throws Exception {
+ private static void register(IProject p, IServer[] servers, String contextRoot, IProgressMonitor monitor) throws XModelException {
if(monitor != null) monitor.beginTask("", 100);
if(monitor != null) monitor.worked(5);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesLoader.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,11 +10,13 @@
******************************************************************************/
package org.jboss.tools.jst.web.tiles.model;
+import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileAuxiliary;
import org.jboss.tools.common.model.filesystems.impl.AbstractXMLFileImpl;
@@ -121,7 +123,7 @@
XModelObjectLoaderUtil.setTempBody(process, sw.toString());
aux.write(object.getParent(), object, process);
return true;
- } catch (Exception exc) {
+ } catch (IOException exc) {
ModelPlugin.getPluginLog().logError(exc);
return false;
}
@@ -133,17 +135,19 @@
if(systemId == null || systemId.length() == 0) systemId = DOC_EXTDTD;
String publicId = DOC_PUBLICID;
Element element = XMLUtil.createDocumentElement(object.getModelEntity().getXMLSubPath(), DOC_QUALIFIEDNAME, publicId, systemId, null);
-
+ String result = null;
try {
util.setup(null, false);
String att = object.getAttributeValue("comment");
if (att.length() > 0) util.saveAttribute(element, "#comment", att);
util.saveChildren(element, object);
- return SimpleWebFileLoader.serialize(element, object);
- } catch (Exception e) {
+ result = SimpleWebFileLoader.serialize(element, object);
+ } catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
- return null;
+ } catch (XModelException e) {
+ ModelPlugin.getPluginLog().logError(e);
}
+ return result;
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesRecognizer.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesRecognizer.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles/src/org/jboss/tools/jst/web/tiles/model/FileTilesRecognizer.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,8 +10,9 @@
******************************************************************************/
package org.jboss.tools.jst.web.tiles.model;
-import org.jboss.tools.common.log.LogHelper;
-import org.jboss.tools.common.model.loaders.*;
+import java.io.IOException;
+
+import org.jboss.tools.common.model.loaders.EntityRecognizer;
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.xml.XMLEntityResolver;
@@ -19,7 +20,7 @@
static {
try {
XMLEntityResolver.registerPublicEntity(TilesConstants.DOC_PUBLICID, FileTilesRecognizer.class, "/meta/tiles_config_1_1.dtd");
- } catch (Exception e) {
+ } catch (IOException e) {
ModelPlugin.getPluginLog().logError(e);
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/TilesUIPlugin.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -34,12 +34,7 @@
}
public Shell getShell() {
- try {
- return TilesUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- } catch(Exception e){
- getPluginLog().logError("Exception:", e);
- return null;
- }
+ return TilesUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
}
public static TilesUIPlugin getDefault() {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesCompoundEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesCompoundEditor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesCompoundEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -13,6 +13,7 @@
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.jboss.tools.common.editor.AbstractSelectionProvider;
@@ -69,7 +70,7 @@
guiEditor.addErrorSelectionListener(createErrorSelectionListener());
selectionProvider.addHost(
"guiEditor", guiEditor.getSelectionProvider()); //$NON-NLS-1$
- } catch (Exception e) {
+ } catch (PartInitException e) {
TilesUIPlugin.getPluginLog().logError(e);
}
}
@@ -81,11 +82,7 @@
public void dispose() {
if(input != null) {
selectionProvider.setHost(null);
- try {
- getSite().setSelectionProvider(null);
- } catch (Exception e) {
- TilesUIPlugin.getPluginLog().logError(e);
- }
+ getSite().setSelectionProvider(null);
}
super.dispose();
if(guiEditor != null) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesGuiEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesGuiEditor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/TilesGuiEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,20 +10,19 @@
******************************************************************************/
package org.jboss.tools.jst.web.tiles.ui.editor;
-import org.jboss.tools.common.editor.AbstractSectionEditor;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.layout.GridData;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IFileEditorInput;
-
-import org.jboss.tools.common.log.LogHelper;
+import org.eclipse.ui.PartInitException;
+import org.jboss.tools.common.editor.AbstractSectionEditor;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
import org.jboss.tools.jst.web.tiles.ui.TilesUIPlugin;
import org.jboss.tools.jst.web.tiles.ui.editor.model.impl.TilesModel;
+import org.xml.sax.SAXException;
public class TilesGuiEditor extends AbstractSectionEditor {
private TilesEditor gui = null;
@@ -77,8 +76,10 @@
wrapper.update();
wrapper.layout();
- } catch (Exception ex) {
+ } catch (SAXException ex) {
TilesUIPlugin.getPluginLog().logError(ex);
+ } catch (PartInitException ex) {
+ TilesUIPlugin.getPluginLog().logError(ex);
}
}
@@ -96,11 +97,7 @@
if(gui != null) {
gui.dispose();
gui = null;
- try {
- control.dispose();
- } catch (Exception e) {
- TilesUIPlugin.getPluginLog().logError(e);
- }
+ control.dispose();
control = null;
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesElement.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesElement.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesElement.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -106,14 +106,8 @@
public void updateModelModifiedProperty(Object oldValue, Object newValue) {
if (getTilesModel() != null) {
- try {
- if (!oldValue.equals(newValue))
- ;
+ if (!oldValue.equals(newValue)) {
getTilesModel().setModified(true);
- } catch (Exception exception) {
- TilesUIPlugin.getPluginLog().logError(exception);
- if (newValue != null)
- getTilesModel().setModified(true);
}
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/editor/model/impl/TilesModel.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,18 +10,24 @@
******************************************************************************/
package org.jboss.tools.jst.web.tiles.ui.editor.model.impl;
-import java.util.*;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
-import org.xml.sax.*;
-
-import java.beans.*;
-
import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Control;
-
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.model.event.*;
+import org.eclipse.swt.widgets.Menu;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.event.XModelTreeEvent;
+import org.jboss.tools.common.model.event.XModelTreeListener;
+import org.jboss.tools.common.model.ui.action.XModelObjectActionList;
+import org.jboss.tools.common.model.ui.util.ModelUtilities;
+import org.jboss.tools.common.model.util.XModelTreeListenerSWTSync;
import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
import org.jboss.tools.jst.web.tiles.TilesPreference;
import org.jboss.tools.jst.web.tiles.model.helpers.TilesStructureHelper;
@@ -34,12 +40,8 @@
import org.jboss.tools.jst.web.tiles.ui.editor.model.ITilesModelListener;
import org.jboss.tools.jst.web.tiles.ui.editor.model.ITilesOptions;
import org.jboss.tools.jst.web.tiles.ui.preferences.TilesEditorTabbedPreferencesPage;
+import org.xml.sax.SAXException;
-import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.ui.action.*;
-import org.jboss.tools.common.model.ui.util.ModelUtilities;
-import org.jboss.tools.common.model.util.XModelTreeListenerSWTSync;
-
public class TilesModel extends TilesElement implements ITilesModel, PropertyChangeListener, XModelTreeListener {
List<IDefinition> visibleDefinitions = new Vector<IDefinition>();
static final int DEFAULT_VERTICAL_SPACING = 20;
@@ -73,7 +75,7 @@
public TilesModel() {
try {
setName(WebUIMessages.STRUTS_MODEL);
- } catch (Exception ex) {
+ } catch (PropertyVetoException ex) {
TilesUIPlugin.getPluginLog().logError(ex);
}
}
@@ -102,7 +104,7 @@
return options;
}
- public TilesModel(Object data) throws SAXException, Exception {
+ public TilesModel(Object data) throws SAXException {
this();
setData(data);
map.setData((XModelObject) data);
@@ -181,7 +183,7 @@
XModelTreeListenerSWTSync listener = null;
- public void setData(Object data) throws Exception {
+ public void setData(Object data) {
source = helper.getProcess((XModelObject) data);
if (source == null) {
return;
@@ -300,7 +302,6 @@
}
public void nodeChanged(XModelTreeEvent event) {
- try {
if (map == null)
return;
fireProcessChanged();
@@ -316,33 +317,26 @@
return;
}
element.nodeChanged(event);
- } catch (Exception x) {
- TilesUIPlugin.getPluginLog().logError("Error in processing model event", x);
- }
}
public void structureChanged(XModelTreeEvent event) {
TilesElement element;
- try {
- Object obj = event.getModelObject().getPath();
- if (obj == null)
- return;
- if (map == null)
- return;
- element = (TilesElement) map.get(obj);
- if (element == null) {
- return;
- }
- if (event.kind() == XModelTreeEvent.STRUCTURE_CHANGED) {
- element.structureChanged(event);
- } else if (event.kind() == XModelTreeEvent.CHILD_ADDED) {
- element.nodeAdded(event);
- } else if (event.kind() == XModelTreeEvent.CHILD_REMOVED) {
- element.nodeRemoved(event);
- }
- } catch (Exception x) {
- TilesUIPlugin.getPluginLog().logError("Error in processing model event", x);
+ Object obj = event.getModelObject().getPath();
+ if (obj == null)
+ return;
+ if (map == null)
+ return;
+ element = (TilesElement) map.get(obj);
+ if (element == null) {
+ return;
}
+ if (event.kind() == XModelTreeEvent.STRUCTURE_CHANGED) {
+ element.structureChanged(event);
+ } else if (event.kind() == XModelTreeEvent.CHILD_ADDED) {
+ element.nodeAdded(event);
+ } else if (event.kind() == XModelTreeEvent.CHILD_REMOVED) {
+ element.nodeRemoved(event);
+ }
}
public void putToMap(Object key, Object value) {
@@ -560,7 +554,7 @@
if (str.indexOf("default") >= 0)return DEFAULT_VERTICAL_SPACING; //$NON-NLS-1$
try {
return Integer.parseInt(str);
- } catch (Exception ex) {
+ } catch (NumberFormatException ex) {
TilesUIPlugin.getPluginLog().logError(ex);
return DEFAULT_VERTICAL_SPACING;
}
@@ -573,7 +567,7 @@
if (str.indexOf("default") >= 0)return DEFAULT_HORIZONTAL_SPACING; //$NON-NLS-1$
try {
return Integer.parseInt(str);
- } catch (Exception ex) {
+ } catch (NumberFormatException ex) {
TilesUIPlugin.getPluginLog().logError(ex);
return DEFAULT_HORIZONTAL_SPACING;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XContentProvider.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -131,18 +131,14 @@
protected XFilteredTree getFilteredTree(Object object) {
XFilteredTree result = null;
if (result == null && object instanceof XModelObject) {
- try {
- XModel model = ((XModelObject)object).getModel();
- String n = getFilteredTreeName(model);
- result = FilteredTreesCache.getInstance().getFilteredTree(n, model);
- if(result == null) return null;
- if(result.getRoot() == null) {
- result = null;
- } else {
- FilteredTreesCache.getInstance().addListener(syncListener, model);
- }
- } catch(Exception ex) {
- WebUiPlugin.getPluginLog().logError(ex);
+ XModel model = ((XModelObject)object).getModel();
+ String n = getFilteredTreeName(model);
+ result = FilteredTreesCache.getInstance().getFilteredTree(n, model);
+ if(result == null) return null;
+ if(result.getRoot() == null) {
+ result = null;
+ } else {
+ FilteredTreesCache.getInstance().addListener(syncListener, model);
}
}
return result;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/CustomCheckboxTreeAndListGroup.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/CustomCheckboxTreeAndListGroup.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/CustomCheckboxTreeAndListGroup.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -38,24 +38,26 @@
}
public void initialCheckListItem(File listElement) {
- setCurrentTreeSelection(listElement.getParentFile());
- try {
- super.listItemChecked(listElement, true, true);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- }
+ super.listItemChecked(listElement, true, true);
setCurrentTreeSelection(null);
}
public CheckboxTreeViewer getTreeViewer() {
+ CheckboxTreeViewer viewer = null;
try {
Field f = cls.getDeclaredField("treeViewer");
f.setAccessible(true);
- return (CheckboxTreeViewer)f.get(this);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- return null;
- }
+ viewer = (CheckboxTreeViewer)f.get(this);
+ } catch (SecurityException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (NoSuchFieldException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (IllegalArgumentException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ }
+ return viewer;
}
public void setExpansions() {
@@ -68,13 +70,19 @@
}
private void setCurrentTreeSelection(Object element) {
- try {
- Field f = cls.getDeclaredField("currentTreeSelection");
+ Field f;
+ try {
+ f = cls.getDeclaredField("currentTreeSelection");
f.setAccessible(true);
f.set(this, element);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- }
+ } catch (SecurityException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (NoSuchFieldException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (IllegalArgumentException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (IllegalAccessException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ }
}
-
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizard.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizard.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jst.web.ui.wizards.project;
+import java.lang.reflect.InvocationTargetException;
import java.util.Properties;
import org.eclipse.core.runtime.CoreException;
@@ -82,7 +83,7 @@
public boolean performFinish() {
if(!checkOldVersion()) return false;
- boolean result = true;
+ boolean result = false;
try {
if(!checkServletVersion()) return false;
context.commitSupportDelta();
@@ -90,9 +91,15 @@
getContainer().run(false, true, op);
updatePerspective();
BasicNewResourceWizard.selectAndReveal(context.getProjectHandle(), ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
- } catch (Exception ex) {
+ result = true;
+ } catch (XModelException ex) {
WebUiPlugin.getPluginLog().logError(ex);
- result = false;
+ } catch (CoreException ex) {
+ WebUiPlugin.getPluginLog().logError(ex);
+ } catch (InvocationTargetException ex) {
+ WebUiPlugin.getPluginLog().logError(ex);
+ } catch (InterruptedException ex) {
+ WebUiPlugin.getPluginLog().logError(ex);
}
return result;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebProjectWizardPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -349,14 +349,7 @@
setErrorMessage(nameStatus.getMessage());
return false;
}
- IProject project = null;
- try {
- project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- } catch (Exception e) {
- WebUiPlugin.getPluginLog().logError(e);
- setErrorMessage(e.getMessage());
- return false;
- }
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if(project != null && project.exists() && !project.isOpen()) {
setErrorMessage(NLS.bind(WebUIMessages.PROJECT_EXISTS_IN_WORKSPACE, getProjectNameValue()) );
@@ -399,13 +392,9 @@
}
private void updateContext(boolean onProjectNameEdit, boolean onProjectLocationEdit) {
- try {
if (getWebXmlFile() != null) updateProjectNameValue(onProjectNameEdit, onProjectLocationEdit);
context.setProjectName(getProjectNameValue());
context.setWebXmlLocation(getWebXmlLocationValue());
- } catch (Exception ex) {
- WebUiPlugin.getPluginLog().logError(ex);
- }
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebWarWizard.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebWarWizard.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/wizards/project/ImportWebWarWizard.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.jst.web.ui.wizards.project;
+import java.lang.reflect.InvocationTargetException;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
@@ -61,7 +63,6 @@
public boolean performFinish() {
boolean result = true;
- try {
mainPage.commit();
context.setServletVersion("2.4");
@@ -70,19 +71,21 @@
}
IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(createOperation());
- getContainer().run(false, true, op);
+ try {
+ getContainer().run(false, true, op);
+ } catch (InvocationTargetException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ } catch (InterruptedException e) {
+ WebUiPlugin.getPluginLog().logError(e);
+ }
updatePerspective();
BasicNewResourceWizard.selectAndReveal(context.getProjectHandle(), ModelUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow());
- } catch (Exception ex) {
- WebUiPlugin.getPluginLog().logError(ex);
- result = false;
- }
return result;
}
protected abstract IRunnableWithProgress createOperation();
- protected void updatePerspective() throws CoreException {
+ protected void updatePerspective() {
BasicNewProjectResourceWizard.updatePerspective(new ConfigurationElementInternal());
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/event/Change.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -83,7 +83,7 @@
* @return
*/
public boolean isChildrenAffected() {
- return children != null && children.size() > 0;
+ return children != null && !children.isEmpty();
}
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -246,7 +246,7 @@
}
public ISeamJavaComponentDeclaration getJavaDeclaration() {
- if(javaDeclarations.size() == 0) return null;
+ if(javaDeclarations.isEmpty()) return null;
return javaDeclarations.iterator().next();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -518,7 +518,7 @@
element.setAttribute(ATTR_CLASS_NAME, className);
}
- if(bijectedAttributes.size() > 0) {
+ if(!bijectedAttributes.isEmpty()) {
Element b = XMLUtilities.createElement(element, "bijected");
for (IBijectedAttribute a: bijectedAttributes) {
SeamObject o = (SeamObject)a;
@@ -526,7 +526,7 @@
}
}
- if(componentMethods.size() > 0) {
+ if(!componentMethods.isEmpty()) {
Element b = XMLUtilities.createElement(element, "methods");
for (ISeamComponentMethod a: componentMethods) {
SeamObject o = (SeamObject)a;
@@ -534,7 +534,7 @@
}
}
- if(roles.size() > 0) {
+ if(!roles.isEmpty()) {
Element b = XMLUtilities.createElement(element, "roles");
for (IRole a: roles) {
SeamObject o = (SeamObject)a;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamMessagesLoader.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -120,7 +120,7 @@
}
}
}
- if(ds.size() == 0) {
+ if(ds.isEmpty()) {
names.add("messages");
}
return getResources(names, srcs);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPackageUtil.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -111,7 +111,7 @@
public static void collectAllPackages(Map<String, ISeamPackage> packages, Collection<ISeamPackage> list) {
for (ISeamPackage p : packages.values()) {
- if(p.getComponents().size() > 0) list.add(p);
+ if(!p.getComponents().isEmpty()) list.add(p);
collectAllPackages(p.getPackages(), list);
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -526,7 +526,7 @@
Element pathElement = XMLUtilities.createElement(sourcePathsElement, "path"); //$NON-NLS-1$
pathElement.setAttribute("value", path.toString()); //$NON-NLS-1$
List<ISeamComponentDeclaration> cs = ds.getComponents();
- if(cs != null && cs.size() > 0) {
+ if(cs != null && !cs.isEmpty()) {
Element cse = XMLUtilities.createElement(pathElement, "components"); //$NON-NLS-1$
for (ISeamComponentDeclaration d: cs) {
SeamObject o = (SeamObject)d;
@@ -534,7 +534,7 @@
}
}
List<ISeamFactory> fs = ds.getFactories();
- if(fs != null && fs.size() > 0) {
+ if(fs != null && !fs.isEmpty()) {
Element cse = XMLUtilities.createElement(pathElement, "factories"); //$NON-NLS-1$
for (ISeamFactory d: fs) {
SeamObject o = (SeamObject)d;
@@ -542,7 +542,7 @@
}
}
List<String> imports = ds.getImports();
- if(imports != null && imports.size() > 0) {
+ if(imports != null && !imports.isEmpty()) {
Element cse = XMLUtilities.createElement(pathElement, "imports"); //$NON-NLS-1$
for (String d: imports) {
Element e = XMLUtilities.createElement(cse, SeamXMLConstants.TAG_IMPORT); //$NON-NLS-1$
@@ -777,7 +777,7 @@
ISeamComponentDeclaration[] components = ds.getComponents().toArray(new ISeamComponentDeclaration[0]);
ISeamFactory[] factories = ds.getFactories().toArray(new ISeamFactory[0]);
- if(ns.length == 0 && components.length == 0 && factories.length == 0 && ds.getImports().size() == 0) {
+ if(ns.length == 0 && components.length == 0 && factories.length == 0 && ds.getImports().isEmpty()) {
pathRemoved(source);
if(EclipseResourceUtil.isJar(source.toString())) {
if(!sourcePaths.contains(source)) sourcePaths.add(source);
@@ -792,7 +792,7 @@
namespaces.addPath(source, ns);
}
- if(ds.getImports().size() > 0) {
+ if(!ds.getImports().isEmpty()) {
setImports(source.toString(), ds.getImports());
} else {
removeImports(source.toString());
@@ -828,7 +828,7 @@
if(isClassNameChanged(currentClassName, loadedClassName)) {
this.components.onClassNameChanged(currentClassName, loadedClassName, current);
}
- if(changes != null && changes.size() > 0) {
+ if(changes != null && !changes.isEmpty()) {
Change cc = new Change(c, null, null, null);
cc.addChildren(changes);
List<Change> cchanges = Change.addChange(null, cc);
@@ -947,7 +947,7 @@
* @throws CloneNotSupportedException
*/
public void registerComponentsInDependentProjects(LoadedDeclarations ds, IPath source) throws CloneNotSupportedException {
- if(usedBy.size() == 0) return;
+ if(usedBy.isEmpty()) return;
if(EclipseResourceUtil.isJar(source.toString())) return;
for (SeamProject p : usedBy) {
@@ -1062,7 +1062,7 @@
}
public void firePathRemovedToDependentProjects(IPath source) {
- if(usedBy.size() == 0) return;
+ if(usedBy.isEmpty()) return;
if(EclipseResourceUtil.isJar(source.toString())) return;
for (SeamProject p : usedBy) {
@@ -1134,7 +1134,7 @@
*
*/
private boolean isComponentEmpty(SeamComponent c) {
- if(c.getAllDeclarations().size() == 0) return true;
+ if(c.getAllDeclarations().isEmpty()) return true;
for (ISeamComponentDeclaration d: c.getAllDeclarations()) {
if(c.getName().equals(d.getName())) return false;
}
@@ -1512,7 +1512,7 @@
* @param changes
*/
void fireChanges(List<Change> changes) {
- if(changes == null || changes.size() == 0) return;
+ if(changes == null || changes.isEmpty()) return;
if(postponedChanges != null) {
postponedChanges.addAll(changes);
return;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamPropertiesDeclaration.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -89,7 +89,7 @@
} else {
String oldName = p1.getName();
List<Change> cc = p1.merge(p2);
- if(cc != null && cc.size() > 0) children.addChildren(cc);
+ if(cc != null && !cc.isEmpty()) children.addChildren(cc);
if(oldName != null && !oldName.equals(p1.getName())) {
properties.remove(oldName);
addProperty(p1);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProperty.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -76,7 +76,7 @@
changes = Change.addChange(changes, new Change(this, SeamXMLConstants.ATTR_VALUE, old, value));
} else {
List<Change> cs = ((SeamObject)value).merge((SeamObject)d.value);
- if(cs != null && cs.size() > 0) {
+ if(cs != null && !cs.isEmpty()) {
Change c = new Change(this, SeamXMLConstants.ATTR_VALUE, value, value);
c.addChildren(cs);
changes = Change.addChange(changes, c);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamValueMapEntry.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -54,14 +54,14 @@
SeamValueMapEntry e = (SeamValueMapEntry)s;
List<Change> keyChanges = key.merge(e.key);
- if(keyChanges != null && keyChanges.size() > 0) {
+ if(keyChanges != null && !keyChanges.isEmpty()) {
Change keyChange = new Change(this, "key", key, key); //$NON-NLS-1$
keyChange.addChildren(keyChanges);
changes = Change.addChange(changes, keyChange);
}
List<Change> valueChanges = value.merge(e.value);
- if(valueChanges != null && valueChanges.size() > 0) {
+ if(valueChanges != null && !valueChanges.isEmpty()) {
Change valueChange = new Change(this, "value", value, value); //$NON-NLS-1$
valueChange.addChildren(valueChanges);
changes = Change.addChange(changes, valueChange);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamXMLHelper.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -210,7 +210,7 @@
}
public static void saveMap(Element parent, Map<String, IValueInfo> map, String child, Properties context) {
- if(map == null || map.size() == 0) return;
+ if(map == null || map.isEmpty()) return;
Element element = XMLUtilities.createElement(parent, child);
for (String name: map.keySet()) {
IValueInfo value = map.get(name);
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -292,7 +292,7 @@
ELParser p = factory.createParser();
ELModel model = p.parse(el);
List<ELInstance> is = model.getInstances();
- if(is.size() == 0) return null;
+ if(is.isEmpty()) return null;
return is.get(0).getExpression();
}
@@ -402,7 +402,7 @@
}
// Save all resolved variables. It's useful for incremental validation.
- if(resolvedVariables != null && resolvedVariables.size() > 0) {
+ if(resolvedVariables != null && !resolvedVariables.isEmpty()) {
status.setUsedVariables(resolvedVariables);
}
@@ -539,7 +539,7 @@
}
}
members = newMembers;
- if (members != null && members.size() > 0)
+ if (members != null && !members.isEmpty())
status.setLastResolvedToken(expr);
}
if (expr.getType() == ELObjectType.EL_METHOD_INVOCATION) {
@@ -562,7 +562,7 @@
}
}
members = newMembers;
- if (members != null && members.size() > 0)
+ if (members != null && !members.isEmpty())
status.setLastResolvedToken(expr);
}
return members;
@@ -834,7 +834,7 @@
if (varName != null) {
resolvedVars = SeamExpressionResolver.resolveVariables(project, scope, varName, onlyEqualNames);
}
- if (resolvedVars != null && resolvedVars.size() > 0) {
+ if (resolvedVars != null && !resolvedVars.isEmpty()) {
List<ISeamContextVariable> newResolvedVars = new ArrayList<ISeamContextVariable>();
for (ISeamContextVariable var : resolvedVars) {
if(!isFinal) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamExpressionResolver.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -347,7 +347,7 @@
if(member == null) {
ELParser p = ELParserUtil.getJbossFactory().createParser();
ELModel m = p.parse(factory.getValue());
- ELInstance i = m.getInstances().size() == 0 ? null : m.getInstances().get(0);
+ ELInstance i = m.getInstances().isEmpty() ? null : m.getInstances().get(0);
ELExpression ex = i == null ? null : i.getExpression();
if(ex instanceof ELInvocationExpression) {
ELInvocationExpression expr = (ELInvocationExpression)ex;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -165,7 +165,7 @@
for (Iterator iterator = applications.iterator(); iterator.hasNext();) {
ApplicationType application = (ApplicationType) iterator.next();
EList localeConfigs = application.getLocaleConfig();
- if(localeConfigs.size()>0) {
+ if(!localeConfigs.isEmpty()) {
localeConfigExists = true;
break;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -833,7 +833,7 @@
}
if(names.contains(defaultDs)) {
model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, defaultDs);
- } else if(names.size()>0) {
+ } else if(!names.isEmpty()) {
model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, names.get(0));
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderMoveChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderMoveChange.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderMoveChange.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -62,7 +62,7 @@
*/
@Override
public boolean isRelevant() {
- return relevantProperties.size()>0;
+ return !relevantProperties.isEmpty();
}
/* (non-Javadoc)
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamFolderRenameChange.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -57,7 +57,7 @@
*/
@Override
public boolean isRelevant() {
- return relevantProperties.size()>0;
+ return !relevantProperties.isEmpty();
}
/* (non-Javadoc)
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameChange.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamJavaPackageRenameChange.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -66,7 +66,7 @@
*/
@Override
public boolean isRelevant() {
- return relevantPropertyIndexes.size()>0;
+ return !relevantPropertyIndexes.isEmpty();
}
/* (non-Javadoc)
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamProjectRenameChange.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -62,7 +62,7 @@
*/
@Override
public boolean isRelevant() {
- return relevantProjectNameProperties.size() > 0 || relevantSourceFolderProperties.size() > 0;
+ return !relevantProjectNameProperties.isEmpty() || !relevantSourceFolderProperties.isEmpty();
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -59,7 +59,7 @@
AnnotatedASTNode<MethodDeclaration> currentAnnotatedMethod = null;
public boolean hasSeamComponentItself() {
- if(annotatedFields.size() > 0 || annotatedMethods.size() > 0) return true;
+ if(!annotatedFields.isEmpty() || !annotatedMethods.isEmpty()) return true;
if(annotatedType != null && annotatedType.getAnnotations() != null) return true;
return false;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -104,7 +104,7 @@
types.put(BeanType.values()[i], v);
}
}
- if(types.size() > 0) {
+ if(!types.isEmpty()) {
component.setTypes(types);
}
}
@@ -171,7 +171,7 @@
for (AnnotatedASTNode<MethodDeclaration> n: annotatedMethods) {
Annotation main = getBijectedType(n, as, types);
- if(as.size() == 0) continue;
+ if(as.isEmpty()) continue;
boolean isDataModelSelectionType = !types.get(0).isUsingMemberName();
MethodDeclaration m = n.getNode();
@@ -213,7 +213,7 @@
for (AnnotatedASTNode<FieldDeclaration> n: annotatedFields) {
Annotation main = getBijectedType(n, as, types);
- if(as.size() == 0) continue;
+ if(as.isEmpty()) continue;
boolean isDataModelSelectionType = !types.get(0).isUsingMemberName();
FieldDeclaration m = n.getNode();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/TypeScanner.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -163,7 +163,7 @@
types.put(t, v);
}
}
- if(types.size() > 0) {
+ if(!types.isEmpty()) {
component.setTypes(types);
}
@@ -239,7 +239,7 @@
types.add(BijectedAttributeType.values()[i]);
}
}
- if(as.size() == 0) return;
+ if(as.isEmpty()) return;
boolean isDataModelSelectionType = !types.get(0).isUsingMemberName();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -351,7 +351,7 @@
private void validateComponent(IPath sourceFilePath, Set<ISeamComponent> checkedComponents, Set<IPath> unnamedResources) {
Set<ISeamComponent> components = seamProject.getComponentsByPath(sourceFilePath);
- if(components.size()==0) {
+ if(components.isEmpty()) {
unnamedResources.add(sourceFilePath);
return;
}
@@ -591,7 +591,7 @@
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
ISeamTextSourceReference classNameLocation = getNameLocation(javaDeclaration);
Set<ISeamComponentMethod> methods = javaDeclaration.getMethodsByType(methodType);
- if(methods==null || methods.size()==0) {
+ if(methods==null || methods.isEmpty()) {
addError(STATEFUL_COMPONENT_DOES_NOT_CONTAIN_METHOD_SUFIX_MESSAGE_ID + postfixMessageId, preferenceKey, new String[]{component.getName()}, classNameLocation, javaDeclaration.getResource());
}
}
@@ -736,7 +736,7 @@
private void validateMethodOfUnknownComponent(SeamComponentMethodType methodType, ISeamJavaComponentDeclaration declaration, String sufixMessageId, String preferenceKey) {
Set<ISeamComponentMethod> methods = declaration.getMethodsByType(methodType);
- if(methods!=null && methods.size()>0) {
+ if(methods!=null && !methods.isEmpty()) {
for (ISeamComponentMethod method : methods) {
IMethod javaMethod = (IMethod)method.getSourceMember();
String methodName = javaMethod.getElementName();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -332,7 +332,7 @@
ELParser parser = ELParserUtil.getJbossFactory().createParser();
ELModel model = parser.parse(string);
List<SyntaxError> errors = model.getSyntaxErrors();
- if(errors.size() > 0) {
+ if(!errors.isEmpty()) {
for (SyntaxError error: errors) {
//TODO 1) make message more informative
// 2) create other preference
@@ -345,7 +345,7 @@
if (reporter.isCancelled()) {
return;
}
- if(i.getErrors().size() > 0) {
+ if(!i.getErrors().isEmpty()) {
//Already reported syntax problem in this piece of EL.
continue;
}
@@ -385,7 +385,7 @@
}
// Check pair for getter/setter
- if(status.getUnpairedGettersOrSetters().size()>0) {
+ if(!status.getUnpairedGettersOrSetters().isEmpty()) {
TypeInfoCollector.MethodInfo unpairedMethod = status.getUnpairedGettersOrSetters().values().iterator().next();
String methodName = unpairedMethod.getName();
String propertyName = status.getUnpairedGettersOrSetters().keySet().iterator().next();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -59,7 +59,7 @@
ISeamValidator[] validators = new ISeamValidator[]{coreValidator, elValidator};
Set<IFile> changedFiles = coreHelper.getChangedFiles();
- if(changedFiles.size()>0) {
+ if(!changedFiles.isEmpty()) {
status = validate(validators, changedFiles);
} else {
// reporter.removeAllMessages(this);
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesDiagramHelper.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -50,7 +50,7 @@
Set<Object> updateLocks = new HashSet<Object>();
public boolean isUpdateLocked() {
- return updateLocks.size() > 0;
+ return !updateLocks.isEmpty();
}
public void addUpdateLock(Object lock) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesPageRefUpdateManager.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -146,11 +146,7 @@
}
if(stopped) break;
if(!isLocked()) {
- try {
- updateAll();
- } catch (Exception t) {
- SeamPagesXMLPlugin.log("Error while running page update", t);
- }
+ updateAll();
}
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamBeanHyperlinkPartitioner.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -78,7 +78,7 @@
Map<String, ISeamMessages> messages = findMessagesComponents(document, superRegion);
- if (messages != null && messages.size() > 0) {
+ if (messages != null && !messages.isEmpty()) {
String axis = getAxis(document, superRegion);
String contentType = superRegion.getContentType();
String type = SEAM_MESSAGES_BEAN_PARTITION;
@@ -91,7 +91,7 @@
}
List<IJavaElement> javaElements = findJavaElements(document, superRegion);
- if (javaElements != null && javaElements.size() > 0) {///
+ if (javaElements != null && !javaElements.isEmpty()) {///
String axis = getAxis(document, superRegion);
String contentType = superRegion.getContentType();
String type = SEAM_BEAN_PARTITION;
@@ -268,12 +268,12 @@
Utils.findNodeForOffset(xmlDocument, region.getOffset());
Map<String, ISeamMessages> messages = findMessagesComponents(document, region);
- if (messages != null && messages.size() > 0) {
+ if (messages != null && !messages.isEmpty()) {
return true;
}
List<IJavaElement> javaElements = findJavaElements(document, region);
- if (javaElements != null && javaElements.size() > 0) {
+ if (javaElements != null && !javaElements.isEmpty()) {
return true;
}
@@ -324,7 +324,7 @@
}
//Do not need it, vars handled in getJavaElementsForELOperandTokens
- if (javaElements == null || javaElements.size() == 0) {
+ if (javaElements == null || javaElements.isEmpty()) {
// Try to find a local Var (a pair of variable-value attributes)
ElVarSearcher varSearcher = new ElVarSearcher(file, engine);
// Find a Var in the EL
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamComponentHyperlinkDetector.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -210,7 +210,7 @@
}
}
}
- if (hyperlinks != null && hyperlinks.size() > 0) {
+ if (hyperlinks != null && !hyperlinks.isEmpty()) {
return (IHyperlink[])hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
}
} catch (JavaModelException jme) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlink.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -96,7 +96,7 @@
private void openMessages() {
Map <String, ISeamMessages> messages = fMessages;
- if (messages == null || messages.size() == 0) {
+ if (messages == null || messages.isEmpty()) {
// Nothing to open
return;
}
@@ -104,7 +104,7 @@
for (String property : messages.keySet()) {
ISeamMessages messagesComponent = messages.get(property);
Map <String, IResource> resources = messagesComponent.getResourcesMap();
- if (resources == null || resources.size() == 0)
+ if (resources == null || resources.isEmpty())
continue;
for (String bundle : resources.keySet()) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamELInJavaStringHyperlinkDetector.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -98,7 +98,7 @@
if(range == null) range = new int[]{0, document.getLength()};
Map<String, ISeamMessages> messages = findMessagesComponents(document, file, wordRegion, range[0], range[1]);
- if (messages != null && messages.size() > 0)
+ if (messages != null && !messages.isEmpty())
return new IHyperlink[] {new SeamELInJavaStringHyperlink(wordRegion, messages)};
IJavaElement[] elements = findJavaElements(document, file, wordRegion, range[0], range[1]);
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamMessagesBeanHyperlink.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -34,7 +34,7 @@
*/
protected void doHyperlink(IRegion region) {
Map <String, ISeamMessages> messages = SeamBeanHyperlinkPartitioner.findMessagesComponents(getDocument(), region);
- if (messages == null || messages.size() == 0) {
+ if (messages == null || messages.isEmpty()) {
// Nothing to open
openFileFailed();
return;
@@ -43,7 +43,7 @@
for (String property : messages.keySet()) {
ISeamMessages messagesComponent = messages.get(property);
Map <String, IResource> resources = messagesComponent.getResourcesMap();
- if (resources == null || resources.size() == 0)
+ if (resources == null || resources.isEmpty())
continue;
for (String bundle : resources.keySet()) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.text.ext/src/org/jboss/tools/seam/text/ext/hyperlink/SeamViewHyperlink.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -35,7 +35,7 @@
if (xModel != null) {
List list = provider.getList(xModel, WebPromptingProvider.JSF_GET_PATH, filename, null);
- if (list != null && list.size() > 0) {
+ if (list != null && !list.isEmpty()) {
for (Iterator i = list.iterator(); i.hasNext();) {
Object o = i.next();
if (o instanceof String) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/actions/FindSeamAction.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -237,7 +237,7 @@
tokens = tokens.getLeft();
}
- if (variables.size() != 0) {
+ if (!variables.isEmpty()) {
// Some variable/variables are found - perform search for their declarations
varNames = new String[variables.size()];
for (int i = 0; i < variables.size(); i++) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -186,7 +186,7 @@
WizardDialog dialog = new WizardDialog(Display.getCurrent()
.getActiveShell(), wiz);
int ok = dialog.open();
- if ((ok == Dialog.OK) && (added.size() > 0)) {
+ if (ok == Dialog.OK && !added.isEmpty()) {
SeamRuntimeManager.getInstance().addRuntime(added.get(0));
refreshSeamRuntimeCombo();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/handlers/FindSeamHandler.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -223,7 +223,7 @@
tokens = tokens.getLeft();
}
- if (variables.size() != 0) {
+ if (!variables.isEmpty()) {
// Some variable/variables are found - perform search for their declarations
varNames = new String[variables.size()];
for (int i = 0; i < variables.size(); i++) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -546,7 +546,7 @@
.getSeamRuntimeDefaultValue(model);
if (defaultRnt != null && runtimes.contains(defaultRnt)) {
newValue = defaultRnt;
- } else if (runtimes.size() > 0) {
+ } else if (!runtimes.isEmpty()) {
newValue = runtimes.get(0);
}
} else {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -142,7 +142,7 @@
public Map<String, IStatus> validate(Object value, Object context) {
Map<String, IStatus> errors = FILE_SYSTEM_FOLDER_EXISTS.validate(
value, context);
- if (errors.size() > 0) {
+ if (!errors.isEmpty()) {
errors = createErrorMap();
errors.put(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME, new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
SeamUIMessages.VALIDATOR_FACTORY_SEAM_HOME_FOLDER_DOES_NOT_EXISTS));
@@ -180,7 +180,7 @@
public Map<String, IStatus> validate(Object value, Object context) {
Map<String, IStatus> errors = FILE_SYSTEM_FOLDER_EXISTS.validate(
value, context);
- if (errors.size() > 0) {
+ if (!errors.isEmpty()) {
errors = createErrorMap();
errors.put(ISeamFacetDataModelProperties.JBOSS_AS_HOME,
new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/JDBCTablesColumnsReader.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -21,6 +21,7 @@
import org.hibernate.connection.ConnectionProvider;
import org.hibernate.exception.SQLExceptionConverter;
import org.hibernate.util.StringHelper;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
/**
* @author Vitali
@@ -104,6 +105,7 @@
metadataDialect.close(tableIterator);
}
} catch (Exception ignore) {
+ SeamGuiPlugin.getPluginLog().logError(ignore);
}
}
}
@@ -151,6 +153,7 @@
metadataDialect.close(columnIterator);
}
} catch (Exception ignore) {
+ SeamGuiPlugin.getPluginLog().logError(ignore);
}
}
}
@@ -192,6 +195,7 @@
try {
currentCatalog = info.getConnectionProvider().getConnection().getCatalog();
} catch (SQLException ignore) {
+ SeamGuiPlugin.getPluginLog().logError(ignore);
}
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/reveng/TablesColumnsCollector.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -301,7 +301,7 @@
*/
public static final Bounds binaryBoundsSearch(List list, String prefix) {
Bounds bounds = new Bounds();
- if (0 == list.size()) {
+ if (list.isEmpty()) {
bounds.nL = bounds.nH = 0;
return bounds;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -493,7 +493,7 @@
private String getDefaultConnectionProfile() {
List<String> names = getProfileNameList();
- return names.size()>0?names.get(0):"";
+ return !names.isEmpty()?names.get(0):"";
}
private String getEjbProjectName() {
@@ -536,7 +536,7 @@
return;
}
Map<String, IStatus> errors = ValidatorFactory.SEAM_RUNTIME_VALIDATOR.validate(value, null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
IStatus status = errors.get(IValidator.DEFAULT_ERROR);
if(IStatus.ERROR == status.getSeverity()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
@@ -886,7 +886,7 @@
SeamRuntime runtime = SeamRuntimeManager.getDefaultRuntimeForProject(getSeamProject());
if(runtime==null) {
List<String> names = getRuntimeNames();
- if(names.size()>0) {
+ if(!names.isEmpty()) {
return names.get(0);
}
return "";
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -57,7 +57,7 @@
ISeamComponent component=null;
if (seamProject != null) {
Set<ISeamComponent> components = seamProject.getComponentsByPath(file.getFullPath());
- if (components.size() > 0) {
+ if (!components.isEmpty()) {
// This is a component which we want to rename.
component = components.iterator().next();
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchEngine.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -104,7 +104,7 @@
String variableName = tokens.getText(); //SeamSearchVisitor.tokensToString(tokens);
Set<ISeamContextVariable> variables = seamProject.getVariablesByName(variableName);
- if (variables != null && variables.size() > 0) {
+ if (variables != null && !variables.isEmpty()) {
return search(javaScope, requestor, sourceFile, variables.toArray(new ISeamContextVariable[0]), monitor);
}
@@ -120,7 +120,7 @@
return Status.OK_STATUS;
}
- if (elements != null && elements.size() > 0) {
+ if (elements != null && !elements.isEmpty()) {
return search(javaScope, requestor, sourceFile, elements.toArray(new IJavaElement[0]), monitor);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchResultPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -431,7 +431,7 @@
}
public void dragStart(DragSourceEvent event) {
- event.doit= convertSelection().size() > 0;
+ event.doit= !convertSelection().isEmpty();
}
public void dragSetData(DragSourceEvent event) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamSearchVisitor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -469,7 +469,7 @@
if (fVarMatchers[i] != null && fVarMatchers[i].getFile() != null)
fileList.add(fVarMatchers[i].getFile());
}
- if (fileList.size() > 0) {
+ if (!fileList.isEmpty()) {
files = fileList.toArray(new IFile[0]);
}
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -460,7 +460,7 @@
}
}
- if (result == null || result.size() == 0) {
+ if (result == null || result.isEmpty()) {
return NO_PROPOSALS;
}
ICompletionProposal[] resultArray = result.toArray(new ICompletionProposal[result.size()]);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/CompositeEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -77,7 +77,7 @@
@Override
public Object[] getEditorControls() {
- if(controls.size()>0) return controls.toArray();
+ if(!controls.isEmpty()) return controls.toArray();
else throw new IllegalStateException(SeamUIMessages.COMPOSITE_EDITOR_THIS_METOD_CAN_BE_INVOKED);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/TextFieldEditor.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -144,7 +144,7 @@
*/
private String checkCollection(Object value){
- return value != null && (((Collection)value).size() > 0) ? prepareCollectionToString((Collection)value) : ""; //$NON-NLS-1$
+ return value != null && (!((Collection)value).isEmpty()) ? prepareCollectionToString((Collection)value) : ""; //$NON-NLS-1$
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/field/RadioField.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -39,7 +39,7 @@
}
radios = new Button[values.size()];
- if(defaultValue==null && values.size()>0) {
+ if(defaultValue==null && !values.isEmpty()) {
defaultValue = values.get(0);
}
for (int i = 0; i < radios.length; i++) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/RenameComponentWizard.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -95,7 +95,7 @@
protected final void validatePage() {
Map<String, IStatus> errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(editor.getValueAsString(), seamProject);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),SeamUIMessages.SEAM_BASE_WIZARD_PAGE_SEAM_COMPONENTS));
setPageComplete(false);
return;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizardPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -104,7 +104,7 @@
Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(
getEditor(IParameter.SEAM_PROJECT_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
getEditor(IParameter.SEAM_BEAN_NAME).setEnabled(false);
} else if(isWar()) {
@@ -236,7 +236,7 @@
Map<String, IStatus> errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_COMPONENT_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),SeamUIMessages.SEAM_BASE_WIZARD_PAGE_SEAM_COMPONENTS));
setPageComplete(false);
return;
@@ -245,7 +245,7 @@
errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_LOCAL_INTERFACE_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),SeamUIMessages.SEAM_BASE_WIZARD_PAGE_LOCAL_INTERFACE));
setPageComplete(false);
return;
@@ -255,7 +255,7 @@
errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_BEAN_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),"Bean")); //$NON-NLS-1$
setPageComplete(false);
return;
@@ -265,7 +265,7 @@
IFieldEditor editor = editorRegistry.get(IParameter.SEAM_PACKAGE_NAME);
if(editor!=null) {
errors = ValidatorFactory.PACKAGE_NAME_VALIDATOR.validate(editor.getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage()); //$NON-NLS-1$
setPageComplete(false);
return;
@@ -275,7 +275,7 @@
errors = ValidatorFactory.SEAM_METHOD_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_METHOD_NAME).getValue(), new Object[]{"Method",project}); //$NON-NLS-1$
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return;
@@ -284,7 +284,7 @@
errors = ValidatorFactory.FILE_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_PAGE_NAME).getValue(), new Object[]{"Page",project}); //$NON-NLS-1$
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return;
@@ -293,7 +293,7 @@
errors = ValidatorFactory.SEAM_JAVA_INTEFACE_NAME_CONVENTION_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_LOCAL_INTERFACE_NAME).getValue(), new Object[]{SeamUIMessages.SEAM_BASE_WIZARD_PAGE_LOCAL_INTERFACE,project});
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(null);
setMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage(),IMessageProvider.WARNING);
setPageComplete(true);
@@ -353,7 +353,7 @@
Map<String, IStatus> errors;
String seamRt = SeamCorePlugin.getSeamPreferences(project).get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,""); //$NON-NLS-1$
errors = ValidatorFactory.SEAM_RUNTIME_VALIDATOR.validate(seamRt, null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return false;
@@ -365,7 +365,7 @@
Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_PROJECT_NAME).getValue(), null);
- if(errors.size()>0 || !isProjectSettingsOk()) {
+ if(!errors.isEmpty() || !isProjectSettingsOk()) {
IStatus errorStatus = errors.get(IValidator.DEFAULT_ERROR);
String errorMessage = SeamUIMessages.VALIDATOR_INVALID_SETTINGS;
if(errorStatus!=null) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizardPage1.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -146,7 +146,7 @@
Map<String, IStatus> errors = ValidatorFactory.SEAM_COMPONENT_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_ENTITY_CLASS_NAME).getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(NLS.bind(errors.get(IValidator.DEFAULT_ERROR).getMessage(),SeamUIMessages.SEAM_ENTITY_WIZARD_PAGE1_ENTITY_CLASS_NAME));
setPageComplete(false);
return;
@@ -155,7 +155,7 @@
IFieldEditor editor = editorRegistry.get(IParameter.SEAM_PACKAGE_NAME);
if(editor!=null) {
errors = ValidatorFactory.PACKAGE_NAME_VALIDATOR.validate(editor.getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage()); //$NON-NLS-1$
setPageComplete(false);
return;
@@ -165,7 +165,7 @@
errors = ValidatorFactory.FILE_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_MASTER_PAGE_NAME).getValue(), new Object[]{SeamUIMessages.SEAM_ENTITY_WIZARD_PAGE1_ENTITY_MASTER_PAGE,project,project});
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return;
@@ -174,7 +174,7 @@
errors = ValidatorFactory.FILE_NAME_VALIDATOR.validate(
editorRegistry.get(IParameter.SEAM_PAGE_NAME).getValue(), new Object[]{SeamUIMessages.SEAM_ENTITY_WIZARD_PAGE1_PAGE,project});
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -69,7 +69,7 @@
projectEditor.addPropertyChangeListener(this);
if(projectName!=null && projectName.length()>0) {
Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectEditor.getValue(), null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
IStatus message = errors.get(IValidator.DEFAULT_ERROR);
if(message.getSeverity()==IStatus.ERROR) {
setErrorMessage(message.getMessage());
@@ -199,7 +199,7 @@
Map<String, IStatus> errors;
String seamRt = SeamCorePlugin.getSeamPreferences(project).get(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,""); //$NON-NLS-1$
errors = ValidatorFactory.SEAM_RUNTIME_VALIDATOR.validate(seamRt, null);
- if(errors.size()>0) {
+ if(!errors.isEmpty()) {
setErrorMessage(errors.get(IValidator.DEFAULT_ERROR).getMessage());
setPageComplete(false);
return false;
@@ -210,7 +210,7 @@
private void validate() {
Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectEditor.getValue(), null);
- if(errors.size()>0 || !isProjectSettingsOk()) {
+ if(!errors.isEmpty() || !isProjectSettingsOk()) {
IStatus errorMessage = errors.get(IValidator.DEFAULT_ERROR);
if(errorMessage==null) {
setErrorMessage(SeamUIMessages.VALIDATOR_INVALID_SETTINGS);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -500,7 +500,7 @@
.getActiveShell(), wiz);
dialog.open();
- if (added.size() > 0) {
+ if (!added.isEmpty()) {
SeamRuntimeManager.getInstance().addRuntime(added.get(0));
List<String> runtimes = getRuntimeNames(sv);
getFieldEditor().setValue(added.get(0).getName());
@@ -574,7 +574,7 @@
configurationNames.add(configs[i].getName());
}
if(defaultSelection==null) {
- if(configurationNames.size()>0) {
+ if(!configurationNames.isEmpty()) {
defaultSelection = configurationNames.get(0);
} else {
defaultSelection = ""; //$NON-NLS-1$
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/PagesCompoundCommand.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/PagesCompoundCommand.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/commands/PagesCompoundCommand.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -29,7 +29,7 @@
}
public boolean canExecute() {
- if(elements.size() > 0){
+ if(!elements.isEmpty()){
XModelObject[] objects = (XModelObject[])elements.toArray(new XModelObject[]{});
XModelObject object= objects[0];
if(elements.size() == 1) objects = null;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -223,7 +223,7 @@
int height = getVisualHeight() + getPageModel().getOutputLinks().size()
* NodeFigure.LINK_HEIGHT;
- if (getPageModel().getOutputLinks().size() == 0)
+ if (getPageModel().getOutputLinks().isEmpty())
height = getVisualHeight() + NodeFigure.LINK_HEIGHT;
String name = getPageModel().getName();
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesDiagramEditPart.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -234,7 +234,7 @@
if(getPagesModel().getChildren().get(i) instanceof Page){
Page page = (Page)getPagesModel().getChildren().get(i);
- if(page.getChildren().size() > 0 && page.isParamsVisible()){
+ if(!page.getChildren().isEmpty() && page.isParamsVisible()){
PageWrapper wrapper = page.getParamList();
list.add(wrapper);
}
@@ -262,7 +262,7 @@
if (val != null && val.booleanValue())
snapStrategies.add(new SnapToGrid(this));
- if (snapStrategies.size() == 0)
+ if (snapStrategies.isEmpty())
return null;
if (snapStrategies.size() == 1)
return (SnapToHelper) snapStrategies.get(0);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -45,7 +45,7 @@
}
public void refreshFont() {
- if (getChildren().size() > 0 && getChildren().get(0) instanceof Label) {
+ if (!getChildren().isEmpty() && getChildren().get(0) instanceof Label) {
Label label = (Label) getChildren().get(0);
// label.setFont(editPart.getLinkModel().getJSFModel().getOptions()
// .getLinkPathFont());
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -162,7 +162,7 @@
g.drawString(page.getName(), 27, 3);
}
- if(page.getChildren().size() != 0){
+ if(!page.getChildren().isEmpty()){
if(page.isParamsVisible()){
g.drawImage(minusImage, 4, height-12);
}else{
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/CustomTLDParser.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -50,8 +50,6 @@
Element rootElement = document.getDocumentElement();
NodeList nodeList = rootElement.getElementsByTagName(NAMESPACE);
return nodeList.item(0).getFirstChild().getNodeValue();
- } catch (Exception e) {
- VpePlugin.reportProblem(e);
} finally {
if(document!=null) {
VpeCreatorUtil.releaseDocumentFromRead(document);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -188,7 +188,7 @@
double dVersion;
try {
dVersion = Double.parseDouble(parseableVersion);
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
VpePlugin.getPluginLog().logError(e);
dVersion = 0.0;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.util;
+import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
@@ -49,7 +50,7 @@
}
is.close();
- } catch (Exception e) {
+ } catch (IOException e) {
e.printStackTrace();
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java 2009-05-11 16:55:55 UTC (rev 15216)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/Messages.java 2009-05-12 00:52:12 UTC (rev 15217)
@@ -31,9 +31,15 @@
try {
Field field = c.getDeclaredField(fieldName);
return (String) field.get(null);
- } catch (Exception e) {
+ } catch (NoSuchFieldException e) {
PalettePlugin.getPluginLog().logError(e);
return "!" + fieldName + "!"; //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (IllegalArgumentException e) {
+ PalettePlugin.getPluginLog().logError(e);
+ return "!" + fieldName + "!"; //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (IllegalAccessException e) {
+ PalettePlugin.getPluginLog().logError(e);
+ return "!" + fieldName + "!"; //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
17 years, 2 months