JBoss Tools SVN: r19084 - trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-12-07 17:21:00 -0500 (Mon, 07 Dec 2009)
New Revision: 19084
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5402 Create new Portlet wizard - portlet source not generated
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java 2009-12-07 21:24:07 UTC (rev 19083)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java 2009-12-07 22:21:00 UTC (rev 19084)
@@ -58,4 +58,12 @@
protected Object getTemplateImplementation() {
return null;
}
+
+ @Override
+ protected String generateTemplateSource(WTPPlugin plugin,
+ CreateJavaEEArtifactTemplateModel templateModel,
+ String templateFile, Object templateImpl, IProgressMonitor monitor)
+ throws JETException {
+ return generateTemplateSource(plugin, templateModel, templateFile, monitor);
+ }
}
16 years, 4 months
JBoss Tools SVN: r19083 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-12-07 16:24:07 -0500 (Mon, 07 Dec 2009)
New Revision: 19083
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
Log:
JBIDE-4877: completion in xhtml should not require namespace to match on tag
CA proposal for the tag names calculation is modified
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-12-07 18:49:25 UTC (rev 19082)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-12-07 21:24:07 UTC (rev 19083)
@@ -102,7 +102,7 @@
return;
}
- addTagNameProposals(contentAssistRequest, childPosition);
+ addTagNameProposals(contentAssistRequest, childPosition, true);
}
private void addTagNameProposalsForPrefix(
@@ -111,8 +111,8 @@
String query,
String prefix,
String uri,
- int defaultRelevance
- ) {
+ int defaultRelevance,
+ boolean insertTagOpenningCharacter) {
if (query == null)
query = ""; //$NON-NLS-1$
String stringQuery = "<" + query; //$NON-NLS-1$
@@ -129,7 +129,7 @@
closingTag = closingTag.substring(1);
}
- if (replacementString.startsWith("<")) { //$NON-NLS-1$
+ if (!insertTagOpenningCharacter && replacementString.startsWith("<")) { //$NON-NLS-1$
// Because the tag starting char is already in the text
replacementString = replacementString.substring(1);
}
@@ -162,6 +162,7 @@
}
}
+
/**
* Calculates and adds the tag name proposals to the Content Assist Request object
*
@@ -171,12 +172,23 @@
@Override
protected void addTagNameProposals(
ContentAssistRequest contentAssistRequest, int childPosition) {
+ addTagNameProposals(contentAssistRequest, childPosition, false);
+ }
+ /**
+ * Calculates and adds the tag name proposals to the Content Assist Request object
+ *
+ * @param contentAssistRequest Content Assist Request object
+ * @param childPosition the
+ */
+ protected void addTagNameProposals(
+ ContentAssistRequest contentAssistRequest, int childPosition, boolean insertTagOpenningCharacter) {
+
String mainPrefix = getTagPrefix();
String mainURI = getTagUri();
String query = contentAssistRequest.getMatchString();
- addTagNameProposalsForPrefix(contentAssistRequest, childPosition, query, mainPrefix, mainURI, TextProposal.R_TAG_INSERTION);
+ addTagNameProposalsForPrefix(contentAssistRequest, childPosition, query, mainPrefix, mainURI, TextProposal.R_TAG_INSERTION, insertTagOpenningCharacter);
if (query == null || query.length() == 0 || query.contains(":")) //$NON-NLS-1$
return;
@@ -200,7 +212,8 @@
String possibleQuery = namespace.getPrefix() + ":" + query; //$NON-NLS-1$
addTagNameProposalsForPrefix(contentAssistRequest, childPosition,
possibleQuery, possiblePrefix, possibleURI,
- TextProposal.R_TAG_INSERTION - 1);
+ TextProposal.R_TAG_INSERTION - 1,
+ insertTagOpenningCharacter);
}
}
}
16 years, 4 months
JBoss Tools SVN: r19082 - in trunk/common: plugins/org.jboss.tools.common.el.ui/META-INF and 17 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-12-07 13:49:25 -0500 (Mon, 07 Dec 2009)
New Revision: 19082
Added:
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.project
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/.jsdtscope
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.jdt.core.prefs
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.common.component
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.jsdt.ui.superType.container
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.jsdt.ui.superType.name
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/Messages.properties
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/User.java
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/META-INF/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/META-INF/MANIFEST.MF
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/classes/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/classes/demo/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/faces-config.xml
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/common-annotations.jar
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-beanutils.jar
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-collections.jar
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-digester.jar
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-logging.jar
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/jsf-tlds.jar
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/jstl.jar
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/standard.jar
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/web.xml
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/index.jsp
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/hello.jsp
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/inputUserName.jsp
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.properties
trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.xml
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELRefactoringTest.java
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELReferencesRenameTest.java
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RefactorSearcher.java
trunk/common/plugins/org.jboss.tools.common.el.ui/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/RenameMethodParticipant.java
trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF
trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5232
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RefactorSearcher.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RefactorSearcher.java 2009-12-07 16:40:49 UTC (rev 19081)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RefactorSearcher.java 2009-12-07 18:49:25 UTC (rev 19082)
@@ -24,6 +24,7 @@
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
import org.eclipse.jdt.ui.text.IJavaPartitions;
@@ -418,6 +419,15 @@
return methodName;
}
+ public static String getPropertyName(IType method, String className){
+ StringBuffer name = new StringBuffer(className);
+ if(name.length()<2 || Character.isLowerCase(name.charAt(1))) {
+ name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
+ }
+ String propertyName = name.toString();
+ return propertyName;
+ }
+
private boolean containsInSearchScope(IProject project){
if(searchScope == null)
return true;
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/META-INF/MANIFEST.MF 2009-12-07 16:40:49 UTC (rev 19081)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/META-INF/MANIFEST.MF 2009-12-07 18:49:25 UTC (rev 19082)
@@ -5,7 +5,8 @@
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.jboss.tools.common.el.ui;singleton:=true
Bundle-Version: 1.0.0
-Export-Package: org.jboss.tools.common.el.ui
+Export-Package: org.jboss.tools.common.el.ui,
+ org.jboss.tools.common.el.ui.refactoring
Bundle-Activator: org.jboss.tools.common.el.ui.ElUiPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/RenameMethodParticipant.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/RenameMethodParticipant.java 2009-12-07 16:40:49 UTC (rev 19081)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/RenameMethodParticipant.java 2009-12-07 18:49:25 UTC (rev 19082)
@@ -20,7 +20,9 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
@@ -38,7 +40,7 @@
import org.jboss.tools.common.model.project.ProjectHome;
public class RenameMethodParticipant extends RenameParticipant{
- private IMethod method;
+ private IJavaElement element;
private String oldName;
private String newName;
private SeamRenameMethodSearcher searcher;
@@ -55,13 +57,15 @@
CheckConditionsContext context) throws OperationCanceledException {
if(searcher == null)
return status;
-
- if(method != null && !added){
- if(searcher.isGetter(method))
- status.addWarning(ElUIMessages.RENAME_METHOD_PARTICIPANT_GETTER_WARNING);
- else if(searcher.isSetter(method))
- status.addWarning(ElUIMessages.RENAME_METHOD_PARTICIPANT_SETTER_WARNING);
- added = true;
+ if(element instanceof IMethod){
+ IMethod method = (IMethod)element;
+ if(method != null && !added){
+ if(searcher.isGetter(method))
+ status.addWarning(ElUIMessages.RENAME_METHOD_PARTICIPANT_GETTER_WARNING);
+ else if(searcher.isSetter(method))
+ status.addWarning(ElUIMessages.RENAME_METHOD_PARTICIPANT_SETTER_WARNING);
+ added = true;
+ }
}
searcher.findELReferences();
@@ -83,21 +87,71 @@
@Override
protected boolean initialize(Object element) {
if(element instanceof IMethod){
+ IMethod method = (IMethod)element;
status = new RefactoringStatus();
rootChange = new CompositeChange(ElUIMessages.RENAME_METHOD_PARTICIPANT_UPDATE_METHOD_REFERENCES);
- method = (IMethod)element;
+ this.element = method;
+
oldName = method.getElementName();
newName = RefactorSearcher.getPropertyName(method, getArguments().getNewName());
searcher = new SeamRenameMethodSearcher((IFile)method.getResource(), oldName);
added = false;
return true;
+ }else if(element instanceof IType){
+ IType type = (IType)element;
+ status = new RefactoringStatus();
+
+ rootChange = new CompositeChange(ElUIMessages.RENAME_METHOD_PARTICIPANT_UPDATE_METHOD_REFERENCES);
+
+ this.element = type;
+
+ oldName = type.getElementName();
+
+ newName = RefactorSearcher.getPropertyName(type, getArguments().getNewName());
+ searcher = new SeamRenameMethodSearcher((IFile)type.getResource(), oldName);
+ added = false;
+ return true;
}
return false;
}
+ // for test only
+ public boolean initialize(Object element, String newName) {
+ if(element instanceof IMethod){
+ IMethod method = (IMethod)element;
+ status = new RefactoringStatus();
+
+ rootChange = new CompositeChange(ElUIMessages.RENAME_METHOD_PARTICIPANT_UPDATE_METHOD_REFERENCES);
+
+ this.element = method;
+
+ oldName = method.getElementName();
+
+ this.newName = newName;
+ searcher = new SeamRenameMethodSearcher((IFile)method.getResource(), oldName);
+ added = false;
+ return true;
+ }else if(element instanceof IType){
+ IType type = (IType)element;
+ status = new RefactoringStatus();
+
+ rootChange = new CompositeChange(ElUIMessages.RENAME_METHOD_PARTICIPANT_UPDATE_METHOD_REFERENCES);
+
+ this.element = type;
+
+ oldName = type.getElementName();
+
+ this.newName = newName;
+ searcher = new SeamRenameMethodSearcher((IFile)type.getResource(), oldName);
+ added = false;
+ return true;
+ }
+ return false;
+ }
+
protected TextFileChange getChange(IFile file){
if(lastChange != null && lastChange.getFile().equals(file))
return lastChange;
@@ -130,7 +184,7 @@
class SeamRenameMethodSearcher extends RefactorSearcher{
ProjectsSet projectSet=null;
public SeamRenameMethodSearcher(IFile file, String name){
- super(file, name, method);
+ super(file, name, element);
ELProjectSetExtension[] extensions = ELProjectSetExtension.getInstances();
if(extensions.length > 0){
projectSet = extensions[0].getProjectSet();
Modified: trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF 2009-12-07 16:40:49 UTC (rev 19081)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/META-INF/MANIFEST.MF 2009-12-07 18:49:25 UTC (rev 19082)
@@ -13,7 +13,12 @@
org.eclipse.jface.text,
org.jboss.tools.common.el.core,
org.jboss.tools.common.test,
- org.jboss.tools.tests
+ org.jboss.tools.tests,
+ org.eclipse.jst.j2ee;bundle-version="1.1.300",
+ org.jboss.tools.common.el.ui;bundle-version="1.0.0",
+ org.eclipse.jdt.core;bundle-version="3.5.0",
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.0",
+ org.jboss.tools.common;bundle-version="2.0.0"
Export-Package: org.jboss.tools.common.el.core.test
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="JavaSource"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.jboss.ide.eclipse.as.core.server.runtime.runtimeTarget/JBoss 4.2 Runtime">
+ <attributes>
+ <attribute name="owner.project.facets" value="jst.web"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.5.0_10">
+ <attributes>
+ <attribute name="owner.project.facets" value="jst.java"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.project (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.project 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>testJSFProject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.common.verification.verifybuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.jst.web.kb.kbbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ <nature>org.jboss.tools.jst.web.kb.kbnature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/.jsdtscope
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/.jsdtscope (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/.jsdtscope 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
+ <attributes>
+ <attribute name="hide" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.jdt.core.prefs 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,7 @@
+#Mon Dec 07 18:26:41 MSK 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.common.component (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.common.component 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="testJSFProject">
+<wb-resource deploy-path="/" source-path="/WebContent"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/JavaSource"/>
+<property name="context-root" value="testJSFProject"/>
+<property name="java-output-path"/>
+</wb-module>
+</project-modules>
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.common.project.facet.core.xml 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <runtime name="JBoss 4.2 Runtime"/>
+ <fixed facet="jst.java"/>
+ <fixed facet="jst.web"/>
+ <installed facet="jst.java" version="5.0"/>
+ <installed facet="jst.web" version="2.5"/>
+</faceted-project>
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.common.project.facet.core.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.jsdt.ui.superType.container
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.jsdt.ui.superType.container (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.jsdt.ui.superType.container 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1 @@
+org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.jsdt.ui.superType.name
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.jsdt.ui.superType.name (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/.settings/org.eclipse.wst.jsdt.ui.superType.name 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1 @@
+Window
\ No newline at end of file
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/Messages.properties
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/Messages.properties (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/Messages.properties 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,3 @@
+header=Hello Demo Application
+prompt_message=Name:
+hello_message=Hello
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/Messages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/User.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/User.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/User.java 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package demo;
+
+/**
+ * Created by JBoss Developer Studio
+ */
+public class User {
+
+ private String name;
+
+ /**
+ * @return User Name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param User Name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/JavaSource/demo/User.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/META-INF/MANIFEST.MF (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/META-INF/MANIFEST.MF 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/faces-config.xml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/faces-config.xml (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/faces-config.xml 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+ <managed-bean>
+ <description>User Name Bean</description>
+ <managed-bean-name>user</managed-bean-name>
+ <managed-bean-class>demo.User</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>name</property-name>
+ <property-class>java.lang.String</property-class>
+ <value/>
+ </managed-property>
+ </managed-bean>
+ <navigation-rule>
+ <from-view-id>/pages/inputUserName.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>hello</from-outcome>
+ <to-view-id>/pages/hello.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <application>
+ <locale-config/>
+ </application>
+ <factory/>
+ <lifecycle/>
+</faces-config>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/common-annotations.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/common-annotations.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-beanutils.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-beanutils.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-collections.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-collections.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-digester.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-digester.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-logging.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/jsf-tlds.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/jsf-tlds.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/jstl.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/jstl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/standard.jar
===================================================================
(Binary files differ)
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/lib/standard.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/web.xml (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/web.xml 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <display-name>testJSFProject</display-name>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
+ </listener>
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/index.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/index.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/index.jsp 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,7 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+ <body>
+ <jsp:forward page="/pages/inputUserName.jsf" />
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/index.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/hello.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/hello.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/hello.jsp 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,20 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+
+<f:loadBundle var="Message" basename="demo.Messages" />
+
+<html>
+ <head>
+ <title>Hello!</title>
+ </head>
+
+ <body>
+ <f:view>
+ <h3>
+ <h:outputText value="#{Message.hello_message}" />,
+ <h:outputText value="#{user.name}" />!
+ </h3>
+ </f:view>
+ </body>
+
+</html>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/hello.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/inputUserName.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/inputUserName.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/inputUserName.jsp 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,28 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+
+<f:loadBundle var="Message" basename="demo.Messages"/>
+
+<html>
+ <head>
+ <title>Input User Name Page</title>
+ </head>
+ <body>
+
+ <f:view>
+ <h1><h:outputText value="#{Message.header}"/></h1>
+
+ <h:messages style="color: red"/>
+
+ <h:form id="greetingForm">
+ <h:outputText value="#{Message.prompt_message}"/>
+ <h:inputText value="#{user.name}" required="true">
+ <f:validateLength maximum="30" minimum="3"/>
+ </h:inputText>
+
+ <h:commandButton action="hello" value="Say Hello!" />
+
+ </h:form>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/WebContent/pages/inputUserName.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.properties
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.properties (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.properties 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,3 @@
+#
+#Mon Dec 07 18:26:39 MSK 2009
+classpath.external=
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.xml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.xml (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.xml 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,74 @@
+<project name="KickStart" default="deploy" basedir="../">
+
+ <!-- Project settings -->
+ <property file="${basedir}/ant/build.properties" />
+
+ <property name="project.name" value="KickStart" />
+ <property name="web.content.dir" value="${basedir}/WebContent" />
+ <property name="web-inf.dir" value="${web.content.dir}/WEB-INF" />
+ <property name="build.dir" value="build" />
+ <property name="war.name" value="${build.dir}/${project.name}.war" />
+
+ <!-- Define a folder for deployment -->
+ <property name="deploy.dir" value="deploy" />
+
+ <!-- Compile classpath -->
+ <path id="compile.classpath">
+ <fileset dir="${webinf.dir}/lib">
+ <include name="**/*.jar" />
+ </fileset>
+ <pathelement path="${classpath}" />
+ <pathelement path="${classpath.external}" />
+ <pathelement path="${webinf.dir}/classes" />
+ </path>
+
+ <!-- Copy any resource or configuration files -->
+ <target name="copyResources">
+ <copy todir="${web-inf.dir}/classes" includeEmptyDirs="no">
+ <fileset dir="JavaSource">
+ <patternset>
+ <include name="**/*.*" />
+ <exclude name="**/*.java" />
+ </patternset>
+ </fileset>
+ </copy>
+ </target>
+
+ <!-- Check timestamp on files -->
+ <target name="prepare">
+ <tstamp />
+ </target>
+
+ <!-- Remove classes directory for clean build -->
+ <target name="clean" description="Prepare for clean build">
+ <delete dir="${web-inf.dir}/classes" failonerror="false"/>
+ <mkdir dir="${web-inf.dir}/classes" />
+ </target>
+
+ <!-- Normal build of application -->
+ <target name="compile" depends="prepare, copyResources">
+ <javac srcdir="JavaSource" destdir="${web-inf.dir}/classes">
+ <classpath refid="compile.classpath" />
+ </javac>
+ </target>
+
+ <!-- Build Project -->
+ <target name="build" depends="prepare, compile" />
+
+ <!-- Rebuild Project -->
+ <target name="rebuild" depends="clean, prepare, compile" />
+
+ <!-- Build WAR -->
+ <target name="war" depends="build">
+ <mkdir dir="${build.dir}" />
+ <war warfile="${war.name}" basedir="${web.content.dir}" webxml="${web-inf.dir}/web.xml">
+ <exclude name="WEB-INF/web.xml" />
+ </war>
+ </target>
+
+ <target name="deploy" depends="war">
+ <delete dir="${deploy.dir}/${project.name}" failonerror="false"/>
+ <copy file="${war.name}" todir="${deploy.dir}" />
+ </target>
+
+</project>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/projects/testJSFProject/ant/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java 2009-12-07 16:40:49 UTC (rev 19081)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/CommonELAllTests.java 2009-12-07 18:49:25 UTC (rev 19082)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.common.el.core.test;
+import org.jboss.tools.common.el.core.test.refactoring.ELReferencesRenameTest;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
import junit.framework.Test;
import junit.framework.TestSuite;
/**
@@ -24,6 +27,10 @@
suite.setName("All tests for " + PLUGIN_ID);
suite.addTestSuite(ELParserTest.class);
suite.addTestSuite(ELModelTest.class);
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(ELReferencesRenameTest.class),
+ "org.jboss.tools.common.el.core.test",
+ new String[]{"projects/testJSFProject",},
+ new String[]{"testJSFProject"}));
return suite;
}
}
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELRefactoringTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELRefactoringTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELRefactoringTest.java 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,131 @@
+package org.jboss.tools.common.el.core.test.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
+import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+import junit.framework.TestCase;
+
+public class ELRefactoringTest extends TestCase {
+ static String jsfProjectName = "testJSFProject";
+ static IProject jsfProject;
+
+ public ELRefactoringTest(String name){
+ super(name);
+ }
+
+ protected void setUp() throws Exception {
+ loadProjects();
+ List<IProject> projectList = new ArrayList<IProject>();
+ projectList.add(jsfProject);
+ J2EEComponentClasspathUpdater.getInstance().forceUpdate(projectList);
+ loadProjects();
+ }
+
+ private void loadProjects() throws Exception {
+ jsfProject = ProjectImportTestSetup.loadProject(jsfProjectName);
+ jsfProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ }
+
+ protected TestChangeStructure findChange(List<TestChangeStructure> changeList, IFile file){
+ for(TestChangeStructure tcs : changeList){
+ if(tcs.getFileName().equals("/"+file.getFullPath().removeFirstSegments(1).toString()))
+ return tcs;
+ }
+ return null;
+ }
+
+ protected IType getJavaType(IProject project, String className){
+ IJavaProject javaProject = EclipseUtil.getJavaProject(project);
+ if(javaProject != null){
+ try{
+ return javaProject.findType(className);
+ }catch(JavaModelException ex){
+ fail(ex.getMessage());
+ }
+ }
+
+ return null;
+ }
+
+ protected IMethod getJavaMethod(IProject project, String className, String methodName){
+ IType type = getJavaType(project, className);
+ if(type != null){
+ return type.getMethod(methodName, new String[0]);
+ }
+ return null;
+ }
+
+ class TestChangeStructure{
+ private IProject project;
+ private String fileName;
+ ArrayList<TestTextChange> textChanges = new ArrayList<TestTextChange>();
+
+
+ public TestChangeStructure(IProject project, String fileName){
+ this.project = project;
+ this.fileName = fileName;
+ }
+
+ public IProject getProject(){
+ return project;
+ }
+
+ public String getFileName(){
+ return fileName;
+ }
+
+ public ArrayList<TestTextChange> getTextChanges(){
+ return textChanges;
+ }
+
+ public void addTextChange(TestTextChange change){
+ textChanges.add(change);
+ }
+
+ public int size(){
+ return textChanges.size();
+ }
+
+ }
+
+ class TestTextChange{
+ private int offset;
+ private int length;
+ private String text;
+
+ public TestTextChange(int offset, int length, String text){
+ this.offset = offset;
+ this.length = length;
+ this.text = text;
+ }
+
+ public int getOffset(){
+ return offset;
+ }
+
+ public int getLength(){
+ return length;
+ }
+
+ public String getText(){
+ return text;
+ }
+ }
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELRefactoringTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELReferencesRenameTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELReferencesRenameTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELReferencesRenameTest.java 2009-12-07 18:49:25 UTC (rev 19082)
@@ -0,0 +1,109 @@
+package org.jboss.tools.common.el.core.test.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.jboss.tools.common.el.ui.refactoring.RenameMethodParticipant;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.test.util.JobUtils;
+
+public class ELReferencesRenameTest extends ELRefactoringTest {
+
+
+ public ELReferencesRenameTest(){
+ super("Rename Method Refactoring Test");
+ }
+
+
+
+ public void testRenameMethod() throws CoreException {
+ ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
+
+
+ TestChangeStructure structure = new TestChangeStructure(jsfProject, "/WebContent/pages/hello.jsp");
+ TestTextChange change = new TestTextChange(353, 4, "name");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ structure = new TestChangeStructure(jsfProject, "/WebContent/pages/inputUserName.jsp");
+ change = new TestTextChange(499, 4, "name");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ IMethod method = getJavaMethod(jsfProject, "demo.User", "getName");
+
+ renameELReferences(method, "alias", list);
+ }
+
+ public void testRenameClass() throws CoreException {
+ ArrayList<TestChangeStructure> list = new ArrayList<TestChangeStructure>();
+
+
+ TestChangeStructure structure = new TestChangeStructure(jsfProject, "/WebContent/pages/hello.jsp");
+ TestTextChange change = new TestTextChange(349, 4, "user");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ structure = new TestChangeStructure(jsfProject, "/WebContent/pages/inputUserName.jsp");
+ change = new TestTextChange(495, 4, "user");
+ structure.addTextChange(change);
+ list.add(structure);
+
+ IType type = getJavaType(jsfProject, "demo.User");
+
+ renameELReferences(type, "person", list);
+ }
+
+ private void renameELReferences(IJavaElement element, String newName, List<TestChangeStructure> changeList) throws CoreException{
+ JobUtils.waitForIdle();
+
+
+ // Rename EL references
+ RenameMethodParticipant participant = new RenameMethodParticipant();
+ participant.initialize(element, newName);
+ participant.checkConditions(new NullProgressMonitor(), null);
+ CompositeChange rootChange = (CompositeChange)participant.createChange(new NullProgressMonitor());
+
+ assertEquals("There is unexpected number of changes",changeList.size(), rootChange.getChildren().length);
+
+ for(int i = 0; i < rootChange.getChildren().length;i++){
+ TextFileChange fileChange = (TextFileChange)rootChange.getChildren()[i];
+
+ MultiTextEdit edit = (MultiTextEdit)fileChange.getEdit();
+
+ TestChangeStructure change = findChange(changeList, fileChange.getFile());
+ if(change != null){
+ assertEquals(change.size(), edit.getChildrenSize());
+ }
+ }
+
+ rootChange.perform(new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ // Test results
+
+ for(TestChangeStructure changeStructure : changeList){
+ IFile file = changeStructure.getProject().getFile(changeStructure.getFileName());
+ String content = null;
+ try {
+ content = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ //System.out.println("File - "+file.getName()+" offset - "+changeStructure.getOffset()+" expected - ["+changeStructure.getText()+"] actual - ["+content.substring(changeStructure.getOffset(), changeStructure.getOffset()+changeStructure.getLength())+"]");
+ for(TestTextChange change : changeStructure.getTextChanges()){
+ assertEquals("There is unexpected change in resource - "+file.getName(), newName, content.substring(change.getOffset(), change.getOffset()+newName.length()));
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.el.core.test/src/org/jboss/tools/common/el/core/test/refactoring/ELReferencesRenameTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 4 months
JBoss Tools SVN: r19081 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors: actions and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-12-07 11:40:49 -0500 (Mon, 07 Dec 2009)
New Revision: 19081
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramContentOutlinePage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/LexicalSortingAction.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5386 - fix
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramContentOutlinePage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramContentOutlinePage.java 2009-12-07 16:23:34 UTC (rev 19080)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramContentOutlinePage.java 2009-12-07 16:40:49 UTC (rev 19081)
@@ -292,6 +292,9 @@
}
public void setContents(Object contents) {
+ if (getViewer().getEditPartFactory() == null) {
+ getViewer().setEditPartFactory(new TreePartFactory());
+ }
getViewer().setContents(contents);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/LexicalSortingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/LexicalSortingAction.java 2009-12-07 16:23:34 UTC (rev 19080)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/actions/LexicalSortingAction.java 2009-12-07 16:40:49 UTC (rev 19081)
@@ -48,10 +48,6 @@
}
}
- public boolean isChecked() {
- return getOrmDiagram().isDeepIntoSort();
- }
-
public void run() {
valueChanged(!getOrmDiagram().isDeepIntoSort());
setChecked(getOrmDiagram().isDeepIntoSort());
16 years, 4 months
JBoss Tools SVN: r19080 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-12-07 11:23:34 -0500 (Mon, 07 Dec 2009)
New Revision: 19080
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5383
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java 2009-12-07 14:43:47 UTC (rev 19079)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java 2009-12-07 16:23:34 UTC (rev 19080)
@@ -12,7 +12,6 @@
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -30,7 +29,9 @@
import org.jboss.tools.cdi.core.IAnnotationDeclaration;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.IBeanManager;
+import org.jboss.tools.cdi.core.IBeanMember;
import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IInjectionPoint;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.ITypeDeclaration;
@@ -38,6 +39,7 @@
import org.jboss.tools.common.el.core.model.ELInvocationExpression;
import org.jboss.tools.common.el.core.parser.ELParserFactory;
import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine;
@@ -54,7 +56,7 @@
*/
@Override
public Image getELProposalImage() {
- // TODO Auto-generated method stub
+ // TODO
return null;
}
@@ -71,9 +73,15 @@
* @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#getMemberInfoByVariable(org.jboss.tools.common.el.core.resolver.IVariable, boolean)
*/
@Override
- protected MemberInfo getMemberInfoByVariable(IBean var, boolean onlyEqualNames) {
- // TODO
- return null;
+ protected MemberInfo getMemberInfoByVariable(IBean bean, boolean onlyEqualNames) {
+ IMember member = null;
+ if(bean instanceof IClassBean) {
+ member = bean.getBeanClass();
+ } else if(bean instanceof IBeanMember) {
+ IBeanMember beanMember = (IBeanMember)bean;
+ member = beanMember.getSourceMember();
+ }
+ return TypeInfoCollector.createMemberInfo(member);
}
/*
@@ -92,10 +100,8 @@
String varName = expr.toString();
if (varName != null) {
- IBeanManager manager = null;
- // TODO
-// Set<IBean> resolvedBeans = manager.getBeans(varName, true);
- Set<IBean> resolvedBeans = new HashSet<IBean>();
+ IBeanManager manager = CDICorePlugin.getCDI(project, false).getDelegate();
+ Set<IBean> resolvedBeans = manager.getBeans(varName, true);
if(onlyEqualNames) {
beans.addAll(resolvedBeans);
} else {
16 years, 4 months
JBoss Tools SVN: r19079 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl/definition and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-07 09:43:47 -0500 (Mon, 07 Dec 2009)
New Revision: 19079
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2009-12-07 13:59:39 UTC (rev 19078)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2009-12-07 14:43:47 UTC (rev 19079)
@@ -246,4 +246,7 @@
//TODO
}
+ public void registerDefinitions(DefinitionContext newDefinitions) {
+ System.out.println("ok");
+ }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2009-12-07 13:59:39 UTC (rev 19078)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/AbstractMemberDefinition.java 2009-12-07 14:43:47 UTC (rev 19079)
@@ -27,11 +27,14 @@
protected void init(IType contextType, DefinitionContext context) throws CoreException {
IAnnotation[] ts = member.getAnnotations();
- for (int i = 0; i < annotations.size(); i++) {
+ for (int i = 0; i < ts.length; i++) {
AnnotationDeclaration a = new AnnotationDeclaration();
a.setDeclaration(ts[i], contextType);
annotations.add(a);
}
}
+ public List<AnnotationDeclaration> getAnnotations() {
+ return annotations;
+ }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2009-12-07 13:59:39 UTC (rev 19078)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2009-12-07 14:43:47 UTC (rev 19079)
@@ -96,5 +96,6 @@
addType(annotationType.getPath(), annotationType, d);
return kind;
}
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2009-12-07 13:59:39 UTC (rev 19078)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/MethodDefinition.java 2009-12-07 14:43:47 UTC (rev 19079)
@@ -1,6 +1,8 @@
package org.jboss.tools.cdi.internal.core.impl.definition;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
public class MethodDefinition extends AbstractMemberDefinition {
IMethod method;
@@ -16,4 +18,9 @@
return method;
}
+ protected void init(IType contextType, DefinitionContext context) throws CoreException {
+ super.init(contextType, context);
+ //TODO process parameters
+
+ }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2009-12-07 13:59:39 UTC (rev 19078)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/TypeDefinition.java 2009-12-07 14:43:47 UTC (rev 19079)
@@ -27,16 +27,29 @@
for (int i = 0; i < fs.length; i++) {
FieldDefinition f = new FieldDefinition();
f.setField(fs[i], context);
- //TODO check if it is annotated
- fields.add(f);
+ int k = getMaxAnnotationKind(f.getAnnotations(), context);
+ if(k >= AnnotationDefinition.CDI) {
+ fields.add(f);
+ }
}
IMethod[] ms = getType().getMethods();
for (int i = 0; i < ms.length; i++) {
MethodDefinition m = new MethodDefinition();
m.setMethod(ms[i], context);
- //TODO check if it is annotated
- methods.add(m);
+ int k = getMaxAnnotationKind(m.getAnnotations(), context);
+ if(k >= AnnotationDefinition.CDI) {
+ methods.add(m);
+ }
}
}
+ private int getMaxAnnotationKind(List<AnnotationDeclaration> as, DefinitionContext context) throws CoreException {
+ int result = -1;
+ for (AnnotationDeclaration a: as) {
+ int k = context.getAnnotationKind(a.getType());
+ if(k > result) result = k;
+ }
+ return result;
+ }
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java 2009-12-07 13:59:39 UTC (rev 19078)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java 2009-12-07 14:43:47 UTC (rev 19079)
@@ -17,6 +17,7 @@
import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.internal.core.impl.CDIProject;
import org.jboss.tools.cdi.internal.core.impl.definition.DefinitionContext;
+import org.jboss.tools.cdi.internal.core.impl.definition.TypeDefinition;
public class CDIBuilderDelegate implements ICDIBuilderDelegate {
@@ -54,8 +55,15 @@
Map<IPath, Set<IType>> cs = fileSet.getClasses();
for (IPath f: cs.keySet()) {
-
+ Set<IType> ts = cs.get(f);
+ for (IType type: ts) {
+ TypeDefinition def = new TypeDefinition();
+ def.setType(type, context);
+ context.addType(f, type, def);
+ }
}
+ projectNature.registerDefinitions(context);
}
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2009-12-07 13:59:39 UTC (rev 19078)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2009-12-07 14:43:47 UTC (rev 19079)
@@ -8,7 +8,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
public class FileSet {
16 years, 4 months
JBoss Tools SVN: r19078 - trunk/common/plugins/org.jboss.tools.common.el.ui.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-12-07 08:59:39 -0500 (Mon, 07 Dec 2009)
New Revision: 19078
Modified:
trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5232
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml 2009-12-07 13:43:12 UTC (rev 19077)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml 2009-12-07 13:59:39 UTC (rev 19078)
@@ -15,20 +15,13 @@
<renameParticipant
class="org.jboss.tools.common.el.ui.refactoring.RenameMethodParticipant"
id="org.jboss.tools.common.el.ui.refactoring.RenameMethodParticipant"
- name="seam-RenameMethodParticipant">
+ name="el-RenameMethodParticipant">
<enablement>
- <with
- variable="element">
+ <with variable="element">
<or>
- <instanceof
- value="org.eclipse.jdt.core.IMethod">
- </instanceof>
+ <instanceof value="org.eclipse.jdt.core.IMethod"/>
+ <instanceof value="org.eclipse.jdt.core.IType"/>
</or>
- <or>
- <instanceof
- value="org.eclipse.jdt.core.IType">
- </instanceof>
- </or>
</with>
</enablement>
</renameParticipant>
16 years, 4 months
JBoss Tools SVN: r19077 - in trunk/esb/docs/esb_ref_guide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-12-07 08:43:12 -0500 (Mon, 07 Dec 2009)
New Revision: 19077
Modified:
trunk/esb/docs/esb_ref_guide/en/images/esb_project/02_create_esb_project.png
trunk/esb/docs/esb_ref_guide/en/images/esb_project/26_esb_export.png
trunk/esb/docs/esb_ref_guide/en/modules/esb_support.xml
Log:
JBDS-971 - New icon is designed for ESB project creation wizard - images and content is updated
Modified: trunk/esb/docs/esb_ref_guide/en/images/esb_project/02_create_esb_project.png
===================================================================
(Binary files differ)
Modified: trunk/esb/docs/esb_ref_guide/en/images/esb_project/26_esb_export.png
===================================================================
(Binary files differ)
Modified: trunk/esb/docs/esb_ref_guide/en/modules/esb_support.xml
===================================================================
--- trunk/esb/docs/esb_ref_guide/en/modules/esb_support.xml 2009-12-07 12:58:44 UTC (rev 19076)
+++ trunk/esb/docs/esb_ref_guide/en/modules/esb_support.xml 2009-12-07 13:43:12 UTC (rev 19077)
@@ -66,8 +66,10 @@
</mediaobject>
</figure>
- <para> Clicking <emphasis>
- <property>Next</property>
+ <para>Next step provides you an opportunity to configure your project for building a java application</para>
+
+ <para> Clicking <emphasis>
+ <property>Next</property> on this form
</emphasis> brings you to the ESB facet installation page where you can
specify Java Source Directory and ESB Content Directory. ESB Content Directory is a folder that contains the most of
artifacts that an ESB archive needs. You also can configure ESB libraries to the project by selecting a ESB runtime using one of the options:
16 years, 4 months
JBoss Tools SVN: r19076 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/impl/definition and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-07 07:58:44 -0500 (Mon, 07 Dec 2009)
New Revision: 19076
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2009-12-07 12:37:53 UTC (rev 19075)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2009-12-07 12:58:44 UTC (rev 19076)
@@ -25,13 +25,20 @@
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.cdi.internal.core.scanner.CDIBuilderDelegate;
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
@@ -128,7 +135,10 @@
}
if(n.getClassPath().update()) {
- n.getClassPath().process();
+ List<String> newJars = n.getClassPath().process();
+ buildJars(newJars);
+
+ n.getClassPath().validateProjectDependencies();
} else if(n.getClassPath().hasToUpdateProjectDependencies()) {
n.getClassPath().validateProjectDependencies();
}
@@ -166,6 +176,7 @@
CDIResourceVisitor rv = getResourceVisitor();
getProject().accept(rv);
FileSet fs = rv.fileSet;
+ builderDelegate.build(fs, getCDICoreNature());
} catch (CoreException e) {
CDICorePlugin.getDefault().logError(e);
@@ -180,6 +191,31 @@
builderDelegate.build(fs, getCDICoreNature());
}
+ protected void buildJars(List<String> newJars) throws CoreException {
+ IJavaProject jp = EclipseResourceUtil.getJavaProject(getCDICoreNature().getProject());
+ if(jp == null) return;
+ FileSet fileSet = new FileSet();
+
+ for (String jar: newJars) {
+ Path path = new Path(jar);
+ IPackageFragmentRoot root = jp.getPackageFragmentRoot(jar);
+ if (root == null || !root.exists())
+ return;
+ IJavaElement[] es = root.getChildren();
+ for (IJavaElement e : es) {
+ if (e instanceof IPackageFragment) {
+ IPackageFragment pf = (IPackageFragment) e;
+ IClassFile[] cs = pf.getClassFiles();
+ for (IClassFile c : cs) {
+ fileSet.add(path, c.getType());
+ }
+ }
+ }
+ //TODO add beans.xml object
+ }
+ builderDelegate.build(fileSet, getCDICoreNature());
+ }
+
protected void clean(IProgressMonitor monitor) throws CoreException {
CDICoreNature n = getCDICoreNature();
if(n != null) n.clean();
@@ -259,20 +295,14 @@
if(f.getName().endsWith(".java")) {
ICompilationUnit unit = EclipseUtil.getCompilationUnit(f);
IType[] ts = unit.getTypes();
- if(ts == null || ts.length == 0) {
- fileSet.getNonModelFiles().add(f);
- } else if(findPublicAnnotation(ts) != null) {
- fileSet.getAnnotations().put(f, unit);
- } else if(findPublicInterface(ts) != null) {
- fileSet.getInterfaces().put(f, unit);
- }
+ fileSet.add(f.getFullPath(), ts);
}
return false;
}
}
if(webinf != null && webinf.isPrefixOf(path)) {
if(f.getName().equals("beans.xml")) {
- fileSet.setBeanXML(f);
+ fileSet.setBeanXML(f.getFullPath(), f); //file
}
}
}
@@ -304,21 +334,5 @@
}
- static IType findPublicAnnotation(IType[] ts) throws JavaModelException {
- for (IType t: ts) {
- if(t.isAnnotation()) {
- return t;
- }
- }
- return null;
- }
- static IType findPublicInterface(IType[] ts) throws JavaModelException {
- for (IType t: ts) {
- if(t.isInterface()) {
- return t;
- }
- }
- return null;
- }
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2009-12-07 12:37:53 UTC (rev 19075)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2009-12-07 12:58:44 UTC (rev 19076)
@@ -22,6 +22,7 @@
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.cdi.internal.core.impl.definition.DefinitionContext;
import org.jboss.tools.cdi.internal.core.scanner.lib.ClassPathMonitor;
import org.jboss.tools.common.util.FileUtil;
@@ -32,7 +33,10 @@
ICDIProject cdiProjectDelegate;
ClassPathMonitor classPath = new ClassPathMonitor(this);
+ DefinitionContext definitions = new DefinitionContext();
+ boolean isBuilt = false;
+
Map<IPath, Object> sourcePaths2 = new HashMap<IPath, Object>(); //TODO
private boolean isStorageResolved = false;
@@ -60,6 +64,10 @@
this.cdiProjectDelegate = cdiProject;
}
+ public DefinitionContext getDefinitions() {
+ return definitions;
+ }
+
public ICDIProject getDelegate() {
return cdiProjectDelegate;
}
@@ -120,6 +128,7 @@
if(file != null && file.isFile()) {
file.delete();
}
+ isBuilt = false;
classPath.clean();
postponeFiring();
IPath[] ps = sourcePaths2.keySet().toArray(new IPath[0]);
@@ -135,10 +144,10 @@
* @throws IOException
*/
public void store() throws IOException {
+ isBuilt = true;
File file = getStorageFile();
- file.getParentFile().mkdirs();
-
- //TODO
+//TODO
+// file.getParentFile().mkdirs();
}
/**
*
@@ -216,6 +225,7 @@
}
public boolean hasNoStorage() {
+ if(isBuilt) return false;
File f = getStorageFile();
return f == null || !f.exists();
}
@@ -232,6 +242,7 @@
public List<Long> statistics;
public void pathRemoved(IPath source) {
+ definitions.clean(source);
//TODO
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2009-12-07 12:37:53 UTC (rev 19075)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/definition/DefinitionContext.java 2009-12-07 12:58:44 UTC (rev 19076)
@@ -22,6 +22,16 @@
public DefinitionContext() {}
+ public DefinitionContext copy() {
+ DefinitionContext copy = new DefinitionContext();
+ copy.project = project;
+ copy.javaProject = javaProject;
+ copy.types.addAll(types);
+ copy.typeDefinitions.putAll(typeDefinitions);
+
+ return copy;
+ }
+
public void setProject(CDICoreNature project) {
this.project = project;
javaProject = EclipseResourceUtil.getJavaProject(project.getProject());
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java 2009-12-07 12:37:53 UTC (rev 19075)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java 2009-12-07 12:58:44 UTC (rev 19076)
@@ -1,10 +1,12 @@
package org.jboss.tools.cdi.internal.core.scanner;
import java.util.Map;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IAnnotation;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IType;
@@ -32,33 +34,26 @@
}
public void build(FileSet fileSet, CDICoreNature projectNature) {
- //TODO get context from projectNature
- DefinitionContext context = new DefinitionContext();
+ DefinitionContext context = projectNature.getDefinitions().copy();
+ Set<IPath> ps = fileSet.getAllPaths();
+ for (IPath p: ps) context.clean(p);
context.setProject(projectNature);
- Map<IFile, ICompilationUnit> as = fileSet.getAnnotations();
- for (IFile f: as.keySet()) {
- ICompilationUnit u = as.get(f);
- IType[] ts = null;
- try {
- ts = u.getTypes();
- if(ts != null) for (int i = 0; i < ts.length; i++) {
- if(ts[i].isAnnotation()) {
- //this builds annotation definition
- context.getAnnotationKind(ts[i]);
- }
- }
- } catch (CoreException e) {
- CDICorePlugin.getDefault().logError(e);
+ Map<IPath, Set<IType>> as = fileSet.getAnnotations();
+ for (IPath f: as.keySet()) {
+ Set<IType> ts = as.get(f);
+ for (IType type: ts) {
+ //this builds annotation definition
+ context.getAnnotationKind(type);
}
}
- Map<IFile, ICompilationUnit> is = fileSet.getInterfaces();
- for (IFile f: is.keySet()) {
-
+ Map<IPath, Set<IType>> is = fileSet.getInterfaces();
+ for (IPath f: is.keySet()) {
+ //TODO
}
- Map<IFile, ICompilationUnit> cs = fileSet.getClasses();
- for (IFile f: cs.keySet()) {
+ Map<IPath, Set<IType>> cs = fileSet.getClasses();
+ for (IPath f: cs.keySet()) {
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2009-12-07 12:37:53 UTC (rev 19075)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/FileSet.java 2009-12-07 12:58:44 UTC (rev 19076)
@@ -5,37 +5,85 @@
import java.util.Map;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.IMember;
+import org.eclipse.jdt.core.IType;
public class FileSet {
- Set<IFile> nonmodel = new HashSet<IFile>();
- Map<IFile, ICompilationUnit> annotations = new HashMap<IFile, ICompilationUnit>();
- Map<IFile, ICompilationUnit> interfaces = new HashMap<IFile, ICompilationUnit>();
- Map<IFile, ICompilationUnit> classes = new HashMap<IFile, ICompilationUnit>();
- IFile beansXML = null;
+ Set<IPath> allpaths = new HashSet<IPath>();
+ Set<IPath> nonmodel = new HashSet<IPath>();
+ Map<IPath, Set<IType>> annotations = new HashMap<IPath, Set<IType>>();
+ Map<IPath, Set<IType>> interfaces = new HashMap<IPath, Set<IType>>();
+ Map<IPath, Set<IType>> classes = new HashMap<IPath, Set<IType>>();
+ Map<IPath, Object> beanXMLs = new HashMap<IPath, Object>();
- public Set<IFile> getNonModelFiles() {
+ public FileSet() {}
+
+ public void add(IPath path, IType[] types) throws CoreException {
+ allpaths.add(path);
+ if(types == null || types.length == 0) {
+ nonmodel.add(path);
+ } else {
+ for (IType type: types) {
+ add(path, type);
+ }
+ }
+ }
+ public void add(IPath path, IType type) throws CoreException {
+ if(type == null) return;
+ allpaths.add(path);
+ if(type.isAnnotation()) {
+ add(annotations, path, type);
+ } else if(type.isInterface()) {
+ add(interfaces, path, type);
+ } else {
+ add(classes, path, type);
+ IType[] ts = type.getTypes();
+ for (IType t: ts) {
+ if(Flags.isStatic(t.getFlags())) {
+ add(path, t);
+ }
+ }
+ }
+ }
+
+ private void add(Map<IPath, Set<IType>> target, IPath path, IType type) {
+ Set<IType> ts = target.get(path);
+ if(ts == null) {
+ ts = new HashSet<IType>();
+ target.put(path, ts);
+ }
+ ts.add(type);
+ }
+
+ public Set<IPath> getAllPaths() {
+ return allpaths;
+ }
+
+ public Set<IPath> getNonModelFiles() {
return nonmodel;
}
-
- public Map<IFile, ICompilationUnit> getAnnotations() {
+
+ public Map<IPath, Set<IType>> getAnnotations() {
return annotations;
}
- public Map<IFile, ICompilationUnit> getInterfaces() {
+ public Map<IPath, Set<IType>> getInterfaces() {
return interfaces;
}
- public Map<IFile, ICompilationUnit> getClasses() {
+ public Map<IPath, Set<IType>> getClasses() {
return classes;
}
- public IFile getBeanXML() {
- return beansXML;
+ public Object getBeanXML(IPath f) {
+ return beanXMLs.get(f);
}
- public void setBeanXML(IFile f) {
- beansXML = f;
+ public void setBeanXML(IPath f, Object o) {
+ beanXMLs.put(f, o);
}
+
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2009-12-07 12:37:53 UTC (rev 19075)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2009-12-07 12:58:44 UTC (rev 19076)
@@ -10,10 +10,20 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.scanner.lib;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Path;
import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.ext.AbstractClassPathMonitor;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.kb.internal.scanner.LibraryScanner;
+import org.jboss.tools.jst.web.kb.internal.scanner.LoadedDeclarations;
+import org.jboss.tools.jst.web.kb.internal.scanner.ScannerException;
public class ClassPathMonitor extends AbstractClassPathMonitor<CDICoreNature>{
@@ -29,8 +39,32 @@
//TODO
}
- public void process() {
- //TODO
+ public List<String> process() {
+ List<String> newJars = new ArrayList<String>();
+ Iterator<String> it = processedPaths.iterator();
+ while(it.hasNext()) {
+ String p = it.next();
+ if(paths.contains(p)) continue;
+ project.pathRemoved(new Path(p));
+ it.remove();
+ }
+ for (int i = 0; i < paths.size(); i++) {
+ String p = paths.get(i);
+ if(processedPaths.contains(p)) continue;
+ processedPaths.add(p);
+
+ String fileName = new File(p).getName();
+ if(EclipseResourceUtil.SYSTEM_JAR_SET.contains(fileName)) continue;
+ String jsname = "lib-" + fileName; //$NON-NLS-1$
+ XModelObject o = model.getByPath("FileSystems").getChildByPath(jsname); //$NON-NLS-1$
+ if(o == null) continue;
+ XModelObject b = o.getChildByPath("META-INF/beans.xml");
+ if(b == null) continue;
+ newJars.add(p);
+ }
+
+ return newJars;
+// validateProjectDependencies();
}
public boolean hasToUpdateProjectDependencies() {
16 years, 4 months
JBoss Tools SVN: r19075 - in trunk/jst/plugins: org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-12-07 07:37:53 -0500 (Mon, 07 Dec 2009)
New Revision: 19075
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
Log:
JBIDE-5381: CA doen't work for elements which defined using default namespace
The fix allows to use CA for the elements defined using default namespace
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2009-12-07 12:28:33 UTC (rev 19074)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JspContentAssistProcessor.java 2009-12-07 12:37:53 UTC (rev 19075)
@@ -73,7 +73,7 @@
*/
@Override
public String getUri(String prefix) {
- if (prefix == null || prefix.length() == 0)
+ if (prefix == null)
return null;
Map<String, List<INameSpace>> nameSpaces = getContext().getNameSpaces(getOffset());
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-12-07 12:28:33 UTC (rev 19074)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/XmlContentAssistProcessor.java 2009-12-07 12:37:53 UTC (rev 19075)
@@ -193,16 +193,31 @@
for (INameSpace namespace : namespaces) {
String possiblePrefix = namespace.getPrefix();
+ if (possiblePrefix == null || possiblePrefix.length() == 0)
+ continue; // Don't query proposals for the default value here
+
String possibleURI = namespace.getURI();
String possibleQuery = namespace.getPrefix() + ":" + query; //$NON-NLS-1$
addTagNameProposalsForPrefix(contentAssistRequest, childPosition,
possibleQuery, possiblePrefix, possibleURI,
- TextProposal.R_TAG_INSERTION - 1); // TODO: Make relevance to be lower here
+ TextProposal.R_TAG_INSERTION - 1);
}
}
}
}
+
+
+ @Override
+ public String getTagPrefix() {
+ String prefix = super.getTagPrefix();
+ if (prefix != null)
+ return prefix;
+
+ String uri = getUri(""); //$NON-NLS-1$
+ return uri == null ? null : ""; //$NON-NLS-1$
+ }
+
/**
* Calculates and adds the attribute value proposals to the Content Assist Request object
*/
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-12-07 12:28:33 UTC (rev 19074)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2009-12-07 12:37:53 UTC (rev 19075)
@@ -101,7 +101,7 @@
@SuppressWarnings("restriction")
public class PageContextFactory implements IResourceChangeListener, IDocumentListener {
private static PageContextFactory fInstance;
-
+ private static final String XHTML_TAG_LIB_URI = "http://www.w3.org/1999/xhtml"; //$NON-NLS-1$
public static final String XML_PAGE_CONTEXT_TYPE = "XML_PAGE_CONTEXT_TYPE"; //$NON-NLS-1$
public static final String JSP_PAGE_CONTEXT_TYPE = "JSP_PAGE_CONTEXT_TYPE"; //$NON-NLS-1$
public static final String FACELETS_PAGE_CONTEXT_TYPE = "FACELETS_PAGE_CONTEXT_TYPE"; //$NON-NLS-1$
@@ -232,16 +232,6 @@
// long ctm = 0;
-// String getContextType1(IFile file) {
-// if (file.getFileExtension().endsWith("jsp"))
-// return JSP_PAGE_CONTEXT_TYPE;
-// else if (file.getFileExtension().endsWith("html"))
-// return FACELETS_PAGE_CONTEXT_TYPE;
-// else if (file.getFileExtension().endsWith("xml"))
-// return XML_PAGE_CONTEXT_TYPE;
-// return null;
-// }
-
/**
* Creates a page context for the specified context type
*
@@ -517,47 +507,56 @@
*/
private void fillXMLNamespacesForNode(Element node, XmlContextImpl context) {
NamedNodeMap attrs = node.getAttributes();
+ boolean mainNnIsRedefined = false;
for (int j = 0; attrs != null && j < attrs.getLength(); j++) {
Attr a = (Attr) attrs.item(j);
String name = a.getName();
- if (name.startsWith("xmlns:")) { //$NON-NLS-1$
- String prefix = name.substring("xmlns:".length()); //$NON-NLS-1$
- String uri = a.getValue();
+
+ if (!name.startsWith("xmlns:") && !name.equals("xmlns")) //$NON-NLS-1$ //$NON-NLS-2$
+ continue;
+
+ String prefix = name.startsWith("xmlns:") ? name.substring("xmlns:".length()) : ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ String uri = a.getValue();
- prefix = prefix == null ? null : prefix.trim();
- uri = uri == null ? null : uri.trim();
-
- if (prefix != null && prefix.length() > 0
- && uri != null && uri.length() > 0) {
+ prefix = prefix == null ? null : prefix.trim();
+ uri = uri == null ? null : uri.trim();
+ if (XHTML_TAG_LIB_URI.equalsIgnoreCase(uri))
+ continue;
+
+ if (prefix != null // prefix may be empty
+ && uri != null && uri.length() > 0) {
- int start = ((IndexedRegion) node).getStartOffset();
- int length = ((IndexedRegion) node).getLength();
+ int start = ((IndexedRegion) node).getStartOffset();
+ int length = ((IndexedRegion) node).getLength();
- IDOMElement domElement = (node instanceof IDOMElement ? (IDOMElement) node
- : null);
- if (domElement != null) {
- start = domElement.getStartOffset();
- length = (domElement.hasEndTag() ? domElement
- .getEndStructuredDocumentRegion()
- .getEnd() : ((IDOMNode) node.getOwnerDocument()).getEndOffset() - 1 - start);
- }
+ IDOMElement domElement = (node instanceof IDOMElement ? (IDOMElement) node
+ : null);
+ if (domElement != null) {
+ start = domElement.getStartOffset();
+ length = (domElement.hasEndTag() ? domElement
+ .getEndStructuredDocumentRegion()
+ .getEnd() : ((IDOMNode) node.getOwnerDocument()).getEndOffset() - 1 - start);
+ }
- Region region = new Region(start, length);
- INameSpace nameSpace = new NameSpace(
- uri, prefix,
- TagLibraryManager.getLibraries(
- context.getResource().getProject(), uri));
+ Region region = new Region(start, length);
+ INameSpace nameSpace = new NameSpace(
+ uri, prefix,
+ TagLibraryManager.getLibraries(
+ context.getResource().getProject(), uri));
+ context.addNameSpace(region, nameSpace);
+ if (prefix.length() == 0)
+ mainNnIsRedefined = true;
+
+ if (context instanceof FaceletPageContextImpl &&
+ CustomTagLibManager.FACELETS_UI_TAG_LIB_URI.equals(uri) &&
+ !mainNnIsRedefined) {
+ nameSpace = new NameSpace(
+ CustomTagLibManager.FACELETS_HTML_TAG_LIB_URI, "", //$NON-NLS-1$
+ TagLibraryManager.getLibraries(
+ context.getResource().getProject(),
+ CustomTagLibManager.FACELETS_HTML_TAG_LIB_URI));
context.addNameSpace(region, nameSpace);
- if (context instanceof FaceletPageContextImpl &&
- CustomTagLibManager.FACELETS_UI_TAG_LIB_URI.equals(uri)) {
- nameSpace = new NameSpace(
- CustomTagLibManager.FACELETS_HTML_TAG_LIB_URI, "", //$NON-NLS-1$
- TagLibraryManager.getLibraries(
- context.getResource().getProject(),
- CustomTagLibManager.FACELETS_HTML_TAG_LIB_URI));
- context.addNameSpace(region, nameSpace);
- }
}
}
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-12-07 12:28:33 UTC (rev 19074)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-12-07 12:37:53 UTC (rev 19075)
@@ -115,7 +115,9 @@
if(nameSpace!=null) {
for (INameSpace n : nameSpace) {
String sPrefix = n.getPrefix();
- if(sPrefix!=null && sPrefix.length()>0) {
+ if(sPrefix!=null
+// && sPrefix.length()>0 // Fix for JBIDE-5381
+ ) {
String fullTagName = null;
boolean mask = false;
if(query.getType()==KbQuery.Type.TAG_NAME || query.getType()==KbQuery.Type.TEXT) {
@@ -141,10 +143,12 @@
}
if(mask && prefixIndex<0) {
if(ignoreCase) {
- if(sPrefix.toLowerCase().startsWith(tagName.toLowerCase())) {
+// if(sPrefix.toLowerCase().startsWith(tagName.toLowerCase())) {
+ if(fullTagName.toLowerCase().startsWith(tagName.toLowerCase())) { // Fix for JBIDE-5381
prefixes.add(sPrefix);
}
- } else if(sPrefix.startsWith(tagName)) {
+// } else if(sPrefix.startsWith(tagName)) {
+ } else if(fullTagName.startsWith(tagName)) { // Fix for JBIDE-5381
prefixes.add(sPrefix);
}
} else if(sPrefix.equals(queryPrefix)) {
@@ -195,7 +199,8 @@
if(fullTagName.length()==0) {
return getExtendedComponents(context);
}
- if(prefix==null) {
+ if(prefix==null
+ || prefix.length() == 0) { // fix for JBIDE-5381
return getComponents(fullTagName, context);
}
}
16 years, 4 months