JBoss Tools SVN: r37782 - trunk/cdi/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-01-11 22:40:47 -0500 (Wed, 11 Jan 2012)
New Revision: 37782
Modified:
trunk/cdi/docs/reference/en-US/master.xml
Log:
updated maven version to have correct chapter order
Modified: trunk/cdi/docs/reference/en-US/master.xml
===================================================================
--- trunk/cdi/docs/reference/en-US/master.xml 2012-01-12 03:32:12 UTC (rev 37781)
+++ trunk/cdi/docs/reference/en-US/master.xml 2012-01-12 03:40:47 UTC (rev 37782)
@@ -38,7 +38,7 @@
</bookinfo>
<toc/>
+ &CDI_Web_Project;
&Revision_History;
- &CDI_Web_Project;
</book>
12 years, 12 months
JBoss Tools SVN: r37781 - in trunk/cdi/docs/reference/en-US: images and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2012-01-11 22:32:12 -0500 (Wed, 11 Jan 2012)
New Revision: 37781
Added:
trunk/cdi/docs/reference/en-US/Creating_a_CDI_Web_Project.xml
trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/
trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_01.png
trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_02.png
trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_03.png
trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_04.png
trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_05.png
trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_06.png
Modified:
trunk/cdi/docs/reference/en-US/CDI_Tools_Reference_Guide.xml
trunk/cdi/docs/reference/en-US/master.xml
Log:
updated with info about new wizard
Modified: trunk/cdi/docs/reference/en-US/CDI_Tools_Reference_Guide.xml
===================================================================
--- trunk/cdi/docs/reference/en-US/CDI_Tools_Reference_Guide.xml 2012-01-12 02:01:29 UTC (rev 37780)
+++ trunk/cdi/docs/reference/en-US/CDI_Tools_Reference_Guide.xml 2012-01-12 03:32:12 UTC (rev 37781)
@@ -4,6 +4,7 @@
<book>
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Creating_a_CDI_Web_Project.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>
Added: trunk/cdi/docs/reference/en-US/Creating_a_CDI_Web_Project.xml
===================================================================
--- trunk/cdi/docs/reference/en-US/Creating_a_CDI_Web_Project.xml (rev 0)
+++ trunk/cdi/docs/reference/en-US/Creating_a_CDI_Web_Project.xml 2012-01-12 03:32:12 UTC (rev 37781)
@@ -0,0 +1,256 @@
+<?xml version='1.0' encoding='utf-8' ?>
+
+ <chapter id="chap-CDI_Tools_Reference_Guide-Creating_a_CDI_Web_Project">
+ <title>Creating a CDI Web Project</title>
+ <para>
+ From the workbench go to <menuchoice><guimenuitem>File</guimenuitem><guimenuitem>New</guimenuitem><guimenuitem>Other</guimenuitem></menuchoice>.
+ </para>
+ <figure id="project_creation_01">
+ <title>Selecting the CDI Web Project wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Creating_a_CDI_Web_Project/project_creation_01.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Wizard selection screen with the CDI Web Project wizard selected.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ The first screen of the wizard will ask you to define the attributes according to the options outlined in <xref linkend="table-jbt-new_cdi_web_project_01"/>. Click the <guibutton>Next</guibutton> button after defining the attributes in order to continue customizing your project or click the <guibutton>Finish</guibutton> button to accept all other defaults and create your application.
+ </para>
+ <figure id="project_creation_02">
+ <title>Main project creation screen</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Creating_a_CDI_Web_Project/project_creation_02.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ The main options to define and select for your project.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <table id="table-jbt-new_cdi_web_project_01" frame='all'>
+ <title>New CDI Web Project</title>
+ <tgroup cols='4' align='left' colsep='1' rowsep='1'>
+ <colspec colname='c1' colwidth="1*"/>
+ <colspec colname='c2' colwidth="1*"/>
+ <colspec colname='c3' colwidth="3*"/>
+ <colspec colname='c4' colwidth="3*"/>
+ <thead>
+ <row>
+ <entry>Field</entry>
+ <entry>Mandatory</entry>
+ <entry>Instruction</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>Project name</entry>
+ <entry>yes</entry>
+ <entry>Enter a project name.</entry>
+ <entry>The project name can be any name you define.</entry>
+ </row>
+ <row>
+ <entry>Project location</entry>
+ <entry>yes</entry>
+ <entry>The <guilabel>Use default location</guilabel> checkbox will be selected automatically to define the project location as the Eclipse workspace. However you can define a custom path in the <guilabel>Location</guilabel> field be deselecting the <guilabel>Use default location</guilabel> checkbox.</entry>
+ <entry>The default location corresponds to the Eclipse workspace.</entry>
+ </row>
+ <row>
+ <entry>Target runtime</entry>
+ <entry>no</entry>
+ <entry>Select a pre-configured runtime from the available options or configure a new runtime environment.</entry>
+ <entry>
+ <para>
+ The target runtime defines the server to which the application will be deployed.
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>Dynamic web module version</entry>
+ <entry>yes</entry>
+ <entry>Select the required web module version.</entry>
+ <entry>
+ <para>
+ This option adds support for the Java Servlet API with module versions corresponding to JEE or J2EE levels as listed in <xref linkend="table-jbt-new_cdi_web_project_02"/>.
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>Configuration</entry>
+ <entry>yes</entry>
+ <entry>Select the project configuration from the available options.</entry>
+ <entry>
+ <para>
+ The project can be based on either a custom or a set of pre-defined configurations as described in <xref linkend="table-jbt-new_cdi_web_project_03"/>.
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>EAR membership</entry>
+ <entry>no</entry>
+ <entry>Add the project to an existing EAR project.</entry>
+ <entry>
+ <para>
+ The project can be added to an existing EAR project by selecting the checkbox. Once checked, a new EAR project can be defined by clicking the <guibutton>New Project</guibutton> button.
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>Working sets</entry>
+ <entry>no</entry>
+ <entry>Add the project to an existing working set.</entry>
+ <entry>
+ <para>
+ A working set provides the ability to group projects or project attributes in a customized way to improve access. A new working set can be defined once the <guibutton>Select</guibutton> button has been clicked.
+ </para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table id="table-jbt-new_cdi_web_project_02" frame="all">
+ <!-- <table id="NewJSFProject_Web_ServletVersion" frame='all'> -->
+ <title>New Dynamic Project - Dynamic web module version</title>
+ <tgroup cols='2' align='left' colsep='1' rowsep='1'>
+ <colspec colname='c1' colwidth="1*"/>
+ <colspec colname='c2' colwidth="4*"/>
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>3.0</entry>
+ <entry>This web module version corresponds to the JEE 6 implementation.</entry>
+ </row>
+ <row>
+ <entry>2.5</entry>
+ <entry>This web module version corresponds to the JEE 5 implementation.</entry>
+ </row>
+ <row>
+ <entry>2.4</entry>
+ <entry>This web module version corresponds to the J2EE 1.4 implementation.</entry>
+ </row>
+ <row>
+ <entry>2.3</entry>
+ <entry>This web module version corresponds to the J2EE 1.3 implementation.</entry>
+ </row>
+ <row>
+ <entry>2.2</entry>
+ <entry>This web module version corresponds to the J2EE 1.2 implementation.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table id="table-jbt-new_cdi_web_project_03">
+ <title>CDI Web Project - Configuration</title>
+ <tgroup cols='2' align='left' colsep='1' rowsep='1'>
+ <colspec colname='c1' colwidth="1*"/>
+ <colspec colname='c2' colwidth="2*"/>
+ <thead>
+ <row>
+ <entry>Option</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>Dynamic Web Project with CDI</entry>
+ <entry>The default configuration option. Choosing this configuration will create a Dynamic Web Project with the CDI facet enabled.</entry>
+ </row>
+ <row>
+ <entry>Default configuration for the runtime specified in <guilabel>Target runtime</guilabel></entry>
+ <entry>Depending on the runtime configuration, you may have to manually add CDI facet support through the <guibutton>Modify</guibutton> button.</entry>
+ </row>
+ <row>
+ <entry>JavaServer Faces v2.0 Project</entry>
+ <entry>Configures a project to use JSF v2.0. You will need to manually add CDI support to this configuration through th <guibutton>Modify</guibutton> button. </entry>
+ </row>
+ <row>
+ <entry>Minimal Configuration</entry>
+ <entry>The minimum required facets are installed. You will need to manually add CDI support to this configuration through th <guibutton>Modify</guibutton> button.</entry>
+ </row>
+ <row>
+ <entry><custom></entry>
+ <entry>Total manual configuration is required through the <guibutton>Modify</guibutton> button. Ensure you enable the CDI facet for CDI Web Project creation to succeed.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>
+ The <guilabel>Java</guilabel> configuration screen allows you to define <guilabel>Source folders on the build path</guilabel> and the <guilabel>Default output folder</guilabel>. The defaults for each are recommended, however you have the option to change them as you see fit.
+ </para>
+ <figure id="project_creation_03">
+ <title>Java configuration screen</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Creating_a_CDI_Web_Project/project_creation_03.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Java configuration screen for your project.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ The <guilabel>Web Module</guilabel> configuration screen allows you to define the <guilabel>Context root</guilabel> and the <guilabel>Content directory</guilabel> to be created, the option to <guilabel>Generate web.xml deployment descriptor</guilabel> is selected by default. The defaults for each are recommended, however you have the option to change them as you see fit.
+ </para>
+ <figure id="project_creation_04">
+ <title>Web Module configuration screen</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Creating_a_CDI_Web_Project/project_creation_04.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Web Module configuration screen for your project.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ The <guilabel>Context and Dependency Injection (CDI) Facet</guilabel> settings configuration screen allows you to <guilabel>Generate beans.xml file</guilabel>, selected by default. The <filename>beans.xml</filename> file is a bean archive descriptor that allows you to enable CDI services for a bean archive. It is recommended that you leave the option selected.
+ </para>
+ <figure id="project_creation_05">
+ <title>Web Module configuration screen</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Creating_a_CDI_Web_Project/project_creation_05.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ Web Module configuration screen for your project.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
+ The final wizard screen pertains to <guilabel>JSF Capabilities</guilabel> configuration.
+ </para>
+ <figure id="project_creation_06">
+ <title>Web Module configuration screen</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Creating_a_CDI_Web_Project/project_creation_06.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>
+ JSF Capabilities configuration screen for your project.
+ </phrase>
+ </textobject>
+ </mediaobject>
+ </figure>
+</chapter>
+
Added: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_01.png
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_01.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_02.png
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_02.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_03.png
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_03.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_04.png
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_04.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_05.png
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_05.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_06.png
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/docs/reference/en-US/images/Creating_a_CDI_Web_Project/project_creation_06.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/cdi/docs/reference/en-US/master.xml
===================================================================
--- trunk/cdi/docs/reference/en-US/master.xml 2012-01-12 02:01:29 UTC (rev 37780)
+++ trunk/cdi/docs/reference/en-US/master.xml 2012-01-12 03:32:12 UTC (rev 37781)
@@ -4,6 +4,7 @@
[
<!ENTITY Revision_History SYSTEM "Revision_History.xml">
+<!ENTITY CDI_Web_Project SYSTEM "Creating_a_CDI_Web_Project.xml">
]>
<book>
@@ -38,5 +39,6 @@
<toc/>
&Revision_History;
+ &CDI_Web_Project;
</book>
12 years, 12 months
JBoss Tools SVN: r37780 - in trunk: common/tests/org.jboss.tools.common.base.test/META-INF and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-01-11 21:01:29 -0500 (Wed, 11 Jan 2012)
New Revision: 37780
Added:
trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/kb/
trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/kb/QueryParticipantTestUtils.java
trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/model/
trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/model/XProjectImportTestSetUp.java
Removed:
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/util/test/XProjectImportTestSetUp.java
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/QueryParticipantTestUtils.java
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsSearchParticipantTest.java
trunk/common/tests/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/ELReferencesQueryParticipantTest.java
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELReferencesQueryParticipantTest.java
Log:
removed dependency to mode.test plugin
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/ELReferencesQueryParticipantTest.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -4,9 +4,9 @@
import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.common.base.test.kb.QueryParticipantTestUtils;
+import org.jboss.tools.common.base.test.kb.QueryParticipantTestUtils.MatchStructure;
import org.jboss.tools.jst.web.kb.refactoring.ELReferencesQueryParticipant;
-import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils;
-import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.MatchStructure;
public class ELReferencesQueryParticipantTest extends TCKTest{
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsSearchParticipantTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsSearchParticipantTest.java 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/search/FiveDependentProjectsSearchParticipantTest.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -35,9 +35,9 @@
import org.jboss.tools.cdi.ui.search.CDIMatch;
import org.jboss.tools.cdi.ui.search.InjectionPointQueryParticipant;
import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.base.test.kb.QueryParticipantTestUtils;
+import org.jboss.tools.common.base.test.kb.QueryParticipantTestUtils.MatchStructure;
import org.jboss.tools.jst.web.kb.refactoring.ELReferencesQueryParticipant;
-import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils;
-import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.MatchStructure;
public class FiveDependentProjectsSearchParticipantTest extends TestCase {
IProject project1 = null;
Modified: trunk/common/tests/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/common/tests/org.jboss.tools.common.base.test/META-INF/MANIFEST.MF 2012-01-12 02:01:29 UTC (rev 37780)
@@ -8,6 +8,8 @@
Bundle-Localization: plugin
Export-Package: org.jboss.tools.common.base.test,
org.jboss.tools.common.base.test.contentassist,
+ org.jboss.tools.common.base.test.kb,
+ org.jboss.tools.common.base.test.model,
org.jboss.tools.common.base.test.validation
Require-Bundle: org.jboss.tools.common,
org.eclipse.core.runtime;bundle-version="3.7.0",
@@ -30,7 +32,9 @@
org.jboss.tools.common.validation,
org.eclipse.wst.validation;bundle-version="1.2.300",
org.eclipse.wst.common.frameworks;bundle-version="1.2.100",
- org.eclipse.ltk.core.refactoring;bundle-version="3.5.0"
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.0",
+ org.jboss.tools.common.model;bundle-version="3.3.0",
+ org.eclipse.search;bundle-version="3.7.0"
Bundle-Version: 3.3.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .
Copied: trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/kb/QueryParticipantTestUtils.java (from rev 37773, trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/QueryParticipantTestUtils.java)
===================================================================
--- trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/kb/QueryParticipantTestUtils.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/kb/QueryParticipantTestUtils.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -0,0 +1,148 @@
+package org.jboss.tools.common.base.test.kb;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.ILocalVariable;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory;
+import org.eclipse.jdt.ui.search.ElementQuerySpecification;
+import org.eclipse.jdt.ui.search.IQueryParticipant;
+import org.eclipse.jdt.ui.search.ISearchRequestor;
+import org.eclipse.jdt.ui.search.QuerySpecification;
+import org.eclipse.search.ui.text.Match;
+import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.util.FileUtil;
+
+public class QueryParticipantTestUtils extends TestCase {
+ public static final int FIELD_SEARCH = 1;
+ public static final int METHOD_SEARCH = 2;
+ public static final int TYPE_SEARCH = 3;
+ public static final int PARAMETER_SEARCH = 4;
+
+ public static void testSearchParticipant(IProject project, String fileName, int searchType, String elementName, String parameterName, IQueryParticipant participant, List<MatchStructure> matches) throws CoreException{
+ IFile file = project.getFile(fileName);
+ assertNotNull("File - " + fileName + " not found", file);
+
+ ICompilationUnit compilationUnit = EclipseUtil.getCompilationUnit(file);
+
+ assertNotNull("CompilationUnit not found", compilationUnit);
+
+ IJavaElement element = null;
+
+ IType type = compilationUnit.findPrimaryType();
+
+ assertNotNull("Primary type not found", type);
+
+ if(searchType == FIELD_SEARCH){
+ element = type.getField(elementName);
+ } else if(searchType == METHOD_SEARCH){
+ element = getMethod(type, elementName);
+ } else if(searchType == TYPE_SEARCH){
+ element = type;
+ } else if(searchType == PARAMETER_SEARCH){
+ IMethod method = getMethod(type, elementName);
+ element = getParameter(method, parameterName);
+ }
+
+ assertNotNull("Java Element not found", element);
+
+ SearchRequestor requestor = new SearchRequestor();
+
+ JavaSearchScopeFactory factory = JavaSearchScopeFactory.getInstance();
+ IJavaSearchScope scope = factory.createWorkspaceScope(true);
+ String description = factory.getWorkspaceScopeDescription(true);
+ QuerySpecification specification = new ElementQuerySpecification(element, IJavaSearchConstants.REFERENCES, scope, description);
+
+ participant.search(requestor, specification, new NullProgressMonitor());
+
+ List<Match> matchesForCheck = requestor.getMatches();
+
+ checkMatches(matchesForCheck, matches);
+ }
+
+ private static IMethod getMethod(IType type, String name) throws JavaModelException{
+ IMethod[] methods = type.getMethods();
+ for(IMethod method : methods){
+ if(method.getElementName().equals(name))
+ return method;
+ }
+ return null;
+ }
+
+ private static ILocalVariable getParameter(IMethod method, String name) throws JavaModelException{
+ ILocalVariable[] parameters = method.getParameters();
+ for(ILocalVariable parameter : parameters) {
+ if(parameter.getElementName().equals(name)) {
+ return parameter;
+ }
+ }
+ return null;
+ }
+
+ private static void checkMatches(List<Match> matchesForCheck, List<MatchStructure> matchList) throws CoreException {
+ for(Match match : matchesForCheck){
+ assertTrue("Match must return IFile", match.getElement() instanceof IFile);
+
+ IFile file = (IFile)match.getElement();
+ String filePath = file.getFullPath().toString();
+ String text = FileUtil.getContentFromEditorOrFile(file);
+ String name = text.substring(match.getOffset(), match.getOffset()+match.getLength());
+
+ MatchStructure ms = findMatch(matchList, match, filePath, name);
+
+ assertNotNull("Unexpected match found (file - " + filePath + " name - " + name + ")", ms);
+ ms.checked = true;
+ }
+
+ for(MatchStructure ms : matchList){
+ assertTrue("Match not found (file - "+ms.path+" name - "+ms.name+")", ms.checked);
+ }
+ }
+
+ protected static MatchStructure findMatch(List<MatchStructure> matchList, Match match, String filePath, String name){
+ for(MatchStructure ms : matchList){
+ if(!ms.checked && ms.path.equals(filePath) && ms.name.equals(name)){
+ //System.out.println("Match found (file - "+ms.path+" name - "+ms.name+")");
+ return ms;
+ }
+ }
+ return null;
+ }
+
+ static class SearchRequestor implements ISearchRequestor {
+ ArrayList<Match> matches = new ArrayList<Match>();
+
+ public void reportMatch(Match match){
+ matches.add(match);
+ }
+
+ public List<Match> getMatches(){
+ return matches;
+ }
+ }
+
+ public static class MatchStructure{
+ String path;
+ String name; // label
+ boolean checked;
+
+ public MatchStructure(String path, String name){
+ this.path = path;
+ this.name = name;
+ checked = false;
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/kb/QueryParticipantTestUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/model/XProjectImportTestSetUp.java (from rev 37773, trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/util/test/XProjectImportTestSetUp.java)
===================================================================
--- trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/model/XProjectImportTestSetUp.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/model/XProjectImportTestSetUp.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -0,0 +1,24 @@
+package org.jboss.tools.common.base.test.model;
+
+import junit.framework.Test;
+
+import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+public class XProjectImportTestSetUp extends ProjectImportTestSetup {
+
+ public XProjectImportTestSetUp(Test test, String bundleName, String projectPath, String projectName) {
+ super(test,bundleName, projectPath, projectName);
+ }
+
+ public XProjectImportTestSetUp(Test test, String bundleName, String[] projectPaths, String[] projectNames) {
+ super(test, bundleName, projectPaths, projectNames);
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ PreferenceModelUtilities.getPreferenceModel();
+ super.setUp();
+ }
+
+}
Deleted: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/util/test/XProjectImportTestSetUp.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/util/test/XProjectImportTestSetUp.java 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/util/test/XProjectImportTestSetUp.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -1,24 +0,0 @@
-package org.jboss.tools.common.model.util.test;
-
-import junit.framework.Test;
-
-import org.jboss.tools.common.model.options.PreferenceModelUtilities;
-import org.jboss.tools.test.util.ProjectImportTestSetup;
-
-public class XProjectImportTestSetUp extends ProjectImportTestSetup {
-
- public XProjectImportTestSetUp(Test test, String bundleName, String projectPath, String projectName) {
- super(test,bundleName, projectPath, projectName);
- }
-
- public XProjectImportTestSetUp(Test test, String bundleName, String[] projectPaths, String[] projectNames) {
- super(test, bundleName, projectPaths, projectNames);
- }
-
- @Override
- protected void setUp() throws Exception {
- PreferenceModelUtilities.getPreferenceModel();
- super.setUp();
- }
-
-}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/META-INF/MANIFEST.MF 2012-01-12 02:01:29 UTC (rev 37780)
@@ -36,7 +36,6 @@
org.eclipse.wst.validation,
org.jboss.tools.common.el.core,
org.jboss.tools.jst.jsp,
- org.jboss.tools.common.model.test,
org.eclipse.wst.common.project.facet.core,
org.eclipse.jst.jsf.core,
org.eclipse.jst.j2ee,
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/kb/test/JsfKbAllTests.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -13,8 +13,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import org.jboss.tools.common.model.util.test.XProjectImportTestSetUp;
-import org.jboss.tools.jsf.kb.test.WebWithModuleTest;
+import org.jboss.tools.common.base.test.model.XProjectImportTestSetUp;
import org.jboss.tools.test.util.ProjectImportTestSetup;
/**
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/ELReferencesQueryParticipantTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/ELReferencesQueryParticipantTest.java 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/ELReferencesQueryParticipantTest.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -8,9 +8,9 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.jboss.tools.common.base.test.kb.QueryParticipantTestUtils;
+import org.jboss.tools.common.base.test.kb.QueryParticipantTestUtils.MatchStructure;
import org.jboss.tools.jst.web.kb.refactoring.ELReferencesQueryParticipant;
-import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils;
-import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.MatchStructure;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
Modified: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/JstWebKbAllTests.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -13,8 +13,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.tools.common.base.test.model.XProjectImportTestSetUp;
import org.jboss.tools.common.base.test.validation.ValidationProjectTestSetup;
-import org.jboss.tools.common.model.util.test.XProjectImportTestSetUp;
import org.jboss.tools.jst.web.kb.test.validation.BuilderOrderMarkerResolutionTest;
import org.jboss.tools.jst.web.kb.test.validation.KBValidationTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
Deleted: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/QueryParticipantTestUtils.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/QueryParticipantTestUtils.java 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/src/org/jboss/tools/jst/web/kb/test/QueryParticipantTestUtils.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -1,148 +0,0 @@
-package org.jboss.tools.jst.web.kb.test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.ILocalVariable;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchConstants;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory;
-import org.eclipse.jdt.ui.search.ElementQuerySpecification;
-import org.eclipse.jdt.ui.search.IQueryParticipant;
-import org.eclipse.jdt.ui.search.ISearchRequestor;
-import org.eclipse.jdt.ui.search.QuerySpecification;
-import org.eclipse.search.ui.text.Match;
-import org.jboss.tools.common.EclipseUtil;
-import org.jboss.tools.common.util.FileUtil;
-
-public class QueryParticipantTestUtils extends TestCase {
- public static final int FIELD_SEARCH = 1;
- public static final int METHOD_SEARCH = 2;
- public static final int TYPE_SEARCH = 3;
- public static final int PARAMETER_SEARCH = 4;
-
- public static void testSearchParticipant(IProject project, String fileName, int searchType, String elementName, String parameterName, IQueryParticipant participant, List<MatchStructure> matches) throws CoreException{
- IFile file = project.getFile(fileName);
- assertNotNull("File - " + fileName + " not found", file);
-
- ICompilationUnit compilationUnit = EclipseUtil.getCompilationUnit(file);
-
- assertNotNull("CompilationUnit not found", compilationUnit);
-
- IJavaElement element = null;
-
- IType type = compilationUnit.findPrimaryType();
-
- assertNotNull("Primary type not found", type);
-
- if(searchType == FIELD_SEARCH){
- element = type.getField(elementName);
- } else if(searchType == METHOD_SEARCH){
- element = getMethod(type, elementName);
- } else if(searchType == TYPE_SEARCH){
- element = type;
- } else if(searchType == PARAMETER_SEARCH){
- IMethod method = getMethod(type, elementName);
- element = getParameter(method, parameterName);
- }
-
- assertNotNull("Java Element not found", element);
-
- SearchRequestor requestor = new SearchRequestor();
-
- JavaSearchScopeFactory factory = JavaSearchScopeFactory.getInstance();
- IJavaSearchScope scope = factory.createWorkspaceScope(true);
- String description = factory.getWorkspaceScopeDescription(true);
- QuerySpecification specification = new ElementQuerySpecification(element, IJavaSearchConstants.REFERENCES, scope, description);
-
- participant.search(requestor, specification, new NullProgressMonitor());
-
- List<Match> matchesForCheck = requestor.getMatches();
-
- checkMatches(matchesForCheck, matches);
- }
-
- private static IMethod getMethod(IType type, String name) throws JavaModelException{
- IMethod[] methods = type.getMethods();
- for(IMethod method : methods){
- if(method.getElementName().equals(name))
- return method;
- }
- return null;
- }
-
- private static ILocalVariable getParameter(IMethod method, String name) throws JavaModelException{
- ILocalVariable[] parameters = method.getParameters();
- for(ILocalVariable parameter : parameters) {
- if(parameter.getElementName().equals(name)) {
- return parameter;
- }
- }
- return null;
- }
-
- private static void checkMatches(List<Match> matchesForCheck, List<MatchStructure> matchList) throws CoreException {
- for(Match match : matchesForCheck){
- assertTrue("Match must return IFile", match.getElement() instanceof IFile);
-
- IFile file = (IFile)match.getElement();
- String filePath = file.getFullPath().toString();
- String text = FileUtil.getContentFromEditorOrFile(file);
- String name = text.substring(match.getOffset(), match.getOffset()+match.getLength());
-
- MatchStructure ms = findMatch(matchList, match, filePath, name);
-
- assertNotNull("Unexpected match found (file - " + filePath + " name - " + name + ")", ms);
- ms.checked = true;
- }
-
- for(MatchStructure ms : matchList){
- assertTrue("Match not found (file - "+ms.path+" name - "+ms.name+")", ms.checked);
- }
- }
-
- protected static MatchStructure findMatch(List<MatchStructure> matchList, Match match, String filePath, String name){
- for(MatchStructure ms : matchList){
- if(!ms.checked && ms.path.equals(filePath) && ms.name.equals(name)){
- //System.out.println("Match found (file - "+ms.path+" name - "+ms.name+")");
- return ms;
- }
- }
- return null;
- }
-
- static class SearchRequestor implements ISearchRequestor {
- ArrayList<Match> matches = new ArrayList<Match>();
-
- public void reportMatch(Match match){
- matches.add(match);
- }
-
- public List<Match> getMatches(){
- return matches;
- }
- }
-
- public static class MatchStructure{
- String path;
- String name; // label
- boolean checked;
-
- public MatchStructure(String path, String name){
- this.path = path;
- this.name = name;
- checked = false;
- }
- }
-}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELReferencesQueryParticipantTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELReferencesQueryParticipantTest.java 2012-01-12 01:31:34 UTC (rev 37779)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELReferencesQueryParticipantTest.java 2012-01-12 02:01:29 UTC (rev 37780)
@@ -7,9 +7,9 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.jboss.tools.common.base.test.kb.QueryParticipantTestUtils;
+import org.jboss.tools.common.base.test.kb.QueryParticipantTestUtils.MatchStructure;
import org.jboss.tools.jst.web.kb.refactoring.ELReferencesQueryParticipant;
-import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils;
-import org.jboss.tools.jst.web.kb.test.QueryParticipantTestUtils.MatchStructure;
public class ELReferencesQueryParticipantTest extends TestCase{
IProject project = null;
12 years, 12 months
JBoss Tools SVN: r37779 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-01-11 20:31:34 -0500 (Wed, 11 Jan 2012)
New Revision: 37779
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
Log:
Quick fix for "Injection point other than injected field must not declare a @Named annotation that does not specify the value member [JSR-299 ?\194?\1673.11]" error marker https://issues.jboss.org/browse/JBIDE-7638
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2012-01-11 20:59:14 UTC (rev 37778)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2012-01-12 01:31:34 UTC (rev 37779)
@@ -484,15 +484,8 @@
}
}
}else if(messageId == CDIValidationErrorManager.PARAM_INJECTION_DECLARES_EMPTY_NAME_ID){
- ILocalVariable parameter = findParameter(file, start);
- if(parameter != null){
- IAnnotation namedAnnotation = getAnnotation(parameter, CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
- if(namedAnnotation != null){
- return new IMarkerResolution[] {
- new AddNameMarkerResolution(namedAnnotation, parameter.getElementName())
- };
- }
- }
+ List<IMarkerResolution> resolutions = getAddNameResolutions(file, start);
+ return resolutions.toArray(new IMarkerResolution[]{});
}
}else if (XML_EXTENSION.equals(file.getFileExtension())){
FileEditorInput input = new FileEditorInput(file);
@@ -561,6 +554,47 @@
return new IMarkerResolution[] {};
}
+ private List<IMarkerResolution> getAddNameResolutions(IFile file, int start){
+ List<IMarkerResolution> resolutions = new ArrayList<IMarkerResolution>();
+ ILocalVariable parameter = findParameter(file, start);
+ if(parameter != null){
+ IAnnotation namedAnnotation = getAnnotation(parameter, CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+ if(namedAnnotation != null){
+ CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(file.getProject());
+ if(cdiNature == null)
+ return resolutions;
+
+ ICDIProject cdiProject = cdiNature.getDelegate();
+
+ if(cdiProject == null){
+ return resolutions;
+ }
+
+ Set<IBean> allBeans = CDIUtil.getFilteredBeans(cdiProject, file.getFullPath());
+
+ IInjectionPoint ip = CDIUtil.findInjectionPoint(allBeans, parameter, start);
+ if(ip != null){
+ List<IBean> beans;
+ beans = findLegalBeans(ip);
+ if(beans.size() == 0){
+ beans = findBeans(ip);
+ }
+ if(beans.size() < MARKER_RESULUTION_NUMBER_LIMIT){
+ for(IBean bean : beans){
+ if(bean.getName() != null && !bean.getName().isEmpty()){
+ resolutions.add(new AddNameMarkerResolution(namedAnnotation, bean.getName()));
+ }
+ }
+ }
+ }
+ }
+ if(resolutions.size() == 0){
+ resolutions.add(new AddNameMarkerResolution(namedAnnotation, parameter.getElementName()));
+ }
+ }
+ return resolutions;
+ }
+
private IType getTypeToAddAlternativeToBean(IProject project, String qualifiedName){
IJavaProject javaProject = EclipseUtil.getJavaProject(project);
IType type = null;
12 years, 12 months
JBoss Tools SVN: r37778 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-01-11 15:59:14 -0500 (Wed, 11 Jan 2012)
New Revision: 37778
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10606 Seam Generate Entities wizard problem
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java 2012-01-11 20:10:15 UTC (rev 37777)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java 2012-01-11 20:59:14 UTC (rev 37778)
@@ -45,7 +45,7 @@
testSeamBaseNewWizardInstanceIsInitialized(ISeamUiConstants.NEW_SEAM_ENTITY_WIZARD_ID);
}
- public void testSeamBaseNewWizardInstanceIsInitialized(String wizardId) {
+ private void testSeamBaseNewWizardInstanceIsInitialized(String wizardId) {
IWizard
aWizard = WorkbenchUtils.findWizardByDefId(wizardId);
12 years, 12 months
JBoss Tools SVN: r37777 - trunk/common/tests/org.jboss.tools.common.mylyn.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-01-11 15:10:15 -0500 (Wed, 11 Jan 2012)
New Revision: 37777
Modified:
trunk/common/tests/org.jboss.tools.common.mylyn.test/pom.xml
Log:
fixed coverage properties for plugin
Modified: trunk/common/tests/org.jboss.tools.common.mylyn.test/pom.xml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.mylyn.test/pom.xml 2012-01-11 19:49:37 UTC (rev 37776)
+++ trunk/common/tests/org.jboss.tools.common.mylyn.test/pom.xml 2012-01-11 20:10:15 UTC (rev 37777)
@@ -8,10 +8,9 @@
</parent>
<groupId>org.jboss.tools.common.tests</groupId>
<artifactId>org.jboss.tools.common.mylyn.test</artifactId>
-
<packaging>eclipse-test-plugin</packaging>
<properties>
- <emma.instrument.bundles>org.jboss.tools.common,org.jboss.tools.common.model</emma.instrument.bundles>
+ <emma.instrument.bundles>org.jboss.tools.common.mylyn</emma.instrument.bundles>
</properties>
</project>
12 years, 12 months
JBoss Tools SVN: r37776 - trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2012-01-11 14:49:37 -0500 (Wed, 11 Jan 2012)
New Revision: 37776
Modified:
trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenProjectExample.java
Log:
JBIDE-10616 Allow project examples to use examples in maven artifacts
Modified: trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenProjectExample.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenProjectExample.java 2012-01-11 18:48:02 UTC (rev 37775)
+++ trunk/maven/plugins/org.jboss.tools.maven.project.examples/src/org/jboss/tools/maven/project/examples/ImportMavenProjectExample.java 2012-01-11 19:49:37 UTC (rev 37776)
@@ -174,6 +174,23 @@
return projectNames;
}
}
+ List<String> includedProjects = projectDescription
+ .getIncludedProjects();
+ if (includedProjects != null && includedProjects.size() > 0) {
+ List<MavenProjectInfo> newInfos = new ArrayList<MavenProjectInfo>();
+ for (MavenProjectInfo info : infos) {
+ Model model = info.getModel();
+ if (model != null && model.getArtifactId() != null
+ && model.getArtifactId().trim().length() > 0) {
+ for (String includedProject : includedProjects) {
+ if (model.getArtifactId().equals(includedProject)) {
+ newInfos.add(info);
+ }
+ }
+ }
+ }
+ infos = newInfos;
+ }
MavenPlugin.getProjectConfigurationManager().importProjects(infos,
importConfiguration, monitor);
for (MavenProjectInfo info : infos) {
12 years, 12 months
JBoss Tools SVN: r37775 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2012-01-11 13:48:02 -0500 (Wed, 11 Jan 2012)
New Revision: 37775
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java
Log:
https://issues.jboss.org/browse/JBIDE-10606 Seam Generate Entities wizard problem
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java 2012-01-11 18:28:31 UTC (rev 37774)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/SeamNewWizardTest.java 2012-01-11 18:48:02 UTC (rev 37775)
@@ -79,7 +79,7 @@
SeamGenerateEntitiesWizardPage page = (SeamGenerateEntitiesWizardPage)dialog.getSelectedPage();
page.getProjectEditor().setValue("Test1-ear");
- assertEquals("Seam web parent project was not initialized for Seam EAR project.", "Test1", page.getRootSeamProject());
+ assertEquals("Seam web parent project was not initialized for Seam EAR project.", "Test1", page.getRootSeamProject().getName());
} finally {
dialog.close();
}
12 years, 12 months
JBoss Tools SVN: r37774 - in trunk: cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2012-01-11 13:28:31 -0500 (Wed, 11 Jan 2012)
New Revision: 37774
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/AddNameMarkerResolution.java
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/CDIValidationErrorManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/ChangeAnnotationMarkerResolution.java
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java
Log:
Quick fix for "Injection point other than injected field must not declare a @Named annotation that does not specify the value member [JSR-299 ?\194?\1673.11]" error marker https://issues.jboss.org/browse/JBIDE-7638
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-01-11 17:07:12 UTC (rev 37773)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2012-01-11 18:28:31 UTC (rev 37774)
@@ -1554,7 +1554,7 @@
if (named != null) {
boolean valueExists = named.getMemberValue(null) != null;
if (!valueExists) {
- addError(CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, CDIPreferences.PARAM_INJECTION_DECLARES_EMPTY_NAME, named, initializer.getResource());
+ addError(CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME, CDIPreferences.PARAM_INJECTION_DECLARES_EMPTY_NAME, named, initializer.getResource(), PARAM_INJECTION_DECLARES_EMPTY_NAME_ID);
}
}
@@ -1594,7 +1594,8 @@
addError(CDIValidationMessages.PARAM_INJECTION_DECLARES_EMPTY_NAME,
CDIPreferences.PARAM_INJECTION_DECLARES_EMPTY_NAME,
named,
- injection.getResource());
+ injection.getResource(),
+ PARAM_INJECTION_DECLARES_EMPTY_NAME_ID);
}
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2012-01-11 17:07:12 UTC (rev 37773)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2012-01-11 18:28:31 UTC (rev 37774)
@@ -69,6 +69,7 @@
public static final int UNKNOWN_INTERCEPTOR_CLASS_NAME_ID = 48;
public static final int ILLEGAL_DECORATOR_BEAN_CLASS_ID = 49;
public static final int ILLEGAL_INTERCEPTOR_CLASS_ID = 50;
+ public static final int PARAM_INJECTION_DECLARES_EMPTY_NAME_ID = 51;
/*
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2012-01-11 17:07:12 UTC (rev 37773)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2012-01-11 18:28:31 UTC (rev 37774)
@@ -113,6 +113,7 @@
public static String CREATE_STEREOTYPE_TITLE;
public static String CREATE_INTERCEPTOR_TITLE;
public static String CREATE_DECORATOR_TITLE;
+ public static String ADD_NAME_MARKER_RESOLUTION_TITLE;
public static String CDI_QUICK_FIXES_ANNOTATION;
public static String CDI_QUICK_FIXES_INTERFACE;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2012-01-11 17:07:12 UTC (rev 37773)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2012-01-11 18:28:31 UTC (rev 37774)
@@ -77,26 +77,27 @@
MESSAGE_BEAN_SHOULD_BE_SERIALIZABLE=Bean with selected scope should implement java.io.Serializable.
-MAKE_FIELD_STATIC_MARKER_RESOLUTION_TITLE=Make ''{0}'' field static
-MAKE_METHOD_PUBLIC_MARKER_RESOLUTION_TITLE=Make ''{0}'' method public
-MAKE_METHOD_BUSINESS_MARKER_RESOLUTION_TITLE=Add ''{0}'' method to ''{1}'' interface
-ADD_LOCAL_BEAN_MARKER_RESOLUTION_TITLE=Add @LocalBean annotation to ''{0}'' class
-DELETE_ALL_DISPOSER_DUPLICANT_MARKER_RESOLUTION_TITLE=Delete @Disposes annotations from all methods except ''{0}'' method
-DELETE_ALL_INJECTED_CONSTRUCTORS_MARKER_RESOLUTION_TITLE=Delete @Inject annotations from all constructors except ''{0}'' constructor
-MAKE_INJECTED_POINT_UNAMBIGUOUS_TITLE=Specify ''{0}'' bean for injection to the injection point
+MAKE_FIELD_STATIC_MARKER_RESOLUTION_TITLE=Make field ''{0}'' static
+MAKE_METHOD_PUBLIC_MARKER_RESOLUTION_TITLE=Make method ''{0}'' public
+MAKE_METHOD_BUSINESS_MARKER_RESOLUTION_TITLE=Add method ''{0}'' to interface ''{1}''
+ADD_LOCAL_BEAN_MARKER_RESOLUTION_TITLE=Add @LocalBean annotation to class ''{0}''
+DELETE_ALL_DISPOSER_DUPLICANT_MARKER_RESOLUTION_TITLE=Delete annotations @Disposes from all methods except method ''{0}''
+DELETE_ALL_INJECTED_CONSTRUCTORS_MARKER_RESOLUTION_TITLE=Delete annotations @Inject from all constructors except constructor ''{0}''
+MAKE_INJECTED_POINT_UNAMBIGUOUS_TITLE=Specify bean ''{0}'' for injection to the injection point
SELECT_BEAN_TITLE=Select bean to configure the injection point
-ADD_SERIALIZABLE_INTERFACE_MARKER_RESOLUTION_TITLE=Add java.io.Serializable interface to ''{0}'' class
-MAKE_BEAN_SCOPED_DEPENDENT_MARKER_RESOLUTION_TITLE=Make ''{0}'' bean scoped @Dependent
-MAKE_FIELD_PROTECTED_MARKER_RESOLUTION_TITLE=Make ''{0}'' field protected
-ADD_RETENTION_MARKER_RESOLUTION_TITLE=Add @Retention(RUNTIME) annotation to ''{0}'' class
-ADD_TARGET_MARKER_RESOLUTION_TITLE=Add @Target({0}) annotation to ''{1}'' class
-ADD_ANNOTATION_MARKER_RESOLUTION_TITLE=Add @{0} annotation to ''{1}'' {2}
-DELETE_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete @{0} annotation from ''{1}'' {2}
-CHANGE_ANNOTATION_MARKER_RESOLUTION_TITLE=Change ''{0}'' annotation to {1}
-CREATE_BEAN_CLASS_TITLE=Create ''{0}'' CDI Bean Class
-CREATE_STEREOTYPE_TITLE=Create ''{0}'' CDI Stereotype
-CREATE_INTERCEPTOR_TITLE=Create ''{0}'' CDI Interceptor
-CREATE_DECORATOR_TITLE=Create ''{0}'' CDI Decorator
+ADD_SERIALIZABLE_INTERFACE_MARKER_RESOLUTION_TITLE=Add java.io.Serializable interface to class ''{0}''
+MAKE_BEAN_SCOPED_DEPENDENT_MARKER_RESOLUTION_TITLE=Make bean ''{0}'' scoped @Dependent
+MAKE_FIELD_PROTECTED_MARKER_RESOLUTION_TITLE=Make field ''{0}'' protected
+ADD_RETENTION_MARKER_RESOLUTION_TITLE=Add annotation @Retention(RUNTIME) to class ''{0}''
+ADD_TARGET_MARKER_RESOLUTION_TITLE=Add annotation @Target({0}) to class ''{1}''
+ADD_ANNOTATION_MARKER_RESOLUTION_TITLE=Add annotation @{0} to {2} ''{1}''
+DELETE_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete annotation @{0} from {2} ''{1}''
+CHANGE_ANNOTATION_MARKER_RESOLUTION_TITLE=Change annotation ''{0}'' to {1}
+CREATE_BEAN_CLASS_TITLE=Create CDI Bean Class ''{0}''
+CREATE_STEREOTYPE_TITLE=Create CDI Stereotype ''{0}''
+CREATE_INTERCEPTOR_TITLE=Create CDI Interceptor ''{0}''
+CREATE_DECORATOR_TITLE=Create CDI Decorator ''{0}''
+ADD_NAME_MARKER_RESOLUTION_TITLE=Add name ''{0}'' to annotation @Named
CDI_QUICK_FIXES_ANNOTATION=annotation
CDI_QUICK_FIXES_INTERFACE=interface
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/AddNameMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/AddNameMarkerResolution.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/AddNameMarkerResolution.java 2012-01-11 18:28:31 UTC (rev 37774)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.marker;
+
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.cdi.core.CDIImages;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+
+public class AddNameMarkerResolution extends ChangeAnnotationMarkerResolution {
+ private String parameter;
+
+ public AddNameMarkerResolution(IAnnotation annotation, String parameter) {
+ super(annotation, "\""+parameter+"\"");
+ this.parameter = parameter;
+ }
+
+ @Override
+ public String getLabel() {
+ return NLS.bind(CDIUIMessages.ADD_NAME_MARKER_RESOLUTION_TITLE, parameter);
+ }
+
+ @Override
+ public String getDescription() {
+ return NLS.bind(CDIUIMessages.ADD_NAME_MARKER_RESOLUTION_TITLE, parameter);
+ }
+
+ @Override
+ public Image getImage() {
+ return CDIImages.QUICKFIX_ADD;
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/AddNameMarkerResolution.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2012-01-11 17:07:12 UTC (rev 37773)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2012-01-11 18:28:31 UTC (rev 37774)
@@ -483,6 +483,16 @@
};
}
}
+ }else if(messageId == CDIValidationErrorManager.PARAM_INJECTION_DECLARES_EMPTY_NAME_ID){
+ ILocalVariable parameter = findParameter(file, start);
+ if(parameter != null){
+ IAnnotation namedAnnotation = getAnnotation(parameter, CDIConstants.NAMED_QUALIFIER_TYPE_NAME);
+ if(namedAnnotation != null){
+ return new IMarkerResolution[] {
+ new AddNameMarkerResolution(namedAnnotation, parameter.getElementName())
+ };
+ }
+ }
}
}else if (XML_EXTENSION.equals(file.getFileExtension())){
FileEditorInput input = new FileEditorInput(file);
@@ -798,6 +808,22 @@
}
+ private ILocalVariable findParameter(IFile file, int start){
+ IJavaElement element = findJavaElement(file, start);
+ if(element instanceof IMethod){
+ try {
+ for(ILocalVariable parameter : ((IMethod) element).getParameters()){
+ if(parameter.getSourceRange().getOffset() <= start && parameter.getSourceRange().getOffset()+parameter.getSourceRange().getLength() > start){
+ return parameter;
+ }
+ }
+ } catch (JavaModelException ex) {
+ CDIUIPlugin.getDefault().logError(ex);
+ }
+ }
+ return null;
+ }
+
private List<IType> findLocalAnnotattedInterfaces(IMethod method) throws JavaModelException{
ArrayList<IType> types = new ArrayList<IType>();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/ChangeAnnotationMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/ChangeAnnotationMarkerResolution.java 2012-01-11 17:07:12 UTC (rev 37773)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/ChangeAnnotationMarkerResolution.java 2012-01-11 18:28:31 UTC (rev 37774)
@@ -23,7 +23,6 @@
import org.eclipse.text.edits.ReplaceEdit;
import org.eclipse.text.edits.TextEdit;
import org.eclipse.ui.IMarkerResolution2;
-import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDIImages;
import org.jboss.tools.cdi.internal.core.refactoring.CDIMarkerResolutionUtils;
import org.jboss.tools.cdi.ui.CDIUIMessages;
@@ -33,8 +32,8 @@
IMarkerResolution2 {
private IAnnotation annotation;
- private String sourceString = "";
- private String changeString = CDIMarkerResolutionUtils.AT;
+ protected String sourceString = "";
+ protected String changeString = CDIMarkerResolutionUtils.AT;
private boolean useBraces = true;
private String[] qualifiedNames = new String[0];
@@ -93,7 +92,6 @@
MultiTextEdit edit = new MultiTextEdit();
change.setEdit(edit);
- CDIMarkerResolutionUtils.addImport(CDIConstants.TARGET_ANNOTATION_TYPE_NAME, compilationUnit, edit);
for(String qualifiedName : qualifiedNames){
CDIMarkerResolutionUtils.addImport(qualifiedName, compilationUnit, true, edit);
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java 2012-01-11 17:07:12 UTC (rev 37773)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/refactoring/MarkerResolutionUtils.java 2012-01-11 18:28:31 UTC (rev 37774)
@@ -134,7 +134,7 @@
}
public static boolean addImport(String qualifiedName, ICompilationUnit compilationUnit, boolean staticFlag, MultiTextEdit rootEdit) throws JavaModelException{
- if(primitives.contains(qualifiedName))
+ if(primitives.contains(qualifiedName) || qualifiedName.indexOf(DOT) < 0)
return false;
if(qualifiedName != null){
@@ -143,20 +143,18 @@
IPackageDeclaration[] packages = compilationUnit.getPackageDeclarations();
// local classes do not need to be imported
- if(qualifiedName.indexOf(DOT) >= 0){
- String typePackage = qualifiedName.substring(0,qualifiedName.lastIndexOf(DOT));
-
- for(IPackageDeclaration packageDeclaration : packages){
- if(packageDeclaration.getElementName().equals(typePackage))
- return false;
- }
-
- for(IPackageDeclaration packageDeclaration : packages){
- IType type = compilationUnit.getJavaProject().findType(packageDeclaration.getElementName()+DOT+shortName);
- if(type != null && type.exists())
- return true;
- }
+ String typePackage = qualifiedName.substring(0,qualifiedName.lastIndexOf(DOT));
+
+ for(IPackageDeclaration packageDeclaration : packages){
+ if(packageDeclaration.getElementName().equals(typePackage))
+ return false;
}
+
+ for(IPackageDeclaration packageDeclaration : packages){
+ IType type = compilationUnit.getJavaProject().findType(packageDeclaration.getElementName()+DOT+shortName);
+ if(type != null && type.exists())
+ return true;
+ }
IImportDeclaration[] importDeclarations = compilationUnit.getImports();
12 years, 12 months
JBoss Tools SVN: r37773 - trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2012-01-11 12:07:12 -0500 (Wed, 11 Jan 2012)
New Revision: 37773
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLClassHyperlinkPartitioner.java
Log:
JBIDE-10572
NullPointerException in ClassHyperlink
Issue is fixed.
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLClassHyperlinkPartitioner.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLClassHyperlinkPartitioner.java 2012-01-11 17:01:44 UTC (rev 37772)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/xml/XMLClassHyperlinkPartitioner.java 2012-01-11 17:07:12 UTC (rev 37773)
@@ -98,6 +98,8 @@
// Check that text is a 'class name'
text = document.get(bStart + start, bEnd - bStart);
int positionInText = offset - start - bStart;
+ if (positionInText >= text.length()) return null;
+
int classNameStart = positionInText;
while (classNameStart > 0 && !Character.isWhitespace(text.charAt(classNameStart))) {
classNameStart--;
12 years, 12 months