JBoss Tools SVN: r33153 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: core/extension/feature and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-22 21:09:07 -0400 (Fri, 22 Jul 2011)
New Revision: 33153
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBuildParticipant2Feature.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/JarSet.java
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/internal/core/scanner/lib/ClassPathMonitor.java
Log:
JBIDE-9395
https://issues.jboss.org/browse/JBIDE-9395
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 2011-07-23 00:37:36 UTC (rev 33152)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2011-07-23 01:09:07 UTC (rev 33153)
@@ -42,11 +42,13 @@
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IType;
import org.jboss.tools.cdi.core.extension.IDefinitionContextExtension;
+import org.jboss.tools.cdi.core.extension.feature.IBuildParticipant2Feature;
import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
import org.jboss.tools.cdi.internal.core.impl.definition.AnnotationHelper;
import org.jboss.tools.cdi.internal.core.impl.definition.Dependencies;
import org.jboss.tools.cdi.internal.core.scanner.CDIBuilderDelegate;
import org.jboss.tools.cdi.internal.core.scanner.FileSet;
+import org.jboss.tools.cdi.internal.core.scanner.lib.JarSet;
import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -73,6 +75,7 @@
CDIResourceVisitor resourceVisitor = null;
Set<IBuildParticipantFeature> buildParticipants = null;
+ Set<IBuildParticipant2Feature> buildParticipants2 = null;
public CDICoreBuilder() {}
@@ -150,7 +153,7 @@
//1. Check class path.
boolean isClassPathUpdated = n.getClassPath().update();
- Map<String, XModelObject> newJars = new HashMap<String, XModelObject>();
+ JarSet newJars = new JarSet();
if(isClassPathUpdated) {
//2. Update class path. Removed paths will be cached to be applied to working copy of context.
n.getClassPath().setSrcs(getResourceVisitor().srcs);
@@ -158,10 +161,14 @@
//3. Install extensions. That should be done before constructing working copy of context.
buildParticipants = n.getExtensionManager().getBuildParticipantFeature();
+ buildParticipants2 = new HashSet<IBuildParticipant2Feature>();
Set<IDefinitionContextExtension> es = new HashSet<IDefinitionContextExtension>();
for (IBuildParticipantFeature p: buildParticipants) {
IDefinitionContextExtension e = p.getContext();
if(e != null) es.add(e);
+ if(p instanceof IBuildParticipant2Feature) {
+ buildParticipants2.add((IBuildParticipant2Feature)p);
+ }
}
n.getDefinitions().setExtensions(es);
}
@@ -243,12 +250,12 @@
invokeBuilderDelegates(fs, getCDICoreNature());
}
- protected void buildJars(Map<String, XModelObject> newJars) throws CoreException {
+ protected void buildJars(JarSet newJars) throws CoreException {
IJavaProject jp = EclipseResourceUtil.getJavaProject(getCDICoreNature().getProject());
if(jp == null) return;
FileSet fileSet = new FileSet();
- for (String jar: newJars.keySet()) {
+ for (String jar: newJars.getBeanModules().keySet()) {
Path path = new Path(jar);
IPackageFragmentRoot root = jp.getPackageFragmentRoot(jar);
if(root == null) continue;
@@ -275,11 +282,18 @@
}
}
}
- XModelObject beansXML = newJars.get(jar);
+ XModelObject beansXML = newJars.getBeanModules().get(jar);
fileSet.setBeanXML(path, beansXML);
for (IBuildParticipantFeature p: buildParticipants) p.visitJar(path, root, beansXML);
}
+ if(!buildParticipants2.isEmpty()) {
+ for (String jar: newJars.getFileSystems().keySet()) {
+ Path path = new Path(jar);
+ XModelObject fs = newJars.getFileSystems().get(jar);
+ for (IBuildParticipant2Feature p: buildParticipants2) p.visitJar(path, fs);
+ }
+ }
addBasicTypes(fileSet);
invokeBuilderDelegates(fileSet, getCDICoreNature());
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBuildParticipant2Feature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBuildParticipant2Feature.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBuildParticipant2Feature.java 2011-07-23 01:09:07 UTC (rev 33153)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.core.extension.feature;
+
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ * This feature visits any jar in classpath.
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface IBuildParticipant2Feature extends IBuildParticipantFeature {
+
+ /**
+ * Looks for artifacts in any jar entries.
+ *
+ * @param path
+ * @param beansXML
+ */
+ public void visitJar(IPath path, XModelObject fs);
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBuildParticipant2Feature.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
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-07-23 00:37:36 UTC (rev 33152)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2011-07-23 01:09:07 UTC (rev 33153)
@@ -50,8 +50,8 @@
super.init();
}
- public Map<String, XModelObject> process() {
- Map<String, XModelObject> newJars = new HashMap<String, XModelObject>();
+ public JarSet process() {
+ JarSet newJars = new JarSet();
for (String p: syncProcessedPaths()) {
synchronized (removedPaths) {
removedPaths.add(new Path(p));
@@ -71,11 +71,13 @@
//Load cdi extensions. Do we need beans.xml to look for extensions?
project.getExtensionManager().setRuntimes(p, readRuntimes(o));
+ newJars.getFileSystems().put(p, o);
+
XModelObject b = o.getChildByPath("META-INF/beans.xml");
if(b == null && !isWeldJar(fileName)) {
continue;
}
- newJars.put(p, b);
+ newJars.getBeanModules().put(p, b);
}
validateProjectDependencies();
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/JarSet.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/JarSet.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/JarSet.java 2011-07-23 01:09:07 UTC (rev 33153)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.internal.core.scanner.lib;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ *
+ * @author Viacheslav Kabanlvich
+ *
+ */
+public class JarSet {
+ Map<String, XModelObject> fileSystems = new HashMap<String, XModelObject>();
+ Map<String, XModelObject> beanModules = new HashMap<String, XModelObject>();
+
+ public Map<String, XModelObject> getBeanModules() {
+ return beanModules;
+ }
+
+ public Map<String, XModelObject> getFileSystems() {
+ return fileSystems;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/JarSet.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 5 months
JBoss Tools SVN: r33152 - in trunk/cdi/plugins/org.jboss.tools.cdi.seam.core: src/org/jboss/tools/cdi/seam/core/international and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-22 20:37:36 -0400 (Fri, 22 Jul 2011)
New Revision: 33152
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalDefinitionContext.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalExtension.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundle.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundleModel.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleImpl.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleModel.java
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/scanner/
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/scanner/BundleFileSet.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml
Log:
JBIDE-9395
https://issues.jboss.org/browse/JBIDE-9395
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml 2011-07-23 00:37:10 UTC (rev 33151)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/plugin.xml 2011-07-23 00:37:36 UTC (rev 33152)
@@ -10,4 +10,11 @@
</el-resolver>
</extension>
+ <extension
+ point="org.jboss.tools.cdi.core.cdiextensions">
+ <cdiextension
+ class="org.jboss.tools.cdi.seam.core.international.CDISeamInternationalExtension"
+ runtime="org.jboss.seam.international.status.TypedStatusMessageBundleExtension">
+ </cdiextension>
+ </extension>
</plugin>
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalDefinitionContext.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalDefinitionContext.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalDefinitionContext.java 2011-07-23 00:37:36 UTC (rev 33152)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.core.international;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.cdi.core.extension.AbstractDefinitionContextExtension;
+import org.jboss.tools.cdi.seam.core.international.scanner.BundleFileSet;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class CDISeamInternationalDefinitionContext extends AbstractDefinitionContextExtension {
+ private Map<IPath, Set<XModelObject>> bundles = new HashMap<IPath, Set<XModelObject>>();
+ private Set<XModelObject> allBundles = new HashSet<XModelObject>();
+
+ public CDISeamInternationalDefinitionContext() {}
+
+ @Override
+ protected AbstractDefinitionContextExtension copy(boolean clean) {
+ CDISeamInternationalDefinitionContext copy = new CDISeamInternationalDefinitionContext();
+ copy.root = root;
+ if(!clean) {
+ copy.bundles.putAll(bundles);
+ }
+ return copy;
+ }
+
+ protected void doApplyWorkingCopy() {
+ CDISeamInternationalDefinitionContext copy = (CDISeamInternationalDefinitionContext)workingCopy;
+ bundles = copy.bundles;
+ allBundles = copy.allBundles;
+ }
+
+ public void clean() {
+ synchronized(bundles) {
+ bundles.clear();
+ }
+ synchronized (allBundles) {
+ allBundles.clear();
+ }
+ }
+
+ public void clean(IPath path) {
+ Set<XModelObject> bs = null;
+ synchronized(bundles) {
+ bs = bundles.remove(path);
+ }
+ if(bs != null) {
+ synchronized (allBundles) {
+ allBundles.removeAll(bs);
+ }
+ }
+ }
+
+ public void addDefinitions(BundleFileSet fileSet) {
+ for (IPath path: fileSet.getAllPaths()) {
+ Set<XModelObject> bs = fileSet.getBundles(path);
+ synchronized(bundles) {
+ bundles.put(path, bs);
+ }
+ synchronized (allBundles) {
+ allBundles.addAll(bs);
+ }
+ }
+ }
+
+ public Set<XModelObject> getAllBundles() {
+ return allBundles;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalDefinitionContext.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalExtension.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalExtension.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalExtension.java 2011-07-23 00:37:36 UTC (rev 33152)
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.core.international;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.extension.ICDIExtension;
+import org.jboss.tools.cdi.core.extension.feature.IBuildParticipant2Feature;
+import org.jboss.tools.cdi.core.extension.feature.IBuildParticipantFeature;
+import org.jboss.tools.cdi.internal.core.scanner.FileSet;
+import org.jboss.tools.cdi.seam.core.international.impl.BundleModel;
+import org.jboss.tools.cdi.seam.core.international.scanner.BundleFileSet;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+
+/**
+ *
+ * @author Viacheslav Kabanlvich
+ *
+ */
+public class CDISeamInternationalExtension implements ICDIExtension, IBuildParticipant2Feature {
+ CDICoreNature project;
+ CDISeamInternationalDefinitionContext context = new CDISeamInternationalDefinitionContext();
+ BundleFileSet fileSet = new BundleFileSet();
+
+ BundleModel model = new BundleModel();
+
+ public static CDISeamInternationalExtension getExtension(CDICoreNature project) {
+ Set<ICDIExtension> es = project.getExtensionManager().getExtensions(IBuildParticipantFeature.class);
+ for (ICDIExtension ext: es) {
+ if(ext instanceof CDISeamInternationalExtension) return (CDISeamInternationalExtension)ext;
+ }
+ return null;
+ }
+
+ public void setProject(CDICoreNature n) {
+ project = n;
+ }
+
+ public BundleModel getBundleModel() {
+ return model;
+ }
+
+ public CDISeamInternationalDefinitionContext getContext() {
+ return context;
+ }
+
+ public void beginVisiting() {
+ fileSet = new BundleFileSet();
+ }
+
+ public void visit(IFile file, IPath src, IPath webinf) {
+ IPath path = file.getFullPath();
+ if(src != null && src.isPrefixOf(path)) {
+ addBundle(file, fileSet);
+ }
+ }
+
+ private void addBundle(IFile f, BundleFileSet fileSet) {
+ if(f.getName().endsWith(".properties")) {
+ XModelObject b = getObject(f);
+ if(b != null) {
+ fileSet.setBundle(f.getFullPath(), b);
+ }
+ }
+ }
+
+ private XModelObject getObject(IFile f) {
+ XModelObject o = EclipseResourceUtil.getObjectByResource(f);
+ if(o == null) {
+ o = EclipseResourceUtil.createObjectForResource(f);
+ }
+ return o;
+ }
+
+ @Override
+ public void visitJar(IPath path, IPackageFragmentRoot root, XModelObject beansXML) {
+ }
+
+ @Override
+ public void buildDefinitions() {
+ ((CDISeamInternationalDefinitionContext)context.getWorkingCopy()).addDefinitions(fileSet);
+ }
+
+ @Override
+ public void buildDefinitions(FileSet fileSet) {
+ }
+
+ @Override
+ public void buildBeans() {
+ model.rebuild(context.getAllBundles());
+ }
+
+ @Override
+ public void visitJar(IPath path, XModelObject fs) {
+ Set<XModelObject> objects = collectXModelBundleObjects(fs, null);
+ fileSet.setBundles(path, objects);
+ }
+
+ private Set<XModelObject> collectXModelBundleObjects(XModelObject o, Set<XModelObject> objects) {
+ if(objects == null) {
+ objects = new HashSet<XModelObject>();
+ }
+ if (o == null) return objects;
+
+ String path = o.getPath();
+ if (path == null || "META-INF".equalsIgnoreCase(o.getAttributeValue("name")))
+ return objects;
+
+ if (path.endsWith(".properties")) {
+ objects.add(o);
+ }
+
+ if (o.getFileType() > XModelObject.FILE && o.hasChildren()) {
+ XModelObject[] children = o.getChildren();
+ if (children != null) {
+ for (XModelObject c : children) {
+ collectXModelBundleObjects(c, objects);
+ }
+ }
+ }
+ return objects;
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/CDISeamInternationalExtension.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundle.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundle.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundle.java 2011-07-23 00:37:36 UTC (rev 33152)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.core.international;
+
+import java.util.Set;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface IBundle {
+
+ public String getName();
+
+ public Set<String> getPropertyNames();
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundle.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundleModel.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundleModel.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundleModel.java 2011-07-23 00:37:36 UTC (rev 33152)
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.core.international;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public interface IBundleModel {
+ public IBundle getBundle(String banename);
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/IBundleModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleImpl.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleImpl.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleImpl.java 2011-07-23 00:37:36 UTC (rev 33152)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.core.international.impl;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.tools.cdi.seam.core.international.IBundle;
+import org.jboss.tools.common.model.XModelObject;
+
+public class BundleImpl implements IBundle {
+ String name = "";
+ Set<XModelObject> objects = new HashSet<XModelObject>();
+
+ public BundleImpl() {}
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String s) {
+ name = s;
+ }
+
+ public Set<String> getPropertyNames() {
+ Set<String> result = new HashSet<String>();
+ for (XModelObject o: objects) {
+ XModelObject[] os = o.getChildren();
+ for (XModelObject p: os) {
+ result.add(p.getAttributeValue("name"));
+ }
+ }
+ return result;
+ }
+
+ public void addObject(XModelObject o) {
+ objects.add(o);
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleImpl.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleModel.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleModel.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleModel.java 2011-07-23 00:37:36 UTC (rev 33152)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.core.international.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.cdi.seam.core.international.IBundleModel;
+import org.jboss.tools.common.model.XModelObject;
+
+public class BundleModel implements IBundleModel {
+ long timeStamp = 0;
+ Map<String, BundleImpl> bundles = new HashMap<String, BundleImpl>();
+
+ public BundleImpl getBundle(String name) {
+ return bundles.get(name);
+ }
+
+ public void rebuild(Set<XModelObject> objects) {
+ long t = computeTimeStamp(objects);
+ if(t == timeStamp) return;
+ timeStamp = t;
+ bundles.clear();
+ for (XModelObject o: objects) {
+ addToBundle(getBundleName(o), o);
+ }
+ }
+
+ private BundleImpl addToBundle(String name, XModelObject o) {
+ BundleImpl b = getBundle(name);
+ if(b == null) {
+ b = new BundleImpl();
+ b.setName(name);
+ }
+ b.addObject(o);
+ return b;
+ }
+
+ private String getBundleName(XModelObject o) {
+ IPath p = new Path(o.getPath());
+ p = p.removeFirstSegments(2);
+ String n = p.toString();
+ n = n.substring(0, n.lastIndexOf('.'));
+ if (n.indexOf('_') != -1)
+ n = n.substring(0, n.indexOf('_'));
+ return n.replace('/', '.');
+ }
+
+ long computeTimeStamp(Set<XModelObject> objects) {
+ long t = 0;
+ for (XModelObject o: objects) {
+ t += o.hashCode() + 713 * o.getTimeStamp();
+ }
+ return t;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/impl/BundleModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/scanner/BundleFileSet.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/scanner/BundleFileSet.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/scanner/BundleFileSet.java 2011-07-23 00:37:36 UTC (rev 33152)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.seam.core.international.scanner;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
+public class BundleFileSet {
+ private Set<IPath> allpaths = new HashSet<IPath>();
+ private Map<IPath, Set<XModelObject>> bundles = new HashMap<IPath, Set<XModelObject>>();
+
+ public BundleFileSet() {}
+
+ public Set<IPath> getAllPaths() {
+ return allpaths;
+ }
+
+ public Set<XModelObject> getBundles(IPath f) {
+ return bundles.get(f);
+ }
+
+ public void setBundle(IPath f, XModelObject o) {
+ Set<XModelObject> set = bundles.get(f);
+ if(set == null) {
+ set = new HashSet<XModelObject>();
+ bundles.put(f, set);
+ }
+ set.add(o);
+ allpaths.add(f);
+ }
+
+ public void setBundles(IPath f, Set<XModelObject> set) {
+ bundles.put(f, set);
+ allpaths.add(f);
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.seam.core/src/org/jboss/tools/cdi/seam/core/international/scanner/BundleFileSet.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 5 months
JBoss Tools SVN: r33151 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-22 20:37:10 -0400 (Fri, 22 Jul 2011)
New Revision: 33151
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
JBIDE-9395
https://issues.jboss.org/browse/JBIDE-9395
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2011-07-22 23:32:04 UTC (rev 33150)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2011-07-23 00:37:10 UTC (rev 33151)
@@ -135,12 +135,22 @@
FileSystemsImpl fso = (FileSystemsImpl)FileSystemsHelper.getFileSystems(model);
if(fso == null) return null;
fso.updateOverlapped();
+ XModelObject result = null;
+ int pathLength = 10000;
XModelObject[] fs = fso.getChildren(XModelObjectConstants.ENT_FILE_SYSTEM_FOLDER);
for (int i = 0; i < fs.length; i++) {
FileSystemImpl s = (FileSystemImpl)fs[i];
XModelObject o = findResourceInFileSystem(s, resource);
- if(o != null) return o;
+ if(o != null) {
+ if(path == null || pathLength > o.getPath().length()) {
+ result = o;
+ pathLength = o.getPath().length();
+ }
+ }
}
+ if(result != null) {
+ return result;
+ }
fs = fso.getChildren("FileSystemJar"); //$NON-NLS-1$
String location = path == null ? null : path.toString().replace('\\', '/');
if(location != null && isJar(location)) {
14 years, 5 months
JBoss Tools SVN: r33150 - in trunk/cdi: plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-07-22 19:32:04 -0400 (Fri, 22 Jul 2011)
New Revision: 33150
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/AddAnnotationMarkerResolution.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAnnotationMarkerResolution.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7684
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-07-22 20:56:58 UTC (rev 33149)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-07-22 23:32:04 UTC (rev 33150)
@@ -1069,9 +1069,9 @@
decoratorDeclaration = decorator.getNameLocation();
}
addError(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, decoratorDeclaration, bean
- .getResource());
+ .getResource(), DISPOSER_IN_DECORATOR_ID);
for (ITextSourceReference declaration : disposerDeclarations) {
- addError(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource());
+ addError(CDIValidationMessages.DISPOSER_IN_DECORATOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean.getResource(), DISPOSER_IN_DECORATOR_ID);
}
}
@@ -1087,10 +1087,10 @@
interceptorDeclaration = interceptor.getNameLocation();
}
addError(CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, interceptorDeclaration, bean
- .getResource());
+ .getResource(), DISPOSER_IN_INTERCEPTOR_ID);
for (ITextSourceReference declaration : disposerDeclarations) {
addError(CDIValidationMessages.DISPOSER_IN_INTERCEPTOR, CDIPreferences.DISPOSER_IN_INTERCEPTOR_OR_DECORATOR, declaration, bean
- .getResource());
+ .getResource(), DISPOSER_IN_INTERCEPTOR_ID);
}
}
@@ -1926,7 +1926,7 @@
*/
Set<IProducer> producers = interceptor.getProducers();
for (IProducer producer : producers) {
- addError(CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, producer.getProducesAnnotation(), interceptor.getResource());
+ addError(CDIValidationMessages.PRODUCER_IN_INTERCEPTOR, CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, producer.getProducesAnnotation(), interceptor.getResource(), PRODUCER_IN_INTERCEPTOR_ID);
}
/*
* 9.2. Declaring the interceptor bindings of an interceptor
@@ -2014,7 +2014,7 @@
*/
Set<IProducer> producers = decorator.getProducers();
for (IProducer producer : producers) {
- addError(CDIValidationMessages.PRODUCER_IN_DECORATOR, CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, producer.getProducesAnnotation(), decorator.getResource());
+ addError(CDIValidationMessages.PRODUCER_IN_DECORATOR, CDIPreferences.PRODUCER_IN_INTERCEPTOR_OR_DECORATOR, producer.getProducesAnnotation(), decorator.getResource(), PRODUCER_IN_DECORATOR_ID);
}
Set<IInjectionPoint> injections = decorator.getInjectionPoints();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2011-07-22 20:56:58 UTC (rev 33149)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2011-07-22 23:32:04 UTC (rev 33150)
@@ -42,9 +42,12 @@
public static final int PRODUCER_ANNOTATED_INJECT_ID = 21;
public static final int OBSERVER_ANNOTATED_INJECT_ID = 22;
public static final int DISPOSER_ANNOTATED_INJECT_ID = 23;
-
public static final int CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES_ID = 24;
public static final int CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES_ID = 25;
+ public static final int PRODUCER_IN_INTERCEPTOR_ID = 26;
+ public static final int PRODUCER_IN_DECORATOR_ID = 27;
+ public static final int DISPOSER_IN_INTERCEPTOR_ID = 28;
+ public static final int DISPOSER_IN_DECORATOR_ID = 29;
/*
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/AddAnnotationMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/AddAnnotationMarkerResolution.java 2011-07-22 20:56:58 UTC (rev 33149)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/AddAnnotationMarkerResolution.java 2011-07-22 23:32:04 UTC (rev 33150)
@@ -44,7 +44,7 @@
}else if(element instanceof IField){
type = "field";
}else if(element instanceof ILocalVariable && ((ILocalVariable) element).isParameter()){
- type = "parameter";
+ type = "parameter of '"+element.getParent().getElementName()+"' method";
}
label = NLS.bind(CDIUIMessages.ADD_ANNOTATION_MARKER_RESOLUTION_TITLE, new String[]{shortName, element.getElementName(), type});
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-07-22 20:56:58 UTC (rev 33149)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-07-22 23:32:04 UTC (rev 33150)
@@ -328,6 +328,30 @@
};
}
}
+ }else if(messageId == CDIValidationErrorManager.DISPOSER_IN_INTERCEPTOR_ID){
+ IJavaElement element = findJavaElement(file, start);
+ if(element != null){
+ IJavaElement disposerElement = findJavaElementByAnnotation(element, CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME);
+ IJavaElement interceptorElement = findJavaElementByAnnotation(element, CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME);
+ if(disposerElement != null && interceptorElement != null){
+ return new IMarkerResolution[] {
+ new DeleteAnnotationMarkerResolution(disposerElement, CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME),
+ new DeleteAnnotationMarkerResolution(interceptorElement, CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME)
+ };
+ }
+ }
+ }else if(messageId == CDIValidationErrorManager.DISPOSER_IN_DECORATOR_ID){
+ IJavaElement element = findJavaElement(file, start);
+ if(element != null){
+ IJavaElement disposerElement = findJavaElementByAnnotation(element, CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME);
+ IJavaElement decoratorElement = findJavaElementByAnnotation(element, CDIConstants.DECORATOR_TYPE_NAME);
+ if(disposerElement != null && decoratorElement != null){
+ return new IMarkerResolution[] {
+ new DeleteAnnotationMarkerResolution(disposerElement, CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME),
+ new DeleteAnnotationMarkerResolution(decoratorElement, CDIConstants.DECORATOR_TYPE_NAME)
+ };
+ }
+ }
}
}
return new IMarkerResolution[] {};
@@ -577,7 +601,31 @@
if(annotation != null)
return parent;
}
+ }else if(element instanceof IType){
+ for(IField field : ((IType)element).getFields()){
+ annotation = getAnnotation(field, qualifiedName);
+ if(annotation != null)
+ return field;
+ }
+
+ for(IMethod method : ((IType)element).getMethods()){
+ annotation = getAnnotation(method, qualifiedName);
+ if(annotation != null)
+ return method;
+ for(ILocalVariable parameter : method.getParameters()){
+ annotation = getAnnotation(parameter, qualifiedName);
+ if(annotation != null)
+ return parameter;
+ }
+ }
}
+
+ if(element instanceof IMember){
+ annotation = getAnnotation(((IMember)element).getDeclaringType(), qualifiedName);
+ if(annotation != null)
+ return ((IMember)element).getDeclaringType();
+ }
+
return null;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAnnotationMarkerResolution.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAnnotationMarkerResolution.java 2011-07-22 20:56:58 UTC (rev 33149)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/DeleteAnnotationMarkerResolution.java 2011-07-22 23:32:04 UTC (rev 33150)
@@ -44,7 +44,7 @@
}else if(element instanceof IField){
type = "field";
}else if(element instanceof ILocalVariable && ((ILocalVariable) element).isParameter()){
- type = "parameter";
+ type = "parameter of '"+element.getParent().getElementName()+"' method";
}
label = NLS.bind(CDIUIMessages.DELETE_ANNOTATION_MARKER_RESOLUTION_TITLE, new String[]{shortName, element.getElementName(), type});
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-07-22 20:56:58 UTC (rev 33149)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/MarkerResolutionUtils.java 2011-07-22 23:32:04 UTC (rev 33150)
@@ -264,15 +264,17 @@
if (annotation == null || !annotation.exists()) {
annotation = ((IAnnotatable)element).getAnnotation(name);
}
- IMember member=null;
- if(element instanceof IMember){
- member = (IMember)element;
+ IType type=null;
+ if(element instanceof IType){
+ type = (IType)element;
+ }else if(element instanceof IMember){
+ type = ((IMember)element).getDeclaringType();
}else if(element instanceof ITypeParameter){
- member = ((ITypeParameter)element).getDeclaringMember();
+ type = ((ITypeParameter)element).getDeclaringMember().getDeclaringType();
}else if(element instanceof ILocalVariable){
- member = ((ILocalVariable)element).getDeclaringMember();
+ type = ((ILocalVariable)element).getDeclaringMember().getDeclaringType();
}
- if (member != null && annotation != null && qualifiedName.equals(EclipseJavaUtil.resolveType(member.getDeclaringType(), name))) {
+ if (type != null && annotation != null && qualifiedName.equals(EclipseJavaUtil.resolveType(type, name))) {
return annotation;
}
}
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.java 2011-07-22 23:32:04 UTC (rev 33150)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.decorator.Decorator;
+import javax.enterprise.inject.Disposes;
+
+@Decorator
+public class TestDecorator {
+
+ public void method(@Disposes String parameter){
+
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDecorator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.java 2011-07-22 23:32:04 UTC (rev 33150)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.inject.Disposes;
+import javax.interceptor.Interceptor;
+
+@Interceptor
+public class TestInterceptor3 {
+
+ public void method(@Disposes String parameter){
+
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestInterceptor3.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-22 20:56:58 UTC (rev 33149)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-22 23:32:04 UTC (rev 33150)
@@ -679,4 +679,26 @@
DeleteAnnotationMarkerResolution.class);
}
+ public void testDeleteDisposerFromInterceptorResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestInterceptor3.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.DISPOSER_IN_INTERCEPTOR_ID,
+ DeleteAnnotationMarkerResolution.class);
+ }
+
+ public void testDeleteDisposerFromDecoratorResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestDecorator.java"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.DISPOSER_IN_DECORATOR_ID,
+ DeleteAnnotationMarkerResolution.class);
+ }
+
}
\ No newline at end of file
14 years, 5 months
JBoss Tools SVN: r33149 - trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-07-22 16:56:58 -0400 (Fri, 22 Jul 2011)
New Revision: 33149
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
Log:
Fix for the issue to support paths configured at install time to search for runtimes
JBDS-1673 Installer should align with runtime detection
added check for new file, added parser for new file and merged paths come from other sources
Modified: trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2011-07-22 18:40:20 UTC (rev 33148)
+++ trunk/runtime/plugins/org.jboss.tools.runtime/src/org/jboss/tools/runtime/JBossRuntimeStartup.java 2011-07-22 20:56:58 UTC (rev 33149)
@@ -18,6 +18,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Set;
@@ -50,16 +51,24 @@
public class JBossRuntimeStartup implements IStartup {
private static final String JBOSS_EAP_HOME = "../../jboss-eap"; // JBoss EAP home directory (relative to plugin)- <RHDS_HOME>/jbossas. //$NON-NLS-1$
+
private static final String SERVERS_FILE_NAME = "application_platforms.properties"; //$NON-NLS-1$
private static final String SERVERS_FILE = "../../../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
private static final String SERVERS_FILE_CONFIGURATION = "../../studio/" + SERVERS_FILE_NAME; //$NON-NLS-1$
-
+
+ private static final String LOCATIONS_FILE_NAME = "runtime_locations.properties"; //$NON-NLS-1$
+ private static final String LOCATIONS_FILE = "../../../../studio/" + LOCATIONS_FILE_NAME; //$NON-NLS-1$
+ private static final String LOCATIONS_FILE_CONFIGURATION = "../../studio/" + LOCATIONS_FILE_NAME; //$NON-NLS-1$
+
private List<ServerDefinition> serverDefinitions = new ArrayList<ServerDefinition>();
private IEclipsePreferences preferences;
+ Set<RuntimePath> installersRuntimePaths = new HashSet<RuntimePath>();
+
public void earlyStartup() {
if (isJBDS() && willBeInitialized()) {
parseServerFile();
+ parseRuntimeLocationsFile();
initializeIncludedRuntimes();
initializeRuntimes(serverDefinitions);
saveWorkspacePreferences();
@@ -127,6 +136,9 @@
RuntimePath runtimePath = new RuntimePath(location.getAbsolutePath());
runtimePaths.add(runtimePath);
}
+
+ runtimePaths.addAll(installersRuntimePaths);
+
if (runtimePaths.size() > 0) {
RuntimeUIActivator.getDefault().saveRuntimePaths();
}
@@ -247,10 +259,60 @@
}
}
+ private void parseRuntimeLocationsFile() {
+
+ try {
+ String pluginLocation = FileLocator.resolve(Activator.getDefault().getBundle().getEntry("/")).getPath(); //$NON-NLS-1$
+ File serversFile = new File(pluginLocation, LOCATIONS_FILE);
+
+ if (!serversFile.isFile()) {
+ String configuration = getConfiguration();
+ serversFile = new File(configuration, LOCATIONS_FILE_CONFIGURATION).getCanonicalFile();
+ } else {
+ serversFile = serversFile.getCanonicalFile();
+ }
+ if (!serversFile.isFile()) {
+ serversFile = new File(pluginLocation,LOCATIONS_FILE_NAME);
+ }
+ if (serversFile.isFile()) {
+ //String str = FileUtil.readFile(serversFile);
+ Properties servers = new Properties();
+ servers.load(new BufferedInputStream(new FileInputStream(serversFile)));
+ Enumeration<Object> elements = servers.elements();
+ while (elements.hasMoreElements()) {
+ String str = (String) elements.nextElement();
+ StringTokenizer lineTokenizer = new StringTokenizer(str,
+ "\n\r\f"); //$NON-NLS-1$
+ while (lineTokenizer.hasMoreTokens()) {
+ String lineToken = lineTokenizer.nextToken();
+ StringTokenizer tokenizer = new StringTokenizer(
+ lineToken, ","); //$NON-NLS-1$
+ if (tokenizer.countTokens() == 2) {
+ String location = tokenizer.nextToken();
+ boolean scan = Boolean.parseBoolean(tokenizer.nextToken());
+ File locationFile = new File(location);
+ if (locationFile.isDirectory()) {
+ RuntimePath tempLocation = new RuntimePath(location);
+ tempLocation.setScanOnEveryStartup(scan);
+ installersRuntimePaths.add(tempLocation);
+ }
+ }
+ }
+ }
+ }
+ } catch (FileNotFoundException e) {
+ Activator.log(e);
+ } catch (IOException e) {
+ Activator.log(e);
+ }
+ }
+
+
private String getConfiguration() throws IOException {
Location configLocation = Platform.getConfigurationLocation();
URL configURL = configLocation.getURL();
String configuration = FileLocator.resolve(configURL).getPath();
return configuration;
- }
+ }
+
}
\ No newline at end of file
14 years, 5 months
JBoss Tools SVN: r33148 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-07-22 14:40:20 -0400 (Fri, 22 Jul 2011)
New Revision: 33148
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
(JBIDE-9396) EL references are not collected for Text regions of XML files
Issue is fixed
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 2011-07-22 17:45:28 UTC (rev 33147)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2011-07-22 18:40:20 UTC (rev 33148)
@@ -509,7 +509,7 @@
}
private void fillContextForNode(IDocument document, IDOMNode node, ELContext context, List<String> parents) {
- if (!(context instanceof FaceletPageContextImpl) && !(node instanceof IDOMElement)) {
+ if (context instanceof JspContextImpl && !(context instanceof FaceletPageContextImpl) && !(node instanceof IDOMElement)) {
// There is no any useful info for JSP in text nodes
return;
}
14 years, 5 months
JBoss Tools SVN: r33147 - in trunk/cdi: tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-07-22 13:45:28 -0400 (Fri, 22 Jul 2011)
New Revision: 33147
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7664
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-07-22 17:17:33 UTC (rev 33146)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-07-22 17:45:28 UTC (rev 33147)
@@ -308,6 +308,26 @@
};
}
}
+ }else if(messageId == CDIValidationErrorManager.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES_ID){
+ IJavaElement element = findJavaElement(file, start);
+ if(element != null){
+ IJavaElement disposesElement = findJavaElementByAnnotation(element, CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME);
+ if(disposesElement != null){
+ return new IMarkerResolution[] {
+ new DeleteAnnotationMarkerResolution(disposesElement, CDIConstants.DISPOSES_ANNOTATION_TYPE_NAME)
+ };
+ }
+ }
+ }else if(messageId == CDIValidationErrorManager.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES_ID){
+ IJavaElement element = findJavaElement(file, start);
+ if(element != null){
+ IJavaElement observerElement = findJavaElementByAnnotation(element, CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME);
+ if(observerElement != null){
+ return new IMarkerResolution[] {
+ new DeleteAnnotationMarkerResolution(observerElement, CDIConstants.OBSERVERS_ANNOTATION_TYPE_NAME)
+ };
+ }
+ }
}
}
return new IMarkerResolution[] {};
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.java 2011-07-22 17:45:28 UTC (rev 33147)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named("sss")
+public class TestDisposerConstructor {
+ @Produces
+ public String produce(){
+ return "test";
+ }
+
+
+ @Inject
+ public TestDisposerConstructor(@Disposes String aaa){
+
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult 2011-07-22 17:45:28 UTC (rev 33147)
@@ -0,0 +1,19 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+@Named("sss")
+public class TestDisposerConstructor {
+ @Produces
+ public String produce(){
+ return "test";
+ }
+
+
+ @Inject
+ public TestDisposerConstructor(String aaa){
+
+ }
+}
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.java 2011-07-22 17:45:28 UTC (rev 33147)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+
+public class TestObserverConstructor {
+
+ @Inject
+ public TestObserverConstructor(@Observes String aaa){
+
+ }
+}
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult 2011-07-22 17:45:28 UTC (rev 33147)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.inject.Inject;
+
+public class TestObserverConstructor {
+
+ @Inject
+ public TestObserverConstructor(String aaa){
+
+ }
+}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-22 17:17:33 UTC (rev 33146)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-22 17:45:28 UTC (rev 33147)
@@ -651,4 +651,32 @@
DeleteAnnotationMarkerResolution.class);
}
+ public void testDeleteDisposesAnnotationFromParameterResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestDisposerConstructor.java"
+ },
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestDisposerConstructor.qfxresult"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.CONSTRUCTOR_PARAMETER_ANNOTATED_DISPOSES_ID,
+ DeleteAnnotationMarkerResolution.class);
+ }
+
+ public void testDeleteObservesAnnotationFromParameterResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestObserverConstructor.java"
+ },
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/TestObserverConstructor.qfxresult"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.CONSTRUCTOR_PARAMETER_ANNOTATED_OBSERVES_ID,
+ DeleteAnnotationMarkerResolution.class);
+ }
+
}
\ No newline at end of file
14 years, 5 months
JBoss Tools SVN: r33146 - in trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf: ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-22 13:17:33 -0400 (Fri, 22 Jul 2011)
New Revision: 33146
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
Log:
JBIDE-9362
https://issues.jboss.org/browse/JBIDE-9362
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java 2011-07-22 17:17:33 UTC (rev 33146)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.jsp.ca.test;
+
+import org.jboss.tools.common.base.test.contentassist.JavaContentAssistantTestCase;
+import org.jboss.tools.test.util.TestProjectProvider;
+
+public class CAForJSF2BeansInJavaTest extends JavaContentAssistantTestCase{
+ TestProjectProvider provider = null;
+ boolean makeCopy = true;
+ private static final String PROJECT_NAME = "JSF2Beans";
+ private static final String PAGE_NAME = "/src/test/beans/Bean1.java";
+
+ public void setUp() throws Exception {
+ provider = new TestProjectProvider("org.jboss.tools.jsf.test", null, PROJECT_NAME, makeCopy);
+ project = provider.getProject();
+ }
+
+ protected void tearDown() throws Exception {
+ if(provider != null) {
+ provider.dispose();
+ }
+ }
+
+ /**
+ * JBIDE-9362
+ */
+ public void testCAForJSF2Beans(){
+ String[] proposals = {
+ "mybean1", "mybean2"
+ };
+
+ checkProposals(PAGE_NAME, "#{}", 2, proposals, false);
+
+ }
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/CAForJSF2BeansInJavaTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-07-22 16:41:32 UTC (rev 33145)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-07-22 17:17:33 UTC (rev 33146)
@@ -18,6 +18,7 @@
import org.jboss.tools.jsf.jsp.ca.test.CAForELinStyleTest;
import org.jboss.tools.jsf.jsp.ca.test.CAForIDTest;
import org.jboss.tools.jsf.jsp.ca.test.CAForInputTagSrcAttributeSuggestsFilePathsJBIDE1807Test;
+import org.jboss.tools.jsf.jsp.ca.test.CAForJSF2BeansInJavaTest;
import org.jboss.tools.jsf.jsp.ca.test.CAForJSF2BeansTest;
import org.jboss.tools.jsf.jsp.ca.test.CAForUnclosedELTest;
import org.jboss.tools.jsf.jsp.ca.test.CANotEmptyWhenThereIsNoSpaceBetweenInvertedCommandsInAttributeJBIDE1759Test;
@@ -43,6 +44,7 @@
suite.addTestSuite(CAForUnclosedELTest.class);
suite.addTestSuite(CAForCompositeComponentTest.class);
suite.addTestSuite(CAForJSF2BeansTest.class);
+ suite.addTestSuite(CAForJSF2BeansInJavaTest.class);
// suite.addTestSuite(MissingKBBuilderTest.class);
suite.addTestSuite(CAForInputTagSrcAttributeSuggestsFilePathsJBIDE1807Test.class);
suite.addTestSuite(CAForIDTest.class);
14 years, 5 months
JBoss Tools SVN: r33145 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-22 12:41:32 -0400 (Fri, 22 Jul 2011)
New Revision: 33145
Removed:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/CDIELProposalProcessor.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/CDIJavaELProposalComputer.java
Log:
JBIDE-9362
https://issues.jboss.org/browse/JBIDE-9362
Deleted: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/CDIELProposalProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/CDIELProposalProcessor.java 2011-07-22 16:39:40 UTC (rev 33144)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/CDIELProposalProcessor.java 2011-07-22 16:41:32 UTC (rev 33145)
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.cdi.ui.ca;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.cdi.core.CDICoreNature;
-import org.jboss.tools.cdi.core.CDICorePlugin;
-import org.jboss.tools.cdi.internal.core.el.CdiElResolver;
-import org.jboss.tools.jst.web.kb.el.KbELProposalProcessor;
-
-/**
- * @author Alexey Kazakov
- */
-public class CDIELProposalProcessor extends KbELProposalProcessor {
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.ui.ca.ELProposalProcessor#isEnabled(org.eclipse.core.resources.IFile)
- */
- @Override
- protected boolean isEnabled(IFile file) {
- IProject project = (file == null ? null : file.getProject());
- CDICoreNature nature = CDICorePlugin.getCDI(project, true);
- return nature!=null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.ui.ca.ELProposalProcessor#getImage()
- */
- @Override
- protected Image getImage() {
- return CdiElResolver.CDI_EL_PROPOSAL_IMAGE;
- }
-}
\ No newline at end of file
Deleted: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/CDIJavaELProposalComputer.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/CDIJavaELProposalComputer.java 2011-07-22 16:39:40 UTC (rev 33144)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/ca/CDIJavaELProposalComputer.java 2011-07-22 16:41:32 UTC (rev 33145)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.cdi.ui.ca;
-
-import org.jboss.tools.common.el.ui.ca.ELProposalProcessor;
-import org.jboss.tools.common.el.ui.ca.JavaELProposalComputer;
-
-/**
- * Custom Java Completion Proposal computer
- *
- * @author Jeremy
- */
-public class CDIJavaELProposalComputer extends JavaELProposalComputer {
-
- private final CDIELProposalProcessor fProcessor = new CDIELProposalProcessor();
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.ui.ca.JavaELProposalComputer#getELProcessor()
- */
- @Override
- protected ELProposalProcessor getELProcessor() {
- return fProcessor;
- }
-}
\ No newline at end of file
14 years, 5 months
JBoss Tools SVN: r33144 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-22 12:39:40 -0400 (Fri, 22 Jul 2011)
New Revision: 33144
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
JBIDE-9362
https://issues.jboss.org/browse/JBIDE-9362
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java 2011-07-22 16:04:44 UTC (rev 33143)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalComputer.java 2011-07-22 16:39:40 UTC (rev 33144)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.seam.ui.text.java;
-
-import org.jboss.tools.common.el.ui.ca.ELProposalProcessor;
-import org.jboss.tools.common.el.ui.ca.JavaELProposalComputer;
-
-/**
- * Custom Java Completion Proposal computer
- *
- * @author Jeremy
- */
-public class SeamELProposalComputer extends JavaELProposalComputer {
-
- private final SeamELProposalProcessor fProcessor = new SeamELProposalProcessor();
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.ui.ca.JavaELProposalComputer#getELProcessor()
- */
- @Override
- protected ELProposalProcessor getELProcessor() {
- return fProcessor;
- }
-}
\ No newline at end of file
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2011-07-22 16:04:44 UTC (rev 33143)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2011-07-22 16:39:40 UTC (rev 33144)
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.ui.text.java;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.jst.web.kb.el.KbELProposalProcessor;
-import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-
-/**
- * @author Alexey Kazakov
- */
-public class SeamELProposalProcessor extends KbELProposalProcessor {
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.ui.ca.ELProposalProcessor#isEnabled(org.eclipse.core.resources.IFile)
- */
- @Override
- protected boolean isEnabled(IFile file) {
- IProject project = (file == null ? null : file.getProject());
- ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
- return seamProject!=null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.common.el.ui.ca.ELProposalProcessor#getImage()
- */
- @Override
- protected Image getImage() {
- return SeamCorePlugin.getDefault().getImage(SeamCorePlugin.CA_SEAM_EL_IMAGE_PATH);
- }
-}
\ No newline at end of file
14 years, 5 months