JBoss Tools SVN: r31252 - in trunk/documentation/whatsnew: vpe and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-05-12 14:08:27 -0400 (Thu, 12 May 2011)
New Revision: 31252
Added:
trunk/documentation/whatsnew/vpe/images/3.3.0.M1/
trunk/documentation/whatsnew/vpe/images/3.3.0.M1/vpe-multiple-selection.png
trunk/documentation/whatsnew/vpe/vpe-news-3.3.0.M1.html
Modified:
trunk/documentation/whatsnew/index.html
Log:
https://issues.jboss.org/browse/JBIDE-8886 : Create "New and Noteworthy" for 3.3.0.M1 /
https://issues.jboss.org/browse/JBIDE-8898 : CLONE - CLONE - Visual Editor Component N&N
- N&N 3.3.0.M1 page for VPE is created
Modified: trunk/documentation/whatsnew/index.html
===================================================================
--- trunk/documentation/whatsnew/index.html 2011-05-12 17:26:22 UTC (rev 31251)
+++ trunk/documentation/whatsnew/index.html 2011-05-12 18:08:27 UTC (rev 31252)
@@ -38,6 +38,7 @@
<p align="right"><b>3.3.0.M1</b>
<td valign="top">
<p><a href="jst/jst-news-3.3.0.M1.html">JST/JSF Tools</a></p>
+ <p><a href="vpe/vpe-news-3.3.0.M1.html">Visual Page Editor</a></p>
<p><a href="seam/seam-news-3.3.0.M1.html">Seam Tools</a></p>
</td>
</tr>
Added: trunk/documentation/whatsnew/vpe/images/3.3.0.M1/vpe-multiple-selection.png
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/vpe/images/3.3.0.M1/vpe-multiple-selection.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/documentation/whatsnew/vpe/vpe-news-3.3.0.M1.html
===================================================================
--- trunk/documentation/whatsnew/vpe/vpe-news-3.3.0.M1.html (rev 0)
+++ trunk/documentation/whatsnew/vpe/vpe-news-3.3.0.M1.html 2011-05-12 18:08:27 UTC (rev 31252)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!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">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>What's New Visual Page Editor 3.3.0.M1</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>What's New Visual Page Editor 3.3.0.M1</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a
+ href="../seam/seam-news-3.3.0.M1.html">Seam Tools ></a></p>
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>General</h3>
+ <hr />
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>XULRunner 1.9</b></td>
+ <td valign="top">
+ <p>Visual Editor is now based on Mozilla Xulrunner 1.9.2.16 - the same rendering engine on which Firefox 3.6.16 is built.</p>
+ <p>This means support for new CSS attributes, better performance and many improvements for web developers,
+ including HTML5 support which will be added to the Editor in the near future.</p>
+
+
+ <p><small><a href="https://jira.jboss.org/jira/browse/JBIDE-6429">Related
+ Jira</a></small></p>
+ </td>
+ </tr>
+
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>Editor</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3"
+ id="itemname3"></a><b>Multiple selection from the source part</b></td>
+ <td valign="top">
+ <p>
+ Now all tags from the source selection are selected in the visual part.</p>
+ <p><img src="images/3.3.0.M1/vpe-multiple-selection.png" alt="VPE Multiple Selection" /></p>
+
+ <p><small><a
+ href="https://jira.jboss.org/jira/browse/JBIDE-8115">Related Jira</a></small></p>
+ </td>
+ </tr>
+</table>
+
+</body>
+
+</html>
+
+
\ No newline at end of file
13 years, 5 months
JBoss Tools SVN: r31250 - trunk/documentation/whatsnew/forge.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-05-12 13:20:21 -0400 (Thu, 12 May 2011)
New Revision: 31250
Added:
trunk/documentation/whatsnew/forge/forge-news-3.3.0.M1.html
Log:
Forge Tools 3.3.0.M1 N&N
Property changes on: trunk/documentation/whatsnew/forge/forge-news-3.3.0.M1.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 5 months
JBoss Tools SVN: r31249 - trunk/documentation/whatsnew/forge.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-05-12 13:16:18 -0400 (Thu, 12 May 2011)
New Revision: 31249
Added:
trunk/documentation/whatsnew/forge/.project
Log:
initial Forge N&N folder
Added: trunk/documentation/whatsnew/forge/.project
===================================================================
--- trunk/documentation/whatsnew/forge/.project (rev 0)
+++ trunk/documentation/whatsnew/forge/.project 2011-05-12 17:16:18 UTC (rev 31249)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>forge-new-and-noteworthy</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Property changes on: trunk/documentation/whatsnew/forge/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 5 months
JBoss Tools SVN: r31248 - trunk/documentation/whatsnew.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-05-12 13:07:16 -0400 (Thu, 12 May 2011)
New Revision: 31248
Added:
trunk/documentation/whatsnew/forge/
Log:
New folder to contain N&N for the Forge component
13 years, 5 months
JBoss Tools SVN: r31247 - trunk/documentation/whatsnew/gwt.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-05-12 13:02:04 -0400 (Thu, 12 May 2011)
New Revision: 31247
Added:
trunk/documentation/whatsnew/gwt/gwt-news-1.0.1.M1.html
Log:
[JBIDE-8889] created N&N for 1.0.1 M1
Added: trunk/documentation/whatsnew/gwt/gwt-news-1.0.1.M1.html
===================================================================
--- trunk/documentation/whatsnew/gwt/gwt-news-1.0.1.M1.html (rev 0)
+++ trunk/documentation/whatsnew/gwt/gwt-news-1.0.1.M1.html 2011-05-12 17:02:04 UTC (rev 31247)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!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">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css" />
+<title>GWT Integration 1.0.1.M1 What's New</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>GWT Integration 1.0.1.M1 What's New</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a
+href="../maven/maven-news-3.2.0.CR1.html">Maven Tools ></a></p>
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+ <tr>
+ <td colspan="2">
+ <hr />
+ <h3>General</h3>
+ <hr />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" align="left"><a name="itemname3" id="itemname3"></a><b>Installation impediments</b></td>
+ <td valign="top">
+ We initially had a dependency to the google GWT SDK so that installing our facet would have been a single click operation. The Google GWT SDK would have been installed automatically.
+ <p>Unfortuntately our plugin became uninstallable when Google removed old versions of their plugin from their update site. We could have solved that by mirroring those old versions.
+ The proprietary license google applies to their plugin unfortunately prevents us from doing that (<a href="http://code.google.com/intl/de-DE/eclipse/terms.html">http://code.google.com/intl/de-DE/eclipse/terms.html</a>, Section 5.3).
+ We therefore removed the dependency to their SDK and dropped any installation ease and guard.
+ You'll therefore have to install the Google plugins manually in a first step.</p>
+ <p>You'll find installation and usage instructions in all details at <a href="http://community.jboss.org/wiki/CreateGWTProjectsWithJBossToolsAndEclipseWTP">http://community.jboss.org/wiki/CreateGWTProjectsWithJBossToolsAndEclipseWTP</a></p>
+ <p><small><a href="https://issues.jboss.org/browse/JBIDE-7828">Related Jira</a></small></p>
+ </td>
+ </tr>
+</table>
+
+</body>
+
+</html>
+
+
Property changes on: trunk/documentation/whatsnew/gwt/gwt-news-1.0.1.M1.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
13 years, 5 months
JBoss Tools SVN: r31246 - in trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test: projects/CDIConfigTest/src/org/jboss/beans and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-12 12:33:12 -0400 (Thu, 12 May 2011)
New Revision: 31246
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean3.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean4.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean5.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean6.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType3.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType4.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType5.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType6.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean1.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean2.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyQualifier.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyType1.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/seam-beans.xml
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java
Log:
JBIDE-8935
https://issues.jboss.org/browse/JBIDE-8935
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/seam-beans.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/seam-beans.xml 2011-05-12 16:31:33 UTC (rev 31245)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/META-INF/seam-beans.xml 2011-05-12 16:33:12 UTC (rev 31246)
@@ -6,6 +6,7 @@
xmlns:test02="urn:java:org.jboss.beans.test02"
xmlns:test03="urn:java:org.jboss.beans.test03"
xmlns:test04="urn:java:org.jboss.beans.test04"
+ xmlns:test05="urn:java:org.jboss.beans.test05"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://jboss.org/schema/cdi/beans_1_0.xsd">
<!-- Test 01-1 -->
@@ -81,4 +82,55 @@
</test04:myType2>
</test04:MyBean2>
+<!-- Test 04-3 -->
+<test04:MyBean3>
+ <s:modifies/>
+ <test04:myType3>
+ <s:Produces/>
+ </test04:myType3>
+</test04:MyBean3>
+
+<!-- Test 04-4 -->
+<test04:MyBean4>
+ <s:replaces/>
+</test04:MyBean4>
+
+<!-- Test 04-5 -->
+<test04:MyBean5>
+ <s:replaces/>
+ <test04:myType5>
+ <s:Inject/>
+ <test04:MyQualifier kind="kind-04-5-a"/>
+ </test04:myType5>
+</test04:MyBean5>
+
+<!-- Test 04-6 -->
+<test04:MyBean6>
+ <test04:MyQualifier kind="kind-04-6"/>
+ <test04:myType6>
+ <s:Produces/>
+ </test04:myType6>
+</test04:MyBean6>
+
+<!-- Test 05-1 -->
+<test05:MyBean1>
+ <s:modifies/>
+ <test05:createType>
+ <s:Produces/>
+ <test05:MyQualifier/>
+ <s:parameters>
+ <test05:MyType1>
+ </test05:MyType1>
+ </s:parameters>
+ </test05:createType>
+</test05:MyBean1>
+
+<!-- Test 05-2 -->
+<test05:MyBean2>
+ <s:parameters>
+ <test05:MyType1>
+ </test05:MyType1>
+ </s:parameters>
+</test05:MyBean2>
+
</beans>
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean3.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean3.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean3.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,27 @@
+package org.jboss.beans.test04;
+
+/**
+ * Test 04-3.
+ * Sources contain class MyBean2 that declares a field of type MyType3,
+ * class MyType3 has no bean constructor.
+ * Seam config xml contains declaration:
+ * <test04:MyBean3>
+ * <s:modifies/>
+ * <test04:myType3>
+ * <s:Produces/>
+ * </test04:myType3>
+ * </test04:MyBean3>
+ *
+ * ASSERT: Model contains 1 bean with type MyType3.
+ * ASSERT: That bean is field producer.
+ * ASSERT: That bean has qualifier MyQualifier with kind="kind-04-3".
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyBean3 {
+
+ @MyQualifier(kind="kind-04-3")
+ public MyType3 myType3 = new MyType3("");
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean4.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean4.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean4.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,24 @@
+package org.jboss.beans.test04;
+
+import javax.enterprise.inject.Produces;
+
+/**
+ * Test 04-4.
+ * Sources contain class MyBean4 that declares producer field of type MyType4,
+ * class MyType4 has no bean constructor.
+ * Seam config xml contains declaration:
+ * <test04:MyBean4>
+ * <s:replaces/>
+ * </test04:MyBean4>
+ *
+ * ASSERT: Model contains no bean with type MyType4.
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyBean4 {
+
+ @Produces
+ public MyType4 myType4 = new MyType4("");
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean4.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean5.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean5.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean5.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,31 @@
+package org.jboss.beans.test04;
+
+import javax.enterprise.inject.Produces;
+
+/**
+ * Test 04-5.
+ * Sources contain class MyBean5 that declares producer field of type MyType5,
+ * class MyType5 has no bean constructor.
+ * Seam config xml contains declaration:
+ * <test04:MyBean5>
+ * <s:replaces/>
+ * <test04:myType5>
+ * <s:Inject/>
+ * <test04:MyQualifier kind="kind-04-5-a"/>
+ * </test04:myType5>
+ * </test04:MyBean5>
+ *
+ * ASSERT: Model contains no bean with type MyType5.
+ * ASSERT: Model contains 1 bean with type MyBean5.
+ * ASSERT: That bean has injection point field with qualifier MyQualifier with kind="kind-04-5-a".
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyBean5 {
+
+ @Produces
+ @MyQualifier(kind="kind-04-5")
+ public MyType5 myType5 = new MyType5("");
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean5.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean6.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean6.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean6.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,33 @@
+package org.jboss.beans.test04;
+
+import javax.inject.Inject;
+
+/**
+ * Test 04-6.
+ * Sources contain class MyBean6 that declares field of type MyType6,
+ * class MyType6 has no bean constructor.
+ * Seam config xml contains declaration:
+ * <test04:MyBean6>
+ * <test04:MyQualifier kind="kind-04-6"/>
+ * <test04:myType6>
+ * <s:Produces/>
+ * </test04:myType6>
+ * </test04:MyBean6>
+ *
+ * ASSERT: Model contains 1 bean with type MyType6.
+ * ASSERT: That bean is field producer.
+ * ASSERT: Model contains 1 bean with type MyBean6 with qualifier MyQualifier
+ * ASSERT: That bean has no injection points.
+ * ASSERT: Model contains 1 bean with type MyBean6 with default qualifier..
+ * ASSERT: That bean has 1 injection point.
+ * ASSERT: That injection point is resolved to bean MyType6.
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyBean6 {
+
+ @Inject
+ public MyType6 myType6 = new MyType6("");
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyBean6.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType3.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType3.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType3.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,13 @@
+package org.jboss.beans.test04;
+
+/**
+ * Test 04-3.
+ * see org.jboss.beans.test04.MyBean3
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyType3 {
+ public MyType3(String s) {
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType4.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType4.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType4.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,13 @@
+package org.jboss.beans.test04;
+
+/**
+ * Test 04-4.
+ * see org.jboss.beans.test04.MyBean4
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyType4 {
+ public MyType4(String s) {
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType4.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType5.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType5.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType5.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,13 @@
+package org.jboss.beans.test04;
+
+/**
+ * Test 04-2.
+ * see org.jboss.beans.test04.MyBean2
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyType5 {
+ public MyType5(String s) {
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType5.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType6.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType6.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType6.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,13 @@
+package org.jboss.beans.test04;
+
+/**
+ * Test 04-6.
+ * see org.jboss.beans.test04.MyBean6
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyType6 {
+ public MyType6(String s) {
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test04/MyType6.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean1.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean1.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean1.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,35 @@
+package org.jboss.beans.test05;
+
+/**
+ * Test 05-1
+ * Sources contain class MyBean1 that declares method createType
+ * with parameter MyType1.
+ * Seam config xml contains declaration:
+ * <test05:MyBean1>
+ * <test05:createType>
+ * <s:Produces/>
+ * <test05:MyQualifier/>
+ * <s:parameters>
+ * <test05:MyType1>
+ * </test05:MyType1>
+ * </s:parameters>
+ * </test05:createType>
+ * </test05:MyBean1>
+ *
+ * ASSERT: Model contains 1 bean with type MyType1 with qualifier MyQualifier.
+ * ASSERT: That bean is method producer.
+ * ASSERT: That bean has one injection point; it is parameter.
+ * ASSERT: That injection point is resolved to class bean with type MyType1 with default qualifier.
+ *
+ * @author Viacheslav Kababovich
+ *
+ */
+public class MyBean1 {
+
+ public MyType1 createType(MyType1 template) {
+ MyType1 result = new MyType1();
+ //use template to modify result.
+ return result;
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean1.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean2.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean2.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean2.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,28 @@
+package org.jboss.beans.test05;
+
+import javax.inject.Inject;
+
+/**
+ * Test 05-2
+ * Sources contain class MyBean2 that declares constructor.
+ * Seam config xml contains declaration:
+ * <test05:MyBean2>
+ * <s:parameters>
+ * <test05:MyType1>
+ * </test05:MyType1>
+ * </s:parameters>
+ * </test05:MyBean2>
+ *
+ * ASSERT: Model contains 1 bean with type MyBean2.
+ * ASSERT: That bean has one injection point; it is parameter.
+ * ASSERT: That injection point is resolved to class bean with type MyType1 with default qualifier.
+ *
+ * @author Viacheslav Kababovich
+ *
+ */
+public class MyBean2 {
+
+ public MyBean2(MyType1 type) {
+ }
+
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyBean2.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyQualifier.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyQualifier.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyQualifier.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,20 @@
+package org.jboss.beans.test05;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Qualifier
+@Target({ TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+public @interface MyQualifier {
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyQualifier.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyType1.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyType1.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyType1.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -0,0 +1,11 @@
+package org.jboss.beans.test05;
+
+/**
+ * Test 05-1.
+ * see org.jboss.beans.test05.MyBean1
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class MyType1 {
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/projects/CDIConfigTest/src/org/jboss/beans/test05/MyType1.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java 2011-05-12 16:31:33 UTC (rev 31245)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.core.test/src/org/jboss/tools/cdi/seam/config/core/test/SeamBeansTest.java 2011-05-12 16:33:12 UTC (rev 31246)
@@ -13,13 +13,17 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IInjectionPointParameter;
import org.jboss.tools.cdi.core.IProducerField;
-import org.jboss.tools.cdi.core.IQualifier;
+import org.jboss.tools.cdi.core.IProducerMethod;
import org.jboss.tools.cdi.core.IQualifierDeclaration;
/**
@@ -267,6 +271,7 @@
new String[]{"org.jboss.beans.test04.MyQualifier"});
assertEquals(1, beans.size());
IBean b = beans.iterator().next();
+ assertTrue(b instanceof IProducerField);
Set<IQualifierDeclaration> qs = b.getQualifierDeclarations();
Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
for (IQualifierDeclaration q: qs) {
@@ -276,10 +281,228 @@
assertNotNull(myQualifier);
assertEquals("kind-04-2", myQualifier.getMemberValue("kind"));
assertEquals("test04-2-a", b.getName());
+ }
+
+ /**
+ * Test 04-3.
+ * Sources contain class MyBean2 that declares a field of type MyType3,
+ * class MyType3 has no bean constructor.
+ * Seam config xml contains declaration:
+ * <test04:MyBean3>
+ * <s:modifies/>
+ * <test04:myType3>
+ * <s:Produces/>
+ * </test04:myType3>
+ * </test04:MyBean3>
+ *
+ * ASSERT: Model contains 1 bean with type MyType3.
+ * ASSERT: That bean is field producer.
+ * ASSERT: That bean has qualifier MyQualifier with kind="kind-04-3".
+ */
+ public void testModifyingBeanWithFieldMadeProducer() {
+ Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType3",
+ new String[]{"org.jboss.beans.test04.MyQualifier"});
+ assertEquals(1, beans.size());
+ IBean b = beans.iterator().next();
+ assertTrue(b instanceof IProducerField);
+ Set<IQualifierDeclaration> qs = b.getQualifierDeclarations();
+ Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
+ for (IQualifierDeclaration q: qs) {
+ map.put(q.getType().getFullyQualifiedName(), q);
+ }
+ IQualifierDeclaration myQualifier = map.get("org.jboss.beans.test04.MyQualifier");
+ assertNotNull(myQualifier);
+ assertEquals("kind-04-3", myQualifier.getMemberValue("kind"));
+ }
+
+ /**
+ * Test 04-4.
+ * Sources contain class MyBean4 that declares producer field of type MyType4,
+ * class MyType4 has no bean constructor.
+ * Seam config xml contains declaration:
+ * <test04:MyBean4>
+ * <s:replaces/>
+ * </test04:MyBean4>
+ *
+ * ASSERT: Model contains no bean with type MyType4.
+ */
+ public void testReplacingBeanWithFieldProducer() {
+ Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType4");
+ assertTrue(beans.isEmpty());
+ }
+
+ /**
+ * Test 04-5.
+ * Sources contain class MyBean5 that declares producer field of type MyType5,
+ * class MyType5 has no bean constructor.
+ * Seam config xml contains declaration:
+ * <test04:MyBean5>
+ * <s:replaces/>
+ * <test04:myType5>
+ * <test04:MyQualifier kind="kind-04-5-a"/>
+ * </test04:myType5>
+ * </test04:MyBean5>
+ *
+ * ASSERT: Model contains no bean with type MyType5.
+ * ASSERT: Model contains 1 bean with type MyBean5.
+ * ASSERT: That bean has injection point field with qualifier MyQualifier with kind="kind-04-5-a".
+ */
+ public void testReplacingBeanWithModifiedFieldProducer() {
+ Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType5",
+ new String[]{"org.jboss.beans.test04.MyQualifier"});
+ assertTrue(beans.isEmpty());
+ beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean5", new String[0]);
+ assertEquals(1, beans.size());
+ IBean b = beans.iterator().next();
+ Set<IInjectionPoint> is = b.getInjectionPoints();
+ assertEquals(1, is.size());
+ IInjectionPoint p = is.iterator().next();
+ Set<IQualifierDeclaration> qs = p.getQualifierDeclarations();
+ Map<String, IQualifierDeclaration> map = new HashMap<String, IQualifierDeclaration>();
+ for (IQualifierDeclaration q: qs) {
+ map.put(q.getType().getFullyQualifiedName(), q);
+ }
+ IQualifierDeclaration myQualifier = map.get("org.jboss.beans.test04.MyQualifier");
+ assertNotNull(myQualifier);
+ assertEquals("kind-04-5-a", myQualifier.getMemberValue("kind"));
+ }
+
+ /**
+ * Test 04-6.
+ * Sources contain class MyBean6 that declares field of type MyType6,
+ * class MyType6 has no bean constructor.
+ * Seam config xml contains declaration:
+ * <test04:MyBean6>
+ * <test04:MyQualifier kind="kind-04-6"/>
+ * <test04:myType6>
+ * <s:Produces/>
+ * </test04:myType6>
+ * </test04:MyBean6>
+ *
+ * ASSERT: Model contains 1 bean with type MyType6.
+ * ASSERT: That bean is field producer.
+ * ASSERT: Model contains 1 bean with type MyBean6 with qualifier MyQualifier
+ * ASSERT: That bean has no injection points.
+ * ASSERT: Model contains 1 bean with type MyBean6 with default qualifier..
+ * ASSERT: That bean has 1 injection point.
+ * ASSERT: That injection point is resolved to bean MyType6.
+ */
+ public void testCreatingBeanWithFieldMadeProducer() {
+ Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test04.MyType6", new String[0]);
+ assertEquals(1, beans.size());
+ IBean b = beans.iterator().next();
assertTrue(b instanceof IProducerField);
+
+ Set<IBean> beans1 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6",
+ new String[]{"org.jboss.beans.test04.MyQualifier"});
+ assertEquals(1, beans1.size());
+ IBean b1 = beans1.iterator().next();
+ Set<IInjectionPoint> is1 = b1.getInjectionPoints();
+ assertTrue(is1.isEmpty());
+
+ Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test04.MyBean6", new String[0]);
+ assertEquals(1, beans2.size());
+ IBean b2 = beans2.iterator().next();
+ Set<IInjectionPoint> is2 = b2.getInjectionPoints();
+ assertEquals(1, is2.size());
+
+ IInjectionPoint p = is2.iterator().next();
+
+ Set<IBean> beansI = cdiProject.getBeans(false, p);
+ assertTrue(beansI.contains(b));
}
+ /**
+ * Test 05-1
+ * Sources contain class MyBean1 that declares method createType
+ * with parameter MyType1.
+ * Seam config xml contains declaration:
+ * <test05:MyBean1>
+ * <test05:createType>
+ * <s:Produces/>
+ * <test05:MyQualifier/>
+ * <s:parameters>
+ * <test05:MyType1>
+ * </test05:MyType1>
+ * </s:parameters>
+ * </test05:createType>
+ * </test05:MyBean1>
+ *
+ * ASSERT: Model contains 1 bean with type MyType1 with qualifier MyQualifier.
+ * ASSERT: That bean is method producer.
+ * ASSERT: That bean has one injection point; it is parameter.
+ * ASSERT: That injection point is resolved to class bean with type MyType1 with default qualifier.
+ *
+ * @author Viacheslav Kababovich
+ *
+ */
+ public void testCreatingBeanWithMethodMadeProducer() {
+ Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1",
+ new String[]{"org.jboss.beans.test05.MyQualifier"});
+ assertEquals(1, beans.size());
+ IBean b = beans.iterator().next();
+ assertTrue(b instanceof IProducerMethod);
+
+ Set<IInjectionPoint> is = b.getInjectionPoints();
+ assertEquals(1, is.size());
+
+ IInjectionPoint p = is.iterator().next();
+ Set<IBean> beansI = cdiProject.getBeans(false, p);
+ assertEquals(1, beansI.size());
+
+ Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
+ assertEquals(1, beans2.size());
+ IBean b2 = beans2.iterator().next();
+
+ assertTrue(beansI.contains(b2));
+ }
+
+ /**
+ * Test 05-2
+ * Sources contain class MyBean2 that declares constructor.
+ * Seam config xml contains declaration:
+ * <test05:MyBean2>
+ * <s:parameters>
+ * <test05:MyType1>
+ * </test05:MyType1>
+ * </s:parameters>
+ * </test05:MyBean2>
+ *
+ * ASSERT: Model contains 1 bean with type MyBean2.
+ * ASSERT: That bean has one injection point; it is parameter.
+ * ASSERT: That injection point is resolved to class bean with type MyType1 with default qualifier.
+ *
+ */
+ public void testCreatingBeanWithConstructor() {
+ Set<IBean> beans = cdiProject.getBeans(false, "org.jboss.beans.test05.MyBean2", new String[0]);
+ assertEquals(1, beans.size());
+ IBean b = beans.iterator().next();
+ assertTrue(b instanceof IClassBean);
+
+ Set<IInjectionPoint> is = b.getInjectionPoints();
+ assertFalse(is.isEmpty());
+ IInjectionPoint p = null;
+ Iterator<IInjectionPoint> it = is.iterator();
+ while(it.hasNext()) {
+ IInjectionPoint i = it.next();
+ if(i instanceof IInjectionPointParameter) {
+ p = i;
+ break;
+ }
+ }
+ assertNotNull(p);
+
+ Set<IBean> beansI = cdiProject.getBeans(false, p);
+ assertEquals(1, beansI.size());
+
+ Set<IBean> beans2 = cdiProject.getBeans(false, "org.jboss.beans.test05.MyType1", new String[0]);
+ assertEquals(1, beans2.size());
+ IBean b2 = beans2.iterator().next();
+
+ assertTrue(beansI.contains(b2));
+ }
+
protected Set<IBean> getBeansByClassName(String className) {
return cdiProject.getBeans(false, className, new String[0]);
}
13 years, 5 months
JBoss Tools SVN: r31245 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui: src/org/jboss/tools/cdi/seam/config/ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-12 12:31:33 -0400 (Thu, 12 May 2011)
New Revision: 31245
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/icons/package.gif
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/src/org/jboss/tools/cdi/seam/config/ui/CDISeamConfigUiImages.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/src/org/jboss/tools/cdi/seam/config/ui/contentassist/SeamConfigXmlCompletionProposalComputer.java
Log:
JBIDE-8842
https://issues.jboss.org/browse/JBIDE-8842
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/icons/package.gif
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/icons/package.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/src/org/jboss/tools/cdi/seam/config/ui/CDISeamConfigUiImages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/src/org/jboss/tools/cdi/seam/config/ui/CDISeamConfigUiImages.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/src/org/jboss/tools/cdi/seam/config/ui/CDISeamConfigUiImages.java 2011-05-12 16:31:33 UTC (rev 31245)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * 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.cdi.seam.config.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+
+public class CDISeamConfigUiImages {
+
+ private static CDISeamConfigUiImages INSTANCE;
+
+ static {
+ try {
+ INSTANCE = new CDISeamConfigUiImages(new URL(CDISeamConfigUIPlugin.getDefault().getBundle().getEntry("/"), "icons/")); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (MalformedURLException e) {
+ CDISeamConfigUIPlugin.log(e);
+ }
+ }
+
+ public static final Image PACKAGE_IMAGE = getImage("package.gif"); //$NON-NLS-1$
+
+ public static Image getImage(String key) {
+ return INSTANCE.createImageDescriptor(key).createImage();
+ }
+
+ public static ImageDescriptor getImageDescriptor(String key) {
+ return INSTANCE.createImageDescriptor(key);
+ }
+
+ public static void setImageDescriptors(IAction action, String iconName) {
+ action.setImageDescriptor(INSTANCE.createImageDescriptor(iconName));
+ }
+
+ public static CDISeamConfigUiImages getInstance() {
+ return INSTANCE;
+ }
+
+ private URL baseUrl;
+ private CDISeamConfigUiImages parentRegistry;
+
+ protected CDISeamConfigUiImages(URL registryUrl, CDISeamConfigUiImages parent){
+
+ if(registryUrl == null) throw new IllegalArgumentException();
+ baseUrl = registryUrl;
+ parentRegistry = parent;
+ }
+
+ protected CDISeamConfigUiImages(URL url){
+ this(url,null);
+ }
+
+ public Image getImageByFileName(String key) {
+ return createImageDescriptor(key).createImage();
+ }
+
+ public ImageDescriptor createImageDescriptor(String key) {
+ try {
+ return ImageDescriptor.createFromURL(makeIconFileURL(key));
+ } catch (MalformedURLException e) {
+ if(parentRegistry == null) {
+ return ImageDescriptor.getMissingImageDescriptor();
+ } else {
+ return parentRegistry.createImageDescriptor(key);
+ }
+
+ }
+ }
+
+ private URL makeIconFileURL(String name) throws MalformedURLException {
+ if (name == null) throw new MalformedURLException();
+ return new URL(baseUrl, name);
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/src/org/jboss/tools/cdi/seam/config/ui/CDISeamConfigUiImages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/src/org/jboss/tools/cdi/seam/config/ui/contentassist/SeamConfigXmlCompletionProposalComputer.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/src/org/jboss/tools/cdi/seam/config/ui/contentassist/SeamConfigXmlCompletionProposalComputer.java 2011-05-12 16:29:30 UTC (rev 31244)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.ui/src/org/jboss/tools/cdi/seam/config/ui/contentassist/SeamConfigXmlCompletionProposalComputer.java 2011-05-12 16:31:33 UTC (rev 31245)
@@ -17,6 +17,7 @@
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
@@ -28,14 +29,16 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
+import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.eclipse.wst.xml.core.internal.contentmodel.CMNode;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
import org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLModelQueryCompletionProposalComputer;
import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
import org.eclipse.wst.xml.ui.internal.contentassist.XMLContentModelGenerator;
@@ -49,6 +52,7 @@
import org.jboss.tools.cdi.seam.config.core.util.Util;
import org.jboss.tools.cdi.seam.config.core.xml.SAXElement;
import org.jboss.tools.cdi.seam.config.ui.CDISeamConfigUIPlugin;
+import org.jboss.tools.cdi.seam.config.ui.CDISeamConfigUiImages;
import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.xml.XMLUtilities;
@@ -56,8 +60,13 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
public class SeamConfigXmlCompletionProposalComputer extends AbstractXMLModelQueryCompletionProposalComputer implements CDISeamConfigConstants {
- static int RELEVANCE_TAG = XMLRelevanceConstants.R_STRICTLY_VALID_TAG_NAME;
+ static int RELEVANCE_TAG = XMLRelevanceConstants.R_STRICTLY_VALID_TAG_NAME + 100;
static int RELEVANCE_TAG_KEYWORD = RELEVANCE_TAG - 1;
static int RELEVANCE_TAG_ANNOTATION = RELEVANCE_TAG_KEYWORD - 1;
static int RELEVANCE_TAG_MEMBER = RELEVANCE_TAG_ANNOTATION - 1;
@@ -184,7 +193,7 @@
if("beans".equals(parentElementName)) {
//suggest all classes in all packages.
- addTypeNames(tagData, false);
+ addTypeNames(tagData, false, false);
} else if(parentElementPrefix != null && prefixByPackage.containsValue(parentElementPrefix)) {
// If we are not in <beans>, then we have to be in context of some seam package.
IType contextType = null;
@@ -196,12 +205,12 @@
}
} else if(Util.isValue(sax) || Util.isKey(sax)) {
//Inside value or key we can define new bean.
- addTypeNames(tagData, false);
+ addTypeNames(tagData, false, true);
} else if(Util.isParameters(sax)) {
//TODO find parent method name and type, and suggest parameter types.
} else if((contextType = Util.resolveType(sax, cdi)) != null) {
//We are inside bean. Suggest members and annotations.
- addTypeNames(tagData, true); //only annotations allowed here.
+ addTypeNames(tagData, true, false); //only annotations allowed here.
addTagData(tagData, getTagNamesForMembers(parentElementPrefix, contextType, false), RELEVANCE_TAG_MEMBER);
if(eePrefix != null
@@ -209,6 +218,7 @@
&& XMLUtilities.getUniqueChild((Element)parentElement, eePrefix + ":" + KEYWORD_REPLACES) == null) {
addTagData(tagData, eePrefix, KEYWORD_MODIFIES, false, true, RELEVANCE_TAG_KEYWORD);
addTagData(tagData, eePrefix, KEYWORD_REPLACES, false, true, RELEVANCE_TAG_KEYWORD);
+ addTagData(tagData, eePrefix, KEYWORD_PARAMETERS, true, true, RELEVANCE_TAG_KEYWORD);
}
} else if(sax.getParent() != null && ((contextType = Util.resolveType(sax.getParent(), cdi)) != null)) {
IMember member = null;
@@ -219,10 +229,12 @@
}
if(member != null) {
//We are inside bean member. Suggest annotations and <value>.
- addTypeNames(tagData, true); //only annotations allowed here.
+ addTypeNames(tagData, true, false); //only annotations allowed here.
if(eePrefix != null) {
if(member instanceof IField) {
addTagData(tagData, eePrefix, KEYWORD_VALUE, true, RELEVANCE_TAG_KEYWORD);
+ //should we suggest entry only for maps...
+ addTagData(tagData, eePrefix, KEYWORD_ENTRY, true, true, RELEVANCE_TAG_KEYWORD);
} else if(member instanceof IMethod) {
addTagData(tagData, eePrefix, KEYWORD_PARAMETERS, true, true, RELEVANCE_TAG_KEYWORD);
}
@@ -234,10 +246,17 @@
return tagData;
}
- private void addTypeNames(Set<TagData> tagData, boolean annotationsOnly) {
+ private void addTypeNames(Set<TagData> tagData, boolean annotationsOnly, boolean classesOnly) {
try {
- Map<String, IMember> tagNames = getAllTagNames(annotationsOnly);
- addTagData(tagData, tagNames, annotationsOnly ? RELEVANCE_TAG_ANNOTATION : RELEVANCE_TAG_TYPE);
+ Map<String, IMember> tagNames = getAllTagNames(annotationsOnly, classesOnly);
+ Set<TagData> append = new HashSet<TagData>();
+ addTagData(append, tagNames, annotationsOnly ? RELEVANCE_TAG_ANNOTATION : RELEVANCE_TAG_TYPE);
+ if(annotationsOnly) {
+ for (TagData tag: append) {
+ tag.setHasClosingTag(false);
+ }
+ }
+ tagData.addAll(append);
} catch (JavaModelException e) {
CDISeamConfigUIPlugin.log(e);
}
@@ -312,7 +331,7 @@
}
private void createProposal(ContentAssistRequest contentAssistRequest, String tagText, String displayText, int positionAdjustment, IMember member, int relevance) {
- int begin = contentAssistRequest.getReplacementBeginPosition();;
+ int begin = contentAssistRequest.getReplacementBeginPosition();
int length = contentAssistRequest.getReplacementLength();
String proposedInfo = null;
if(member != null) {
@@ -353,6 +372,83 @@
}
+ protected void addAttributeValueProposals(
+ ContentAssistRequest contentAssistRequest,
+ CompletionProposalInvocationContext context) {
+
+ IDOMNode node = (IDOMNode) contentAssistRequest.getNode();
+ // Find the attribute region and name for which this position should
+ // have a value proposed
+ IStructuredDocumentRegion open = node.getFirstStructuredDocumentRegion();
+ ITextRegionList openRegions = open.getRegions();
+ int i = openRegions.indexOf(contentAssistRequest.getRegion());
+ if (i < 0) {
+ return;
+ }
+ ITextRegion nameRegion = null;
+ while (i >= 0) {
+ nameRegion = openRegions.get(i--);
+ if (nameRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
+ break;
+ }
+ }
+ // the name region is REQUIRED to do anything useful
+ if (nameRegion != null) {
+ String attributeName = open.getText(nameRegion);
+ if(attributeName.startsWith("xmlns:")) {
+ String match = contentAssistRequest.getMatchString();
+ if(match == null) {
+ match = "";
+ } else if(match.startsWith("\"") || match.startsWith("'")) {
+ match = match.substring(1);
+ }
+ if(match.length() == 0 || match.startsWith(URI_PREFIX) || URI_PREFIX.startsWith(match)) {
+ Set<String> packages = new HashSet<String>();
+ try {
+ packages = getAllPackages(javaProject);
+ } catch (JavaModelException e) {
+ CDISeamConfigUIPlugin.log(e);
+ }
+ packages.add(PACKAGE_EE);
+ for (String pkg: packages) {
+ String proposal = "urn:java:" + pkg;
+ if(match.startsWith(URI_PREFIX)) {
+ int q = match.lastIndexOf(":");
+ String pMatch = match.substring(q + 1);
+ if(!pkg.startsWith(pMatch)) {
+ continue;
+ }
+ if(pkg.indexOf('.', pMatch.length() + 1) >= 0) {
+ continue;
+ }
+ proposal = match.substring(0, q + 1) + pkg;
+ } else {
+ if(pkg.indexOf('.') > 0) continue;
+ }
+ int positionAdjustment = proposal.length();
+ String displayText = pkg;
+ createValueProposal(contentAssistRequest, proposal, displayText, positionAdjustment, null, 1000);
+ }
+ }
+ }
+ }
+
+ }
+
+ private void createValueProposal(ContentAssistRequest contentAssistRequest, String tagText, String displayText, int positionAdjustment, IMember member, int relevance) {
+ int begin = contentAssistRequest.getReplacementBeginPosition() + 1;
+ String match = contentAssistRequest.getMatchString();
+ int length = match == null || match.length() == 0 ? 0 : match.length() - 1;
+ String proposedInfo = null;
+ CustomCompletionProposal textProposal = new CustomCompletionProposal(
+ tagText, begin, length, positionAdjustment,
+ CDISeamConfigUiImages.PACKAGE_IMAGE,
+ displayText, null, proposedInfo, relevance);
+ contentAssistRequest.addProposal(textProposal);
+ }
+
+
+
@Override
protected XMLContentModelGenerator getContentGenerator() {
return new XMLContentModelGenerator();
@@ -396,11 +492,11 @@
}
}
- Map<String, IMember> getAllTagNames(boolean annotationsOnly) throws JavaModelException {
+ Map<String, IMember> getAllTagNames(boolean annotationsOnly, boolean classesOnly) throws JavaModelException {
Map<String, IMember> result = new HashMap<String, IMember>();
for (String packageName: prefixByPackage.keySet()) {
String prefix = prefixByPackage.get(packageName);
- Map<String, IMember> typeNames = findTypeNamesByPackage(javaProject, packageName, annotationsOnly);
+ Map<String, IMember> typeNames = findTypeNamesByPackage(javaProject, packageName, annotationsOnly, classesOnly);
for (String typeName: typeNames.keySet()) {
result.put(prefix + ":" + typeName, typeNames.get(typeName));
}
@@ -408,22 +504,22 @@
return result;
}
- Map<String, IMember> getTypeNamesByPrefix(String prefix, boolean annotationsOnly) throws JavaModelException {
+ Map<String, IMember> getTypeNamesByPrefix(String prefix, boolean annotationsOnly, boolean classesOnly) throws JavaModelException {
Map<String, IMember> result = new HashMap<String, IMember>();
String uri = uriByPrefix.get(prefix);
for (String packageName: Util.getPackages(uri)) {
- result.putAll(findTypeNamesByPackage(javaProject, packageName, annotationsOnly));
+ result.putAll(findTypeNamesByPackage(javaProject, packageName, annotationsOnly, classesOnly));
}
return result;
}
- public static Map<String, IMember> findTypeNamesByPackage(IJavaProject javaProject, String packageName, boolean annotationsOnly) throws JavaModelException {
+ public static Map<String, IMember> findTypeNamesByPackage(IJavaProject javaProject, String packageName, boolean annotationsOnly, boolean classesOnly) throws JavaModelException {
Map<String, IMember> result = new HashMap<String, IMember>();
if(PACKAGE_EE.equals(packageName)) {
for (String name: Util.EE_TYPES.keySet()) {
String cls = Util.EE_TYPES.get(name);
IType t = EclipseJavaUtil.findType(javaProject, cls);
- if(accept(t, annotationsOnly)) result.put(name, t);
+ if(accept(t, annotationsOnly, classesOnly)) result.put(name, t);
}
} else if(javaProject != null) {
IPackageFragmentRoot[] rs = javaProject.getAllPackageFragmentRoots();
@@ -433,11 +529,11 @@
ICompilationUnit[] units = pkg.getCompilationUnits();
for (ICompilationUnit u: units) {
IType[] ts = u.getTypes();
- for (IType t: ts) if(accept(t, annotationsOnly)) result.put(t.getElementName(), t);
+ for (IType t: ts) if(accept(t, annotationsOnly, classesOnly)) result.put(t.getElementName(), t);
}
IClassFile[] cs = pkg.getClassFiles();
for (IClassFile cls: cs) {
- if(accept(cls.getType(), annotationsOnly)) result.put(cls.getType().getElementName(), cls.getType());
+ if(accept(cls.getType(), annotationsOnly, classesOnly)) result.put(cls.getType().getElementName(), cls.getType());
}
}
}
@@ -446,10 +542,24 @@
return result;
}
- private static boolean accept(IType type, boolean annotationOnly) throws JavaModelException {
- return (type != null) && (!annotationOnly || type.isAnnotation());
+ public static Set<String> getAllPackages(IJavaProject javaProject) throws JavaModelException {
+ Set<String> result = new HashSet<String>();
+ IPackageFragmentRoot[] rs = javaProject.getAllPackageFragmentRoots();
+ for (IPackageFragmentRoot r: rs) {
+ IJavaElement[] cs = r.getChildren();
+ for (IJavaElement c: cs) {
+ if(c instanceof IPackageFragment) {
+ result.add(((IPackageFragment)c).getElementName());
+ }
+ }
+ }
+ return result;
}
+ private static boolean accept(IType type, boolean annotationOnly, boolean classesOnly) throws JavaModelException {
+ return (type != null) && (!annotationOnly || type.isAnnotation() && (!classesOnly || !type.isInterface()));
+ }
+
private Map<String, IMember> getTagNamesForMembers(String prefix, IType type, boolean fieldsOnly) {
Map<String, IMember> result = new HashMap<String, IMember>();
try {
13 years, 5 months
JBoss Tools SVN: r31244 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core: definition and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-12 12:29:30 -0400 (Thu, 12 May 2011)
New Revision: 31244
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/TextSourceReference.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigConstants.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXAttribute.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXParser.java
Log:
JBIDE-8940
https://issues.jboss.org/browse/JBIDE-8940
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigConstants.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigConstants.java 2011-05-12 16:27:35 UTC (rev 31243)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigConstants.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -28,6 +28,10 @@
public String ERROR_UNRESOLVED_MEMBER = "Unresolved member";
+ public String ERROR_UNRESOLVED_METHOD = "Unresolved method";
+
+ public String ERROR_UNRESOLVED_CONSTRUCTOR = "Unresolved constructor";
+
//Problem id: node was expected to be resolved to annotation type
public String ERROR_ANNOTATION_EXPECTED = "Annotation expected";
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-05-12 16:27:35 UTC (rev 31243)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigExtension.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -13,6 +13,8 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -21,14 +23,22 @@
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.cdi.core.CDICoreNature;
import org.jboss.tools.cdi.core.extension.ICDIExtension;
import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
+import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
import org.jboss.tools.cdi.seam.config.core.definition.SeamBeansDefinition;
+import org.jboss.tools.cdi.seam.config.core.definition.TextSourceReference;
import org.jboss.tools.cdi.seam.config.core.scanner.ConfigFileSet;
import org.jboss.tools.cdi.seam.config.core.scanner.SeamDefinitionBuilder;
+import org.jboss.tools.cdi.seam.config.core.validation.SeamConfigValidationMessages;
+import org.jboss.tools.cdi.seam.config.core.xml.SAXAttribute;
+import org.jboss.tools.cdi.seam.config.core.xml.SAXElement;
+import org.jboss.tools.cdi.seam.config.core.xml.SAXNode;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
@@ -38,7 +48,7 @@
* @author Viacheslav Kabanovich
*
*/
-public class CDISeamConfigExtension implements ICDIExtension, IBuildParticipantFeature {
+public class CDISeamConfigExtension implements ICDIExtension, IBuildParticipantFeature, IValidatorFeature {
CDICoreNature project;
ConfigDefinitionContext context = new ConfigDefinitionContext();
@@ -147,4 +157,34 @@
return o;
}
+ public void validateResource(IFile file, CDICoreValidator validator) {
+ SeamBeansDefinition def = context.getDefinition(file.getFullPath());
+ if(def != null) {
+ Map<SAXNode, String> nodes = def.getUnresolvedNodes();
+ for (Entry<SAXNode, String> entry: nodes.entrySet()) {
+ SAXNode node = entry.getKey();
+ String problemId = entry.getValue();
+ if(CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE.equals(problemId)) {
+ String name = node instanceof SAXElement ? ((SAXElement)node).getName() : node instanceof SAXAttribute ? ((SAXAttribute)node).getName() : null;
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_TYPE, name);
+ validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_TYPE, new TextSourceReference(file, node), file);
+ } else if(CDISeamConfigConstants.ERROR_UNRESOLVED_MEMBER.equals(problemId)) {
+ String name = node instanceof SAXElement ? ((SAXElement)node).getName() : node instanceof SAXAttribute ? ((SAXAttribute)node).getName() : null;
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_MEMBER, name);
+ validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_MEMBER, new TextSourceReference(file, node), file);
+ } else if(CDISeamConfigConstants.ERROR_UNRESOLVED_METHOD.equals(problemId)) {
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_METHOD, ((SAXElement)node).getName());
+ validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_METHOD, new TextSourceReference(file, node), file);
+ } else if(CDISeamConfigConstants.ERROR_UNRESOLVED_CONSTRUCTOR.equals(problemId)) {
+ String name = node instanceof SAXElement && ((SAXElement)node).getParent() != null ? ((SAXElement)node).getParent().getName() : null;
+ String message = NLS.bind(SeamConfigValidationMessages.UNRESOLVED_CONSTRUCTOR, ((SAXElement)node).getParent().getName());
+ validator.addError(message, CDISeamConfigPreferences.UNRESOLVED_CONSTRUCTOR, new TextSourceReference(file, node), file);
+ } else if(CDISeamConfigConstants.ERROR_ANNOTATION_EXPECTED.equals(problemId)) {
+ String message = NLS.bind(SeamConfigValidationMessages.ANNOTATION_EXPECTED, null);
+ validator.addError(message, CDISeamConfigPreferences.ANNOTATION_EXPECTED, new TextSourceReference(file, node), file);
+ }
+ }
+ }
+ }
+
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -0,0 +1,42 @@
+package org.jboss.tools.cdi.seam.config.core;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.tools.common.preferences.SeverityPreferences;
+
+public class CDISeamConfigPreferences extends SeverityPreferences {
+ public static final Set<String> SEVERITY_OPTION_NAMES = new HashSet<String>();
+
+ private static CDISeamConfigPreferences INSTANCE = new CDISeamConfigPreferences();
+
+ public static final String UNRESOLVED_TYPE = INSTANCE.createSeverityOption("unresolvedType");
+ public static final String UNRESOLVED_MEMBER = INSTANCE.createSeverityOption("unresolvedMember");
+ public static final String UNRESOLVED_METHOD = INSTANCE.createSeverityOption("unresolvedMethod");
+ public static final String UNRESOLVED_CONSTRUCTOR = INSTANCE.createSeverityOption("unresolvedConstructor");
+ public static final String ANNOTATION_EXPECTED = INSTANCE.createSeverityOption("annotationExpected");
+
+ public static CDISeamConfigPreferences getInstance() {
+ return INSTANCE;
+ }
+
+ private CDISeamConfigPreferences() {}
+
+ @Override
+ protected Set<String> getSeverityOptionNames() {
+ return SEVERITY_OPTION_NAMES;
+ }
+
+ @Override
+ protected String createSeverityOption(String shortName) {
+ String name = getPluginId() + ".validator.problem." + shortName; //$NON-NLS-1$
+ SEVERITY_OPTION_NAMES.add(name);
+ return name;
+ }
+
+ @Override
+ protected String getPluginId() {
+ return CDISeamConfigCorePlugin.PLUGIN_ID;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/CDISeamConfigPreferences.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java 2011-05-12 16:27:35 UTC (rev 31243)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/ConfigDefinitionContext.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -58,7 +58,8 @@
beanXMLs = copy.beanXMLs;
seambeanXMLs = copy.seambeanXMLs;
- for (String s: annotations.keySet()) {
+ String[] as = annotations.keySet().toArray(new String[0]);
+ for (String s: as) {
if(!copy.annotations.containsKey(s)) {
//Remove from root and reload it in root.
AnnotationDefinition d = annotations.get(s);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-05-12 16:27:35 UTC (rev 31243)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/SeamBeansDefinition.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -100,7 +100,10 @@
}
//Initialize typeDef taking into account replaces and modifies
int flags = AbstractMemberDefinition.FLAG_ALL_MEMBERS;
- if(replaces) flags |= AbstractMemberDefinition.FLAG_NO_ANNOTATIONS;
+ if(!modifies) {
+ //For replacing or created - no annotations loaded.
+ flags |= AbstractMemberDefinition.FLAG_NO_ANNOTATIONS;
+ }
typeDef.setType(type, context.getRootContext(), flags);
mergeTypeDefinition(def, typeDef, context);
@@ -134,7 +137,7 @@
String n = fieldDef.getField().getElementName();
SeamFieldDefinition f = def.getField(n);
if(f != null) {
- fieldDef.setOriginalDefinition(new TextSourceReference(f.getNode().getLocation()));
+ fieldDef.setOriginalDefinition(new TextSourceReference(resource, f.getNode()));
mergeAnnotations(f, fieldDef, context);
}
}
@@ -172,25 +175,4 @@
}
}
- class TextSourceReference implements ITextSourceReference {
- Location location;
-
- public TextSourceReference(Location location) {
- this.location = location;
- }
-
- public int getStartPosition() {
- return location.getStartPosition();
- }
-
- public int getLength() {
- return location.getLength();
- }
-
- public IResource getResource() {
- return resource;
- }
-
- }
-
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/TextSourceReference.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/TextSourceReference.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/TextSourceReference.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -0,0 +1,28 @@
+package org.jboss.tools.cdi.seam.config.core.definition;
+
+import org.eclipse.core.resources.IResource;
+import org.jboss.tools.cdi.seam.config.core.xml.SAXNode;
+import org.jboss.tools.common.text.ITextSourceReference;
+
+public class TextSourceReference implements ITextSourceReference {
+ IResource resource;
+ SAXNode node;
+
+ public TextSourceReference(IResource resource, SAXNode node) {
+ this.resource = resource;
+ this.node = node;
+ }
+
+ public int getStartPosition() {
+ return node.getLocation().getStartPosition();
+ }
+
+ public int getLength() {
+ return node.getLocation().getLength();
+ }
+
+ public IResource getResource() {
+ return resource;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/definition/TextSourceReference.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java 2011-05-12 16:27:35 UTC (rev 31243)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/scanner/SeamDefinitionBuilder.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -227,6 +227,8 @@
IJavaAnnotation a = loadAnnotationDeclaration(c, IN_ANNOTATION_TYPE);
if(a != null) def.addAnnotation(a);
continue;
+ } else {
+ result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
}
}
@@ -315,6 +317,8 @@
IJavaAnnotation a = loadAnnotationDeclaration(c, IN_ANNOTATION_TYPE);
if(a != null) def.addAnnotation(a);
continue;
+ } else {
+ result.addUnresolvedNode(c, CDISeamConfigConstants.ERROR_UNRESOLVED_TYPE);
}
}
@@ -326,6 +330,9 @@
}
if(method != null) {
def.setMethod(method);
+ } else {
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_METHOD);
+ def = null;
}
return def;
}
@@ -353,6 +360,9 @@
}
if(method != null) {
def.setMethod(method);
+ } else {
+ result.addUnresolvedNode(element, CDISeamConfigConstants.ERROR_UNRESOLVED_CONSTRUCTOR);
+ def = null;
}
return def;
@@ -435,8 +445,13 @@
value, IMemberValuePair.K_STRING, type);
Set<String> ns = element.getAttributeNames();
for (String n: ns) {
- String v = element.getAttribute(n).getValue();
+ SAXAttribute attr = element.getAttribute(n);
+ String v = attr.getValue();
literal.addMemberValuePair(n, v, IMemberValuePair.K_STRING);
+ IMethod m = type.getMethod(n, new String[0]);
+ if(!m.exists()) {
+ result.addUnresolvedNode(attr, CDISeamConfigConstants.ERROR_UNRESOLVED_MEMBER);
+ }
}
return literal;
} else if(contextKind == IN_ANNOTATION_TYPE) {
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -0,0 +1,19 @@
+package org.jboss.tools.cdi.seam.config.core.validation;
+
+import org.eclipse.osgi.util.NLS;
+
+public class SeamConfigValidationMessages {
+
+ private static final String BUNDLE_NAME = SeamConfigValidationMessages.class.getPackage().getName() + ".messages"; //$NON-NLS-1$
+
+ public static String UNRESOLVED_TYPE;
+ public static String UNRESOLVED_MEMBER;
+ public static String UNRESOLVED_METHOD;
+ public static String UNRESOLVED_CONSTRUCTOR;
+ public static String ANNOTATION_EXPECTED;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, SeamConfigValidationMessages.class);
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/SeamConfigValidationMessages.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties 2011-05-12 16:29:30 UTC (rev 31244)
@@ -0,0 +1,5 @@
+UNRESOLVED_TYPE=Cannot resolve type in node {0}.
+UNRESOLVED_MEMBER=Cannot resolve member in node {0}.
+UNRESOLVED_METHOD=Cannot resolve method in node {0}.
+UNRESOLVED_CONSTRUCTOR=Cannot resolve constructor in type node {0}.
+ANNOTATION_EXPECTED=Annotation types are only allowed here.
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/validation/messages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXAttribute.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXAttribute.java 2011-05-12 16:27:35 UTC (rev 31243)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXAttribute.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -17,7 +17,7 @@
*/
public class SAXAttribute extends SAXText {
private String name;
- private Location nameLocation;
+ private Location valueLocation;
private SAXElement parent;
@@ -30,19 +30,19 @@
}
public void setNameLocation(Location location) {
- nameLocation = location;
+ setLocation(location);
}
public Location getNameLocation() {
- return nameLocation;
+ return getLocation();
}
public void setValueLocation(Location location) {
- setLocation(location);
+ valueLocation = location;
}
public Location getValueLocation() {
- return getLocation();
+ return valueLocation;
}
public void setParent(SAXElement parent) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXParser.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXParser.java 2011-05-12 16:27:35 UTC (rev 31243)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.config.core/src/org/jboss/tools/cdi/seam/config/core/xml/SAXParser.java 2011-05-12 16:29:30 UTC (rev 31244)
@@ -43,7 +43,7 @@
setFeature(parserInstance, VALIDATION_SCHEMA_FEATURE_ID, true);
setFeature(parserInstance, VALIDATION_SCHEMA_CHECKING_FEATURE_ID, false);
setFeature(parserInstance, VALIDATION_DYNAMIC_FEATURE_ID, false);
- setFeature(parserInstance, FATAL_ERROR_PROCESSING_FEATURE_ID, false);
+ setFeature(parserInstance, FATAL_ERROR_PROCESSING_FEATURE_ID, true);
try {
parserInstance.setProperty(ENTITY_RESOLVER_PROPERTY_ID, new XMLEntityResolverImpl());
13 years, 5 months
JBoss Tools SVN: r31243 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: core/extension/feature and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-05-12 12:27:35 -0400 (Thu, 12 May 2011)
New Revision: 31243
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionFactory.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
Log:
JBIDE-8940
https://issues.jboss.org/browse/JBIDE-8940
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionFactory.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionFactory.java 2011-05-12 16:22:40 UTC (rev 31242)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionFactory.java 2011-05-12 16:27:35 UTC (rev 31243)
@@ -25,6 +25,7 @@
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedMemberFeature;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedTypeFeature;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
/**
* Loads Eclipse extension point 'org.jboss.tools.cdi.core.cdiextensions'
@@ -50,7 +51,8 @@
IBuildParticipantFeature.class,
IProcessAnnotatedMemberFeature.class,
IProcessAnnotatedTypeFeature.class,
- IAmbiguousBeanResolverFeature.class
+ IAmbiguousBeanResolverFeature.class,
+ IValidatorFeature.class
};
public static CDIExtensionFactory getInstance() {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-05-12 16:22:40 UTC (rev 31242)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-05-12 16:27:35 UTC (rev 31243)
@@ -21,6 +21,7 @@
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedMemberFeature;
import org.jboss.tools.cdi.core.extension.feature.IProcessAnnotatedTypeFeature;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
/**
*
@@ -159,6 +160,14 @@
return result;
}
+ public Set<IValidatorFeature> getValidatorFeature() {
+ Set<IValidatorFeature> result = featureStorage.validator;
+ if(result == null) {
+ featureStorage.validator = result = getFeature(IValidatorFeature.class);
+ }
+ return result;
+ }
+
private <F extends Object> Set<F> getFeature(Class<F> cls) {
Set<F> result = new HashSet<F>();
Set<ICDIExtension> extensions = getExtensions(cls);
@@ -178,12 +187,14 @@
Set<IProcessAnnotatedMemberFeature> processAnnotatedMember = null;
Set<IProcessAnnotatedTypeFeature> processAnnotatedType = null;
Set<IAmbiguousBeanResolverFeature> ambiguousBeanResolver = null;
+ Set<IValidatorFeature> validator = null;
void clean() {
processAnnotatedMember = null;
processAnnotatedType = null;
buildParticipant = null;
ambiguousBeanResolver = null;
+ validator = null;
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java 2011-05-12 16:27:35 UTC (rev 31243)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.cdi.core.extension.feature;
+
+import org.eclipse.core.resources.IFile;
+import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface IValidatorFeature {
+
+ /**
+ * Contributes to validation of resource in CDICoreValidator.validateResource(IFile)
+ *
+ * @param file
+ * @param context
+ */
+ public void validateResource(IFile file, CDICoreValidator validator);
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IValidatorFeature.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-12 16:22:40 UTC (rev 31242)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-05-12 16:27:35 UTC (rev 31243)
@@ -85,6 +85,7 @@
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.IStereotyped;
import org.jboss.tools.cdi.core.ITypeDeclaration;
+import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.cdi.internal.core.impl.ParametedType;
@@ -404,6 +405,10 @@
IInterceptorBinding binding = cdiProject.getInterceptorBinding(file.getFullPath());
validateInterceptorBinding(binding);
}
+ Set<IValidatorFeature> extensions = cdiProject.getNature().getExtensionManager().getValidatorFeature();
+ for (IValidatorFeature v: extensions) {
+ v.validateResource(file, this);
+ }
}
Set<IFolder> getSourceFoldersForProjectsSet() {
13 years, 5 months