JBoss Tools SVN: r38739 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2012-02-15 04:36:25 -0500 (Wed, 15 Feb 2012)
New Revision: 38739
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://issues.jboss.org/browse/JBIDE-9790 - instanceOf check was added.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2012-02-15 07:48:04 UTC (rev 38738)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2012-02-15 09:36:25 UTC (rev 38739)
@@ -914,9 +914,13 @@
}
Element sourceElement = (Element) sourceNode;
- VpeElementMapping elementMapping = (VpeElementMapping) domMapping
- .getNodeMapping(sourceElement);
- if (elementMapping != null) {
+ VpeElementMapping elementMapping = (VpeElementMapping)
+ domMapping.getNodeMapping(sourceElement);
+ /*
+ * https://issues.jboss.org/browse/JBIDE-9790
+ */
+ if ((elementMapping != null) &&
+ (elementMapping.getTemplate() instanceof VpeTemplateSafeWrapper)) {
VpeToggableTemplate toggableTemplate = (VpeToggableTemplate) ((VpeTemplateSafeWrapper)
elementMapping.getTemplate()).getAdapter(VpeToggableTemplate.class);
if (toggableTemplate != null) {
@@ -979,7 +983,7 @@
? sourceNode
: sourceNode.getParentNode());
/*
- * Fixes JBIDE-1823 author dmaliarevich
+ * Fixes JBIDE-1823
* Template is looked according to <code>selectedElem</code>
* so <code>toggleLookupAttr</code> should be retrieved
* from this element
@@ -990,27 +994,36 @@
if (attr != null) {
toggleLookup = "true".equalsIgnoreCase(attr.getNodeValue()); //$NON-NLS-1$
}
- }
- // end of fix
+ } // end of fix JBIDE-1823
if (elementMapping != null) {
- VpeToggableTemplate toggableTemplate = (VpeToggableTemplate) ((VpeTemplateSafeWrapper)
- elementMapping.getTemplate()).getAdapter(VpeToggableTemplate.class);
+ VpeToggableTemplate toggableTemplate = null;
+ /*
+ * https://issues.jboss.org/browse/JBIDE-9790
+ */
+ if (elementMapping.getTemplate() instanceof VpeTemplateSafeWrapper) {
+ toggableTemplate = (VpeToggableTemplate) ((VpeTemplateSafeWrapper)
+ elementMapping.getTemplate()).getAdapter(VpeToggableTemplate.class);
+ } // End of fix JBIDE-9790
while (toggleLookup && (sourceElement != null) && (toggableTemplate == null)) {
sourceElement = (Element) sourceElement.getParentNode();
if (sourceElement == null) {
break;
}
- // Fixes JBIDE-1823 author dmaliarevich
+ // Fixes JBIDE-1823
nodeMapping = domMapping.getNodeMapping(sourceElement);
if (nodeMapping instanceof VpeElementMapping) {
elementMapping = (VpeElementMapping) nodeMapping;
- }
- // end of fix
+ } // end of fix JBIDE-1823
if (elementMapping == null) {
continue;
}
- toggableTemplate = (VpeToggableTemplate) ((VpeTemplateSafeWrapper)
- elementMapping.getTemplate()).getAdapter(VpeToggableTemplate.class);
+ /*
+ * https://issues.jboss.org/browse/JBIDE-9790
+ */
+ if (elementMapping.getTemplate() instanceof VpeTemplateSafeWrapper) {
+ toggableTemplate = (VpeToggableTemplate) ((VpeTemplateSafeWrapper)
+ elementMapping.getTemplate()).getAdapter(VpeToggableTemplate.class);
+ } // End of fix JBIDE-9790
}
if (toggableTemplate != null) {
toggableTemplate.toggle(this, sourceElement, toggleId);
14 years, 1 month
JBoss Tools SVN: r38738 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-02-15 02:48:04 -0500 (Wed, 15 Feb 2012)
New Revision: 38738
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java
Log:
JBIDE-10715
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 2012-02-15 05:29:42 UTC (rev 38737)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/LocalJBossServerRuntime.java 2012-02-15 07:48:04 UTC (rev 38738)
@@ -157,7 +157,7 @@
@Override
public HashMap<String, String> getDefaultRunEnvVars(){
HashMap<String, String> envVars = new HashMap<String, String>(1);
- envVars.put("Path", NATIVE); //$NON-NLS-1$
+ envVars.put("PATH", NATIVE + ":${env_var:PATH}"); //$NON-NLS-1$ //$NON-NLS-2$
return envVars;
}
14 years, 1 month
JBoss Tools SVN: r38737 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-02-15 00:29:42 -0500 (Wed, 15 Feb 2012)
New Revision: 38737
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml
Log:
JBIDE-10264 Wizard-ify the project examples
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml 2012-02-15 02:58:08 UTC (rev 38736)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-maven-3.3.xml 2012-02-15 05:29:42 UTC (rev 38737)
@@ -53,25 +53,25 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1</property>
+ <property name="description">works with JBoss AS 7.0/7.1</property>
<property name="downloadId">org.jboss.tools.runtime.core.as.702</property>
</fix>
<fix type="plugin">
<property name="id">org.eclipse.m2e.core</property>
<property name="versions">[1.0.0,1.2.0)</property>
- <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="description">m2e >= 1.0.</property>
<property name="connectorIds">org.eclipse.m2e.feature</property>
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
<property name="versions">[0.13.1,0.15.0)</property>
- <property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
+ <property name="description">m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
<fix type="plugin">
<property name="id">org.jboss.tools.maven.core</property>
<property name="versions">[1.3.0,1.4.0)</property>
- <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="description">JBoss Maven Tools</property>
<property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature, org.jboss.tools.maven.portlet.feature,org.jboss.tools.maven.seam.feature</property>
</fix>
</fixes>
@@ -100,25 +100,25 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1</property>
+ <property name="description">works with JBoss AS 7.0/7.1</property>
<property name="downloadId">org.jboss.tools.runtime.core.as.702</property>
</fix>
<fix type="plugin">
<property name="id">org.eclipse.m2e.core</property>
<property name="versions">[1.0.0,1.2.0)</property>
- <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="description">m2e >= 1.0.</property>
<property name="connectorIds">org.eclipse.m2e.feature</property>
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
<property name="versions">[0.13.1,0.15.0)</property>
- <property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
+ <property name="description">m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
<fix type="plugin">
<property name="id">org.jboss.tools.maven.core</property>
<property name="versions">[1.3.0,1.4.0)</property>
- <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="description">JBoss Maven Tools</property>
<property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature, org.jboss.tools.maven.portlet.feature,org.jboss.tools.maven.seam.feature</property>
</fix>
</fixes>
@@ -143,25 +143,25 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1</property>
+ <property name="description">works with JBoss AS 7.0/7.1</property>
<property name="downloadId">org.jboss.tools.runtime.core.as.702</property>
</fix>
<fix type="plugin">
<property name="id">org.eclipse.m2e.core</property>
<property name="versions">[1.0.0,1.2.0)</property>
- <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="description">m2e >= 1.0.</property>
<property name="connectorIds">org.eclipse.m2e.feature</property>
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
<property name="versions">[0.13.1,0.15.0)</property>
- <property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
+ <property name="description">m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
<fix type="plugin">
<property name="id">org.jboss.tools.maven.core</property>
<property name="versions">[1.3.0,1.4.0)</property>
- <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="description">JBoss Maven Tools</property>
<property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature, org.jboss.tools.maven.portlet.feature,org.jboss.tools.maven.seam.feature</property>
</fix>
</fixes>
@@ -187,25 +187,25 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1</property>
+ <property name="description">works with JBoss AS 7.0/7.1</property>
<property name="downloadId">org.jboss.tools.runtime.core.as.702</property>
</fix>
<fix type="plugin">
<property name="id">org.eclipse.m2e.core</property>
<property name="versions">[1.0.0,1.2.0)</property>
- <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="description">m2e >= 1.0.</property>
<property name="connectorIds">org.eclipse.m2e.feature</property>
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
<property name="versions">[0.13.1,0.15.0)</property>
- <property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
+ <property name="description">m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
<fix type="plugin">
<property name="id">org.jboss.tools.maven.core</property>
<property name="versions">[1.3.0,1.4.0)</property>
- <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="description">JBoss Maven Tools</property>
<property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature, org.jboss.tools.maven.portlet.feature,org.jboss.tools.maven.seam.feature</property>
</fix>
</fixes>
@@ -232,25 +232,25 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1</property>
+ <property name="description">works with JBoss AS 7.0/7.1</property>
<property name="downloadId">org.jboss.tools.runtime.core.as.702</property>
</fix>
<fix type="plugin">
<property name="id">org.eclipse.m2e.core</property>
<property name="versions">[1.0.0,1.2.0)</property>
- <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="description">m2e >= 1.0.</property>
<property name="connectorIds">org.eclipse.m2e.feature</property>
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
<property name="versions">[0.13.1,0.15.0)</property>
- <property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
+ <property name="description">m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
<fix type="plugin">
<property name="id">org.jboss.tools.maven.core</property>
<property name="versions">[1.3.0,1.4.0)</property>
- <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="description">JBoss Maven Tools</property>
<property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature, org.jboss.tools.maven.portlet.feature,org.jboss.tools.maven.seam.feature</property>
</fix>
</fixes>
@@ -273,25 +273,25 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.70, org.jboss.ide.eclipse.as.runtime.71</property>
- <property name="description">This project example requires JBoss AS 7.0/7.1</property>
+ <property name="description">works with JBoss AS 7.0/7.1</property>
<property name="downloadId">org.jboss.tools.runtime.core.as.702</property>
</fix>
<fix type="plugin">
<property name="id">org.eclipse.m2e.core</property>
<property name="versions">[1.0.0,1.2.0)</property>
- <property name="description">This project example requires m2e >= 1.0.</property>
+ <property name="description">m2e >= 1.0.</property>
<property name="connectorIds">org.eclipse.m2e.feature</property>
</fix>
<fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
<property name="versions">[0.13.1,0.16.0)</property>
- <property name="description">This project example requires m2eclipse-wtp >= 0.13.1.</property>
+ <property name="description">m2eclipse-wtp >= 0.13.1.</property>
<property name="connectorIds">org.maven.ide.eclipse.wtp</property>
</fix>
<fix type="plugin">
<property name="id">org.jboss.tools.maven.core</property>
<property name="versions">[1.3.0,1.4.0)</property>
- <property name="description">This project example requires JBoss Maven Tools.</property>
+ <property name="description">JBoss Maven Tools</property>
<property name="connectorIds">org.jboss.tools.maven.feature,org.jboss.tools.maven.cdi.feature,org.jboss.tools.maven.hibernate.feature,org.jboss.tools.maven.jaxrs.feature, org.jboss.tools.maven.portlet.feature,org.jboss.tools.maven.seam.feature</property>
</fix>
</fixes>
14 years, 1 month
JBoss Tools SVN: r38736 - trunk/hibernatetools/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-02-14 21:58:08 -0500 (Tue, 14 Feb 2012)
New Revision: 38736
Modified:
trunk/hibernatetools/docs/reference/en-US/Book_Info.xml
trunk/hibernatetools/docs/reference/en-US/plugins.xml
Log:
updated for hibernate 4
Modified: trunk/hibernatetools/docs/reference/en-US/Book_Info.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en-US/Book_Info.xml 2012-02-15 02:16:52 UTC (rev 38735)
+++ trunk/hibernatetools/docs/reference/en-US/Book_Info.xml 2012-02-15 02:58:08 UTC (rev 38736)
@@ -7,7 +7,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>5.0</productnumber>
<edition>5.0.0</edition>
- <pubsnumber>1</pubsnumber>
+ <pubsnumber>2</pubsnumber>
<abstract>
<para>
The Hibernate Tools Reference Guide explains how to use the Hibernate Tools to perform reverse engineering, code generation, visualization and interaction with Hibernate.
Modified: trunk/hibernatetools/docs/reference/en-US/plugins.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en-US/plugins.xml 2012-02-15 02:16:52 UTC (rev 38735)
+++ trunk/hibernatetools/docs/reference/en-US/plugins.xml 2012-02-15 02:58:08 UTC (rev 38736)
@@ -200,14 +200,14 @@
</entry>
<entry>
<para>
- Choose between "Core", "Annotations" and "JPA". Note that the two latter requires running Eclipse IDE with a JDK 5 runtime, otherwise you will get class loading and version errors.
+ Choose between "Core", "Annotations" and "JPA". Note that the two latter requires running Eclipse IDE with a JDK 5 (or newer) runtime, otherwise you will get class loading and version errors.
</para>
<para>
- You will also need to select the version of Hibernate your application server has. Select a version from the drop-down box labelled <guilabel>Hibernate Version</guilabel>.
+ You will also need to select the version of Hibernate your application server has (3.5, 3.6 or 4.0). Select a version from the drop-down box labelled <guilabel>Hibernate Version</guilabel>.
</para>
</entry>
<entry>
- <para><guilabel>Hibernate Version:</guilabel> 3.5</para>
+ <para><guilabel>Core</guilabel> and <guilabel>Hibernate Version:</guilabel> 3.5</para>
</entry>
</row>
<row>
14 years, 1 month
JBoss Tools SVN: r38735 - trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-02-14 21:16:52 -0500 (Tue, 14 Feb 2012)
New Revision: 38735
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/AddQualifiersToBeanWizardTest.java
Log:
Wizard 'Specify CDI Bean for the Injection Point' does not compute correctly condition 'can finish' https://issues.jboss.org/browse/JBIDE-10637
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/AddQualifiersToBeanWizardTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/AddQualifiersToBeanWizardTest.java 2012-02-15 01:51:18 UTC (rev 38734)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/wizard/AddQualifiersToBeanWizardTest.java 2012-02-15 02:16:52 UTC (rev 38735)
@@ -224,7 +224,7 @@
public void testValuedQualifier(){
ValuedQualifier oneQualifier = new ValuedQualifier(project.getQualifier(CDIProject.COMPLICATED_QUALIFIER1));
String value = oneQualifier.getValue();
- assertEquals("type = \"default\", name = \"User\", realChanky = false, unrealChanky = true, number = 0, size = 125, bTs = 0, bTs2 = 4, posibility = 0.0, posibility2 = 0.9999, ch = ' ', ch2 = 'T'", value);
+ assertEquals("type = \"default\", realChanky = false, number = 0, bTs = 0, posibility = 0.0, ch = ' '", value);
}
public void testValuedQualifierWithDeclaration(){
14 years, 1 month
JBoss Tools SVN: r38734 - trunk/common/plugins/org.jboss.tools.common.validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-02-14 20:51:18 -0500 (Tue, 14 Feb 2012)
New Revision: 38734
Modified:
trunk/common/plugins/org.jboss.tools.common.validation/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-10738 As-you-type EL validation
Modified: trunk/common/plugins/org.jboss.tools.common.validation/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/plugin.xml 2012-02-15 01:50:33 UTC (rev 38733)
+++ trunk/common/plugins/org.jboss.tools.common.validation/plugin.xml 2012-02-15 01:51:18 UTC (rev 38734)
@@ -61,6 +61,39 @@
</validator>
</extension>
+ <!-- extension point="org.eclipse.wst.sse.ui.sourcevalidation">
+ <validator
+ scope="partial"
+ class="org.jboss.tools.common.validation.AsYouTypeValidatorManager"
+ id="org.jboss.tools.common.validation.AsYouTypeValidatorManager">
+ <contentTypeIdentifier
+ id="org.eclipse.jst.jsp.core.jspsource">
+ <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP">
+ </partitionType>
+ <partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
+ </partitionType>
+ <partitionType id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2">
+ </partitionType>
+ </contentTypeIdentifier>
+ <contentTypeIdentifier
+ id="org.eclipse.wst.html.core.htmlsource">
+ <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
+ </contentTypeIdentifier>
+ <contentTypeIdentifier
+ id="org.jboss.tools.jst.jsp.jspincludesource">
+ </contentTypeIdentifier>
+ <contentTypeIdentifier
+ id="org.eclipse.jst.jsp.core.jspfragmentsource">
+ </contentTypeIdentifier>
+ <contentTypeIdentifier
+ id="org.eclipse.jst.jsp.core.tagsource">
+ </contentTypeIdentifier>
+ <contentTypeIdentifier
+ id="org.eclipse.jdt.core.javaSource">
+ </contentTypeIdentifier>
+ </validator>
+ </extension -->
+
<extension
id="JBTValidationProblem"
name="JBoss Tools Validation Problem"
@@ -72,4 +105,4 @@
</persistent>
</extension>
-</plugin>
+</plugin>
\ No newline at end of file
14 years, 1 month
JBoss Tools SVN: r38733 - in trunk: common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-02-14 20:50:33 -0500 (Tue, 14 Feb 2012)
New Revision: 38733
Added:
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/EditorValidationContext.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IAsYouTypeValidator.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java
trunk/common/plugins/org.jboss.tools.common.validation/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IValidationErrorManager.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationContext.java
trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/BuilderValidationTest.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/internal/validation/ELValidator.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/KBValidator.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java
Log:
https://issues.jboss.org/browse/JBIDE-10738 As-you-type EL validation
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -2532,8 +2532,22 @@
}
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.ValidationErrorManager#getPreferencePageId()
+ */
@Override
protected String getPreferencePageId() {
return PREFERENCE_PAGE_ID;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.TempMarkerManager#getMessageBundleName()
+ */
+ @Override
+ protected String getMessageBundleName() {
+ // TODO
+ return null;
+ }
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContext.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -11,8 +11,10 @@
package org.jboss.tools.common.el.core.resolver;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IRegion;
import org.jboss.tools.common.el.core.ELReference;
/**
@@ -71,4 +73,11 @@
* @param file
*/
void setResource(IFile file);
+
+ /**
+ * Returns all the EL references for the region.
+ *
+ * @return
+ */
+ Set<ELReference> getELReferences(IRegion region);
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELContextImpl.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -11,8 +11,11 @@
package org.jboss.tools.common.el.core.resolver;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
import org.jboss.tools.common.el.core.ELReference;
@@ -116,4 +119,16 @@
}
return null;
}
+
+ @Override
+ public Set<ELReference> getELReferences(IRegion region) {
+ Set<ELReference> references = new HashSet<ELReference>();
+ ELReference[] refs = getELReferences();
+ for (int i = 0; i < refs.length; i++) {
+ if(refs[i].getStartPosition()>=region.getOffset() && (refs[i].getStartPosition() + refs[i].getLength()<=region.getOffset() + region.getLength())) {
+ references.add(refs[i]);
+ }
+ }
+ return references;
+ }
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/SimpleELContext.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -11,9 +11,12 @@
package org.jboss.tools.common.el.core.resolver;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.text.IRegion;
import org.jboss.tools.common.el.core.ELReference;
/**
@@ -104,4 +107,9 @@
public ELReference getELReference(int offset) {
return null;
}
+
+ @Override
+ public Set<ELReference> getELReferences(IRegion region) {
+ return Collections.emptySet();
+ }
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.validation/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/META-INF/MANIFEST.MF 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/common/plugins/org.jboss.tools.common.validation/META-INF/MANIFEST.MF 2012-02-15 01:50:33 UTC (rev 38733)
@@ -17,7 +17,8 @@
org.eclipse.jface;bundle-version="3.7.0",
org.eclipse.ui;bundle-version="3.7.0",
org.eclipse.wst.validation.ui;bundle-version="1.2.204",
- org.eclipse.jdt.core;bundle-version="3.7.0"
+ org.eclipse.jdt.core;bundle-version="3.7.0",
+ org.eclipse.wst.sse.ui;bundle-version="1.3.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %providerName
Added: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.validation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
+import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+
+/**
+ * This Manager is responsible for as-you-type validation.
+ * It's registred as WTP source validator and delegates validation to the corresponding JBT validators.
+ * @author Alexey Kazakov
+ */
+public class AsYouTypeValidatorManager implements ISourceValidator, org.eclipse.wst.validation.internal.provisional.core.IValidator {
+
+ private IDocument document;
+ private IFile file;
+ private EditorValidationContext context;
+ private Map<IValidator, IProject> rootProjects;
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator#connect(org.eclipse.jface.text.IDocument)
+ */
+ @Override
+ public void connect(IDocument document) {
+ this.document = document;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator#disconnect(org.eclipse.jface.text.IDocument)
+ */
+ @Override
+ public void disconnect(IDocument document) {
+ context = null;
+ }
+
+ private boolean init(IValidationContext helper, IReporter reporter) {
+ if(context==null) {
+ String[] uris = helper.getURIs();
+ if(uris.length==0) {
+ return false;
+ }
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ file = root.getFile(new Path(uris[0]));
+ if(!file.isAccessible()) {
+ return false;
+ }
+ context = new EditorValidationContext(file.getProject(), document);
+ if(context.getValidators().isEmpty()) {
+ return false;
+ }
+ rootProjects = new HashMap<IValidator, IProject>();
+ for (IValidator validator : context.getValidators()) {
+ Map<IProject, IValidatingProjectSet> projectTree = context.getValidatingProjectTree(validator).getBrunches();
+ if(!projectTree.isEmpty()) {
+ IProject rootProject = projectTree.keySet().iterator().next();
+ rootProjects.put(validator, rootProject);
+ }
+ }
+ }
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator#validate(org.eclipse.jface.text.IRegion, org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter)
+ */
+ @Override
+ public void validate(IRegion dirtyRegion, IValidationContext helper, IReporter reporter) {
+ if(!init(helper, reporter)) {
+ return;
+ }
+ for (IValidator validator : context.getValidators()) {
+ IProject rootProject = rootProjects.get(validator);
+ IValidatingProjectSet projectBrunch = context.getValidatingProjectTree(validator).getBrunches().get(rootProject);
+ if(projectBrunch!=null) {
+ ((IAsYouTypeValidator)validator).validate(this, rootProject, dirtyRegion, helper, reporter, context, projectBrunch.getRootContext(), file);
+ }
+ }
+// reporter.removeAllMessages(this, file);
+ }
+
+ @Override
+ public void cleanup(IReporter reporter) {
+ }
+
+ @Override
+ public void validate(IValidationContext helper, IReporter reporter) throws ValidationException {
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/AsYouTypeValidatorManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/EditorValidationContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/EditorValidationContext.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/EditorValidationContext.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.validation;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.IDocument;
+
+/**
+ * Validation context used in as-you-type validation.
+ * @author Alexey Kazakov
+ */
+public class EditorValidationContext extends ValidationContext {
+
+ private IDocument document;
+
+ public EditorValidationContext(IProject project, IDocument document) {
+ super(project);
+ this.document = document;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.ValidationContext#shouldValidate(org.jboss.tools.common.validation.IValidator, org.eclipse.core.resources.IProject)
+ */
+ @Override
+ protected boolean shouldValidate(IValidator validator, IProject project) {
+ return validator instanceof IAsYouTypeValidator && super.shouldValidate(validator, project);
+ }
+
+ /**
+ * @return the document
+ */
+ public IDocument getDocument() {
+ return document;
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/EditorValidationContext.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IAsYouTypeValidator.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IAsYouTypeValidator.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IAsYouTypeValidator.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.validation;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
+
+/**
+ * Interface to allow for "partial document" as you type validation.
+ * @author Alexey Kazakov
+ */
+public interface IAsYouTypeValidator {
+
+ /**
+ * Validates the region.
+ * @param validatorManager
+ * @param rootProject
+ * @param dirtyRegion
+ * @param helper
+ * @param reporter
+ * @param validationContext
+ * @param projectContext
+ * @param file
+ */
+ void validate(IValidator validatorManager, IProject rootProject, IRegion dirtyRegion, IValidationContext helper, IReporter reporter, EditorValidationContext validationContext, IProjectValidationContext projectContext, IFile file);
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IAsYouTypeValidator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IValidationErrorManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IValidationErrorManager.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/IValidationErrorManager.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -25,7 +25,7 @@
public interface IValidationErrorManager {
/**
- * inits validator error manager
+ * Inits validator error manager
* @param project
* @param validationHelper
* @param manager
@@ -34,6 +34,17 @@
void init(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext validationContext, IValidator manager, IReporter reporter);
/**
+ * Inits validator error manager
+ * @param project
+ * @param validationHelper
+ * @param validationContext
+ * @param manager
+ * @param reporter
+ * @param asYouTypeValidation
+ */
+ void init(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext validationContext, IValidator manager, IReporter reporter, boolean asYouTypeValidation);
+
+ /**
* Adds a marker to the resource
* @param message
* @param preferenceKey
Added: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.validation;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.wst.validation.internal.core.Message;
+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.CommonPlugin;
+import org.jboss.tools.common.text.ITextSourceReference;
+
+/**
+ * @author Alexey Kazakov
+ */
+abstract public class TempMarkerManager extends ValidationErrorManager {
+
+ protected abstract String getMessageBundleName();
+
+ public IMessage addMesssage(IFile target, ITextSourceReference location, String preferenceKey, String textMessage, String[] messageArguments) {
+ return addMesssage(target, -1, location, preferenceKey, textMessage, messageArguments);
+ }
+
+ public IMessage addMesssage(IFile target, int lineNumber, ITextSourceReference location, String preferenceKey, String textMessage, String[] messageArguments) {
+ int severity = getSeverity(preferenceKey, target);
+ IMessage message = null;
+ try {
+ if(severity!=-1 && (severity!=IMessage.NORMAL_SEVERITY || !hasSuppressWarningsAnnotation(preferenceKey, location))) {
+ message = addMesssage(target, lineNumber, location.getStartPosition(), location.getLength(), severity, preferenceKey, textMessage, messageArguments);
+ }
+ } catch (JavaModelException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+ return message;
+ }
+
+ public IMessage addMesssage(IFile target, int offset, int length, String preferenceKey, String message, String[] messageArguments) {
+ return addMesssage(target, -1, offset, length, preferenceKey, message, messageArguments);
+ }
+
+ public IMessage addMesssage(IFile target, int lineNumber, int offset, int length, String preferenceKey, String message, String[] messageArguments) {
+ int severity = getSeverity(preferenceKey, target);
+ return severity!=-1?addMesssage(target, lineNumber, offset, length, severity, preferenceKey, message, messageArguments):null;
+ }
+
+ private IMessage addMesssage(IFile target, int lineNumber, int offset, int length, int severity, String preferenceKey, String textMessage, String[] messageArguments) {
+ if(lineNumber<0) {
+ try {
+ lineNumber = document.getLineOfOffset(offset) + 1;
+ } catch (BadLocationException e) {
+ CommonPlugin.getDefault().logError(e);
+ }
+ }
+ IMessage message = addMesssage(validationManager, this.reporter, offset, length, target, lineNumber, severity, textMessage, messageArguments, getMessageBundleName());
+ return message;
+ }
+
+ private static IMessage addMesssage(IValidator validator, IReporter reporter, int offset, int length, IFile file, int lineNumber, int severity, String textMessage, Object[] messageArguments, String bundleName) {
+ Message message = new ValidationMessage(severity, MessageFormat.format(textMessage, messageArguments), file);
+ message.setOffset(offset);
+ message.setLength(length);
+ message.setLineNo(lineNumber);
+ message.setBundleName(bundleName);
+ reporter.addMessage(validator, message);
+ return message;
+ }
+
+ static class ValidationMessage extends Message {
+
+ private String message;
+
+ public ValidationMessage(int severity, String message, IFile file) {
+ super(CommonPlugin.PLUGIN_ID, severity, message, null, file);
+ this.message = message;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.wst.validation.internal.core.Message#getText(java.util.Locale, java.lang.ClassLoader)
+ */
+ @Override
+ public java.lang.String getText(Locale locale, ClassLoader classLoader) {
+ return message;
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/TempMarkerManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationContext.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationContext.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationContext.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -62,7 +62,7 @@
}
}
- public void init(IProject project) {
+ protected List<IValidator> getAllValidators(IProject project) {
projectTree.clear();
validators.clear();
validationResourceRegister = null;
@@ -86,10 +86,14 @@
}
// We should add all the dependent validators (e.g. EL validator) to the very end of the list.
allValidators.addAll(dependentValidators);
+ return allValidators;
+ }
+ public void init(IProject project) {
+ List<IValidator> allValidators = getAllValidators(project);
// Init context for given project.
for (IValidator validator : allValidators) {
- if(validator.shouldValidate(project)) {
+ if(shouldValidate(validator, project)) {
IValidatingProjectTree prTree = validator.getValidatingProjects(project);
if(prTree!=null) {
validators.add(validator);
@@ -99,6 +103,10 @@
}
}
+ protected boolean shouldValidate(IValidator validator, IProject project) {
+ return validator.shouldValidate(project);
+ }
+
/*
* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.validation.IValidationContextManager#isObsolete()
Modified: trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/common/plugins/org.jboss.tools.common.validation/src/org/jboss/tools/common/validation/ValidationErrorManager.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -63,6 +63,7 @@
protected String markerId;
protected IProjectValidationContext validationContext;
protected TextFileDocumentProvider documentProvider;
+ protected IDocument document;
protected Set<IFile> dirtyFiles;
private String messageIdQuickFixAttributeName;
@@ -83,9 +84,17 @@
/*
* (non-Javadoc)
+ * @see org.jboss.tools.common.validation.IValidationErrorManager#init(org.eclipse.core.resources.IProject, org.jboss.tools.common.validation.ContextValidationHelper, org.jboss.tools.common.validation.IProjectValidationContext, org.eclipse.wst.validation.internal.provisional.core.IValidator, org.eclipse.wst.validation.internal.provisional.core.IReporter)
+ */
+ public void init(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext validationContext, IValidator manager, IReporter reporter) {
+ init(project, validationHelper, validationContext, manager, reporter, false);
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.validation.IValidationErrorManager#init(org.eclipse.core.resources.IProject, org.jboss.tools.jst.web.kb.internal.validation.ContextValidationHelper, org.jboss.tools.jst.web.kb.validation.IProjectValidationContext, org.eclipse.wst.validation.internal.provisional.core.IValidator, org.eclipse.wst.validation.internal.provisional.core.IReporter)
*/
- public void init(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext validationContext, IValidator manager, IReporter reporter) {
+ public void init(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext validationContext, IValidator manager, IReporter reporter, boolean asYouTypeValidation) {
cleanSavedMarkers();
setProject(project);
setCoreHelper(validationHelper);
@@ -93,14 +102,9 @@
setReporter(reporter);
setValidationContext(validationContext);
setMarkerId(org.jboss.tools.common.validation.IValidator.MARKED_RESOURCE_MESSAGE_GROUP);
- dirtyFiles = EclipseUIUtil.getDirtyFiles();
+ dirtyFiles = asYouTypeValidation?new HashSet<IFile>():EclipseUIUtil.getDirtyFiles();
}
- public void init(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext validationContext, IValidator manager, IReporter reporter, String messageIdQuickFixAttributeName) {
- this.init(project, validationHelper, validationContext, manager, reporter);
- setMessageIdQuickFixAttributeName(messageIdQuickFixAttributeName);
- }
-
protected boolean shouldBeValidated(IFile file) {
return file.isAccessible() && !dirtyFiles.contains(file);
}
@@ -235,7 +239,7 @@
return false;
}
- private static boolean hasSuppressWarningsAnnotation(String preferenceKey, ITextSourceReference location) throws JavaModelException {
+ protected static boolean hasSuppressWarningsAnnotation(String preferenceKey, ITextSourceReference location) throws JavaModelException {
boolean result = false;
if(location instanceof IJavaSourceReference) {
IJavaElement element = ((IJavaSourceReference) location).getSourceElement();
@@ -332,7 +336,7 @@
abstract protected String getPreferencePageId();
- private int getSeverity(String preferenceKey, IResource target) {
+ protected int getSeverity(String preferenceKey, IResource target) {
String preferenceValue = getPreference(target.getProject(), preferenceKey);
int severity = -1;
if (!SeverityPreferences.IGNORE.equals(preferenceValue)) {
@@ -363,7 +367,6 @@
marker.setAttribute(PREFERENCE_KEY_ATTRIBUTE_NAME, preferenceKey);
marker.setAttribute(PREFERENCE_PAGE_ID_NAME, preferencePageId);
}
-
}
} catch(CoreException e) {
CommonPlugin.getDefault().logError(e);
@@ -434,7 +437,7 @@
connected = true;
documentProvider.connect(target);
IDocument doc = documentProvider.getDocument(target);
- if(doc != null){
+ if(doc != null) {
try {
lineNumber = doc.getLineOfOffset(offset) + 1;
} catch (BadLocationException e) {
@@ -495,6 +498,13 @@
* @return
*/
public IMarker addError(String message, int severity, Object[] messageArguments, int lineNumber, int length, int offset, IResource target, TextFileDocumentProvider documentProvider, String markerId, Class markerOwner) {
+ if(document != null && lineNumber < 0) {
+ try {
+ lineNumber = document.getLineOfOffset(offset) + 1;
+ } catch (BadLocationException e) {
+ CommonPlugin.getDefault().logError("Wrong offset [" + offset + "] of the problem marker [" + MessageFormat.format(message, messageArguments) + "] for resource: " + target.getFullPath().toOSString(), e); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$
+ }
+ }
return addError(message, severity, messageArguments, lineNumber, length, offset, target, documentProvider, markerId, markerOwner, getMaxNumberOfMarkersPerFile(target.getProject()), getMarkerType());
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -379,8 +379,22 @@
return false;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.ValidationErrorManager#getPreferencePageId()
+ */
@Override
protected String getPreferencePageId() {
return PREFERENCE_PAGE_ID;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.TempMarkerManager#getMessageBundleName()
+ */
+ @Override
+ protected String getMessageBundleName() {
+ // TODO
+ return null;
+ }
}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/BuilderValidationTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/BuilderValidationTest.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/BuilderValidationTest.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -33,7 +33,7 @@
/**
* See https://issues.jboss.org/browse/JBIDE-10872
- * EL incremental validation doesnt work for complex ELs.
+ * EL incremental validation doesn't work for complex ELs.
* @throws Exception
*/
public void testFullBuildValidation() throws Exception {
Modified: 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 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -167,9 +167,13 @@
* @return
*/
public static ELContext createPageContext(IDocument document) {
- return createPageContext(document, null);
+ return createPageContext(document, null, false);
}
+ public static ELContext createPageContext(IDocument document, boolean dontUseCache) {
+ return createPageContext(document, null, dontUseCache);
+ }
+
/**
* Creates a page context for the specified context document
*
@@ -178,9 +182,13 @@
* @return
*/
public static ELContext createPageContext(IDocument document, String contextType) {
- return createPageContext(document, null, contextType);
+ return createPageContext(document, null, contextType, false);
}
+ public static ELContext createPageContext(IDocument document, String contextType, boolean dontUseCache) {
+ return createPageContext(document, null, contextType, dontUseCache);
+ }
+
/**
* Creates a page context for the specified context file
*
@@ -211,9 +219,13 @@
* @return
*/
public static ELContext createPageContext(IDocument document, IFile file, String contextType) {
- return getInstance().createPageContext(document, file, new ArrayList<String>(), contextType);
+ return getInstance().createPageContext(document, file, new ArrayList<String>(), contextType, false);
}
+ public static ELContext createPageContext(IDocument document, IFile file, String contextType, boolean dontUseCache) {
+ return getInstance().createPageContext(document, file, new ArrayList<String>(), contextType, dontUseCache);
+ }
+
/**
* Cleans up the context for the file specified
*
@@ -341,15 +353,16 @@
* @param parents List of parent contexts
* @return
*/
- private ELContext createPageContext(IDocument document, IFile file, List<String> parents, String defaultContextType) {
- if (file == null)
+ private ELContext createPageContext(IDocument document, IFile file, List<String> parents, String defaultContextType, boolean dontUseCache) {
+ if (file == null) {
file = getResource(document);
-
- boolean isContextCachingAllowed = !EclipseUIUtil.isOpenInActiveEditor(file);
+ }
+
+ boolean isContextCachingAllowed = !dontUseCache && !EclipseUIUtil.isOpenInActiveEditor(file);
ELContext context = isContextCachingAllowed ? getSavedContext(file) : null;
if (context == null) {
String typeId = getContentTypeIdentifier(file == null ? document : file);
-
+
if(JavaCore.JAVA_SOURCE_CONTENT_TYPE.equalsIgnoreCase(typeId)) {
context = createJavaContext(file);
} else if(JAVA_PROPERTIES_CONTENT_TYPE.equalsIgnoreCase(typeId)) {
@@ -401,14 +414,14 @@
}
}
}
-
- if (context != null && isContextCachingAllowed) {
- saveConvext(context);
+
+ if (context != null) { // && isContextCachingAllowed) { <- Save context even for modified files to prevent multiple initialization when invoked from NON-UI thread.
+ saveConvext(context);
}
}
return context;
}
-
+
private static IProject getActiveProject() {
ITextEditor editor = EclipseUIUtil.getActiveEditor();
if (editor == null) return null;
@@ -656,7 +669,7 @@
if (fileName != null && !fileName.trim().isEmpty()) {
IFile file = getFileFromProject(fileName, context.getResource());
if (file != null && checkCycling(parents, file)) { // checkCycling is to fix for JBIDE-5083
- ELContext includedContext = createPageContext(null, file, newParentList, null);
+ ELContext includedContext = createPageContext(null, file, newParentList, null, false);
if (includedContext != null)
((IIncludedContextSupport)context).addIncludedContext(includedContext);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -32,8 +32,11 @@
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMember;
+import org.eclipse.jface.text.IRegion;
import org.eclipse.wst.validation.internal.core.ValidationException;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
+import org.eclipse.wst.validation.internal.provisional.core.IValidator;
import org.jboss.tools.common.CommonPlugin;
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.el.core.ELReference;
@@ -57,6 +60,8 @@
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.java.IJavaSourceReference;
import org.jboss.tools.common.validation.ContextValidationHelper;
+import org.jboss.tools.common.validation.EditorValidationContext;
+import org.jboss.tools.common.validation.IAsYouTypeValidator;
import org.jboss.tools.common.validation.IELValidationDelegate;
import org.jboss.tools.common.validation.IProjectValidationContext;
import org.jboss.tools.common.validation.IValidatingProjectTree;
@@ -70,7 +75,7 @@
* EL Validator
* @author Alexey Kazakov
*/
-public class ELValidator extends WebValidator {
+public class ELValidator extends WebValidator implements IAsYouTypeValidator {
public static final String ID = "org.jboss.tools.jst.web.kb.ELValidator"; //$NON-NLS-1$
public static final String PROBLEM_TYPE = "org.jboss.tools.jst.web.kb.elproblem"; //$NON-NLS-1$
@@ -202,7 +207,7 @@
validateFile(file);
}
for (ELReference el : elsToValidate) {
- validateEL(el);
+ validateEL(el, false, null);
coreHelper.getValidationContextManager().addValidatedProject(this, el.getResource().getProject());
}
@@ -239,6 +244,21 @@
return OK_STATUS;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.IAsYouTypeValidator#validate(org.eclipse.core.resources.IProject, org.eclipse.jface.text.IRegion, org.eclipse.wst.validation.internal.provisional.core.IValidationContext, org.eclipse.wst.validation.internal.provisional.core.IReporter, org.jboss.tools.common.validation.EditorValidationContext, org.eclipse.core.resources.IFile)
+ */
+ @Override
+ public void validate(IValidator validatorManager, IProject rootProject, IRegion dirtyRegion, IValidationContext helper, IReporter reporter, EditorValidationContext validationContext, IProjectValidationContext projectContext, IFile file) {
+ init(rootProject, null, projectContext, validatorManager, reporter);
+ this.document = validationContext.getDocument();
+ ELContext elContext = PageContextFactory.createPageContext(validationContext.getDocument(), true);
+ Set<ELReference> references = elContext.getELReferences(dirtyRegion);
+ for (ELReference elReference : references) {
+ validateEL(elReference, true, elContext);
+ }
+ }
+
private int markers;
private void validateFile(IFile file) {
@@ -253,42 +273,52 @@
if(context!=null) {
ELReference[] references = context.getELReferences();
for (int i = 0; i < references.length; i++) {
- if(!references[i].getSyntaxErrors().isEmpty()) {
- for (SyntaxError error: references[i].getSyntaxErrors()) {
- markers++;
- IJavaSourceReference reference = getJavaReference(file, references[i].getStartPosition() + error.getPosition(), 1);
- if(reference == null) {
- addError(ELValidationMessages.EL_SYNTAX_ERROR, ELSeverityPreferences.EL_SYNTAX_ERROR, new String[]{error.getProblem()}, references[i].getLineNumber(), 1, references[i].getStartPosition() + error.getPosition(), context.getResource());
- } else {
- addError(ELValidationMessages.EL_SYNTAX_ERROR, ELSeverityPreferences.EL_SYNTAX_ERROR, new String[]{error.getProblem()}, reference, context.getResource());
- }
- }
- }
if(markers<getMaxNumberOfMarkersPerFile(file.getProject())) {
- validateEL(references[i]);
+ validateEL(references[i], false, context);
}
}
}
}
- private void validateEL(ELReference el) {
- if(!reporter.isCancelled() && shouldBeValidated(el.getResource())) {
+ private void validateEL(ELReference el, boolean asYouType, ELContext context) {
+ if(asYouType || (!reporter.isCancelled() && shouldBeValidated(el.getResource()))) {
displaySubtask(ELValidationMessages.VALIDATING_EL_FILE, new String[]{el.getResource().getProject().getName(), el.getResource().getName()});
- el.deleteMarkers();
+ if(!asYouType) {
+ el.deleteMarkers();
+ }
+ if(context!=null && !el.getSyntaxErrors().isEmpty()) {
+ for (SyntaxError error: el.getSyntaxErrors()) {
+ markers++;
+ IJavaSourceReference reference = getJavaReference(el.getResource(), el.getStartPosition() + error.getPosition(), 1);
+ if(reference == null) {
+ if(asYouType) {
+ addMesssage(el.getResource(), el.getStartPosition() + error.getPosition(), 1, ELSeverityPreferences.EL_SYNTAX_ERROR, ELValidationMessages.EL_SYNTAX_ERROR, new String[]{error.getProblem()});
+ } else {
+ addError(ELValidationMessages.EL_SYNTAX_ERROR, ELSeverityPreferences.EL_SYNTAX_ERROR, new String[]{error.getProblem()}, el.getLineNumber(), 1, el.getStartPosition() + error.getPosition(), context.getResource());
+ }
+ } else {
+ if(asYouType) {
+ addMesssage(el.getResource(), reference, ELSeverityPreferences.EL_SYNTAX_ERROR, ELValidationMessages.EL_SYNTAX_ERROR, new String[]{error.getProblem()});
+ } else {
+ addError(ELValidationMessages.EL_SYNTAX_ERROR, ELSeverityPreferences.EL_SYNTAX_ERROR, new String[]{error.getProblem()}, reference, context.getResource());
+ }
+ }
+ }
+ }
for (ELExpression expresion : el.getEl()) {
- validateELExpression(el, expresion);
+ validateELExpression(el, expresion, asYouType, context);
}
}
}
- private void validateELExpression(ELReference elReference, ELExpression el) {
+ private void validateELExpression(ELReference elReference, ELExpression el, boolean asYouType, ELContext context) {
List<ELInvocationExpression> es = el.getInvocations();
for (ELInvocationExpression token: es) {
- validateElOperand(elReference, token);
+ validateElOperand(elReference, token, asYouType, context);
}
}
- private void validateElOperand(ELReference elReference, ELInvocationExpression operandToken) {
+ private void validateElOperand(ELReference elReference, ELInvocationExpression operandToken, boolean asYouType, ELContext context) {
IFile file = elReference.getResource();
int documnetOffset = elReference.getStartPosition();
String operand = operandToken.getText();
@@ -300,8 +330,10 @@
int lengthOfVarName = varName.length();
boolean unresolvedTokenIsVariable = false;
ELResolution resolution = null;
- ELContext context = PageContextFactory.createPageContext(file);
if(context==null) {
+ context = PageContextFactory.createPageContext(file);
+ }
+ if(context==null) {
context = new SimpleELContext();
context.setResource(file);
context.setElResolvers(resolvers);
@@ -320,17 +352,13 @@
if(elResolution==null) {
continue;
}
-// ELSegment previousSegment = null;
- for (ELSegment segment : elResolution.getSegments()) {
- IResource resource = segment.getResource();
- if(resource instanceof IFile) {
- validationContext.addLinkedEl(resource.getFullPath().toString(), elReference);
-// if(!segment.isResolved() && previousSegment!=null && previousSegment.isResolved() && previousSegment instanceof JavaMemberELSegment) {
-// IJavaElement element = ((JavaMemberELSegment)previousSegment).getJavaElement();
-// element
-// }
+ if(!asYouType) {
+ for (ELSegment segment : elResolution.getSegments()) {
+ IResource resource = segment.getResource();
+ if(resource instanceof IFile) {
+ validationContext.addLinkedEl(resource.getFullPath().toString(), elReference);
+ }
}
-// previousSegment = segment;
}
if(elResolution.isResolved()) {
resolution = elResolution;
@@ -350,10 +378,12 @@
if(resolution==null) {
return;
}
- if(!resolution.isResolved()) {
- Set<String> names = findVariableNames(operandToken);
- for (String name : names) {
- validationContext.addLinkedEl(name, elReference);
+ if(!asYouType) {
+ if(!resolution.isResolved()) {
+ Set<String> names = findVariableNames(operandToken);
+ for (String name : names) {
+ validationContext.addLinkedEl(name, elReference);
+ }
}
}
@@ -387,11 +417,19 @@
IJavaSourceReference reference = getJavaReference(file, startPosition, length);
IMarker marker = null;
if(reference != null) {
- marker = addError(ELValidationMessages.UNPAIRED_GETTER_OR_SETTER, ELSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, reference, file);
- elReference.addMarker(marker);
+ if(asYouType) {
+ addMesssage(file, reference, ELSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, ELValidationMessages.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName});
+ } else {
+ marker = addError(ELValidationMessages.UNPAIRED_GETTER_OR_SETTER, ELSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, reference, file);
+ elReference.addMarker(marker);
+ }
} else {
- marker = addError(ELValidationMessages.UNPAIRED_GETTER_OR_SETTER, ELSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, elReference.getLineNumber(), length, startPosition, file);
- elReference.addMarker(marker);
+ if(asYouType) {
+ addMesssage(file, startPosition, length, ELSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, ELValidationMessages.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName});
+ } else {
+ marker = addError(ELValidationMessages.UNPAIRED_GETTER_OR_SETTER, ELSeverityPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, elReference.getLineNumber(), length, startPosition, file);
+ elReference.addMarker(marker);
+ }
}
if(marker!=null) {
markers++;
@@ -399,9 +437,11 @@
}
}
}
- // Save links between resource and used variables names
- for(IVariable variable: usedVariables) {
- validationContext.addLinkedEl(variable.getName(), elReference);
+ if(!asYouType) {
+ // Save links between resource and used variables names
+ for(IVariable variable: usedVariables) {
+ validationContext.addLinkedEl(variable.getName(), elReference);
+ }
}
if (resolution.isResolved() || !resolution.isValidatable()) {
@@ -425,26 +465,35 @@
if(usedVariables.isEmpty()) {
unresolvedTokenIsVariable = true;
}
- IJavaSourceReference reference = getJavaReference(file, offsetOfVarName, lengthOfVarName);
+ IJavaSourceReference javaReference = getJavaReference(file, offsetOfVarName, lengthOfVarName);
IMarker marker = null;
// Mark invalid EL
+
+ String message = ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME;
+ String preference = ELSeverityPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME;
if(unresolvedTokenIsVariable) {
- if(reference == null) {
- marker = addError(ELValidationMessages.UNKNOWN_EL_VARIABLE_NAME, ELSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, new String[]{varName}, elReference.getLineNumber(), lengthOfVarName, offsetOfVarName, file);
+ message = ELValidationMessages.UNKNOWN_EL_VARIABLE_NAME;
+ preference = ELSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME;
+ }
+ if(javaReference == null) {
+ if(asYouType) {
+ addMesssage(file, offsetOfVarName, lengthOfVarName, preference, message, new String[]{varName});
} else {
- marker = addError(ELValidationMessages.UNKNOWN_EL_VARIABLE_NAME, ELSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, new String[]{varName}, reference, file);
+ marker = addError(message, preference, new String[]{varName}, elReference.getLineNumber(), lengthOfVarName, offsetOfVarName, file);
}
} else {
- if(reference == null) {
- marker = addError(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, ELSeverityPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new String[]{varName}, elReference.getLineNumber(), lengthOfVarName, offsetOfVarName, file);
+ if(asYouType) {
+ addMesssage(file, javaReference, preference, message, new String[]{varName});
} else {
- marker = addError(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, ELSeverityPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new String[]{varName}, reference, file);
+ marker = addError(message, preference, new String[]{varName}, javaReference, file);
}
}
if(marker != null) {
- elReference.addMarker(marker);
+ if(!asYouType) {
+ elReference.addMarker(marker);
+ }
markers++;
}
}
@@ -573,8 +622,23 @@
return true;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.ValidationErrorManager#getPreferencePageId()
+ */
@Override
protected String getPreferencePageId() {
return PREFERENCE_PAGE_ID;
}
+
+ private static final String BUNDLE_NAME = "org.jboss.tools.jst.web.kb.internal.validation.messages";
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.validation.TempMarkerManager#getMessageBundleName()
+ */
+ @Override
+ protected String getMessageBundleName() {
+ return BUNDLE_NAME;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/KBValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/KBValidator.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/KBValidator.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -29,7 +29,7 @@
import org.jboss.tools.common.validation.IValidatingProjectSet;
import org.jboss.tools.common.validation.IValidatingProjectTree;
import org.jboss.tools.common.validation.IValidator;
-import org.jboss.tools.common.validation.ValidationErrorManager;
+import org.jboss.tools.common.validation.TempMarkerManager;
import org.jboss.tools.common.validation.internal.SimpleValidatingProjectTree;
import org.jboss.tools.common.validation.internal.ValidatingProjectSet;
import org.jboss.tools.jst.web.kb.IKbProject;
@@ -39,7 +39,7 @@
/**
* @author Alexey Kazakov
*/
-public abstract class KBValidator extends ValidationErrorManager implements IValidator {
+public abstract class KBValidator extends TempMarkerManager implements IValidator {
protected boolean notValidatedYet(IResource resource) {
IProject pr = resource.getProject();
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java 2012-02-15 00:19:29 UTC (rev 38732)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java 2012-02-15 01:50:33 UTC (rev 38733)
@@ -205,4 +205,14 @@
support.add(marker);
return marker;
}
+
+ @Override
+ public void init(
+ IProject project,
+ ContextValidationHelper validationHelper,
+ IProjectValidationContext validationContext,
+ org.eclipse.wst.validation.internal.provisional.core.IValidator manager,
+ IReporter reporter, boolean asYouTypeValidation) {
+ this.init(project, validationHelper, validationContext, manager, reporter, false);
+ }
}
\ No newline at end of file
14 years, 1 month
JBoss Tools SVN: r38732 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-02-14 19:19:29 -0500 (Tue, 14 Feb 2012)
New Revision: 38732
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java
Log:
Wizard 'Specify CDI Bean for the Injection Point' does not compute correctly condition 'can finish' https://issues.jboss.org/browse/JBIDE-10637
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java 2012-02-14 23:01:19 UTC (rev 38731)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIMarkerResolutionUtils.java 2012-02-15 00:19:29 UTC (rev 38732)
@@ -284,7 +284,7 @@
for(ValuedQualifier vq : deployed){
String qualifierName = vq.getQualifier().getSourceType().getFullyQualifiedName();
String value = vq.getValue();
- String elName = getELName(bean);
+ String elName = "\""+getELName(bean)+"\"";
if(!value.isEmpty() && (!value.equals(elName) || !qualifierName.equals(CDIConstants.NAMED_QUALIFIER_TYPE_NAME))){
value = "("+value+")";
14 years, 1 month
JBoss Tools SVN: r38731 - trunk/documentation/jboss-tools-docs/index/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-02-14 18:01:19 -0500 (Tue, 14 Feb 2012)
New Revision: 38731
Modified:
trunk/documentation/jboss-tools-docs/index/en-US/master.xml
Log:
updated to break books into core and soa/brms tooling
Modified: trunk/documentation/jboss-tools-docs/index/en-US/master.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/index/en-US/master.xml 2012-02-14 22:53:56 UTC (rev 38730)
+++ trunk/documentation/jboss-tools-docs/index/en-US/master.xml 2012-02-14 23:01:19 UTC (rev 38731)
@@ -11,7 +11,8 @@
</copyright>
</bookinfo>
<index>
- <title/>
+ <title>JBoss Tools - Core</title>
+
<indexentry>
<primaryie>Getting Started with JBoss Developer Studio Guide <ulink
url="en/GettingStartedGuide/html/index.html">(html)</ulink>
@@ -28,6 +29,16 @@
>(pdf)</ulink>
</primaryie>
</indexentry>
+
+ <indexentry>
+ <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"
+ >(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
<indexentry>
<primaryie>CDI Tools Reference Guide <ulink
url="en/cdi_tools_reference_guide/html/index.html">(html)</ulink>
@@ -36,99 +47,101 @@
>(pdf)</ulink>
</primaryie>
</indexentry>
- <indexentry>
- <primaryie>OpenShift Tools Reference Guide <ulink
- url="en/openshift_tools_reference_guide/html/index.html">(html)</ulink>
- <ulink url="en/openshift_tools_reference_guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/openshift_tools_reference_guide/pdf/OpenShift_Reference_Guide.pdf"
- >(pdf)</ulink>
- </primaryie>
- </indexentry>
- <indexentry>
- <primaryie>Seam Dev Tools Reference Guide <ulink url="en/seam/html/index.html"
- >(html)</ulink>
- <ulink url="en/seam/html_single/index.html">(html single)</ulink>
- <ulink url="en/seam/pdf/Seam_Reference_Guide.pdf">(pdf)</ulink>
- </primaryie>
- </indexentry>
+
+ <indexentry>
+ <primaryie>ESB Editor Reference Guide <ulink
+ url="en/esb_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/esb_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/esb_ref_guide/pdf/ESB_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>
+ <ulink url="en/Exadel-migration/pdf/Exadel_Studio_Migration_Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>Hibernate Tools Reference Guide
+ <ulink url="en/hibernatetools/html/index.html">(html)</ulink>
+ <ulink url="en/hibernatetools/html_single/index.html">(html single)</ulink>
+ <ulink url="en/hibernatetools/pdf/Hibernatetools_Reference_Guide.pdf"
+ >(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>JBoss Portal Tools Reference Guide <ulink
+ url="en/jboss_portal_tools_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/jboss_portal_tools_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/jboss_portal_tools_ref_guide/pdf/JBoss_Portal_Tools_Reference_Guide.pdf"
+ >(pdf)</ulink>
+ </primaryie>
+ </indexentry>
<indexentry>
- <primaryie>Visual Web Tools Reference Guide <ulink url="en/jsf/html/index.html"
- >(html)</ulink>
- <ulink url="en/jsf/html_single/index.html">(html single)</ulink>
- <ulink url="en/jsf/pdf/Visual_Web_Tools_Reference_Guide.pdf">(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- <indexentry>
<primaryie>JBoss Server Manager Reference Guide <ulink url="en/as/html/index.html"
>(html)</ulink>
<ulink url="en/as/html_single/index.html">(html single)</ulink>
<ulink url="en/as/pdf/AS_Reference_Guide.pdf">(pdf)</ulink>
</primaryie>
</indexentry>
-
- <indexentry>
- <primaryie>jBPM Tools Reference Guide <ulink url="en/jboss_jbpm_ref_guide/html/index.html">(html)</ulink>
- <ulink url="en/jboss_jbpm_ref_guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/jboss_jbpm_ref_guide/pdf/JBPM_Reference_Guide.pdf">(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- <indexentry>
- <primaryie>Hibernate Tools Reference Guide
- <ulink url="en/hibernatetools/html/index.html">(html)</ulink>
- <ulink url="en/hibernatetools/html_single/index.html">(html single)</ulink>
- <ulink url="en/hibernatetools/pdf/Hibernatetools_Reference_Guide.pdf"
- >(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- <indexentry>
- <primaryie>ESB Editor Reference Guide <ulink
- url="en/esb_ref_guide/html/index.html">(html)</ulink>
- <ulink url="en/esb_ref_guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/esb_ref_guide/pdf/ESB_Reference_Guide.pdf"
- >(pdf)</ulink>
- </primaryie>
- </indexentry>
-
+
<indexentry>
- <primaryie>WS Restful Reference Guide<ulink
- url="en/ws_restful_reference/html/index.html">(html)</ulink>
- <ulink url="en/ws_restful_reference/html_single/index.html">(html single)</ulink>
- <ulink url="en/ws_restful_reference/pdf/RESTful_WS_Reference_Guide.pdf"
+ <primaryie>JMX Reference Guide <ulink
+ url="en/jmx_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/jmx_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/jmx_ref_guide/pdf/JMX_Tools_Reference_Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>JSF Tools Reference Guide <ulink
+ url="en/jsf_tools_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/jsf_tools_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/jsf_tools_ref_guide/pdf/JSF_Tools_Reference_Guide.pdf"
>(pdf)</ulink>
</primaryie>
</indexentry>
+
+ <indexentry>
+ <primaryie>JSF Tools Tutorial <ulink url="en/jsf_tools_tutorial/html/index.html"
+ >(html)</ulink>
+ <ulink url="en/jsf_tools_tutorial/html_single/index.html">(html single)</ulink>
+ <ulink url="en/jsf_tools_tutorial/pdf/JSF_Tools_Tutorial.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>OpenShift Tools Reference Guide <ulink
+ url="en/openshift_tools_reference_guide/html/index.html">(html)</ulink>
+ <ulink url="en/openshift_tools_reference_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/openshift_tools_reference_guide/pdf/OpenShift_Reference_Guide.pdf"
+ >(pdf)</ulink>
+ </primaryie>
+ </indexentry>
<indexentry>
- <primaryie>WS SOAP Reference Guide<ulink
- url="en/ws_soap_reference/html/index.html">(html)</ulink>
- <ulink url="en/ws_soap_reference/html_single/index.html">(html single)</ulink>
- <ulink url="en/ws_soap_reference/pdf/SOAP_WS_Reference_Guide.pdf"
- >(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- <indexentry>
- <primaryie>JSF Tools Reference Guide <ulink
- url="en/jsf_tools_ref_guide/html/index.html">(html)</ulink>
- <ulink url="en/jsf_tools_ref_guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/jsf_tools_ref_guide/pdf/JSF_Tools_Reference_Guide.pdf"
- >(pdf)</ulink>
- </primaryie>
- </indexentry>
+ <primaryie>Seam Dev Tools Reference Guide <ulink url="en/seam/html/index.html"
+ >(html)</ulink>
+ <ulink url="en/seam/html_single/index.html">(html single)</ulink>
+ <ulink url="en/seam/pdf/Seam_Reference_Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <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">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
<indexentry>
- <primaryie>JSF Tools Tutorial <ulink url="en/jsf_tools_tutorial/html/index.html"
- >(html)</ulink>
- <ulink url="en/jsf_tools_tutorial/html_single/index.html">(html single)</ulink>
- <ulink url="en/jsf_tools_tutorial/pdf/JSF_Tools_Tutorial.pdf">(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- <indexentry>
<primaryie>Struts Tools Reference Guide <ulink
url="en/struts_tools_ref_guide/html/index.html">(html)</ulink>
<ulink url="en/struts_tools_ref_guide/html_single/index.html">(html single)</ulink>
@@ -145,91 +158,84 @@
>(pdf)</ulink>
</primaryie>
</indexentry>
+
+ <indexentry>
+ <primaryie>Visual Web Tools Reference Guide <ulink url="en/jsf/html/index.html"
+ >(html)</ulink>
+ <ulink url="en/jsf/html_single/index.html">(html single)</ulink>
+ <ulink url="en/jsf/pdf/Visual_Web_Tools_Reference_Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>WS Restful Reference Guide<ulink
+ url="en/ws_restful_reference/html/index.html">(html)</ulink>
+ <ulink url="en/ws_restful_reference/html_single/index.html">(html single)</ulink>
+ <ulink url="en/ws_restful_reference/pdf/RESTful_WS_Reference_Guide.pdf"
+ >(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>WS SOAP Reference Guide<ulink
+ url="en/ws_soap_reference/html/index.html">(html)</ulink>
+ <ulink url="en/ws_soap_reference/html_single/index.html">(html single)</ulink>
+ <ulink url="en/ws_soap_reference/pdf/SOAP_WS_Reference_Guide.pdf"
+ >(pdf)</ulink>
+ </primaryie>
+ </indexentry>
- <indexentry>
- <primaryie>JBoss Portal Tools Reference Guide <ulink
- url="en/jboss_portal_tools_ref_guide/html/index.html">(html)</ulink>
- <ulink url="en/jboss_portal_tools_ref_guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/jboss_portal_tools_ref_guide/pdf/JBoss_Portal_Tools_Reference_Guide.pdf"
- >(pdf)</ulink>
- </primaryie>
- </indexentry>
-
-
- <indexentry>
- <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"
- >(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- <indexentry>
- <primaryie>Drools Tools Reference Guide<ulink
- url="en/drools_tools_ref_guide/html/index.html">(html)</ulink>
- <ulink url="en/drools_tools_ref_guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/drools_tools_ref_guide/pdf/Drools_Tools_Reference_Guide.pdf"
- >(pdf)</ulink>
- </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/Guvnor_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>
- <ulink url="en/Exadel-migration/pdf/Exadel_Studio_Migration_Guide.pdf">(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- <indexentry>
- <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">(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- <indexentry>
- <primaryie>BPMN Convert Reference Guide <ulink
- url="en/jboss_bpmn_convert_ref_guide/html/index.html">(html)</ulink>
- <ulink url="en/jboss_bpmn_convert_ref_guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/jboss_bpmn_convert_ref_guide/pdf/Converter_Reference_Guide.pdf">(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- <indexentry>
- <primaryie>JMX Reference Guide <ulink
- url="en/jmx_ref_guide/html/index.html">(html)</ulink>
- <ulink url="en/jmx_ref_guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/jmx_ref_guide/pdf/JMX_Tools_Reference_Guide.pdf">(pdf)</ulink>
- </primaryie>
- </indexentry>
-
-
- <indexentry>
- <primaryie>JBoss BPEL User Guide<ulink
- url="en/bpel_user_guide/html/index.html">(html)</ulink>
- <ulink url="en/bpel_user_guide/html_single/index.html">(html single)</ulink>
- <ulink url="en/bpel_user_guide/pdf/JBoss BPEL User Guide.pdf">(pdf)</ulink>
- </primaryie>
- </indexentry>
-
+ </index>
+ <index>
+ <title>JBoss Tools - SOA and Business Rules</title>
+
+ <indexentry>
+ <primaryie>BPMN Convert Reference Guide <ulink
+ url="en/jboss_bpmn_convert_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/jboss_bpmn_convert_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/jboss_bpmn_convert_ref_guide/pdf/Converter_Reference_Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>Drools Tools Reference Guide<ulink
+ url="en/drools_tools_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/drools_tools_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/drools_tools_ref_guide/pdf/Drools_Tools_Reference_Guide.pdf"
+ >(pdf)</ulink>
+ </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/Guvnor_Tools_Reference_Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>JBoss BPEL User Guide<ulink
+ url="en/bpel_user_guide/html/index.html">(html)</ulink>
+ <ulink url="en/bpel_user_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/bpel_user_guide/pdf/JBoss BPEL User Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ <indexentry>
+ <primaryie>jBPM Tools Reference Guide <ulink url="en/jboss_jbpm_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/jboss_jbpm_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/jboss_jbpm_ref_guide/pdf/JBPM_Reference_Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
<indexentry>
- <primaryie>ModeShape Tools Reference Guide<ulink
- url="en/modeshape/html/index.html">(html)</ulink>
- <ulink url="en/modeshape/html_single/index.html">(html single)</ulink>
- <ulink url="en/modeshape/pdf/JBoss BPEL User Guide.pdf">(pdf)</ulink>
- </primaryie>
- </indexentry>
-
- </index>
+ <primaryie>ModeShape Tools Reference Guide<ulink
+ url="en/modeshape/html/index.html">(html)</ulink>
+ <ulink url="en/modeshape/html_single/index.html">(html single)</ulink>
+ <ulink url="en/modeshape/pdf/JBoss BPEL User Guide.pdf">(pdf)</ulink>
+ </primaryie>
+ </indexentry>
+
+ </index>
</book>
14 years, 1 month
JBoss Tools SVN: r38730 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-02-14 17:53:56 -0500 (Tue, 14 Feb 2012)
New Revision: 38730
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamDSXMLWizard.java
Log:
JBIDE-10787
https://issues.jboss.org/browse/JBIDE-10787
Implementation for New DS XML wizard for Seam 2 projects.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamDSXMLWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamDSXMLWizard.java 2012-02-14 22:11:14 UTC (rev 38729)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamDSXMLWizard.java 2012-02-14 22:53:56 UTC (rev 38730)
@@ -1,12 +1,24 @@
package org.jboss.tools.seam.ui.wizard;
+import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import org.apache.tools.ant.types.FilterSet;
+import org.apache.tools.ant.types.FilterSetCollection;
+import org.apache.tools.ant.types.resources.FileResource;
+import org.apache.tools.ant.types.resources.StringResource;
+import org.apache.tools.ant.util.ResourceUtils;
import org.eclipse.core.resources.IFile;
+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.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -20,10 +32,19 @@
import org.eclipse.ui.internal.dialogs.DialogUtil;
import org.eclipse.ui.internal.wizards.newresource.ResourceMessages;
import org.eclipse.ui.wizards.newresource.BasicNewResourceWizard;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.jboss.tools.common.ui.IValidator;
import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamProjectsSet;
import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
-import org.jboss.tools.seam.ui.internal.project.facet.DataModelSynchronizer;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetFilterSetFactory;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreInstallDelegate;
import org.jboss.tools.seam.ui.internal.project.facet.SeamValidatorFactory;
public class SeamDSXMLWizard extends BasicNewResourceWizard {
@@ -79,9 +100,61 @@
protected InputStream getInitialContents() {
Object connection = connProfileSelEditor.getValue();
- //TODO generate text here
- return null;
+ // 1. Find template. For Seam project it is done by its runtime.
+ IPath containerPath = getContainerFullPath();
+ IProject currentProject = ResourcesPlugin.getWorkspace().getRoot().getFolder(containerPath).getProject();
+ SeamProjectsSet set = new SeamProjectsSet(currentProject);
+ IProject project = set.getWarProject();
+ if(project == null) {
+ return null;
+ }
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if(seamProject == null) {
+ return null;
+ }
+ SeamRuntime seamRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(seamProject.getRuntimeName());
+ String seamHomePath = seamRuntime.getHomeDir();
+ File dataSourceDsFile = new File(seamHomePath + "/seam-gen/resources/datasource-ds.xml"); //$NON-NLS-1$
+
+ //2. Create filter set for Ant.
+ FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
+
+ // For Seam project set is filled by reusing data model provider.
+ SeamFacetInstallDataModelProvider provider = new SeamFacetInstallDataModelProvider();
+ IDataModel model = (IDataModel)provider.create();
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, connection);
+ IConnectionProfile connProfile = ProfileManager.getInstance().getProfileByName(connection.toString());
+ if(connProfile == null) {
+ return null;
+ }
+ try {
+ new SeamFacetPreInstallDelegate().execute(project, null, model, new NullProgressMonitor());
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ return null;
+ }
+
+ FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
+ FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
+
+ viewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ viewFilterSetCollection.addFilterSet(projectFilterSet);
+
+ try {
+ // 3. Run Ant - copy template with replaces to StringResource.
+ StringResource sr = new StringResource();
+
+ ResourceUtils.copyResource(new FileResource(dataSourceDsFile), sr, viewFilterSetCollection,
+ null, true, false, false, null, null, null, false);
+
+ // 4. Return input stream for new ds file taken from temp file.
+ return sr.getInputStream();
+ } catch (IOException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ return null;
+ }
}
public void createControl(Composite parent) {
14 years, 1 month