JBoss Tools SVN: r32540 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-07-01 18:44:31 -0400 (Fri, 01 Jul 2011)
New Revision: 32540
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
Log:
JBIDE-9221 booking3-mavenized is incorrectly imported
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2011-07-01 22:44:23 UTC (rev 32539)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2011-07-01 22:44:31 UTC (rev 32540)
@@ -190,6 +190,11 @@
<property name="description">This project example requires Seam version 2.1</property>
</fix>
<fix type="plugin">
+ <property name="id">org.maven.ide.eclipse</property>
+ <property name="versions">0.9.9, 0.12.9</property>
+ <property name="description">This project example requires m2eclipse <= 0.12.x. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
+ </fix>
+ <fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
<property name="versions">0.9.9, 0.12.9</property>
<property name="description">This project example requires m2eclipse <= 0.12.x. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
@@ -271,6 +276,11 @@
<property name="description">This project example requires Seam version 2.0</property>
</fix>
<fix type="plugin">
+ <property name="id">org.maven.ide.eclipse</property>
+ <property name="versions">0.9.9, 0.12.9</property>
+ <property name="description">This project example requires m2eclipse <= 0.12.x. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
+ </fix>
+ <fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
<property name="versions">0.9.9, 0.12.9</property>
<property name="description">This project example requires m2eclipse <= 0.12.x. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
@@ -348,9 +358,14 @@
<property name="description">This project example requires Seam version 2.2.0</property>
</fix>
<fix type="plugin">
+ <property name="id">org.maven.ide.eclipse</property>
+ <property name="versions">0.9.9, 0.12.9</property>
+ <property name="description">This project example requires m2eclipse <= 0.12.x. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
+ </fix>
+ <fix type="plugin">
<property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions">0.9.9, 0.10.0</property>
- <property name="description">This project example requires m2eclipse. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
+ <property name="versions">0.9.9, 0.12.9</property>
+ <property name="description">This project example requires m2eclipse <= 0.12.x. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
</fix>
</fixes>
</project>
13 years, 6 months
JBoss Tools SVN: r32539 - in trunk/jsf/tests/org.jboss.tools.jsf.test: projects/jsf2pr and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-07-01 18:44:23 -0400 (Fri, 01 Jul 2011)
New Revision: 32539
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.classpath
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.project
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/.jsdtscope
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.component
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.jsdt.ui.superType.container
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.jsdt.ui.superType.name
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/resources.properties
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/TestWebContent/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/TestWebContent/inputname.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/META-INF/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/resources.properties
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/faces-config.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/lib/
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/web.xml
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/inputname.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/WebContentTest.java
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/ca/
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
Log:
https://issues.jboss.org/browse/JBIDE-9286
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.classpath
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.classpath (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.classpath 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/JBoss 6.x Runtime">
+ <attributes>
+ <attribute name="owner.project.facets" value="jst.jsf;jst.web"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.project
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.project (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.project 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jsf2pr</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/.jsdtscope
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/.jsdtscope (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/.jsdtscope 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="WebContent"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.component 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="jsf2pr">
+ <wb-resource deploy-path="/" source-path="/WebContent"/>
+ <wb-resource deploy-path="/" source-path="/TestWebContent"/>
+ <wb-resource deploy-path="/WEB-INF/classes" source-path="/JavaSource"/>
+ <property name="context-root" value="jsf2pr"/>
+ <property name="java-output-path" value="/jsf2pr/WebContent/WEB-INF/classes"/>
+ </wb-module>
+</project-modules>
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,7 @@
+<root>
+ <facet id="jst.jsf">
+ <node name="libprov">
+ <attribute name="provider-id" value="jsf-no-op-library-provider"/>
+ </node>
+ </facet>
+</root>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.xml 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="JBoss 6.x Runtime"/>
+ <fixed facet="wst.jsdt.web"/>
+ <fixed facet="java"/>
+ <fixed facet="jst.web"/>
+ <fixed facet="jst.jsf"/>
+ <installed facet="java" version="1.6"/>
+ <installed facet="jst.web" version="3.0"/>
+ <installed facet="jst.jsf" version="2.0"/>
+ <installed facet="wst.jsdt.web" version="1.0"/>
+</faceted-project>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.common.project.facet.core.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.jsdt.ui.superType.container (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.jsdt.ui.superType.container 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.jsdt.ui.superType.name (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/.settings/org.eclipse.wst.jsdt.ui.superType.name 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/resources.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/resources.properties (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/resources.properties 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,2 @@
+prompt=Your Name\:
+greeting=Hello
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/JavaSource/resources.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/TestWebContent/inputname.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/TestWebContent/inputname.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/TestWebContent/inputname.xhtml 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,7 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <h:outputText value="#{msgs.broken}" />
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/META-INF/MANIFEST.MF 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/META-INF/MANIFEST.MF
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/resources.properties
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/resources.properties (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/resources.properties 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,2 @@
+prompt=Your Name\:
+greeting=Hello
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/classes/resources.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/faces-config.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/faces-config.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/faces-config.xml 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<faces-config
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
+ version="2.0">
+
+ <navigation-rule>
+ <from-view-id>/pages/inputname.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>greeting</from-outcome>
+ <to-view-id>/pages/greeting.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <application>
+ <resource-bundle>
+ <base-name>resources</base-name>
+ <var>msgs</var>
+ </resource-bundle>
+ </application>
+</faces-config>
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/faces-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/web.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/web.xml 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+ <display-name>jsf2pr</display-name>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>default.html</welcome-file>
+ <welcome-file>default.htm</welcome-file>
+ <welcome-file>default.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/WEB-INF/web.xml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/inputname.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/inputname.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/projects/jsf2pr/WebContent/inputname.xhtml 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,7 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <h:outputText value="#{msgs.broken}" />
+</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2011-07-01 22:39:12 UTC (rev 32538)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/JsfAllTests.java 2011-07-01 22:44:23 UTC (rev 32539)
@@ -16,12 +16,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.eclipse.wst.validation.Validator;
import org.eclipse.wst.validation.internal.operations.ValidatorManager;
import org.jboss.tools.jsf.model.pv.test.JSFPromptingProviderTest;
import org.jboss.tools.jsf.model.pv.test.JsfJbide7975Test;
@@ -31,9 +27,9 @@
import org.jboss.tools.jsf.test.refactoring.MessagePropertyRefactoringTest;
import org.jboss.tools.jsf.test.refactoring.MethodRefactoringTest;
import org.jboss.tools.jsf.test.validation.ELValidatorTest;
-import org.jboss.tools.jsf.test.validation.I18nValidatorTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsInClassFolderTest;
import org.jboss.tools.jsf.test.validation.JSF2ComponentsValidatorTest;
+import org.jboss.tools.jsf.test.validation.WebContentTest;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
@@ -48,6 +44,7 @@
old.addTestSuite(JSFModelTest.class);
old.addTestSuite(ModelFormat_2_0_0_Test.class);
old.addTestSuite(JSFBeansTest.class);
+ suite.addTestSuite(WebContentTest.class);
suite.addTestSuite(XMLCatalogTest.class);
suite.addTestSuite(JSFPaletteTest.class);
suite.addTest(new ProjectImportTestSetup(old,
Added: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/WebContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/WebContentTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/WebContentTest.java 2011-07-01 22:44:23 UTC (rev 32539)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.test.validation;
+
+import java.text.MessageFormat;
+
+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.jboss.tools.jst.web.kb.internal.validation.ELValidationMessages;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.jboss.tools.tests.AbstractResourceMarkerTest;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class WebContentTest extends AbstractResourceMarkerTest {
+
+ protected static String PLUGIN_ID = "org.jboss.tools.jsf.test";
+ protected static String PROJECT_NAME = "jsf2pr";
+ protected static String PROJECT_PATH = "/projects/jsf2pr";
+ IProject project;
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
+ if(!project.exists()) {
+ project = ResourcesUtils.importProject(PLUGIN_ID, PROJECT_PATH);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
+ project.delete(true, true, null);
+ JobUtils.waitForIdle();
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
+ }
+
+ public void testWebContentValidation() throws CoreException {
+ IFile file = project.getFile("WebContent/input.xhtml");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "broken"), 6);
+ file = project.getFile("TestWebContent/input.xhtml");
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, MessageFormat.format(ELValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, "broken"), 6);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/WebContentTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 6 months
JBoss Tools SVN: r32538 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-07-01 18:39:12 -0400 (Fri, 01 Jul 2011)
New Revision: 32538
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
Log:
JBIDE-9221 booking3-mavenized is incorrectly imported
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2011-07-01 22:18:38 UTC (rev 32537)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2011-07-01 22:39:12 UTC (rev 32538)
@@ -190,15 +190,15 @@
<property name="description">This project example requires Seam version 2.1</property>
</fix>
<fix type="plugin">
+ <property name="id">org.maven.ide.eclipse.wtp</property>
+ <property name="versions">0.9.9, 0.12.9</property>
+ <property name="description">This project example requires m2eclipse <= 0.12.x. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
+ </fix>
+ <fix type="plugin">
<property name="id">org.testng.eclipse</property>
<property name="versions">5.8.0, 5.9.0</property>
<property name="description">The TestNG plugin is required if you want to run Seam tests. You can install it using the following update site: http://beust.com/eclipse</property>
</fix>
- <fix type="plugin">
- <property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions">0.9.9, 0.10.0</property>
- <property name="description">This project example requires m2eclipse. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
- </fix>
</fixes>
</project>
@@ -271,17 +271,16 @@
<property name="description">This project example requires Seam version 2.0</property>
</fix>
<fix type="plugin">
+ <property name="id">org.maven.ide.eclipse.wtp</property>
+ <property name="versions">0.9.9, 0.12.9</property>
+ <property name="description">This project example requires m2eclipse <= 0.12.x. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
+ </fix>
+ <fix type="plugin">
<property name="id">org.testng.eclipse</property>
<property name="versions">5.8.0, 5.9.0</property>
<property name="description">The TestNG plugin is required if you want to run Seam tests. You can install it using the following update site: http://beust.com/eclipse</property>
</fix>
- <fix type="plugin">
- <property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions">0.9.9, 0.10.0</property>
- <property name="description">This project example requires m2eclipse. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
- </fix>
-
</fixes>
</project>
13 years, 6 months
JBoss Tools SVN: r32537 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-07-01 18:18:38 -0400 (Fri, 01 Jul 2011)
New Revision: 32537
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java
Log:
https://issues.jboss.org/browse/JBIDE-9209
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java 2011-07-01 22:17:29 UTC (rev 32536)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java 2011-07-01 22:18:38 UTC (rev 32537)
@@ -16,8 +16,8 @@
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMarkerResolution2;
import org.eclipse.ui.part.FileEditorInput;
@@ -45,7 +45,7 @@
}
public String getLabel() {
- return Messages.bind(Messages.AddTLDMarkerResolution_Name, resolutionName);
+ return NLS.bind(Messages.AddTLDMarkerResolution_Name, resolutionName);
}
public void run(IMarker marker) {
@@ -68,10 +68,10 @@
}
public String getDescription() {
- return Messages.AddTLDMarkerResolution_Name;
+ return getLabel();
}
public Image getImage() {
- return ImageDescriptor.createFromFile(AddTLDMarkerResolution.class, "images/xstudio/editors/taglibs_file.gif").createImage(); //$NON-NLS-1$
+ return null;//ImageDescriptor.createFromFile(AddTLDMarkerResolution.class, "images/xstudio/editors/taglibs_file.gif").createImage(); //$NON-NLS-1$
}
}
\ No newline at end of file
13 years, 6 months
JBoss Tools SVN: r32536 - in trunk/jsf/plugins/org.jboss.tools.jsf: src/org/jboss/tools/jsf/jsf2 and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-01 18:17:29 -0400 (Fri, 01 Jul 2011)
New Revision: 32536
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/build/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/build/JSF2ProjectBuilder.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2ManagedBean.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2Project.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2Constants.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2ProjectFactory.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractMemberDefinition.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractTypeDefinition.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/DefinitionContext.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/JSF2Project.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/TypeDefinition.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/FileSet.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/lib/
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/lib/ClassPathMonitor.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
Log:
JBIDE-5046
https://issues.jboss.org/browse/JBIDE-5046
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2011-07-01 22:15:04 UTC (rev 32535)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2011-07-01 22:17:29 UTC (rev 32536)
@@ -8,6 +8,7 @@
Export-Package: org.jboss.tools.jsf,
org.jboss.tools.jsf.el.refactoring,
org.jboss.tools.jsf.facelet.model,
+ org.jboss.tools.jsf.jsf2.bean.build,
org.jboss.tools.jsf.jsf2.model,
org.jboss.tools.jsf.jsf2.refactoring,
org.jboss.tools.jsf.jsf2.refactoring.action.rename,
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/build/JSF2ProjectBuilder.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/build/JSF2ProjectBuilder.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/build/JSF2ProjectBuilder.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,357 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.build;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClassFile;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageDeclaration;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.jsf2.bean.model.JSF2ProjectFactory;
+import org.jboss.tools.jsf.jsf2.bean.model.impl.DefinitionContext;
+import org.jboss.tools.jsf.jsf2.bean.model.impl.JSF2Project;
+import org.jboss.tools.jsf.jsf2.bean.model.impl.TypeDefinition;
+import org.jboss.tools.jsf.jsf2.bean.scanner.FileSet;
+import org.jboss.tools.jst.web.kb.internal.IIncrementalProjectBuilderExtension;
+
+public class JSF2ProjectBuilder extends IncrementalProjectBuilder implements IIncrementalProjectBuilderExtension {
+
+ JSF2ResourceVisitor resourceVisitor = null;
+
+ public JSF2ProjectBuilder() {}
+
+ protected JSF2Project getJSF2Project() {
+ IProject p = getProject();
+ if(p == null) return null;
+ return (JSF2Project)JSF2ProjectFactory.getJSF2Project(p, false);
+ }
+
+ JSF2ResourceVisitor getResourceVisitor() {
+ if(resourceVisitor == null) {
+ resourceVisitor = new JSF2ResourceVisitor();
+ }
+ return resourceVisitor;
+ }
+
+ @Override
+ public IProject[] build(int kind, Map<String, String> args,
+ IProgressMonitor monitor) throws CoreException {
+ resourceVisitor = null;
+
+ JSF2Project n = getJSF2Project();
+ if(n == null) {
+ return null;
+ }
+
+ if(n.hasNoStorage()) {
+ kind = FULL_BUILD;
+ }
+
+ n.postponeFiring();
+
+ try {
+ n.resolveStorage(kind != FULL_BUILD);
+
+ //1. Check class path.
+ boolean isClassPathUpdated = n.getClassPath().update();
+
+ Map<String, XModelObject> newJars = new HashMap<String, XModelObject>();
+ if(isClassPathUpdated) {
+ //2. Update class path. Removed paths will be cached to be applied to working copy of context.
+ n.getClassPath().setSrcs(getResourceVisitor().srcs);
+ newJars = n.getClassPath().process();
+
+ }
+
+ //4. Create working copy of context.
+ n.getDefinitions().newWorkingCopy(kind == FULL_BUILD);
+
+ //5. Modify working copy of context.
+ //5.1 Apply Removed paths.
+ if(isClassPathUpdated) {
+ n.getClassPath().applyRemovedPaths();
+ }
+
+ //5.2 Discover sources and build definitions.
+ if(isClassPathUpdated) {
+ buildJars(newJars);
+
+ n.getClassPath().validateProjectDependencies();
+
+ kind = FULL_BUILD;
+ } else if(n.getClassPath().hasToUpdateProjectDependencies()) {
+ n.getClassPath().validateProjectDependencies();
+ }
+
+ if (kind == FULL_BUILD) {
+ fullBuild(monitor);
+ } else {
+ IResourceDelta delta = getDelta(getProject());
+ if (delta == null) {
+ fullBuild(monitor);
+ } else {
+ incrementalBuild(delta, monitor);
+ }
+ }
+
+ // 6. Save created definitions to project context and build beans.
+ getJSF2Project().getDefinitions().applyWorkingCopy();
+
+ try {
+ n.store();
+ } catch (IOException e) {
+ JSFModelPlugin.getDefault().logError(e); //$NON-NLS-1$
+ }
+ } finally {
+ n.fireChanges();
+ }
+
+ return null;
+ }
+
+ protected void fullBuild(final IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ JSF2ResourceVisitor rv = getResourceVisitor();
+ rv.incremental = false;
+ getProject().accept(rv);
+ FileSet fs = rv.fileSet;
+ build(fs, getJSF2Project());
+
+ } catch (CoreException e) {
+ JSFModelPlugin.getDefault().logError(e);
+ }
+ }
+
+ protected void incrementalBuild(IResourceDelta delta,
+ IProgressMonitor monitor) throws CoreException {
+ JSF2ResourceVisitor rv = getResourceVisitor();
+ rv.incremental = true;
+ delta.accept(new SampleDeltaVisitor());
+ FileSet fs = rv.fileSet;
+ build(fs, getJSF2Project());
+ }
+
+ protected void buildJars(Map<String, XModelObject> newJars) throws CoreException {
+ IJavaProject jp = EclipseResourceUtil.getJavaProject(getJSF2Project().getProject());
+ if(jp == null) return;
+ FileSet fileSet = new FileSet();
+
+ for (String jar: newJars.keySet()) {
+ Path path = new Path(jar);
+ IPackageFragmentRoot root = jp.getPackageFragmentRoot(jar);
+ if(root == null) continue;
+ if(!root.exists()) {
+ IFile f = EclipseResourceUtil.getFile(jar);
+ if(f != null && f.exists()) {
+ root = jp.getPackageFragmentRoot(f);
+ } else {
+ f = EclipseResourceUtil.getFile(jar + "/META-INF/web-fragment.xml");
+ if(f != null && f.exists()) {
+ root = jp.getPackageFragmentRoot(f.getParent().getParent());
+ }
+ }
+ }
+ if (root == null || !root.exists())
+ continue;
+ IJavaElement[] es = root.getChildren();
+ for (IJavaElement e : es) {
+ if (e instanceof IPackageFragment) {
+ IPackageFragment pf = (IPackageFragment) e;
+ IClassFile[] cs = pf.getClassFiles();
+ for (IClassFile c : cs) {
+ fileSet.add(path, c.getType());
+ }
+ }
+ }
+ }
+ build(fileSet, getJSF2Project());
+ }
+
+ void build(FileSet fs, JSF2Project project) {
+ DefinitionContext context = getJSF2Project().getDefinitions().getWorkingCopy();
+ Map<IPath, Set<IType>> cs = fs.getClasses();
+ for (IPath f: cs.keySet()) {
+ Set<IType> ts = cs.get(f);
+ for (IType type: ts) {
+ TypeDefinition def = new TypeDefinition();
+ def.setType(type, context, TypeDefinition.FLAG_ALL_MEMBERS);
+ context.addType(f, type.getFullyQualifiedName(), def);
+ }
+ }
+ }
+
+ class SampleDeltaVisitor implements IResourceDeltaVisitor {
+ /*
+ * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta)
+ */
+ public boolean visit(IResourceDelta delta) throws CoreException {
+ IResource resource = delta.getResource();
+ switch (delta.getKind()) {
+ case IResourceDelta.ADDED:
+ return getResourceVisitor().visit(resource);
+ case IResourceDelta.REMOVED:
+ JSF2Project p = getJSF2Project();
+ if(p != null) {
+ p.getDefinitions().getWorkingCopy().clean(resource.getFullPath());
+ }
+ break;
+ case IResourceDelta.CHANGED:
+ return getResourceVisitor().visit(resource);
+ }
+ //return true to continue visiting children.
+ return true;
+ }
+ }
+
+ class JSF2ResourceVisitor implements IResourceVisitor {
+ boolean incremental = false;
+ FileSet fileSet = new FileSet();
+ IPath[] outs = new IPath[0];
+ IPath[] srcs = new IPath[0];
+ Set<IPath> visited = new HashSet<IPath>();
+
+ public JSF2ResourceVisitor() {
+ getJavaSourceRoots(getProject());
+ }
+
+ void getJavaSourceRoots(IProject project) {
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
+ if(javaProject == null) return;
+ List<IPath> ps = new ArrayList<IPath>();
+ List<IPath> os = new ArrayList<IPath>();
+ try {
+ IPath output = javaProject.getOutputLocation();
+ if(output != null) os.add(output);
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ IResource findMember = ModelPlugin.getWorkspace().getRoot().findMember(es[i].getPath());
+ if(findMember != null && findMember.exists()) {
+ ps.add(findMember.getFullPath());
+ }
+ IPath out = es[i].getOutputLocation();
+ if(out != null && !os.contains(out)) {
+ os.add(out);
+ }
+ }
+ }
+ srcs = ps.toArray(new IPath[0]);
+ outs = os.toArray(new IPath[0]);
+ } catch(CoreException ce) {
+ JSFModelPlugin.getDefault().logError("Error while locating java source roots for " + project, ce);
+ }
+ }
+
+ @Override
+ public boolean visit(IResource resource) throws CoreException {
+ IPath path = resource.getFullPath();
+ if(resource instanceof IFile) {
+ if(visited.contains(path)) {
+ return false;
+ }
+ visited.add(path);
+ IFile f = (IFile)resource;
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(path)) {
+ return false;
+ }
+ }
+ for (int i = 0; i < srcs.length; i++) {
+ if(srcs[i].isPrefixOf(path)) {
+ if(f.getName().endsWith(".java")) {
+ ICompilationUnit unit = EclipseUtil.getCompilationUnit(f);
+ if(unit!=null) {
+ if(f.getName().equals("package-info.java")) {
+ IPackageDeclaration[] pkg = unit.getPackageDeclarations();
+ if(pkg != null && pkg.length > 0) {
+ fileSet.add(f.getFullPath(), pkg[0]);
+ if(incremental) {
+ IResource[] ms = resource.getParent().members();
+ for (IResource m: ms) {
+ if(m instanceof IFile && !m.getName().equals("package-info.java")) {
+ visit(m);
+ }
+ }
+ }
+ }
+ } else {
+ IType[] ts = unit.getTypes();
+ fileSet.add(f.getFullPath(), ts);
+ }
+ }
+ }
+ Set<IFile> ds = getDependentFiles(path, visited);
+ if(ds != null) for (IFile d: ds) visit(d);
+ return false;
+ }
+ }
+ Set<IFile> ds = getDependentFiles(path, visited);
+ if(ds != null) for (IFile d: ds) visit(d);
+ }
+
+ if(resource instanceof IFolder) {
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(path)) {
+ return false;
+ }
+ }
+ for (int i = 0; i < srcs.length; i++) {
+ if(srcs[i].isPrefixOf(path) || path.isPrefixOf(srcs[i])) {
+ return true;
+ }
+ }
+ if(resource == resource.getProject()) {
+ return true;
+ }
+ return false;
+ }
+ //return true to continue visiting children.
+ return true;
+ }
+
+ }
+
+ //In case if we will need that
+ Set<IFile> getDependentFiles(IPath path, Set<IPath> visited) {
+ return null;
+ }
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/build/JSF2ProjectBuilder.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2ManagedBean.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2ManagedBean.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2ManagedBean.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.model;
+
+public interface IJSF2ManagedBean {
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2ManagedBean.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2Project.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2Project.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2Project.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.model;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+
+public interface IJSF2Project {
+
+ public IJSF2ManagedBean[] getManagedBeans();
+
+ public Set<IJSF2ManagedBean> getManagedBeans(IPath path);
+
+ public IProject getProject();
+
+ public Set<? extends IJSF2Project> getUsedProjects();
+
+ public void addUsedProject(IJSF2Project project);
+
+ public void addDependentProject(IJSF2Project project);
+
+ public void removeUsedProject(IJSF2Project project);
+
+ public void pathRemoved(IPath path);
+
+ public boolean isStorageResolved();
+ public void resolve();
+ public void update();
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/IJSF2Project.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2Constants.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2Constants.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2Constants.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.model;
+
+public interface JSF2Constants {
+ public String MANAGED_BEAN_ANNOTATION_TYPE_NAME = "javax.faces.bean.ManagedBean";
+ public String MANAGED_PROPERTY_ANNOTATION_TYPE_NAME = "javax.faces.bean.ManagedProperty";
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2Constants.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2ProjectFactory.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2ProjectFactory.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2ProjectFactory.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.model;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.jsf.jsf2.bean.model.impl.JSF2Project;
+import org.jboss.tools.jst.web.kb.KbProjectFactory;
+import org.jboss.tools.jst.web.kb.internal.KbProject;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class JSF2ProjectFactory {
+ private static final String MODEL_ID = "JSF2";
+
+ public static IJSF2Project getJSF2Project(IProject project, boolean resolve) {
+ JSF2Project result = null;
+ KbProject kb = (KbProject)KbProjectFactory.getKbProject(project, resolve);
+
+ if(kb != null) {
+ result = (JSF2Project)kb.getExtensionModel(MODEL_ID);
+ if(result == null) {
+ result = new JSF2Project();
+ result.setProject(project);
+ kb.setExtensionModel(MODEL_ID, result);
+ }
+ }
+ if(result != null && resolve) {
+ result.resolve();
+ }
+ return result;
+ }
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/JSF2ProjectFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractMemberDefinition.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractMemberDefinition.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractMemberDefinition.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.model.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IAnnotatable;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.common.java.IAnnotated;
+import org.jboss.tools.common.java.IAnnotationDeclaration;
+import org.jboss.tools.common.java.IJavaAnnotation;
+import org.jboss.tools.common.java.impl.AnnotationDeclaration;
+import org.jboss.tools.common.java.impl.JavaAnnotation;
+import org.jboss.tools.common.text.ITextSourceReference;
+import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.jsf2.bean.model.JSF2Constants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public abstract class AbstractMemberDefinition implements IAnnotated {
+ public static int FLAG_NO_ANNOTATIONS = 1;
+ public static int FLAG_ALL_MEMBERS = 2;
+
+ protected List<IAnnotationDeclaration> annotations = new ArrayList<IAnnotationDeclaration>();
+ protected IAnnotatable member;
+ protected Map<String, AnnotationDeclaration> annotationsByType = new HashMap<String, AnnotationDeclaration>();
+ protected IResource resource;
+
+ protected ITextSourceReference originalDefinition = null;
+
+ public AbstractMemberDefinition() {}
+
+ protected void setAnnotatable(IAnnotatable member, IType contextType, DefinitionContext context, int flags) {
+ this.member = member;
+ try {
+ init(contextType, context, flags);
+ } catch (CoreException e) {
+ JSFModelPlugin.getDefault().logError(e);
+ }
+ }
+
+ public void setOriginalDefinition(ITextSourceReference def) {
+ originalDefinition = def;
+ }
+
+ public IAnnotatable getMember() {
+ return member;
+ }
+
+ public AbstractTypeDefinition getTypeDefinition() {
+ return null;
+ }
+
+ protected void init(IType contextType, DefinitionContext context, int flags) throws CoreException {
+ resource = ((IJavaElement)member).getResource();
+ if((flags & FLAG_NO_ANNOTATIONS) == 0) {
+ IAnnotation[] ts = member.getAnnotations();
+ for (int i = 0; i < ts.length; i++) {
+ IJavaAnnotation ja = new JavaAnnotation(ts[i], contextType);
+ addAnnotation(ja, context);
+ }
+ }
+ }
+
+ public void addAnnotation(IJavaAnnotation ja, DefinitionContext context) {
+ AnnotationDeclaration a = new AnnotationDeclaration();
+ a.setDeclaration(ja);
+ addAnnotation(a, context);
+ }
+
+ private void addAnnotation(AnnotationDeclaration a, DefinitionContext context) {
+ annotations.add(a);
+ if(a.getTypeName() != null) {
+ annotationsByType.put(a.getTypeName(), a);
+ }
+ }
+
+ public void removeAnnotation(IAnnotationDeclaration a) {
+ String name = ((AnnotationDeclaration)a).getTypeName();
+ IAnnotationDeclaration b = annotationsByType.get(name);
+ if(a == b) {
+ annotationsByType.remove(name);
+ annotations.remove(a);
+ }
+ }
+
+ public List<IAnnotationDeclaration> getAnnotations() {
+ return annotations;
+ }
+
+ public AnnotationDeclaration getAnnotation(String typeName) {
+ return annotationsByType.get(typeName);
+ }
+
+ public ITextSourceReference getAnnotationPosition(String annotationTypeName) {
+ return getAnnotation(annotationTypeName);
+ }
+
+ public boolean isAnnotationPresent(String annotationTypeName) {
+ return getAnnotation(annotationTypeName)!=null;
+ }
+
+ public AnnotationDeclaration getManagedBeanAnnotation() {
+ return annotationsByType.get(JSF2Constants.MANAGED_BEAN_ANNOTATION_TYPE_NAME);
+ }
+
+ public IResource getResource() {
+ return resource;
+ }
+
+ public ITextSourceReference getOriginalDefinition() {
+ return originalDefinition;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractMemberDefinition.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractTypeDefinition.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractTypeDefinition.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractTypeDefinition.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.model.impl;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.common.util.FileUtil;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class AbstractTypeDefinition extends AbstractMemberDefinition {
+ protected String qualifiedName;
+ protected IType type;
+
+ protected String content = null;
+
+ public AbstractTypeDefinition() {}
+
+ @Override
+ public AbstractTypeDefinition getTypeDefinition() {
+ return this;
+ }
+
+ public String getQualifiedName() {
+ return qualifiedName;
+ }
+
+ public IType getType() {
+ return type;
+ }
+
+ public void setType(IType type, DefinitionContext context, int flags) {
+ super.setAnnotatable(type, type, context, flags);
+ }
+
+ @Override
+ protected void init(IType contextType, DefinitionContext context, int flags) throws CoreException {
+ this.type = contextType;
+ super.init(contextType, context, flags);
+ qualifiedName = getType().getFullyQualifiedName();
+ }
+
+ public String getContent() {
+ if(type == null || type.isBinary()) return null;
+ if(content == null && resource instanceof IFile && resource.getName().endsWith(".java")) {
+ content = FileUtil.getContentFromEditorOrFile((IFile)resource);
+ }
+ return content;
+ }
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/AbstractTypeDefinition.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/DefinitionContext.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/DefinitionContext.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/DefinitionContext.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.jsf2.bean.model.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.jsf2.bean.model.JSF2Constants;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class DefinitionContext {
+ protected JSF2Project project;
+ protected IJavaProject javaProject;
+
+ private Set<String> types = new HashSet<String>();
+ private Map<IPath, Set<IPath>> childPaths = new HashMap<IPath, Set<IPath>>();
+ private Map<IPath, Set<String>> resources = new HashMap<IPath, Set<String>>();
+ private Map<String, TypeDefinition> typeDefinitions = new HashMap<String, TypeDefinition>();
+
+ private DefinitionContext workingCopy;
+ private DefinitionContext original;
+
+ public DefinitionContext() {}
+
+ private DefinitionContext copy(boolean clean) {
+ DefinitionContext copy = new DefinitionContext();
+ copy.project = project;
+ copy.javaProject = javaProject;
+ if(!clean) {
+ copy.types.addAll(types);
+ copy.typeDefinitions.putAll(typeDefinitions);
+
+ for (IPath p: resources.keySet()) {
+ Set<String> set = resources.get(p);
+ if(set != null) {
+ Set<String> s1 = new HashSet<String>();
+ s1.addAll(set);
+ copy.resources.put(p, s1);
+ }
+ }
+ for (IPath p: childPaths.keySet()) {
+ Set<IPath> set = childPaths.get(p);
+ if(set != null) {
+ Set<IPath> s1 = new HashSet<IPath>();
+ s1.addAll(set);
+ copy.childPaths.put(p, s1);
+ }
+ }
+ }
+
+ return copy;
+ }
+
+ public void setProject(JSF2Project project) {
+ this.project = project;
+ javaProject = EclipseResourceUtil.getJavaProject(project.getProject());
+ }
+
+ public JSF2Project getProject() {
+ return project;
+ }
+
+ public IJavaProject getJavaProject() {
+ return javaProject;
+ }
+
+ public void addType(IPath file, String typeName, TypeDefinition def) {
+ addType(file, typeName);
+ if(def != null) {
+ synchronized (typeDefinitions) {
+ typeDefinitions.put(def.getQualifiedName(), (TypeDefinition)def);
+ }
+ }
+ }
+
+ public void addType(IPath file, String typeName) {
+ if(file != null) {
+ Set<String> ts = resources.get(file);
+ if(ts == null) {
+ ts = new HashSet<String>();
+ resources.put(file, ts);
+ }
+ ts.add(typeName);
+ types.add(typeName);
+ addToParents(file);
+ }
+ }
+
+ public void addToParents(IPath file) {
+ if(file == null) return;
+ if(file.segmentCount() < 2) return;
+ IPath q = file;
+ while(q.segmentCount() >= 2) {
+ q = q.removeLastSegments(1);
+ Set<IPath> cs = childPaths.get(q);
+ if(cs == null) {
+ childPaths.put(q, cs = new HashSet<IPath>());
+ }
+ cs.add(file);
+ }
+ }
+
+ public void clean() {
+ childPaths.clear();
+ resources.clear();
+ types.clear();
+ synchronized (typeDefinitions) {
+ typeDefinitions.clear();
+ }
+
+ }
+
+ public void clean(IPath path) {
+ Set<String> ts = resources.remove(path);
+ if(ts != null) for (String t: ts) {
+ clean(t);
+ }
+
+ Set<IPath> cs = childPaths.get(path);
+ if(cs != null) {
+ IPath[] ps = cs.toArray(new IPath[0]);
+ for (IPath p: ps) {
+ clean(p);
+ }
+ } else {
+ removeFromParents(path);
+ }
+
+ }
+
+ public void clean(String typeName) {
+ types.remove(typeName);
+ synchronized (typeDefinitions) {
+ typeDefinitions.remove(typeName);
+ }
+ }
+
+ void removeFromParents(IPath file) {
+ if(file == null) return;
+ IPath q = file;
+ while(q.segmentCount() >= 2) {
+ q = q.removeLastSegments(1);
+ Set<IPath> cs = childPaths.get(q);
+ if(cs != null) {
+ cs.remove(file);
+ if(cs.isEmpty()) {
+ childPaths.remove(q);
+ }
+ }
+ }
+ }
+
+ public int getAnnotationKind(IType annotationType) {
+ if(annotationType == null) return -1;
+ if(!annotationType.exists()) return -1;
+ String name = annotationType.getFullyQualifiedName();
+ //? use cache for basic?
+ if(types.contains(name)) {
+ return 0;
+ }
+// if(AnnotationHelper.SCOPE_ANNOTATION_TYPES.contains(name)) {
+// return AnnotationDefinition.SCOPE;
+// }
+ if(JSF2Constants.MANAGED_BEAN_ANNOTATION_TYPE_NAME.equals(name)) {
+ return 1;
+ }
+ return 0;
+ }
+
+ public void newWorkingCopy(boolean forFullBuild) {
+ if(original != null) return;
+ workingCopy = copy(forFullBuild);
+ workingCopy.original = this;
+ }
+
+ public DefinitionContext getWorkingCopy() {
+ if(original != null) {
+ return this;
+ }
+ if(workingCopy != null) {
+ return workingCopy;
+ }
+ workingCopy = copy(false);
+ workingCopy.original = this;
+ return workingCopy;
+ }
+
+ public void applyWorkingCopy() {
+ if(original != null) {
+ original.applyWorkingCopy();
+ return;
+ }
+ if(workingCopy == null) {
+ return;
+ }
+
+ Set<TypeDefinition> newTypeDefinitions = new HashSet<TypeDefinition>();
+ for (String typeName: workingCopy.typeDefinitions.keySet()) {
+ TypeDefinition nd = workingCopy.typeDefinitions.get(typeName);
+ TypeDefinition od = typeDefinitions.get(typeName);
+ if(od != nd) {
+ newTypeDefinitions.add(nd);
+ }
+ }
+
+ types = workingCopy.types;
+ resources = workingCopy.resources;
+ childPaths = workingCopy.childPaths;
+ typeDefinitions = workingCopy.typeDefinitions;
+
+ project.update();
+
+ workingCopy = null;
+ }
+
+ public void dropWorkingCopy() {
+ if(original != null) {
+ original.dropWorkingCopy();
+ } else {
+ workingCopy = null;
+ }
+ }
+
+ public List<TypeDefinition> getTypeDefinitions() {
+ List<TypeDefinition> result = new ArrayList<TypeDefinition>();
+ synchronized (typeDefinitions) {
+ result.addAll(typeDefinitions.values());
+ }
+ return result;
+ }
+
+ public TypeDefinition getTypeDefinition(String fullyQualifiedName) {
+ return typeDefinitions.get(fullyQualifiedName);
+ }
+
+}
+
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/DefinitionContext.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/JSF2Project.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/JSF2Project.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/JSF2Project.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,328 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.model.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.common.model.XJob;
+import org.jboss.tools.common.model.XJob.XRunnable;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.util.EclipseJavaUtil;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.jsf2.bean.model.IJSF2ManagedBean;
+import org.jboss.tools.jsf.jsf2.bean.model.IJSF2Project;
+import org.jboss.tools.jsf.jsf2.bean.model.JSF2ProjectFactory;
+import org.jboss.tools.jsf.jsf2.bean.scanner.lib.ClassPathMonitor;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
+import org.jboss.tools.jst.web.kb.internal.KbBuilder;
+import org.w3c.dom.Element;
+
+public class JSF2Project implements IJSF2Project {
+ IProject project = null;
+
+ ClassPathMonitor classPath = new ClassPathMonitor(this);
+ DefinitionContext definitions = new DefinitionContext();
+
+ boolean isBuilt = false;
+ private boolean isStorageResolved = false;
+
+ Set<JSF2Project> dependsOn = new HashSet<JSF2Project>();
+ Set<JSF2Project> usedBy = new HashSet<JSF2Project>();
+
+ private Map<IPath, Set<IJSF2ManagedBean>> beansByPath = new HashMap<IPath, Set<IJSF2ManagedBean>>();
+ private Map<String, Set<IJSF2ManagedBean>> beansByName = new HashMap<String, Set<IJSF2ManagedBean>>();
+ private Set<IJSF2ManagedBean> namedBeans = new HashSet<IJSF2ManagedBean>();
+
+ public JSF2Project() {
+ definitions.setProject(this);
+ }
+
+ @Override
+ public IJSF2ManagedBean[] getManagedBeans() {
+ return namedBeans.toArray(new IJSF2ManagedBean[0]);
+ }
+
+ @Override
+ public Set<IJSF2ManagedBean> getManagedBeans(IPath path) {
+ Set<IJSF2ManagedBean> result = new HashSet<IJSF2ManagedBean>();
+ Set<IJSF2ManagedBean> beans = beansByPath.get(path);
+ if(beans != null && !beans.isEmpty()) result.addAll(beans);
+ return result;
+ }
+
+ @Override
+ public IProject getProject() {
+ return project;
+ }
+
+ /**
+ * Convenience method.
+ *
+ * @param qualifiedName
+ * @return
+ */
+ public IType getType(String qualifiedName) {
+ IJavaProject jp = EclipseResourceUtil.getJavaProject(getProject());
+ if(jp == null) return null;
+ try {
+ return EclipseJavaUtil.findType(jp, qualifiedName);
+ } catch (JavaModelException e) {
+ JSFModelPlugin.getDefault().logError(e);
+ }
+ return null;
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+ classPath.init();
+ }
+
+ @Override
+ public Set<JSF2Project> getUsedProjects() {
+ return dependsOn;
+ }
+
+ public Set<JSF2Project> getUsedProjects(boolean hierarchy) {
+ if(hierarchy) {
+ if(dependsOn.isEmpty()) return dependsOn;
+ Set<JSF2Project> result = new HashSet<JSF2Project>();
+ getAllUsedProjects(result);
+ return result;
+ } else {
+ return dependsOn;
+ }
+ }
+
+ void getAllUsedProjects(Set<JSF2Project> result) {
+ for (JSF2Project n: dependsOn) {
+ if(result.contains(n)) continue;
+ result.add(n);
+ n.getAllUsedProjects(result);
+ }
+ }
+
+ public Set<JSF2Project> getDependentProjects() {
+ return usedBy;
+ }
+
+ @Override
+ public void addUsedProject(final IJSF2Project project) {
+ if(dependsOn.contains(project)) return;
+ addUsedProjectInternal(project);
+ project.addDependentProject(this);
+ if(!project.isStorageResolved()) {
+ XJob.addRunnableWithPriority(new XRunnable() {
+ public void run() {
+ project.resolve();
+ project.update();
+ }
+ public String getId() {
+ return "Build JSF2 Project " + project.getProject().getName();
+ }
+ });
+ }
+ }
+
+ void addUsedProjectInternal(IJSF2Project project) {
+ synchronized (dependsOn) {
+ dependsOn.add((JSF2Project)project);
+ }
+ }
+
+ public void addDependentProject(IJSF2Project project) {
+ usedBy.add((JSF2Project)project);
+ }
+
+ @Override
+ public void removeUsedProject(IJSF2Project project) {
+ JSF2Project p = (JSF2Project)project;
+ if(!dependsOn.contains(p)) return;
+ p.usedBy.remove(this);
+ synchronized (dependsOn) {
+ dependsOn.remove(p);
+ }
+ }
+
+ public DefinitionContext getDefinitions() {
+ return definitions;
+ }
+
+ @Override
+ public void pathRemoved(IPath path) {
+ definitions.getWorkingCopy().clean(path);
+ }
+
+ public ClassPathMonitor getClassPath() {
+ return classPath;
+ }
+
+ @Override
+ public boolean isStorageResolved() {
+ return isStorageResolved;
+ }
+
+ public void resolveStorage(boolean load) {
+ if(isStorageResolved) return;
+ if(load) {
+ load();
+ } else {
+ isStorageResolved = true;
+ }
+ }
+
+ public void resolve() {
+ resolveStorage(true);
+ }
+
+ public void load() {
+ if(isStorageResolved) return;
+ isStorageResolved = true;
+ try {
+ getProject().build(IncrementalProjectBuilder.FULL_BUILD, KbBuilder.BUILDER_ID, new HashMap(), new NullProgressMonitor());
+ } catch (CoreException e) {
+ JSFModelPlugin.getDefault().logError(e);
+ }
+
+ postponeFiring();
+
+ try {
+ //Use kb storage for dependent projects since cdi is not stored.
+ loadProjectDependenciesFromKBProject();
+ } finally {
+ fireChanges();
+ }
+ }
+
+ public void clean() {
+ File file = getStorageFile();
+ if(file != null && file.isFile()) {
+ file.delete();
+ }
+ isBuilt = false;
+ classPath.clean();
+ postponeFiring();
+
+ fireChanges();
+ }
+
+ public void update() {
+ //TODO
+ }
+
+ public void store() throws IOException {
+ isBuilt = true;
+// File file = getStorageFile();
+ }
+
+ private File getStorageFile() {
+ IPath path = JSFModelPlugin.getDefault().getStateLocation();
+ File file = new File(path.toFile(), "projects/" + project.getName()); //$NON-NLS-1$
+ return file;
+ }
+
+ public void clearStorage() {
+ File f = getStorageFile();
+ if(f == null || !f.exists()) return;
+ FileUtil.clear(f);
+ f.delete();
+ }
+
+ public boolean hasNoStorage() {
+ if(isBuilt) return false;
+ File f = getStorageFile();
+ return f == null || !f.exists();
+ }
+
+ public void postponeFiring() {
+ //TODO
+ }
+
+ public void fireChanges() {
+ //TODO
+ }
+
+ /**
+ * Test method.
+ */
+ public void reloadProjectDependencies() {
+ dependsOn.clear();
+ usedBy.clear();
+ loadProjectDependenciesFromKBProject();
+ }
+
+ private void loadProjectDependenciesFromKBProject() {
+ Element root = null;
+ File file = getKBStorageFile();
+ if(file != null && file.isFile()) {
+ root = XMLUtilities.getElement(file, null);
+ if(root != null) {
+ loadProjectDependencies(root);
+ }
+ }
+ }
+
+ private File getKBStorageFile() {
+ IPath path = WebKbPlugin.getDefault().getStateLocation();
+ File file = new File(path.toFile(), "projects/" + project.getName() + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ return file;
+ }
+
+ private void loadProjectDependencies(Element root) {
+ Element dependsOnElement = XMLUtilities.getUniqueChild(root, "depends-on-projects"); //$NON-NLS-1$
+ if(dependsOnElement != null) {
+ Element[] paths = XMLUtilities.getChildren(dependsOnElement, "project"); //$NON-NLS-1$
+ for (int i = 0; i < paths.length; i++) {
+ String p = paths[i].getAttribute("name"); //$NON-NLS-1$
+ if(p == null || p.trim().length() == 0) continue;
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(p);
+ if(project == null || !project.isAccessible()) continue;
+ IJSF2Project sp = JSF2ProjectFactory.getJSF2Project(project, false);
+ if(sp != null) {
+ addUsedProjectInternal(sp);
+ sp.addDependentProject(this);
+ }
+ }
+ }
+
+ Element usedElement = XMLUtilities.getUniqueChild(root, "used-by-projects"); //$NON-NLS-1$
+ if(usedElement != null) {
+ Element[] paths = XMLUtilities.getChildren(usedElement, "project"); //$NON-NLS-1$
+ for (int i = 0; i < paths.length; i++) {
+ String p = paths[i].getAttribute("name"); //$NON-NLS-1$
+ if(p == null || p.trim().length() == 0) continue;
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(p);
+ if(project == null || !project.isAccessible()) continue;
+ IJSF2Project sp = JSF2ProjectFactory.getJSF2Project(project, false);
+ if(sp != null) {
+ addDependentProject(sp);
+ }
+ }
+ }
+
+ }
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/JSF2Project.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/TypeDefinition.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/TypeDefinition.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/TypeDefinition.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.model.impl;
+
+public class TypeDefinition extends AbstractTypeDefinition {
+
+ public TypeDefinition() {}
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/model/impl/TypeDefinition.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/FileSet.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/FileSet.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/FileSet.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.scanner;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IPackageDeclaration;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.jsf.JSFModelPlugin;
+
+public class FileSet {
+ private Set<IPath> allpaths = new HashSet<IPath>();
+ private Set<IPath> nonmodel = new HashSet<IPath>();
+ private Map<IPath, Set<IType>> annotations = new HashMap<IPath, Set<IType>>();
+ private Map<IPath, Set<IType>> interfaces = new HashMap<IPath, Set<IType>>();
+ private Map<IPath, Set<IType>> classes = new HashMap<IPath, Set<IType>>();
+ private Map<IPath, IPackageDeclaration> packages = new HashMap<IPath, IPackageDeclaration>();
+
+ public FileSet() {}
+
+ public void add(IPath path, IType[] types) throws CoreException {
+ allpaths.add(path);
+ if(types.length == 0) {
+ nonmodel.add(path);
+ } else {
+ for (IType type: types) {
+ add(path, type);
+ }
+ }
+ }
+ public void add(IPath path, IType type) throws CoreException {
+ allpaths.add(path);
+ if(!checkType(type, path)) {
+ //do nothing, bug JDT
+ } else if(type.isAnnotation()) {
+ add(annotations, path, type);
+ } else if(type.isInterface()) {
+ add(interfaces, path, type);
+ } else {
+ add(classes, path, type);
+ IType[] ts = type.getTypes();
+ for (IType t: ts) {
+ if(checkType(t, path) && Flags.isStatic(t.getFlags())) {
+ add(path, t);
+ }
+ }
+ }
+ }
+
+ private static Set<IPath> failedPaths = new HashSet<IPath>();
+
+ /**
+ * Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757
+ * This method and field failedPaths should be removed as soon as the
+ * issue is fixed.
+ * @param type
+ * @param path
+ * @return
+ * @throws CoreException
+ */
+ private boolean checkType(IType type, IPath path) throws CoreException {
+ try {
+ type.isAnnotation();
+ } catch (ArrayIndexOutOfBoundsException e) {
+ if(failedPaths.contains(path)) return false; // Do not let's be too noisy.
+ failedPaths.add(path);
+ JSFModelPlugin.getDefault().logError("JDT failed to load " + type.getFullyQualifiedName() + " from " + path + "\nSee https://bugs.eclipse.org/bugs/show_bug.cgi?id=342757");
+ return false;
+ }
+ return true;
+ }
+
+ private void add(Map<IPath, Set<IType>> target, IPath path, IType type) {
+ Set<IType> ts = target.get(path);
+ if(ts == null) {
+ ts = new HashSet<IType>();
+ target.put(path, ts);
+ }
+ ts.add(type);
+ }
+
+ public void add(IPath path, IPackageDeclaration pkg) throws CoreException {
+ allpaths.add(path);
+ packages.put(path, pkg);
+ }
+
+ public Set<IPath> getAllPaths() {
+ return allpaths;
+ }
+
+ public Set<IPath> getNonModelFiles() {
+ return nonmodel;
+ }
+
+ public Map<IPath, Set<IType>> getAnnotations() {
+ return annotations;
+ }
+
+ public Map<IPath, Set<IType>> getInterfaces() {
+ return interfaces;
+ }
+
+ public Map<IPath, Set<IType>> getClasses() {
+ return classes;
+ }
+
+ public Map<IPath, IPackageDeclaration> getPackages() {
+ return packages;
+ }
+
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/FileSet.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/lib/ClassPathMonitor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/lib/ClassPathMonitor.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/lib/ClassPathMonitor.java 2011-07-01 22:17:29 UTC (rev 32536)
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.jsf.jsf2.bean.scanner.lib;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.project.ext.AbstractClassPathMonitor;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jsf.JSFModelPlugin;
+import org.jboss.tools.jsf.jsf2.bean.model.IJSF2Project;
+import org.jboss.tools.jsf.jsf2.bean.model.JSF2ProjectFactory;
+
+public class ClassPathMonitor extends AbstractClassPathMonitor<IJSF2Project>{
+ IPath[] srcs = new IPath[0];
+
+ Set<IPath> removedPaths = new HashSet<IPath>();
+
+ public ClassPathMonitor(IJSF2Project project) {
+ this.project = project;
+ }
+
+ public void init() {
+ model = EclipseResourceUtil.createObjectForResource(getProjectResource()).getModel();
+ super.init();
+ }
+
+ public Map<String, XModelObject> process() {
+ Map<String, XModelObject> newJars = new HashMap<String, XModelObject>();
+ for (String p: syncProcessedPaths()) {
+ synchronized (removedPaths) {
+ removedPaths.add(new Path(p));
+ }
+ }
+ for (int i = 0; i < paths.size(); i++) {
+ String p = paths.get(i);
+ if(!requestForLoad(p)) continue;
+
+ String fileName = new File(p).getName();
+ if(EclipseResourceUtil.SYSTEM_JAR_SET.contains(fileName)) continue;
+
+ XModelObject o = FileSystemsHelper.getLibs(model).getLibrary(p);
+ if(o == null) continue;
+
+ XModelObject b = o.getChildByPath("META-INF/web-fragment.xml");
+ if(b != null) {
+ newJars.put(p, b);
+ }
+ }
+
+ validateProjectDependencies();
+ return newJars;
+ }
+
+ public void applyRemovedPaths() {
+ synchronized (removedPaths) {
+ for (IPath p: removedPaths) {
+ project.pathRemoved(p);
+ }
+ removedPaths.clear();
+ }
+ }
+
+ public IProject getProjectResource() {
+ return project.getProject();
+ }
+
+ public void setSrcs(IPath[] newSrcs) {
+ Set<IPath> ss = new HashSet<IPath>();
+ for (IPath s: newSrcs) {
+ ss.add(s);
+ }
+ for (IPath s: srcs) {
+ if(!ss.contains(s)) {
+ synchronized (removedPaths) {
+ removedPaths.add(s);
+ }
+ }
+ }
+ srcs = newSrcs;
+ }
+
+ public void validateProjectDependencies() {
+ List<IJSF2Project> ps = null;
+
+ try {
+ ps = getProjects(project.getProject());
+ } catch (CoreException e) {
+ JSFModelPlugin.getDefault().logError(e);
+ }
+ if(ps != null) {
+ Set<? extends IJSF2Project> set = project.getUsedProjects();
+ Set<IJSF2Project> removable = new HashSet<IJSF2Project>();
+ removable.addAll(set);
+ removable.removeAll(ps);
+ ps.removeAll(set);
+ for (IJSF2Project p : ps) {
+ project.addUsedProject(p);
+ }
+ for (IJSF2Project p : removable) {
+ project.removeUsedProject(p);
+ }
+ }
+ }
+
+ public boolean hasToUpdateProjectDependencies() {
+ List<IJSF2Project> ps = null;
+
+ try {
+ ps = getProjects(project.getProject());
+ } catch (CoreException e) {
+ JSFModelPlugin.getDefault().logError(e);
+ }
+ if(ps != null) {
+ Set<? extends IJSF2Project> set = project.getUsedProjects();
+ Set<IJSF2Project> removable = new HashSet<IJSF2Project>();
+ removable.addAll(set);
+ removable.removeAll(ps);
+ ps.removeAll(set);
+ for (IJSF2Project p : ps) {
+ return true;
+ }
+ for (IJSF2Project p : removable) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static List<IJSF2Project> getProjects(IProject project) throws CoreException {
+ List<IJSF2Project> list = new ArrayList<IJSF2Project>();
+ IJavaProject javaProject = JavaCore.create(project);
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
+ if(p == null || !p.isAccessible()) continue;
+ IJSF2Project sp = JSF2ProjectFactory.getJSF2Project(p, false);
+ if(sp != null) list.add(sp);
+ }
+ }
+ return list;
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/scanner/lib/ClassPathMonitor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 6 months
JBoss Tools SVN: r32535 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb: internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-01 18:15:04 -0400 (Fri, 01 Jul 2011)
New Revision: 32535
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
Log:
JBIDE-5046
https://issues.jboss.org/browse/JBIDE-5046
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2011-07-01 22:01:41 UTC (rev 32534)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/KbProjectFactory.java 2011-07-01 22:15:04 UTC (rev 32535)
@@ -18,6 +18,7 @@
import org.eclipse.core.internal.resources.BuildConfiguration;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.QualifiedName;
@@ -124,7 +125,7 @@
return mock;
}
- static void setProjectToBuilder(KbBuilder builder, IProject project) {
+ public static void setProjectToBuilder(IncrementalProjectBuilder builder, IProject project) {
try {
Method m = InternalBuilder.class.getDeclaredMethod("setBuildConfig", new Class[]{IBuildConfiguration.class});
m.setAccessible(true);
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java 2011-07-01 22:15:04 UTC (rev 32535)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal;
+
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public interface IIncrementalProjectBuilderExtension {
+ public IProject[] build(int kind, Map<String,String> args, IProgressMonitor monitor) throws CoreException;
+}
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/IIncrementalProjectBuilderExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java 2011-07-01 22:01:41 UTC (rev 32534)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbBuilder.java 2011-07-01 22:15:04 UTC (rev 32535)
@@ -20,6 +20,7 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.jst.web.WebModelPlugin;
@@ -29,6 +30,7 @@
import org.jboss.tools.jst.web.kb.internal.scanner.IFileScanner;
import org.jboss.tools.jst.web.kb.internal.scanner.LibraryScanner;
import org.jboss.tools.jst.web.kb.internal.scanner.XMLScanner;
+import org.osgi.framework.Bundle;
/**
*
@@ -79,7 +81,7 @@
* @see org.eclipse.core.resource.InternalProjectBuilder#build(int,
* java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
*/
- protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
+ protected IProject[] build(int kind, Map<String,String> args, IProgressMonitor monitor)
throws CoreException {
KbProject sp = getKbProject();
if(sp == null) {
@@ -126,6 +128,8 @@
sp.fireChanges();
}
resourceVisitor = null;
+
+ buildExtensionModels(kind, args, monitor);
return null;
}
@@ -169,4 +173,26 @@
PageContextFactory.getInstance().cleanUp(getProject());
}
+ static String[][] builders = {
+ {"org.jboss.tools.jsf", "org.jboss.tools.jsf.jsf2.bean.build.JSF2ProjectBuilder"}
+ };
+
+ void buildExtensionModels(int kind, Map args, IProgressMonitor monitor) throws CoreException {
+ for (int i = 0; i < builders.length; i++) {
+ Bundle b = Platform.getBundle(builders[i][0]);
+ if(b != null) {
+ try {
+ IncrementalProjectBuilder builder = (IncrementalProjectBuilder)b.loadClass(builders[i][1]).newInstance();
+ KbProjectFactory.setProjectToBuilder(builder, getProject());
+ ((IIncrementalProjectBuilderExtension)builder).build(kind, args, monitor);
+ } catch (InstantiationException e) {
+ WebKbPlugin.getDefault().logError(e);
+ } catch (IllegalAccessException e) {
+ WebKbPlugin.getDefault().logError(e);
+ } catch (ClassNotFoundException e) {
+ WebKbPlugin.getDefault().logError(e);
+ }
+ }
+ }
+ }
}
13 years, 6 months
JBoss Tools SVN: r32534 - in trunk: common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-07-01 18:01:41 -0400 (Fri, 01 Jul 2011)
New Revision: 32534
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/SelectRulerAction.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/xpl/
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/xpl/SelectAnnotationRulerAction.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/MarkerAnnotationInfo.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
Log:
https://issues.jboss.org/browse/JBIDE-9209
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml 2011-07-01 21:22:43 UTC (rev 32533)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml 2011-07-01 22:01:41 UTC (rev 32534)
@@ -467,5 +467,37 @@
<provider class="org.jboss.tools.common.model.ui.attribute.adapter.JavaClassContentAssistProvider"/>
<provider class="org.jboss.tools.common.model.ui.attribute.adapter.PropertiesContentAssistProvider"/>
</extension>
-
+<extension
+ point="org.eclipse.ui.editorActions">
+ <editorContribution
+ targetID="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor"
+ id="org.jboss.tools.jst.jsp.jspeditor.HTMLTextEditor.ruler.actions">
+ <action
+ label="SelectRulerAction.label"
+ class="org.jboss.tools.common.model.ui.actions.SelectRulerAction"
+ actionID="Rulerselect"
+ id="org.jboss.tools.common.model.ui.actions.SelectRulerAction">
+ </action>
+ </editorContribution>
+ <editorContribution
+ targetID="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor"
+ id="org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor.ruler.actions">
+ <action
+ label="SelectRulerAction.label"
+ class="org.jboss.tools.common.model.ui.actions.SelectRulerAction"
+ actionID="Rulerselect"
+ id="org.jboss.tools.common.model.ui.actions.SelectRulerAction">
+ </action>
+ </editorContribution>
+ <editorContribution
+ targetID="org.jboss.tools.common.model.ui.editor.EditorPartWrapper"
+ id="org.jboss.tools.common.model.ui.editor.EditorPartWrapper.ruler.actions">
+ <action
+ label="SelectRulerAction.label"
+ class="org.jboss.tools.common.model.ui.actions.SelectRulerAction"
+ actionID="Rulerselect"
+ id="org.jboss.tools.common.model.ui.actions.SelectRulerAction">
+ </action>
+ </editorContribution>
+</extension>
</plugin>
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/SelectRulerAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/SelectRulerAction.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/SelectRulerAction.java 2011-07-01 22:01:41 UTC (rev 32534)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.model.ui.actions;
+
+import java.util.ResourceBundle;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.jboss.tools.common.model.ui.actions.xpl.SelectAnnotationRulerAction;
+
+public class SelectRulerAction extends AbstractRulerActionDelegate {
+ private IAction action=null;
+
+ @Override
+ protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
+ if(action == null)
+ action = new SelectAnnotationRulerAction(ResourceBundle.getBundle("org.eclipse.jdt.internal.ui.javaeditor.ConstructedJavaEditorMessages"), "JavaSelectAnnotationRulerAction.", editor, rulerInfo); //$NON-NLS-1$
+ return action;
+ }
+
+ public void mouseUp(MouseEvent e) {
+ super.mouseUp(e);
+ if(action != null && action.isEnabled())
+ action.run();
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/SelectRulerAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/xpl/SelectAnnotationRulerAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/xpl/SelectAnnotationRulerAction.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/xpl/SelectAnnotationRulerAction.java 2011-07-01 22:01:41 UTC (rev 32534)
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Exadel, Inc.
+ * Red Hat, Inc.
+ *******************************************************************************/
+package org.jboss.tools.common.model.ui.actions.xpl;
+
+import java.util.Iterator;
+import java.util.ResourceBundle;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextOperationTarget;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationAccessExtension;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.ui.texteditor.ITextEditorExtension;
+import org.eclipse.ui.texteditor.SelectMarkerRulerAction;
+
+public class SelectAnnotationRulerAction extends SelectMarkerRulerAction {
+
+ private ITextEditor fTextEditor;
+ private Position fPosition;
+ private boolean fHasCorrection;
+ private ResourceBundle fBundle;
+
+ public SelectAnnotationRulerAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo ruler) {
+ super(bundle, prefix, editor, ruler);
+ fBundle= bundle;
+ fTextEditor= editor;
+ }
+
+ @Override
+ public void run() {
+ runWithEvent(null);
+ }
+
+ @Override
+ public void runWithEvent(Event event) {
+
+ if (fHasCorrection) {
+ ITextOperationTarget operation= (ITextOperationTarget) fTextEditor.getAdapter(ITextOperationTarget.class);
+ final int opCode= ISourceViewer.QUICK_ASSIST;
+ if (operation != null && operation.canDoOperation(opCode)) {
+ fTextEditor.selectAndReveal(fPosition.getOffset(), fPosition.getLength());
+ operation.doOperation(opCode);
+ }
+ return;
+ }
+
+ super.run();
+ }
+
+ @Override
+ public void update() {
+ findAnnotation();
+ setEnabled(true);
+ if (fHasCorrection) {
+ initialize(fBundle, "SelectAnnotationRulerAction.QuickFix."); //$NON-NLS-1$
+ return;
+ }
+
+ initialize(fBundle, "SelectAnnotationRulerAction.GotoAnnotation."); //$NON-NLS-1$;
+ super.update();
+ }
+
+ private void findAnnotation() {
+ fPosition= null;
+ fHasCorrection= false;
+
+ AbstractMarkerAnnotationModel model= getAnnotationModel();
+ IAnnotationAccessExtension annotationAccess= getAnnotationAccessExtension();
+
+ IDocument document= getDocument();
+ if (model == null)
+ return ;
+
+ Iterator<Annotation> iter= model.getAnnotationIterator();
+ int layer= Integer.MIN_VALUE;
+
+ while (iter.hasNext()) {
+ Annotation annotation= iter.next();
+ if (annotation.isMarkedDeleted())
+ continue;
+
+ int annotationLayer= layer;
+ if (annotationAccess != null) {
+ annotationLayer= annotationAccess.getLayer(annotation);
+ if (annotationLayer < layer)
+ continue;
+ }
+
+ Position position= model.getPosition(annotation);
+ if (!includesRulerLine(position, document))
+ continue;
+
+ boolean isReadOnly= fTextEditor instanceof ITextEditorExtension && ((ITextEditorExtension)fTextEditor).isEditorInputReadOnly();
+ if (!isReadOnly) {
+ fPosition= position;
+ fHasCorrection= true;
+ layer= annotationLayer;
+ continue;
+ }
+ }
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/actions/xpl/SelectAnnotationRulerAction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java 2011-07-01 22:01:41 UTC (rev 32534)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.text.xml;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
+import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
+import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
+import org.jboss.tools.common.text.xml.MarkerAnnotationInfo.AnnotationInfo;
+
+public class JBDSQuickAssistProcessor implements IQuickAssistProcessor {
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ public boolean canFix(Annotation annotation) {
+ if(annotation instanceof SimpleMarkerAnnotation || annotation instanceof TemporaryAnnotation)
+ return true;
+ return false;
+ }
+
+ public boolean canAssist(IQuickAssistInvocationContext invocationContext) {
+ return false;
+ }
+
+ public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext invocationContext) {
+ List<AnnotationInfo> all = new ArrayList<AnnotationInfo>();
+ List<AnnotationInfo> high = new ArrayList<AnnotationInfo>();
+ List<AnnotationInfo> low = new ArrayList<AnnotationInfo>();
+
+ IAnnotationModel model = invocationContext.getSourceViewer().getAnnotationModel();
+ if (model != null) {
+ Iterator<Annotation> iterator = model.getAnnotationIterator();
+ while (iterator.hasNext()) {
+ Annotation annotation = (Annotation) iterator.next();
+ if (!canFix(annotation))
+ continue;
+
+ Position position = model.getPosition(annotation);
+
+ if (position.overlapsWith(invocationContext.getOffset(), 1)) {
+ AnnotationInfo info = new AnnotationInfo(annotation, position);
+ if(info.isTop())
+ high.add(info);
+ else
+ low.add(info);
+ }
+ }
+ all.addAll(high);
+ all.addAll(low);
+ }
+ MarkerAnnotationInfo mai = new MarkerAnnotationInfo(all, invocationContext.getSourceViewer());
+ List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
+ for(AnnotationInfo info : all){
+ proposals.addAll(mai.getCompletionProposals(info));
+ }
+ return proposals.toArray(new ICompletionProposal[]{});
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/MarkerAnnotationInfo.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/MarkerAnnotationInfo.java 2011-07-01 21:22:43 UTC (rev 32533)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/MarkerAnnotationInfo.java 2011-07-01 22:01:41 UTC (rev 32534)
@@ -22,7 +22,7 @@
import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
import org.eclipse.jface.text.quickassist.IQuickFixableAnnotation;
import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
@@ -32,9 +32,9 @@
public class MarkerAnnotationInfo {
public final List<AnnotationInfo> infos;
- public final SourceViewer viewer;
+ public final ISourceViewer viewer;
- public MarkerAnnotationInfo(List<AnnotationInfo> infos, SourceViewer textViewer) {
+ public MarkerAnnotationInfo(List<AnnotationInfo> infos, ISourceViewer textViewer) {
this.infos = infos;
this.viewer = textViewer;
}
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2011-07-01 21:22:43 UTC (rev 32533)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2011-07-01 22:01:41 UTC (rev 32534)
@@ -19,19 +19,31 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.DefaultInformationControl;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.ITextHover;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
+import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
+import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.BestMatchHover;
import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
+import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
import org.eclipse.wst.xml.ui.internal.contentassist.XMLStructuredContentAssistProcessor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
@@ -189,5 +201,44 @@
return super.getTextHover(sourceViewer, contentType, stateMask);
}
+
+ private IQuickAssistAssistant fQuickAssistant = null;
+
+ private Color getColor(String key) {
+ RGB rgb = PreferenceConverter.getColor(fPreferenceStore, key);
+ return EditorUtility.getColor(rgb);
+ }
+
+ @Override
+ public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
+ if (fQuickAssistant == null) {
+ IQuickAssistAssistant assistant = new QuickAssistAssistant();
+ assistant.setQuickAssistProcessor(new JBDSQuickAssistProcessor());
+ assistant.setInformationControlCreator(getQuickAssistAssistantInformationControlCreator());
+ if (fPreferenceStore != null) {
+ Color color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND);
+ assistant.setProposalSelectorBackground(color);
+
+ color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND);
+ assistant.setProposalSelectorForeground(color);
+ }
+ fQuickAssistant = assistant;
+ }
+ return fQuickAssistant;
+ }
+
+ /**
+ * Returns the information control creator for the quick assist assistant.
+ *
+ * @return the information control creator
+ */
+ private IInformationControlCreator getQuickAssistAssistantInformationControlCreator() {
+ return new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ return new DefaultInformationControl(parent, new HTMLTextPresenter(true));
+ }
+ };
+ }
+
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2011-07-01 21:22:43 UTC (rev 32533)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2011-07-01 22:01:41 UTC (rev 32534)
@@ -21,14 +21,24 @@
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionAssistant;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.DefaultInformationControl;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.ITextHover;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.formatter.IContentFormatter;
import org.eclipse.jface.text.formatter.MultiPassContentFormatter;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
import org.eclipse.jface.text.information.IInformationProvider;
+import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
+import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.wst.html.core.text.IHTMLPartitions;
import org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML;
@@ -36,11 +46,16 @@
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
import org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder;
import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.correction.CompoundQuickAssistProcessor;
+import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
+import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
import org.eclipse.wst.sse.ui.internal.taginfo.AnnotationHoverProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.ProblemAnnotationHoverProcessor;
import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
+import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
+import org.jboss.tools.common.text.xml.JBDSQuickAssistProcessor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
import org.jboss.tools.common.text.xml.xpl.MarkerProblemAnnotationHoverProcessor;
import org.jboss.tools.jst.jsp.format.HTMLFormatProcessor;
@@ -256,4 +271,43 @@
}
return contentAssisteProcessors;
}
+
+ private IQuickAssistAssistant fQuickAssistant = null;
+
+ private Color getColor(String key) {
+ RGB rgb = PreferenceConverter.getColor(fPreferenceStore, key);
+ return EditorUtility.getColor(rgb);
+ }
+
+ @Override
+ public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
+ if (fQuickAssistant == null) {
+ IQuickAssistAssistant assistant = new QuickAssistAssistant();
+ assistant.setQuickAssistProcessor(new JBDSQuickAssistProcessor());
+ assistant.setInformationControlCreator(getQuickAssistAssistantInformationControlCreator());
+
+ if (fPreferenceStore != null) {
+ Color color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND);
+ assistant.setProposalSelectorBackground(color);
+
+ color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND);
+ assistant.setProposalSelectorForeground(color);
+ }
+ fQuickAssistant = assistant;
+ }
+ return fQuickAssistant;
+ }
+
+ /**
+ * Returns the information control creator for the quick assist assistant.
+ *
+ * @return the information control creator
+ */
+ private IInformationControlCreator getQuickAssistAssistantInformationControlCreator() {
+ return new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ return new DefaultInformationControl(parent, new HTMLTextPresenter(true));
+ }
+ };
+ }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2011-07-01 21:22:43 UTC (rev 32533)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2011-07-01 22:01:41 UTC (rev 32534)
@@ -15,20 +15,33 @@
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.jface.text.DefaultInformationControl;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.ITextHover;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
+import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
+import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jst.jsp.core.text.IJSPPartitions;
import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP;
import org.eclipse.jst.jsp.ui.internal.contentassist.JSPStructuredContentAssistProcessor;
import org.eclipse.jst.jsp.ui.internal.style.jspel.LineStyleProviderForJSPEL;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
+import org.eclipse.wst.sse.ui.internal.derived.HTMLTextPresenter;
+import org.eclipse.wst.sse.ui.internal.preferences.EditorPreferenceNames;
import org.eclipse.wst.sse.ui.internal.provisional.style.LineStyleProvider;
import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
+import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
+import org.jboss.tools.common.text.xml.JBDSQuickAssistProcessor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
import org.jboss.tools.common.text.xml.xpl.MarkerProblemAnnotationHoverProcessor;
@@ -178,5 +191,44 @@
return super.getTextHover(sourceViewer, contentType, stateMask);
}
+
+ private IQuickAssistAssistant fQuickAssistant = null;
+
+ private Color getColor(String key) {
+ RGB rgb = PreferenceConverter.getColor(fPreferenceStore, key);
+ return EditorUtility.getColor(rgb);
+ }
+
+ @Override
+ public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
+ if (fQuickAssistant == null) {
+ IQuickAssistAssistant assistant = new QuickAssistAssistant();
+ assistant.setQuickAssistProcessor(new JBDSQuickAssistProcessor());
+ assistant.setInformationControlCreator(getQuickAssistAssistantInformationControlCreator());
+ if (fPreferenceStore != null) {
+ Color color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND);
+ assistant.setProposalSelectorBackground(color);
+
+ color = getColor(EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND);
+ assistant.setProposalSelectorForeground(color);
+ }
+ fQuickAssistant = assistant;
+ }
+ return fQuickAssistant;
+ }
+
+ /**
+ * Returns the information control creator for the quick assist assistant.
+ *
+ * @return the information control creator
+ */
+ private IInformationControlCreator getQuickAssistAssistantInformationControlCreator() {
+ return new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ return new DefaultInformationControl(parent, new HTMLTextPresenter(true));
+ }
+ };
+ }
+
}
\ No newline at end of file
13 years, 6 months
JBoss Tools SVN: r32533 - in trunk: jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-07-01 17:22:43 -0400 (Fri, 01 Jul 2011)
New Revision: 32533
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/WebValidator.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.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/src/org/jboss/tools/jst/web/WebUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
Log:
https://issues.jboss.org/browse/JBIDE-9286
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 2011-07-01 21:03:04 UTC (rev 32532)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/composite/CompositeComponentValidator.java 2011-07-01 21:22:43 UTC (rev 32533)
@@ -14,7 +14,6 @@
import java.util.HashSet;
import java.util.Set;
-import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
@@ -24,13 +23,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
@@ -49,8 +41,8 @@
import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.jst.web.kb.internal.KbBuilder;
import org.jboss.tools.jst.web.kb.internal.validation.ContextValidationHelper;
-import org.jboss.tools.jst.web.kb.internal.validation.KBValidator;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.jst.web.kb.internal.validation.WebValidator;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
import org.jboss.tools.jst.web.kb.taglib.ICompositeTagLibrary;
import org.jboss.tools.jst.web.kb.taglib.ITagLibrary;
@@ -67,7 +59,7 @@
*
* @author Alexey Kazakov
*/
-public class CompositeComponentValidator extends KBValidator {
+public class CompositeComponentValidator extends WebValidator {
public static final String ID = "org.jboss.tools.jsf.CompositeComponentValidator"; //$NON-NLS-1$
public static final String PROBLEM_TYPE = "org.jboss.tools.jsf.compositeproblem"; //$NON-NLS-1$
@@ -80,22 +72,8 @@
public static final int UNKNOWN_COMPOSITE_COMPONENT_NAME_ID = 1;
public static final int UNKNOWN_COMPOSITE_COMPONENT_ATTRIBUTE_ID = 2;
- private IProject currentProject;
- private IContainer webRootFolder;
-
/*
* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#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)
- */
- @Override
- public void init(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext context, org.eclipse.wst.validation.internal.provisional.core.IValidator manager, IReporter reporter) {
- super.init(project, validationHelper, context, manager, reporter);
- currentProject = null;
- webRootFolder = null;
- }
-
- /*
- * (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.validation.IValidator#validate(java.util.Set, org.eclipse.core.resources.IProject, org.jboss.tools.jst.web.kb.internal.validation.ContextValidationHelper, org.jboss.tools.jst.web.kb.validation.IProjectValidationContext, org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager, org.eclipse.wst.validation.internal.provisional.core.IReporter)
*/
public IStatus validate(Set<IFile> changedFiles, IProject project, ContextValidationHelper validationHelper, IProjectValidationContext validationContext, ValidatorManager manager, IReporter reporter) throws ValidationException {
@@ -274,49 +252,6 @@
}
}
- private boolean enabled = true;
-
- private boolean shouldFileBeValidated(IFile file) {
- if(!file.isAccessible()) {
- return false;
- }
- IProject project = file.getProject();
- if(!file.isSynchronized(IResource.DEPTH_ZERO)) {
- // The resource is out of sync with the file system
- // Just ignore this resource.
- return false;
- }
- if(!project.equals(currentProject)) {
- currentProject = project;
- enabled = isEnabled(project);
- if(!enabled) {
- return false;
- }
- if(webRootFolder!=null && !project.equals(webRootFolder.getProject())) {
- webRootFolder = null;
- }
- if(webRootFolder==null) {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(project);
- } catch (CoreException e) {
- JSFModelPlugin.getDefault().logError(e);
- }
- if(facetedProject!=null && facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET)!=null) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- if(component!=null) {
- IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
- webRootFolder = webRootVirtFolder.getUnderlyingFolder();
- }
- }
- }
- currentProject = project;
- }
-
- // Validate files from Web-Content only (in case of WTP project)
- return enabled && webRootFolder!=null && webRootFolder.getLocation().isPrefixOf(file.getLocation()) && PageContextFactory.isPage(file);
- }
-
/*
* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.validation.IValidator#getId()
@@ -406,4 +341,13 @@
}
return marker;
}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.validation.WebValidator#shouldValidateJavaSources()
+ */
+ @Override
+ protected boolean shouldValidateJavaSources() {
+ return false;
+ }
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebUtils.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebUtils.java 2011-07-01 21:03:04 UTC (rev 32532)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/WebUtils.java 2011-07-01 21:22:43 UTC (rev 32533)
@@ -17,6 +17,7 @@
import java.util.Set;
import java.util.TreeSet;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
@@ -25,12 +26,17 @@
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.web.project.WebProject;
@@ -78,7 +84,23 @@
return (modelNature != null) ? WebProject.getInstance(modelNature.getModel()).getWebRootLocation() : null;
}
-
+ public static IContainer[] getWebRootFolders(IProject project) {
+ IFacetedProject facetedProject = null;
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ } catch (CoreException e) {
+ WebModelPlugin.getDefault().logError(e);
+ }
+ if(facetedProject!=null && facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET)!=null) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if(component!=null) {
+ IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
+ return webRootVirtFolder.getUnderlyingFolders();
+ }
+ }
+ return null;
+ }
+
public static String[] getServletLibraries(String natureId, String templateBase, String servletVersion) {
String classPathVarName = findClassPathVarByNatureId(natureId);
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 2011-07-01 21:03:04 UTC (rev 32532)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2011-07-01 21:22:43 UTC (rev 32533)
@@ -15,7 +15,6 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
@@ -29,14 +28,7 @@
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.validation.internal.core.ValidationException;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.common.el.core.ELReference;
@@ -58,7 +50,6 @@
import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.Var;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jst.web.kb.PageContextFactory;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.jboss.tools.jst.web.kb.internal.KbBuilder;
@@ -71,7 +62,7 @@
* EL Validator
* @author Alexey Kazakov
*/
-public class ELValidator extends KBValidator {
+public class ELValidator extends WebValidator {
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$
@@ -83,9 +74,6 @@
private ELResolver[] resolvers;
protected ELParserFactory mainFactory;
- private IProject currentProject;
- private IResource[] currentSources;
- private IContainer webRootFolder;
private boolean revalidateUnresolvedELs = false;
private boolean validateVars = true;
@@ -148,7 +136,6 @@
resolvers = ELResolverFactoryManager.getInstance().getResolvers(project);
mainFactory = ELParserUtil.getJbossFactory();
validateVars = ELSeverityPreferences.ENABLE.equals(ELSeverityPreferences.getInstance().getProjectPreference(validatingProject, ELSeverityPreferences.CHECK_VARS));
- currentProject = null;
}
/*
@@ -157,7 +144,6 @@
*/
public IStatus validate(Set<IFile> changedFiles, IProject project, ContextValidationHelper validationHelper, IProjectValidationContext context, ValidatorManager manager, IReporter reporter) throws ValidationException {
init(project, validationHelper, context, manager, reporter);
- webRootFolder = null;
initRevalidationFlag();
IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
@@ -224,7 +210,6 @@
*/
public IStatus validateAll(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext context, ValidatorManager manager, IReporter reporter) throws ValidationException {
init(project, validationHelper, context, manager, reporter);
- webRootFolder = null;
initRevalidationFlag();
Set<IFile> files = validationHelper.getProjectSetRegisteredFiles();
Set<IFile> filesToValidate = new HashSet<IFile>();
@@ -243,67 +228,6 @@
return OK_STATUS;
}
- private static final String JAVA_EXT = "java"; //$NON-NLS-1$
-
- private boolean enabled = true;
-
- private boolean shouldFileBeValidated(IFile file) {
- if(!file.isAccessible()) {
- return false;
- }
- IProject project = file.getProject();
- if(!file.isSynchronized(IResource.DEPTH_ZERO)) {
- // The resource is out of sync with the file system
- // Just ignore this resource.
- return false;
- }
- if(!project.equals(currentProject)) {
- currentProject = project;
- enabled = isEnabled(project);
- if(!enabled) {
- return false;
- }
- if(webRootFolder!=null && !project.equals(webRootFolder.getProject())) {
- webRootFolder = null;
- }
- if(webRootFolder==null) {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(project);
- } catch (CoreException e) {
- WebKbPlugin.getDefault().logError(ELValidationMessages.EL_VALIDATOR_ERROR_VALIDATING, e);
- }
- if(facetedProject!=null && facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET)!=null) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- if(component!=null) {
- IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
- webRootFolder = webRootVirtFolder.getUnderlyingFolder();
- }
- }
- }
- currentProject = project;
- currentSources = EclipseResourceUtil.getJavaSourceRoots(project);
- }
- if(!enabled) {
- return false;
- }
- // Validate all files from java source folders.
- for (int i = 0; currentSources!=null && i < currentSources.length; i++) {
- if(currentSources[i].getLocation().isPrefixOf(file.getLocation())) {
- return true;
- }
- }
- // If *.java is out of Java Source path then ignore it.
- if(JAVA_EXT.equalsIgnoreCase(file.getFileExtension())) {
- return false;
- }
- // Otherwise validate only files from Web-Content (in case of WTP project)
- if(webRootFolder!=null) {
- return webRootFolder.getLocation().isPrefixOf(file.getLocation());
- }
- return true;
- }
-
private int markers;
private void validateFile(IFile file) {
@@ -553,4 +477,12 @@
return ValidatorManager.validateBuilderOrder(project, getBuilderId(), getId(), ELSeverityPreferences.getInstance());
}
-}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.validation.WebValidator#shouldValidateJavaSources()
+ */
+ @Override
+ protected boolean shouldValidateJavaSources() {
+ return true;
+ }
+}
\ No newline at end of file
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/WebValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/WebValidator.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/WebValidator.java 2011-07-01 21:22:43 UTC (rev 32533)
@@ -0,0 +1,102 @@
+ /*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.internal.validation;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.WebUtils;
+import org.jboss.tools.jst.web.kb.validation.IProjectValidationContext;
+
+/**
+ * @author Alexey Kazakov
+ */
+abstract public class WebValidator extends KBValidator {
+
+ private static final String JAVA_EXT = "java"; //$NON-NLS-1$
+
+ protected IContainer[] webRootFolders;
+ protected IProject currentProject;
+ protected IResource[] currentSources;
+
+ private boolean enabled = true;
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#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)
+ */
+ @Override
+ public void init(IProject project, ContextValidationHelper validationHelper, IProjectValidationContext context, org.eclipse.wst.validation.internal.provisional.core.IValidator manager, IReporter reporter) {
+ super.init(project, validationHelper, context, manager, reporter);
+ webRootFolders = null;
+ currentProject = null;
+ }
+
+ abstract protected boolean shouldValidateJavaSources();
+
+ protected boolean shouldFileBeValidated(IFile file) {
+ if(!file.isAccessible()) {
+ return false;
+ }
+ IProject project = file.getProject();
+ if(!file.isSynchronized(IResource.DEPTH_ZERO)) {
+ // The resource is out of sync with the file system
+ // Just ignore this resource.
+ return false;
+ }
+ if(!project.equals(currentProject)) {
+ currentProject = project;
+ enabled = isEnabled(project);
+ if(!enabled) {
+ return false;
+ }
+ if(webRootFolders!=null && webRootFolders.length>0 && !project.equals(webRootFolders[0].getProject())) {
+ webRootFolders = null;
+ }
+ if(webRootFolders==null) {
+ webRootFolders = WebUtils.getWebRootFolders(project);
+ }
+ if(shouldValidateJavaSources()) {
+ currentSources = EclipseResourceUtil.getJavaSourceRoots(project);
+ }
+ }
+ if(!enabled) {
+ return false;
+ }
+ // Validate all files from java source folders, if we should.
+ if(shouldValidateJavaSources()) {
+ for (int i = 0; currentSources!=null && i < currentSources.length; i++) {
+ if(currentSources[i].getLocation().isPrefixOf(file.getLocation())) {
+ return true;
+ }
+ }
+ // If *.java is out of Java Source path then ignore it.
+ if(JAVA_EXT.equalsIgnoreCase(file.getFileExtension())) {
+ return false;
+ }
+ }
+ // Otherwise validate only files from Web-Content (in case of WTP project)
+ if(webRootFolders!=null) {
+ for (IContainer webRootFolder : webRootFolders) {
+ if(webRootFolder.getLocation().isPrefixOf(file.getLocation())) {
+ return true;
+ }
+ }
+ if(webRootFolders.length>1) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/WebValidator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2011-07-01 21:03:04 UTC (rev 32532)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2011-07-01 21:22:43 UTC (rev 32533)
@@ -330,7 +330,19 @@
IVirtualComponent component = ComponentCore.createComponent(project);
IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
warDefaultSrcRootFolder = component.getRootFolder().getFolder(new Path("/WEB-INF/classes")); //$NON-NLS-1$
- webRootFolder = webRootVirtFolder.getUnderlyingFolder();
+ IContainer[] roots = webRootVirtFolder.getUnderlyingFolders();
+ webRootFolder = null;
+ if(roots.length>1) {
+ for (IContainer container : roots) {
+ if(!container.getFullPath().toString().contains("/target/")) { //$NON-NLS-1$
+ webRootFolder = container;
+ break;
+ }
+ }
+ }
+ if(webRootFolder==null) {
+ webRootFolder = webRootVirtFolder.getUnderlyingFolder();
+ }
webContentFolder = webRootFolder.getLocation().toFile();
webContentPath = webRootFolder.getFullPath();
13 years, 6 months
JBoss Tools SVN: r32532 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-01 17:03:04 -0400 (Fri, 01 Jul 2011)
New Revision: 32532
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
Log:
JBIDE-5046
https://issues.jboss.org/browse/JBIDE-5046
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2011-07-01 20:33:46 UTC (rev 32531)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2011-07-01 21:03:04 UTC (rev 32532)
@@ -87,6 +87,8 @@
int modifications = 0;
+ Map<String, Object> extensionModels = new HashMap<String, Object>();
+
public KbProject() {}
public void setMock() {
@@ -1083,4 +1085,12 @@
if(validationContext != null)
System.out.println("validationContext " + validationContext.getModificationsSinceLastStore()); //$NON-NLS-1$
}
+
+ public Object getExtensionModel(String id) {
+ return extensionModels.get(id);
+ }
+
+ public void setExtensionModel(String id, Object model) {
+ extensionModels.put(id, model);
+ }
}
\ No newline at end of file
13 years, 6 months
JBoss Tools SVN: r32531 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-01 16:33:46 -0400 (Fri, 01 Jul 2011)
New Revision: 32531
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
Log:
JBIDE-5046
https://issues.jboss.org/browse/JBIDE-5046
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2011-07-01 20:27:35 UTC (rev 32530)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/AnnotationDeclaration.java 2011-07-01 20:33:46 UTC (rev 32531)
@@ -10,25 +10,15 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.impl;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.IMemberValuePair;
-import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.CDICoreNature;
-import org.jboss.tools.cdi.core.ICDIAnnotation;
-import org.jboss.tools.common.java.IAnnotationDeclaration;
-import org.jboss.tools.common.java.IJavaAnnotation;
-import org.jboss.tools.common.java.impl.JavaAnnotation;
/**
*
* @author Viacheslav Kabanovich
*
*/
-public class AnnotationDeclaration implements IAnnotationDeclaration {
+public class AnnotationDeclaration extends org.jboss.tools.common.java.impl.AnnotationDeclaration {
protected CDICoreNature project;
- protected IJavaAnnotation annotation;
public AnnotationDeclaration() {}
@@ -45,67 +35,4 @@
this.project = project;
}
- public void setDeclaration(IJavaAnnotation annotation) {
- this.annotation = annotation;
- }
-
- public IJavaAnnotation getDeclaration() {
- return annotation;
- }
-
- public IResource getResource() {
- return annotation.getResource();
- }
-
- public IMemberValuePair[] getMemberValuePairs() {
- return annotation.getMemberValuePairs();
- }
-
- public Object getMemberValue(String name) {
- if(name == null) name = "value";
- IMemberValuePair[] pairs = getMemberValuePairs();
- if(pairs != null) {
- for (IMemberValuePair pair: pairs) {
- if(name.equals(pair.getMemberName())) {
- return pair.getValue();
- }
- }
- }
- return null;
- }
-
- public IMember getParentMember() {
- return annotation.getParentMember();
- }
-
- public String getTypeName() {
- return annotation.getTypeName();
- }
-
- public IType getType() {
- return annotation.getType();
- }
-
- public int getLength() {
- return annotation.getLength();
- }
-
- public int getStartPosition() {
- return annotation.getStartPosition();
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.cdi.core.IAnnotationDeclaration#getAnnotation()
- */
- public ICDIAnnotation getAnnotation() {
- return null;
- }
-
- public IAnnotation getJavaAnnotation() {
- if(annotation instanceof JavaAnnotation) {
- return ((JavaAnnotation) annotation).getAnnotation();
- }
- return null;
- }
}
\ No newline at end of file
13 years, 6 months