JBoss Tools SVN: r35652 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-10-14 04:32:06 -0400 (Fri, 14 Oct 2011)
New Revision: 35652
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
Log:
JBIDE-9793 - auto-adding projects / modules to the created server
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-14 08:08:24 UTC (rev 35651)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-14 08:32:06 UTC (rev 35652)
@@ -13,8 +13,11 @@
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IProject;
@@ -22,6 +25,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.egit.core.RepositoryUtil;
import org.eclipse.egit.core.op.CloneOperation;
@@ -31,9 +35,12 @@
import org.eclipse.jgit.transport.JschConfigSessionFactory;
import org.eclipse.jgit.transport.URIish;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IApplication;
@@ -149,7 +156,7 @@
File gitFolder = new File(projectFolder, Constants.DOT_GIT);
connectToGitRepo(importedProjects, gitFolder, monitor);
- createServerAdapterIfRequired();
+ createServerAdapterIfRequired(importedProjects);
return Status.OK_STATUS;
} catch (Exception e) {
IStatus status = new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
@@ -218,8 +225,7 @@
Activator.getDefault();
}
- private void createServerAdapterIfRequired() {
- // TODO
+ private void createServerAdapterIfRequired(List<IProject> importedProjects) {
Boolean b = (Boolean)getProperty(AdapterWizardPageModel.CREATE_SERVER);
if( b != null && b.booleanValue() ) {
IServerType type = (IServerType)getProperty(AdapterWizardPageModel.SERVER_TYPE);
@@ -231,6 +237,21 @@
ExpressServerUtils.fillServerWithOpenshiftDetails(server, getApplication().getApplicationUrl(),
getUser().getRhlogin(), getUser().getPassword(),
getUser().getDomain().getRhcDomain(), getApplication().getName(), mode);
+
+ // Now add the projects
+ Iterator<IProject> i = importedProjects.iterator();
+ ArrayList<IModule> toAdd = new ArrayList<IModule>();
+ while(i.hasNext()) {
+ IProject p = i.next();
+ IModule[] m = ServerUtil.getModules(p);
+ if( m != null && m.length > 0 ) {
+ toAdd.addAll(Arrays.asList(m));
+ }
+ }
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ IModule[] add = toAdd.toArray(new IModule[toAdd.size()]);
+ wc.modifyModules(add, new IModule[0], new NullProgressMonitor());
+ server = wc.save(true, new NullProgressMonitor());
} catch(CoreException ce) {
OpenshiftUIActivator.getDefault().getLog().log(ce.getStatus());
} catch( OpenshiftException ose) {
13 years, 3 months
JBoss Tools SVN: r35651 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-14 04:08:24 -0400 (Fri, 14 Oct 2011)
New Revision: 35651
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java
Log:
[JBIDE-9793] fixed git repo path (which erroneously had the app-name appended to. so the proj was cloned to a dir which had the app-name 2 /basepath/appname/appname
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java 2011-10-14 07:36:05 UTC (rev 35650)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java 2011-10-14 08:08:24 UTC (rev 35651)
@@ -57,12 +57,10 @@
}
private String getDefaultRepositoryPath() {
- return getEGitDefaultRepositoryPath()
- + File.separatorChar
- + StringUtils.null2emptyString(wizardModel.getApplicationName());
+ return getEGitDefaultRepositoryPath();
}
- public String getEGitDefaultRepositoryPath() {
+ private String getEGitDefaultRepositoryPath() {
String destinationDir =
Activator.getDefault().getPreferenceStore().getString(UIPreferences.DEFAULT_REPO_DIR);
return destinationDir;
13 years, 3 months
JBoss Tools SVN: r35650 - in trunk/forge/plugins: org.jboss.tools.forge.runtime and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2011-10-14 03:36:05 -0400 (Fri, 14 Oct 2011)
New Revision: 35650
Modified:
trunk/forge/plugins/org.jboss.tools.forge.core/build.properties
trunk/forge/plugins/org.jboss.tools.forge.runtime/build.properties
trunk/forge/plugins/org.jboss.tools.forge.ui/build.properties
Log:
remove the warnings in build.properties
Modified: trunk/forge/plugins/org.jboss.tools.forge.core/build.properties
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.core/build.properties 2011-10-14 00:56:24 UTC (rev 35649)
+++ trunk/forge/plugins/org.jboss.tools.forge.core/build.properties 2011-10-14 07:36:05 UTC (rev 35650)
@@ -4,4 +4,3 @@
.,\
plugin.xml
src.includes = *
-src.excludes = src
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/build.properties
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime/build.properties 2011-10-14 00:56:24 UTC (rev 35649)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime/build.properties 2011-10-14 07:36:05 UTC (rev 35650)
@@ -2,8 +2,5 @@
.,\
modules/,\
jboss-modules.jar
-output.. = bin/
-source.. = src/
src.includes = *
-src.excludes = src
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/build.properties
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.ui/build.properties 2011-10-14 00:56:24 UTC (rev 35649)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/build.properties 2011-10-14 07:36:05 UTC (rev 35650)
@@ -4,5 +4,4 @@
icons/,\
.
source.. = src/
-src.includes = *
-src.excludes = src
+src.includes = *
\ No newline at end of file
13 years, 3 months
JBoss Tools SVN: r35649 - trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-13 20:56:24 -0400 (Thu, 13 Oct 2011)
New Revision: 35649
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanValidationTest.java
Log:
JBIDE-9911
https://issues.jboss.org/browse/JBIDE-9911
Rebuild of all jars added when available cdi extensions changed.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanValidationTest.java 2011-10-14 00:55:17 UTC (rev 35648)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanValidationTest.java 2011-10-14 00:56:24 UTC (rev 35649)
@@ -21,6 +21,9 @@
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.cdi.seam.solder.core.validation.SeamSolderValidationMessages;
import org.jboss.tools.common.base.test.validation.TestUtil;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
+import org.jboss.tools.common.model.filesystems.impl.Libs;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
@@ -216,5 +219,10 @@
static void kickJava(IProject project) throws CoreException {
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, "org.eclipse.jdt.core.javabuilder", null, new NullProgressMonitor());
+ Libs libs = FileSystemsHelper.getLibs(EclipseResourceUtil.createObjectForResource(project));
+ if(libs != null) {
+ libs.requestForUpdate();
+ libs.update();
+ }
}
}
\ No newline at end of file
13 years, 3 months
JBoss Tools SVN: r35648 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-10-13 20:55:17 -0400 (Thu, 13 Oct 2011)
New Revision: 35648
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
Log:
Updated CDI Query Participants in order to search in related projects and check search scope https://issues.jboss.org/browse/JBIDE-9801
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2011-10-14 00:51:34 UTC (rev 35647)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/search/InjectionPointQueryParticipant.java 2011-10-14 00:55:17 UTC (rev 35648)
@@ -109,26 +109,12 @@
}
}
}
- Set<CDICoreNature> natures = cdiProject.getNature().getCDIProjects(true);
- for(CDICoreNature nature : natures){
- resolveObserverMethods(nature.getDelegate(), injectionPoint, requestor, querySpecification);
- }
- CDICoreNature[] naturesArray = cdiProject.getNature().getAllDependentProjects();
- for(CDICoreNature nature : naturesArray){
- resolveObserverMethods(nature.getDelegate(), injectionPoint, requestor, querySpecification);
- }
+ resolveObserverMethods(cdiProject, injectionPoint, requestor, querySpecification);
}
if(element instanceof IMethod){
IParameter param = findObserverParameter(beans, (IMethod)element);
if(param != null){
- Set<CDICoreNature> natures = cdiProject.getNature().getCDIProjects(true);
- for(CDICoreNature nature : natures){
- findObservedEvents(nature.getDelegate(), param, requestor, querySpecification);
- }
- CDICoreNature[] naturesArray = cdiProject.getNature().getAllDependentProjects();
- for(CDICoreNature nature : naturesArray){
- findObservedEvents(nature.getDelegate(), param, requestor, querySpecification);
- }
+ findObservedEvents(cdiProject, param, requestor, querySpecification);
}
}
}
13 years, 3 months
JBoss Tools SVN: r35647 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/scanner/lib and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-13 20:51:34 -0400 (Thu, 13 Oct 2011)
New Revision: 35647
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
Log:
JBIDE-9911
https://issues.jboss.org/browse/JBIDE-9911
Rebuild of all jars added when available cdi extensions changed.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-10-14 00:48:57 UTC (rev 35646)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-10-14 00:51:34 UTC (rev 35647)
@@ -72,23 +72,29 @@
}
}
- public void setRuntimes(String path, Set<String> newRuntimes) {
+ public boolean setRuntimes(String path, Set<String> newRuntimes) {
Set<String> oldRuntimes = runtimes.get(path);
if(oldRuntimes == null) {
- if(newRuntimes.isEmpty()) return;
+ if(newRuntimes.isEmpty()) {
+ return false;
+ }
oldRuntimes = new HashSet<String>();
}
+ boolean result = false;
for (String runtime: oldRuntimes) {
if(!newRuntimes.contains(runtime)) {
deleteRuntime(runtime);
+ result = true;
}
}
for (String runtime: newRuntimes) {
if(!oldRuntimes.contains(runtime)) {
addRuntime(runtime);
+ result = true;
}
}
if(newRuntimes.isEmpty()) runtimes.remove(path); else runtimes.put(path, newRuntimes);
+ return result;
}
private void addRuntime(String runtime) {
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 2011-10-14 00:48:57 UTC (rev 35646)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2011-10-14 00:51:34 UTC (rev 35647)
@@ -72,6 +72,8 @@
}
project.getExtensionManager().pathRemoved(p);
}
+ boolean newRuntimeDetected = false;
+ Set<String> processed = new HashSet<String>(processedPaths);
for (int i = 0; i < paths.size(); i++) {
String p = paths.get(i);
if(!requestForLoad(p)) continue;
@@ -83,24 +85,40 @@
if(o == null) continue;
//Load cdi extensions. Do we need beans.xml to look for extensions?
- project.getExtensionManager().setRuntimes(p, readRuntimes(o));
+ boolean nrd = project.getExtensionManager().setRuntimes(p, readRuntimes(o));
+ if(nrd) newRuntimeDetected = true;
newJars.getFileSystems().put(p, o);
XModelObject b = o.getChildByPath("META-INF/beans.xml");
- if(b == null) {
- continue;
+ if(b != null) {
+ newJars.getBeanModules().put(p, b);
}
- newJars.getBeanModules().put(p, b);
}
for (FileAnyImpl s: servicesInSrc.keySet()) {
IResource r = (IResource)s.getAdapter(IResource.class);
if(r != null && r.exists()) {
- project.getExtensionManager().setRuntimes(r.getFullPath().toString(), readRuntimesInService(s));
+ boolean nrd = project.getExtensionManager().setRuntimes(r.getFullPath().toString(), readRuntimesInService(s));
+ if(nrd) newRuntimeDetected = true;
}
}
+ if(newRuntimeDetected) {
+ for (String p: processed) {
+ String fileName = new File(p).getName();
+ if(EclipseResourceUtil.SYSTEM_JAR_SET.contains(fileName)) continue;
+ XModelObject o = FileSystemsHelper.getLibs(model).getLibrary(p);
+ if(o != null) {
+ newJars.getFileSystems().put(p, o);
+ XModelObject b = o.getChildByPath("META-INF/beans.xml");
+ if(b != null) {
+ newJars.getBeanModules().put(p, b);
+ }
+ }
+ }
+ }
+
validateProjectDependencies();
return newJars;
}
13 years, 3 months
JBoss Tools SVN: r35646 - trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/WebContent/WEB-INF/lib.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-13 20:48:57 -0400 (Thu, 13 Oct 2011)
New Revision: 35646
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/WebContent/WEB-INF/lib/seam-international.original
Log:
JBIDE-9911
https://issues.jboss.org/browse/JBIDE-9911
Rebuild of all jars added when available cdi extensions changed.
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/WebContent/WEB-INF/lib/seam-international.original
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/projects/SeamCoreTest/WebContent/WEB-INF/lib/seam-international.original
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
13 years, 3 months
JBoss Tools SVN: r35645 - in trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test: src/org/jboss/tools/cdi/seam/core/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-13 20:48:36 -0400 (Thu, 13 Oct 2011)
New Revision: 35645
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java
Log:
JBIDE-9911
https://issues.jboss.org/browse/JBIDE-9911
Rebuild of all jars added when available cdi extensions changed.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/META-INF/MANIFEST.MF 2011-10-14 00:43:07 UTC (rev 35644)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/META-INF/MANIFEST.MF 2011-10-14 00:48:36 UTC (rev 35645)
@@ -23,6 +23,7 @@
org.jboss.tools.common.text.ext,
org.jboss.tools.jst.text.ext,
org.jboss.tools.jst.text.ext.test,
+ org.jboss.tools.cdi.seam.solder.core.test,
org.eclipse.wst.validation;bundle-version="1.2.300"
Export-Package: org.jboss.tools.cdi.seam.core.test
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java 2011-10-14 00:43:07 UTC (rev 35644)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java 2011-10-14 00:48:36 UTC (rev 35645)
@@ -43,10 +43,10 @@
TestSuite suite = new TestSuite("Seam Core Project Tests");
suite.addTestSuite(SeamServletValidationTest.class);
suite.addTestSuite(SeamResourceBundlesTest.class);
- suite.addTestSuite(BundleModelTest.class);
suite.addTestSuite(SeamJmsValidationTest.class);
suite.addTestSuite(SeamResourceBundleCdiElResolverTest.class);
suite.addTestSuite(SeamRestValidationTest.class);
+ suite.addTestSuite(BundleModelTest.class); // should be the last in this suite because it removes/adds seam-international.jar
suiteAll.addTest(new SeamCoreTestSetup(suite));
suite = new TestSuite("Seam Persistence Project Tests");
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java 2011-10-14 00:43:07 UTC (rev 35644)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java 2011-10-14 00:48:36 UTC (rev 35645)
@@ -8,6 +8,7 @@
import org.jboss.tools.cdi.seam.core.international.ILocalizedValue;
import org.jboss.tools.cdi.seam.core.international.IProperty;
import org.jboss.tools.cdi.seam.core.test.SeamCoreTest;
+import org.jboss.tools.cdi.seam.solder.core.test.GenericBeanValidationTest;
public class BundleModelTest extends SeamCoreTest {
@@ -32,4 +33,20 @@
assertNotNull(value);
assertEquals("About this example application", value.getValue());
}
+
+ public void testIncrementalBuildAtAddRemoveExtension() throws Exception {
+ String path = "WebContent/WEB-INF/lib/seam-international.jar";
+ String original = "WebContent/WEB-INF/lib/seam-international.original";
+
+ GenericBeanValidationTest.removeFile(getTestProject(), path);
+
+ IBundleModel bundleModel = BundleModelFactory.getBundleModel(getTestProject());
+ assertNull(bundleModel);
+
+ GenericBeanValidationTest.writeFile(getTestProject(), original, path);
+ bundleModel = BundleModelFactory.getBundleModel(getTestProject());
+ assertNotNull(bundleModel);
+ Set<String> bundles = bundleModel.getAllAvailableBundles();
+ assertTrue(bundles.contains("com.sun.corba.se.impl.logging.LogStrings"));
+ }
}
\ No newline at end of file
13 years, 3 months
JBoss Tools SVN: r35644 - trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-13 20:43:07 -0400 (Thu, 13 Oct 2011)
New Revision: 35644
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanValidationTest.java
Log:
JBIDE-9911
https://issues.jboss.org/browse/JBIDE-9911
Rebuild of all jars added when available cdi extensions changed.
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanValidationTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanValidationTest.java 2011-10-14 00:16:04 UTC (rev 35643)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.solder.core.test/src/org/jboss/tools/cdi/seam/solder/core/test/GenericBeanValidationTest.java 2011-10-14 00:43:07 UTC (rev 35644)
@@ -12,9 +12,12 @@
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.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.internal.core.builder.JavaBuilder;
+import org.eclipse.wst.validation.ValidationFramework;
import org.jboss.tools.cdi.internal.core.validation.CDIValidationMessages;
import org.jboss.tools.cdi.seam.solder.core.validation.SeamSolderValidationMessages;
import org.jboss.tools.common.base.test.validation.TestUtil;
@@ -181,6 +184,9 @@
} else {
target.setContents(source.getContents(), true, false, new NullProgressMonitor());
}
+ if(targetPath.endsWith(".jar")) {
+ kickJava(project);
+ }
TestUtil.validate(target);
} finally {
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
@@ -198,10 +204,17 @@
IFile target = project.getFile(new Path(targetPath));
assertTrue(target.exists());
target.delete(true, new NullProgressMonitor());
+ if(targetPath.endsWith(".jar")) {
+ kickJava(project);
+ }
TestUtil.validate(target);
} finally {
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
JobUtils.waitForIdle();
}
}
+
+ static void kickJava(IProject project) throws CoreException {
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, "org.eclipse.jdt.core.javabuilder", null, new NullProgressMonitor());
+ }
}
\ No newline at end of file
13 years, 3 months
JBoss Tools SVN: r35643 - in trunk: cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-10-13 20:16:04 -0400 (Thu, 13 Oct 2011)
New Revision: 35643
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/images/message_bundle.gif
Removed:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/images/
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java
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.seam.core/build.properties
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/CDISeamCorePlugin.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/el/JSF2ElResolver.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
Log:
https://issues.jboss.org/browse/JBIDE-9717 added new icons for CDI message bundles
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/images/message_bundle.gif
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/images/message_bundle.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDIImages.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -8,7 +8,6 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-
package org.jboss.tools.cdi.core;
import java.net.MalformedURLException;
@@ -42,6 +41,8 @@
public static final Image ANNOTATION_IMAGE = CDIXMLImages.ANNOTATION_IMAGE;
public static final Image CDI_EVENT_IMAGE = getImage("event.png"); //$NON-NLS-1$
+ public static final Image MESSAGE_BUNDLE_IMAGE = getImage("message_bundle.gif"); //$NON-NLS-1$
+
public static final Image QUICKFIX_ADD = getImage("quickfixes/cdi_add.png"); //$NON-NLS-1$
public static final Image QUICKFIX_REMOVE = getImage("quickfixes/cdi_remove.png"); //$NON-NLS-1$
public static final Image QUICKFIX_EDIT = getImage("quickfixes/cdi_edit.png"); //$NON-NLS-1$
@@ -69,7 +70,6 @@
private CDIImages parentRegistry;
protected CDIImages(URL registryUrl, CDIImages parent){
-
if(registryUrl == null) throw new IllegalArgumentException(CDICoreMessages.CDI_IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL);
baseUrl = registryUrl;
parentRegistry = parent;
@@ -92,7 +92,6 @@
} else {
return parentRegistry.createImageDescriptor(key);
}
-
}
}
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 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/el/CdiElResolver.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -37,6 +37,7 @@
import org.jboss.tools.common.el.core.resolver.IRelevanceCheck;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
+import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberPresentation;
import org.jboss.tools.common.text.TextProposal;
/**
@@ -46,15 +47,29 @@
private static ELParserFactory factory = ELParserUtil.getJbossFactory();
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#getELProposalImage()
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
@Override
- public Image getELProposalImage() {
- return CDIImages.BEAN_METHOD_IMAGE;
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
+ return (memberInfo instanceof TypeInfoCollector.FieldInfo)?CDIImages.BEAN_FIELD_IMAGE:CDIImages.BEAN_METHOD_IMAGE;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImage(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberPresentation)
+ */
@Override
+ protected Image getELProposalImage(MemberPresentation memberPresentation) {
+ return memberPresentation.isProperty()?CDIImages.BEAN_FIELD_IMAGE:CDIImages.BEAN_METHOD_IMAGE;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#setImage(org.jboss.tools.common.text.TextProposal, org.jboss.tools.common.el.core.resolver.IVariable)
+ */
+ @Override
protected void setImage(TextProposal kbProposal, IBean var) {
kbProposal.setImage(CDIImages.getImageByElement(var));
}
@@ -154,11 +169,20 @@
return factory;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#isStaticMethodsCollectingEnabled()
+ */
@Override
protected boolean isStaticMethodsCollectingEnabled() {
return true;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#createRelevanceCheck(org.eclipse.jdt.core.IJavaElement)
+ */
+ @Override
public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
return new BeanRelevanceCheck(element);
}
@@ -182,6 +206,11 @@
}
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.DefaultJavaRelevanceCheck#isRelevant(java.lang.String)
+ */
+ @Override
public boolean isRelevant(String content) {
if(super.isRelevant(content)) {
return true;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/build.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/build.properties 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/build.properties 2011-10-14 00:16:04 UTC (rev 35643)
@@ -2,11 +2,9 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- images/,\
plugin.xml
src.includes = .settings/,\
META-INF/,\
build.properties,\
plugin.xml,\
- images/,\
src/
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/CDISeamCorePlugin.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/CDISeamCorePlugin.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/CDISeamCorePlugin.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -23,8 +23,6 @@
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.cdi.seam.core"; //$NON-NLS-1$
- public static final String CA_CDI_MESSAGE_IMAGE_PATH = "images/ca/icons_CDI_Message.gif";
-
// Seam 3 International Module Runtime Extension ID
public static final String CDI_INTERNATIONAL_RUNTIME_EXTENTION = "org.jboss.seam.international.status.TypedStatusMessageBundleExtension";
@@ -41,6 +39,7 @@
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -50,6 +49,7 @@
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/el/CDIInternationalMessagesELResolver.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -26,6 +26,7 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.CDIImages;
import org.jboss.tools.cdi.seam.core.CDISeamCorePlugin;
import org.jboss.tools.cdi.seam.core.international.BundleModelFactory;
import org.jboss.tools.cdi.seam.core.international.IBundle;
@@ -66,15 +67,14 @@
*
*/
public class CDIInternationalMessagesELResolver extends AbstractELCompletionEngine<IVariable> {
- private static final Image CDI_INTERNATIONAL_MESSAGE_PROPOSAL_IMAGE =
- CDISeamCorePlugin.getDefault().getImage(CDISeamCorePlugin.CA_CDI_MESSAGE_IMAGE_PATH);
/*
* (non-Javadoc)
- * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImage()
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
- return CDI_INTERNATIONAL_MESSAGE_PROPOSAL_IMAGE;
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
+ return CDIImages.MESSAGE_BUNDLE_IMAGE;
}
private static ELParserFactory factory = ELParserUtil.getDefaultFactory();
@@ -85,6 +85,7 @@
* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELResolver#getParserFactory()
*/
+ @Override
public ELParserFactory getParserFactory() {
return factory;
}
@@ -93,6 +94,7 @@
* (non-Javadoc)
* @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#log(java.lang.Exception)
*/
+ @Override
protected void log(Exception e) {
CDISeamCorePlugin.getDefault().logError(e);
}
@@ -101,22 +103,23 @@
* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELResolver2#getProposals(org.jboss.tools.common.el.core.resolver.ELContext, java.lang.String)
*/
+ @Override
public List<TextProposal> getProposals(ELContext context, String el, int offset) {
return getCompletions(el, false, 0, context);
}
public List<TextProposal> getCompletions(String elString,
boolean returnEqualedVariablesOnly, int position, ELContext context) {
-
+
IProject project = context == null ? null :
context.getResource() == null ? null :
context.getResource().getProject();
if (project == null)
return null;
-
+
if (!CDICorePlugin.getCDI(project, true).getExtensionManager().isCDIExtensionAvailable(CDISeamCorePlugin.CDI_INTERNATIONAL_RUNTIME_EXTENTION))
return null;
-
+
IBundleModel bundleModel = BundleModelFactory.getBundleModel(project);
IResourceBundle[] bundles = bundleModel == null ? null : findResourceBundles(bundleModel);
if (bundles == null)
@@ -137,6 +140,7 @@
* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELResolver2#resolve(org.jboss.tools.common.el.core.resolver.ELContext, org.jboss.tools.common.el.core.model.ELExpression)
*/
+ @Override
public ELResolution resolve(ELContext context, ELExpression operand, int offset) {
ELResolutionImpl resolution = resolveELOperand(operand, context, true);
if(resolution != null)
@@ -152,7 +156,7 @@
context.getResource().getProject();
if (project == null)
return null;
-
+
if (!CDICorePlugin.getCDI(project, true).getExtensionManager().isCDIExtensionAvailable(CDISeamCorePlugin.CDI_INTERNATIONAL_RUNTIME_EXTENTION))
return null;
@@ -183,6 +187,11 @@
return completions;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#parseOperand(java.lang.String)
+ */
+ @Override
public ELExpression parseOperand(String operand) {
if(operand == null) return null;
String el = (operand.indexOf("#{") < 0 && operand.indexOf("${") < 0) ? "#{" + operand + "}" : operand; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
@@ -243,7 +252,7 @@
ELSegmentImpl segment = new MessagePropertyELSegmentImpl(combineLexicalTokensForExpression(left));
processMessageBundleSegment(expr, (MessagePropertyELSegmentImpl)segment, resolvedVariables);
-
+
segment.setResolved(true);
for (Variable variable : resolvedVars) {
segment.getVariables().add(variable);
@@ -278,16 +287,16 @@
if (left != null) {
ELSegmentImpl segment = new MessagePropertyELSegmentImpl(left.getFirstToken());
processMessageBundleSegment(expr, (MessagePropertyELSegmentImpl)segment, resolvedVariables);
-
+
segment.setResolved(false);
resolution.addSegment(segment);
-
+
for (Variable var : resolvedVariables) {
String varName = var.getName();
if(varName.startsWith(operand.getText())) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
}
@@ -309,13 +318,13 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
} else if(returnEqualedVariablesOnly) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName);
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
resolution.getLastSegment().getVariables().add(var);
@@ -364,10 +373,6 @@
return result;
}
- protected void setImage(TextProposal kbProposal) {
- kbProposal.setImage(getELProposalImage());
- }
-
protected void resolveLastSegment(ELInvocationExpression expr,
List<Variable> members,
ELResolutionImpl resolution,
@@ -409,7 +414,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -420,8 +425,8 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.substring(filter.length()));
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
-
+ kbProposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(kbProposal);
}
}
@@ -461,7 +466,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -478,7 +483,7 @@
kbProposal.setReplacementString(replacementString);
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -489,7 +494,7 @@
resolution.setLastResolvedToken(expr);
}
}
-
+
private void processMessageBundleSegment(ELInvocationExpression expr, MessagePropertyELSegmentImpl segment, List<Variable> variables) {
if(segment.getToken() == null)
return;
@@ -509,7 +514,6 @@
for (XModelObject o: os.values()) {
segment.addObject(o);
}
-
}
}
}
@@ -529,7 +533,7 @@
}
return ok;
}
-
+
private void processMessagePropertySegment(ELInvocationExpression expr, MessagePropertyELSegmentImpl segment, List<Variable> variables){
if(segment.getToken() == null)
return;
@@ -540,9 +544,9 @@
IBundle bundle = bundleModel.getBundle(variable.basename);
if(bundle == null)
return;
-
+
String propertyName = segment.getToken().getText();
-
+
IProperty prop = bundle.getProperty(trimQuotes(propertyName));
if(prop == null) continue;
Map<String, LocalizedValue> values = ((PropertyImpl)prop).getValues();
@@ -563,7 +567,7 @@
}
}
}
-
+
public boolean findPropertyLocation(XModelObject property, String content, MessagePropertyELSegmentImpl segment) {
String name = property.getAttributeValue("name"); //$NON-NLS-1$
String nvs = property.getAttributeValue("name-value-separator"); //$NON-NLS-1$
@@ -572,7 +576,7 @@
segment.setMessagePropertySourceReference(i, name.length());
return true;
}
-
+
protected void processSingularMember(Variable mbr, Set<TextProposal> kbProposals) {
// Surround the "long" keys containing the dots with [' ']
TreeSet<String> keys = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
@@ -586,15 +590,15 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString("['" + key + "']"); //$NON-NLS-1$ //$NON-NLS-2$
proposal.setLabel("['" + key + "']");
- setImage(proposal);
-
+ proposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(proposal);
} else {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(key);
proposal.setLabel(key);
- setImage(proposal);
-
+ proposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(proposal);
}
}
@@ -618,6 +622,11 @@
this.f = f;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.resolver.IVariable#getName()
+ */
+ @Override
public String getName() {
return name;
}
@@ -659,11 +668,20 @@
return null;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#isStaticMethodsCollectingEnabled()
+ */
@Override
protected boolean isStaticMethodsCollectingEnabled() {
return false;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#createRelevanceCheck(org.eclipse.jdt.core.IJavaElement)
+ */
+ @Override
public IRelevanceCheck createRelevanceCheck(IJavaElement element) {
return IRRELEVANT;
}
@@ -677,5 +695,4 @@
}
return result.values().toArray(new IResourceBundle[0]);
}
-
-}
+}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ca/AbstractELCompletionEngine.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -53,9 +53,9 @@
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegmentImpl;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
-import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberPresentation;
+import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.el.internal.core.parser.token.JavaNameTokenDescription;
import org.jboss.tools.common.text.TextProposal;
@@ -69,12 +69,16 @@
public AbstractELCompletionEngine() {}
- public abstract Image getELProposalImage();
+ protected abstract Image getELProposalImageForMember(MemberInfo memberInfo);
protected abstract void log(Exception e);
private static ELParserFactory defaultFactory = ELParserUtil.getJbossFactory();
+ protected Image getELProposalImage(MemberPresentation memberPresentation) {
+ return getELProposalImageForMember(memberPresentation!=null?memberPresentation.getMember():null);
+ }
+
/* (non-Javadoc)
* @see org.jboss.tools.common.el.core.resolver.ELResolver#getProposals(org.jboss.tools.common.el.core.resolver.ELContext, int)
*/
@@ -354,7 +358,7 @@
proposal.setLabel(v.getName());
proposal.setReplacementString(varNameProposal);
proposal.setLabel(v.getName());
- proposal.setImage(getELProposalImage());
+ proposal.setImage(getELProposalImageForMember(memberInfo));
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
if (jmSegment != null) {
@@ -770,7 +774,7 @@
ELTextProposal proposal = new ELTextProposal();
proposal.setReplacementString(presentationString);
proposal.setLabel(presentationDisplayName);
- proposal.setImage(getELProposalImage());
+ proposal.setImage(getELProposalImage(presentation));
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
for (MemberInfo mi : presentation.getAllMembers()) {
@@ -816,7 +820,7 @@
ELTextProposal proposal = new ELTextProposal();
proposal.setReplacementString(presentationString);
proposal.setLabel(presentationDisplayName);
- proposal.setImage(getELProposalImage());
+ proposal.setImage(getELProposalImage(presentation));
proposal.setType(typeName);
proposal.setSourceType(sourceTypeName);
for (MemberInfo mi : presentation.getAllMembers()) {
@@ -904,7 +908,7 @@
ELTextProposal kbProposal = new ELTextProposal();
kbProposal.setReplacementString(proposal.getPresentation().substring(filter.length()));
kbProposal.setLabel(proposal.getPresentationDisplayName());
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(proposal.getMember()));
kbProposal.setType(typeName);
kbProposal.setSourceType(sourceTypeName);
for (MemberInfo mi : proposal.getAllMembers()) {
@@ -1015,7 +1019,7 @@
kbProposal.setReplacementString(replacementString);
kbProposal.setLabel(proposal.getPresentationDisplayName());
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(member));
kbProposal.setType(typeName);
kbProposal.setSourceType(sourceTypeName);
for (MemberInfo mi : proposal.getAllMembers()) {
@@ -1045,11 +1049,11 @@
}
protected void setImage(TextProposal kbProposal, TypeInfoCollector.MemberPresentation proposal) {
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImage(proposal));
}
protected void setImage(TextProposal kbProposal, V var) {
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
}
/**
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -1057,6 +1057,7 @@
* @author Alexey Kazakov
*/
public static class MemberPresentation {
+ private boolean property;
private String presentation;
private String displayName;
private MemberInfo member;
@@ -1121,6 +1122,14 @@
public Set<MemberInfo> getAllMembers() {
return allMembers;
}
+
+ public boolean isProperty() {
+ return property;
+ }
+
+ public void setProperty(boolean property) {
+ this.property = property;
+ }
}
private static class MemberPresentationComparator implements Comparator<MemberPresentation> {
@@ -1296,6 +1305,7 @@
MemberPresentation existingPresentation = presentations.get(pr.getPresentation());
existingPresentation.addMember(m);
}
+ pr.setProperty(true);
if(unpairedGettersOrSetters!=null) {
MethodInfo previousGetter = getters.get(propertyName);
MethodInfo previousSetter = setters.get(propertyName);
@@ -1319,7 +1329,7 @@
}
return properties;
}
-
+
public static void cleanCache() {
caches = new Caches();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/el/JSF2ElResolver.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/el/JSF2ElResolver.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/jsf2/bean/el/JSF2ElResolver.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -38,12 +38,12 @@
public static final Image JSF_EL_PROPOSAL_IMAGE =
JSFModelPlugin.getDefault().getImage(JSFModelPlugin.CA_JSF_EL_IMAGE_PATH);
-
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#getELProposalImage()
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
@Override
- public Image getELProposalImage() {
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return JSF_EL_PROPOSAL_IMAGE;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -68,9 +68,10 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImage()
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return JSF2_EL_CC_ATTRS_PROPOSAL_IMAGE;
}
@@ -225,7 +226,7 @@
if(varName.startsWith(operand.getText())) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
}
@@ -249,13 +250,13 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
} else if(returnEqualedVariablesOnly) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName);
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
segment.getVariables().add(var);
@@ -413,10 +414,6 @@
return result;
}
- protected void setImage(TextProposal kbProposal) {
- kbProposal.setImage(getELProposalImage());
- }
-
protected void resolveLastSegment(ELInvocationExpression expr,
List<IVariable> members,
ELResolutionImpl resolution,
@@ -456,7 +453,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -467,7 +464,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.substring(filter.length()));
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -508,7 +505,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -525,7 +522,7 @@
kbProposal.setReplacementString(replacementString);
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -550,15 +547,15 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString("['" + key + "']"); //$NON-NLS-1$ //$NON-NLS-2$
proposal.setLabel("['" + key + "']");
- setImage(proposal);
-
+ proposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(proposal);
} else {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(key);
proposal.setLabel(key);
- setImage(proposal);
-
+ proposal.setImage(getELProposalImageForMember(null));
+
kbProposals.add(proposal);
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFELCompletionEngine.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -26,6 +26,7 @@
import org.jboss.tools.common.el.core.parser.ELParserUtil;
import org.jboss.tools.common.el.core.resolver.IVariable;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
+import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.jsf.JSFModelPlugin;
@@ -43,9 +44,10 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#getELProposalImage()
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return JSF_EL_PROPOSAL_IMAGE;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSFMessageELCompletionEngine.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -66,9 +66,10 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImage()
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return JSF_EL_MESSAGES_PROPOSAL_IMAGE;
}
@@ -259,7 +260,7 @@
if(varName.startsWith(operand.getText())) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
}
@@ -281,13 +282,13 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName.substring(operand.getLength()));
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
} else if(returnEqualedVariablesOnly) {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(varName);
proposal.setLabel(varName);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
proposals.add(proposal);
}
resolution.getLastSegment().getVariables().add(var);
@@ -355,10 +356,6 @@
return result;
}
- protected void setImage(TextProposal kbProposal) {
- kbProposal.setImage(getELProposalImage());
- }
-
protected void resolveLastSegment(ELInvocationExpression expr,
List<Variable> members,
ELResolutionImpl resolution,
@@ -400,7 +397,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -411,7 +408,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal.substring(filter.length()));
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -452,7 +449,7 @@
TextProposal kbProposal = new TextProposal();
kbProposal.setReplacementString(proposal);
kbProposal.setLabel(proposal);
- setImage(kbProposal);
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
@@ -469,7 +466,7 @@
kbProposal.setReplacementString(replacementString);
kbProposal.setLabel(proposal);
- kbProposal.setImage(getELProposalImage());
+ kbProposal.setImage(getELProposalImageForMember(null));
kbProposals.add(kbProposal);
}
@@ -620,14 +617,14 @@
TextProposal proposal = new TextProposal();
proposal.setReplacementString("['" + key + "']"); //$NON-NLS-1$ //$NON-NLS-2$
proposal.setLabel("['" + key + "']");
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
kbProposals.add(proposal);
} else {
TextProposal proposal = new TextProposal();
proposal.setReplacementString(key);
proposal.setLabel(key);
- setImage(proposal);
+ proposal.setImage(getELProposalImageForMember(null));
kbProposals.add(proposal);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2011-10-13 23:28:44 UTC (rev 35642)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELCompletionEngine.java 2011-10-14 00:16:04 UTC (rev 35643)
@@ -39,6 +39,7 @@
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
import org.jboss.tools.common.el.core.resolver.JavaMemberELSegment;
import org.jboss.tools.common.el.core.resolver.TypeInfoCollector;
+import org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo;
import org.jboss.tools.common.el.core.resolver.Var;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -75,9 +76,10 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.el.AbstractELCompletionEngine#getELProposalImage()
+ * @see org.jboss.tools.common.el.core.ca.AbstractELCompletionEngine#getELProposalImageForMember(org.jboss.tools.common.el.core.resolver.TypeInfoCollector.MemberInfo)
*/
- public Image getELProposalImage() {
+ @Override
+ public Image getELProposalImageForMember(MemberInfo memberInfo) {
return SEAM_EL_PROPOSAL_IMAGE;
}
@@ -162,7 +164,7 @@
if (isSeamMessagesComponentVariable((ISeamContextVariable)var)) {
proposal.setImage(SEAM_MESSAGES_PROPOSAL_IMAGE);
} else {
- proposal.setImage(getELProposalImage());
+ proposal.setImage(getELProposalImageForMember(null));
}
}
13 years, 3 months