JBoss Tools SVN: r35682 - in trunk/cdi/plugins: org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-10-14 20:43:08 -0400 (Fri, 14 Oct 2011)
New Revision: 35682
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java
Log:
Updated in order to work with binary files https://issues.jboss.org/browse/JBIDE-9764
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java 2011-10-15 00:34:31 UTC (rev 35681)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/XMLInjectedPointHyperlinkDetector.java 2011-10-15 00:43:08 UTC (rev 35682)
@@ -105,7 +105,7 @@
}
if(elementFile != null)
- findInjectedBeans(cdiNature, element, offset, elementFile, hyperlinks);
+ findInjectedBeans(cdiNature, element, offset, elementFile.getFullPath(), hyperlinks);
if (hyperlinks != null && !hyperlinks.isEmpty()) {
return (IHyperlink[])hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2011-10-15 00:34:31 UTC (rev 35681)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/EventAndObserverMethodHyperlinkDetector.java 2011-10-15 00:43:08 UTC (rev 35682)
@@ -14,14 +14,14 @@
import java.util.HashSet;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.ICodeAssist;
-import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.ISourceRange;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
@@ -53,31 +53,23 @@
int offset= region.getOffset();
- IJavaElement input= EditorUtility.getEditorInputJavaElement(textEditor, false);
+ IJavaElement input= EditorUtility.getEditorInputJavaElement(textEditor, true);
if (input == null)
return null;
- if (input.getResource() == null || input.getResource().getProject() == null)
- return null;
-
IDocument document= textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
IRegion wordRegion= JavaWordFinder.findWord(document, offset);
if (wordRegion == null)
return null;
- IFile file = null;
+ IProject project = null;
- try {
- IResource resource = input.getCorrespondingResource();
- if (resource instanceof IFile)
- file = (IFile) resource;
- } catch (JavaModelException e) {
- CDIExtensionsPlugin.log(e);
- }
+ project = input.getJavaProject().getProject();
- if(file == null)
+ if(project == null)
return null;
- CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(file.getProject());
+
+ CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(project);
if(cdiNature == null)
return null;
@@ -93,8 +85,10 @@
ArrayList<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
int position = 0;
if(elements[0] instanceof IType){
- ICompilationUnit cUnit = (ICompilationUnit)input;
- elements[0] = cUnit.getElementAt(wordRegion.getOffset());
+ if(input instanceof ITypeRoot){
+ ITypeRoot cUnit = (ITypeRoot)input;
+ elements[0] = cUnit.getElementAt(wordRegion.getOffset());
+ }
if(elements[0] == null)
return null;
@@ -104,8 +98,8 @@
}
ICDIProject cdiProject = cdiNature.getDelegate();
if(cdiProject != null){
- IInjectionPoint injectionPoint = findInjectedPoint(cdiProject, elements[0], position, file);
- Set<IParameter> param = findObserverParameter(cdiProject, elements[0], offset, file);
+ IInjectionPoint injectionPoint = findInjectedPoint(cdiProject, elements[0], position, input.getPath());
+ Set<IParameter> param = findObserverParameter(cdiProject, elements[0], offset, input.getPath());
if(injectionPoint != null){
Set<IObserverMethod> observerMethods = cdiProject.resolveObserverMethods(injectionPoint);
@@ -137,15 +131,15 @@
return null;
}
- private IInjectionPoint findInjectedPoint(ICDIProject cdiProject, IJavaElement element, int offset, IFile file){
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ private IInjectionPoint findInjectedPoint(ICDIProject cdiProject, IJavaElement element, int offset, IPath path){
+ Set<IBean> beans = cdiProject.getBeans(path);
return CDIUtil.findInjectionPoint(beans, element, offset);
}
- private Set<IParameter> findObserverParameter(ICDIProject cdiProject, IJavaElement element, int offset, IFile file) throws JavaModelException {
+ private Set<IParameter> findObserverParameter(ICDIProject cdiProject, IJavaElement element, int offset, IPath path) throws JavaModelException {
HashSet<IParameter> result = new HashSet<IParameter>();
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Set<IBean> beans = cdiProject.getBeans(path);
for (IBean bean: beans) {
if(bean instanceof IClassBean) {
Set<IObserverMethod> observers = ((IClassBean)bean).getObserverMethods();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2011-10-15 00:34:31 UTC (rev 35681)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/InjectedPointHyperlinkDetector.java 2011-10-15 00:43:08 UTC (rev 35682)
@@ -14,13 +14,13 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.ICodeAssist;
-import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
@@ -54,31 +54,23 @@
int offset= region.getOffset();
- IJavaElement input= EditorUtility.getEditorInputJavaElement(textEditor, false);
+ IJavaElement input= EditorUtility.getEditorInputJavaElement(textEditor, true);
if (input == null)
return null;
- if (input.getResource() == null || input.getResource().getProject() == null)
- return null;
-
document= textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
IRegion wordRegion= JavaWordFinder.findWord(document, offset);
if (wordRegion == null)
return null;
- IFile file = null;
+ IProject project = null;
- try {
- IResource resource = input.getCorrespondingResource();
- if (resource instanceof IFile)
- file = (IFile) resource;
- } catch (JavaModelException e) {
- CDIExtensionsPlugin.log(e);
- }
+ project = input.getJavaProject().getProject();
- if(file == null)
+ if(project == null)
return null;
- CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(file.getProject());
+
+ CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(project);
if(cdiNature == null)
return null;
@@ -94,17 +86,20 @@
ArrayList<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
int position = 0;
if(elements[0] instanceof IType){
- ICompilationUnit cUnit = (ICompilationUnit)input;
- elements[0] = cUnit.getElementAt(wordRegion.getOffset());
+ if(input instanceof ITypeRoot){
+ ITypeRoot cUnit = (ITypeRoot)input;
+ elements[0] = cUnit.getElementAt(wordRegion.getOffset());
+ }
if(elements[0] == null)
return null;
+
if(elements[0] instanceof IMethod){
position = offset;
}
}
- findInjectedBeans(cdiNature, elements[0], position, file, hyperlinks);
+ findInjectedBeans(cdiNature, elements[0], position, input.getPath(), hyperlinks);
if (hyperlinks != null && !hyperlinks.isEmpty()) {
return (IHyperlink[])hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);
@@ -115,14 +110,14 @@
return null;
}
- protected void findInjectedBeans(CDICoreNature nature, IJavaElement element, int offset, IFile file, ArrayList<IHyperlink> hyperlinks){
+ protected void findInjectedBeans(CDICoreNature nature, IJavaElement element, int offset, IPath path, ArrayList<IHyperlink> hyperlinks){
ICDIProject cdiProject = nature.getDelegate();
if(cdiProject == null){
return;
}
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Set<IBean> beans = cdiProject.getBeans(path);
IInjectionPoint injectionPoint = CDIUtil.findInjectionPoint(beans, element, offset);
if(injectionPoint == null){
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java 2011-10-15 00:34:31 UTC (rev 35681)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/ProducerDisposerHyperlinkDetector.java 2011-10-15 00:43:08 UTC (rev 35682)
@@ -14,13 +14,13 @@
import java.util.List;
import java.util.Set;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.ICodeAssist;
-import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
@@ -52,32 +52,23 @@
int offset= region.getOffset();
- IJavaElement input= EditorUtility.getEditorInputJavaElement(textEditor, false);
+ IJavaElement input= EditorUtility.getEditorInputJavaElement(textEditor, true);
if (input == null)
return null;
- if (input.getResource() == null || input.getResource().getProject() == null)
- return null;
-
IDocument document= textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
IRegion wordRegion= JavaWordFinder.findWord(document, offset);
if (wordRegion == null)
return null;
- IFile file = null;
+ IProject project = null;
- try {
- IResource resource = input.getCorrespondingResource();
- if (resource instanceof IFile)
- file = (IFile) resource;
- } catch (JavaModelException e) {
- CDIExtensionsPlugin.log(e);
- }
+ project = input.getJavaProject().getProject();
- if(file == null)
+ if(project == null)
return null;
- Set<IBean> beans = getBeans(file);
+ Set<IBean> beans = getBeans(project, input.getPath());
if(beans == null)
return null;
@@ -94,8 +85,10 @@
ArrayList<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();
if(elements[0] instanceof IType){
if(CDIConstants.PRODUCES_ANNOTATION_TYPE_NAME.equals(((IType) elements[0]).getFullyQualifiedName())){
- ICompilationUnit cUnit = (ICompilationUnit)input;
- elements[0] = cUnit.getElementAt(wordRegion.getOffset());
+ if(input instanceof ITypeRoot){
+ ITypeRoot cUnit = (ITypeRoot)input;
+ elements[0] = cUnit.getElementAt(wordRegion.getOffset());
+ }
if(elements[0] == null)
return null;
}
@@ -132,8 +125,8 @@
return null;
}
- private Set<IBean> getBeans(IFile file){
- CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(file.getProject());
+ private Set<IBean> getBeans(IProject project, IPath path){
+ CDICoreNature cdiNature = CDIUtil.getCDINatureWithProgress(project);
if(cdiNature == null)
return null;
@@ -145,7 +138,7 @@
return null;
- Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+ Set<IBean> beans = cdiProject.getBeans(path);
return beans;
}
13 years, 3 months
JBoss Tools SVN: r35681 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-14 20:34:31 -0400 (Fri, 14 Oct 2011)
New Revision: 35681
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccessFactory.java
Log:
JBIDE-9917
https://issues.jboss.org/browse/JBIDE-9917
Method synchronization.
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccessFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccessFactory.java 2011-10-14 23:55:54 UTC (rev 35680)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/JarAccessFactory.java 2011-10-15 00:34:31 UTC (rev 35681)
@@ -7,7 +7,7 @@
static Map<String, JarAccess> jars = new HashMap<String, JarAccess>();
- public static JarAccess getJarAccess(String location, JarSystemImpl context) {
+ public synchronized static JarAccess getJarAccess(String location, JarSystemImpl context) {
JarAccess jar = jars.get(location);
if(jar == null) {
jar = new JarAccess();
13 years, 3 months
JBoss Tools SVN: r35680 - trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-14 19:55:54 -0400 (Fri, 14 Oct 2011)
New Revision: 35680
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java
Log:
JBIDE-9347
https://issues.jboss.org/browse/JBIDE-9347
Beans left after resolution process, are shown in bold font.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java 2011-10-14 22:14:05 UTC (rev 35679)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.text.ext/src/org/jboss/tools/cdi/text/ext/hyperlink/AssignableBeansDialog.java 2011-10-14 23:55:54 UTC (rev 35680)
@@ -562,17 +562,20 @@
static Color gray = new Color(null, 128, 128, 128);
static Color black = new Color(null, 0, 0, 0);
- static Styler ELIGIBLE_NAME = new DefaultStyler(black, false);
- static Styler ELIGIBLE_QUALIFIER = new DefaultStyler(gray, false);
- static Styler DISABLED = new DefaultStyler(gray, false);
+ static Styler RESOLVED_NAME = new DefaultStyler(black, true, false);
+ static Styler ELIGIBLE_NAME = new DefaultStyler(black, false, false);
+ static Styler ELIGIBLE_QUALIFIER = new DefaultStyler(gray, false, false);
+ static Styler DISABLED = new DefaultStyler(gray, false, false);
private static class DefaultStyler extends Styler {
- private final Color foreground;
- private final boolean italic;
+ private Color foreground;
+ private boolean bold;
+ private boolean italic;
- public DefaultStyler(Color foreground, boolean italic) {
+ public DefaultStyler(Color foreground, boolean bold, boolean italic) {
this.foreground = foreground;
this.italic = italic;
+ this.bold = bold;
}
public void applyStyles(TextStyle textStyle) {
@@ -582,6 +585,9 @@
if(italic) {
textStyle.font = JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT);
}
+ if(bold) {
+ textStyle.font = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
+ }
}
}
@@ -602,7 +608,9 @@
}
public StyledString getStyledText(Object element) {
IBean b = (IBean)element;
- Styler nameStyler = eligibleBeans.contains(b) ? ELIGIBLE_NAME : DISABLED;
+ RESOLVED_NAME = new DefaultStyler(black, true, false);
+ Styler nameStyler = resolvedBeans.contains(b) ? RESOLVED_NAME
+ : eligibleBeans.contains(b) ? ELIGIBLE_NAME : DISABLED;
StyledString sb = new StyledString();
//1.bean kind
13 years, 3 months
JBoss Tools SVN: r35679 - trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-14 18:14:05 -0400 (Fri, 14 Oct 2011)
New Revision: 35679
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java
Log:
JBIDE-9852
https://issues.jboss.org/browse/JBIDE-9852
One more commit for generic bean.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java 2011-10-14 20:32:42 UTC (rev 35678)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.seam.text.ext/src/org/jboss/tools/cdi/seam/text/ext/hyperlink/GenericInjectedPointHyperlinkDetector.java 2011-10-14 22:14:05 UTC (rev 35679)
@@ -158,7 +158,7 @@
resultBeanSet2.add(gpb);
}
} else if(injectionPoint.getClassBean() instanceof GenericClassBean
- && injectionPoint.isAnnotationPresent(CDISeamSolderConstants.INJECT_GENERIC_ANNOTATION_TYPE_NAME)) {
+ && injectionPoint.isAnnotationPresent(((GenericClassBean)injectionPoint.getClassBean()).getVersion().getInjectGenericAnnotationTypeName())) {
resultBeanSet2.add(b);
}
}
13 years, 3 months
JBoss Tools SVN: r35678 - in trunk/common/tests/org.jboss.tools.common.model.test: .settings and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-14 16:32:42 -0400 (Fri, 14 Oct 2011)
New Revision: 35678
Added:
trunk/common/tests/org.jboss.tools.common.model.test/.settings/
trunk/common/tests/org.jboss.tools.common.model.test/.settings/org.eclipse.jdt.core.prefs
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.classpath
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.project
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/src/
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.classpath
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.project
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/src/
Modified:
trunk/common/tests/org.jboss.tools.common.model.test/projects/Test1/.classpath
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java
Log:
JBIDE-9906
https://issues.jboss.org/browse/JBIDE-9906
Jars exported by parent projects are taken into account.
Added: trunk/common/tests/org.jboss.tools.common.model.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.test/.settings/org.eclipse.jdt.core.prefs 2011-10-14 20:32:42 UTC (rev 35678)
@@ -0,0 +1,8 @@
+#Fri Sep 30 12:13:48 PDT 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test/.settings/org.eclipse.jdt.core.prefs
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test1/.classpath
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/projects/Test1/.classpath 2011-10-14 20:30:20 UTC (rev 35677)
+++ trunk/common/tests/org.jboss.tools.common.model.test/projects/Test1/.classpath 2011-10-14 20:32:42 UTC (rev 35678)
@@ -2,6 +2,6 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="lib/a.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/a.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.classpath
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.classpath (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.classpath 2011-10-14 20:32:42 UTC (rev 35678)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" exported="true" kind="src" path="/Test1"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.project (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.project 2011-10-14 20:32:42 UTC (rev 35678)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Test4</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test4/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.classpath
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.classpath (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.classpath 2011-10-14 20:32:42 UTC (rev 35678)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/Test4"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.classpath
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.project (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.project 2011-10-14 20:32:42 UTC (rev 35678)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Test5</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/common/tests/org.jboss.tools.common.model.test/projects/Test5/.project
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java 2011-10-14 20:30:20 UTC (rev 35677)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java 2011-10-14 20:32:42 UTC (rev 35678)
@@ -3,7 +3,7 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
-import java.util.List;
+import java.util.Collection;
import junit.framework.TestCase;
@@ -27,12 +27,14 @@
import org.osgi.framework.Bundle;
/**
- * Automatic test for JBIDE-1811.
- * Checks that EclipseResourceUtil.getClassPath(IProject)
+ * Automatic test for JBIDE-1811 & 9906.
+ * Checks that EclipseResourceUtil.getAllVisibleLibraries(IProject)
* returns list which includes paths for Eclipse class path entries:
* 1. jars from the same project;
* 2. jars from another project in Eclipse work space;
* 3. external jars.
+ * 4. exported jars from a parent project
+ * 5. exported jars from a project exported by parent project
*
* @author V.Kabanovich
*
@@ -43,6 +45,10 @@
IProject project1 = null;
TestProjectProvider provider2 = null;
IProject project2 = null;
+ TestProjectProvider provider4 = null;
+ IProject project4 = null;
+ TestProjectProvider provider5 = null;
+ IProject project5 = null;
public ClassPathTest() {}
@@ -53,8 +59,16 @@
provider2 = new TestProjectProvider(BUNDLE_NAME, null, "Test2", true);
project2 = provider2.getProject();
+ provider4 = new TestProjectProvider(BUNDLE_NAME, null, "Test4", true);
+ project4 = provider4.getProject();
+
+ provider5 = new TestProjectProvider(BUNDLE_NAME, null, "Test5", true);
+ project5 = provider5.getProject();
+
project1.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
project2.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ project4.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ project5.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
JobUtils.waitForIdle();
@@ -95,17 +109,26 @@
}
public void testGetClassPath() throws CoreException, IOException {
- List<String> list = EclipseResourceUtil.getClassPath(project2);
+ Collection<String> list = EclipseResourceUtil.getAllVisibleLibraries(project2);
String[] testNames = {
"/Test2/lib/b.jar", //1. jar from this project
"/Test1/lib/a.jar", //2. jar from another project
- "/Test3/lib/c.jar" //3. external jar
+ "/Test3/lib/c.jar" //3. external jar
};
for (int i = 0; i < testNames.length; i++) {
assertTrue("Cannot find classpath entry " + testNames[i], contains(list, testNames[i]));
}
+ //4. exported jars from a parent project
+ String testName = "/Test1/lib/a.jar";
+ list = EclipseResourceUtil.getAllVisibleLibraries(project4);
+ assertTrue("Cannot find classpath entry " + testName, contains(list, testName));
+
+ //5. exported jars from a project exported by parent project
+ testName = "/Test1/lib/a.jar";
+ list = EclipseResourceUtil.getAllVisibleLibraries(project5);
+ assertTrue("Cannot find classpath entry " + testName, contains(list, testName));
}
private String getLocation(String relativeInBundle) throws IOException {
@@ -116,11 +139,13 @@
}
public void tearDown() {
+ provider5.dispose();
+ provider4.dispose();
provider2.dispose();
provider1.dispose();
}
- private boolean contains(List<String> list, String name) {
+ private boolean contains(Collection<String> list, String name) {
for (String s: list) {
if(s.replace('\\', '/').endsWith(name.replace('\\', '/'))) {
return true;
13 years, 3 months
JBoss Tools SVN: r35677 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-14 16:30:20 -0400 (Fri, 14 Oct 2011)
New Revision: 35677
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/Libs.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
JBIDE-9906
https://issues.jboss.org/browse/JBIDE-9906
Jars exported by parent projects are taken into account.
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/Libs.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/Libs.java 2011-10-14 18:56:11 UTC (rev 35676)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/filesystems/impl/Libs.java 2011-10-14 20:30:20 UTC (rev 35677)
@@ -11,7 +11,6 @@
package org.jboss.tools.common.model.filesystems.impl;
import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -20,15 +19,18 @@
import java.util.Set;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.ElementChangedEvent;
+import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IElementChangedListener;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaElementDelta;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.XModelObjectConstants;
import org.jboss.tools.common.model.plugin.ModelPlugin;
@@ -44,6 +46,7 @@
protected FileSystemsImpl object;
protected List<String> paths = null;
Map<IPath, String> paths2 = new HashMap<IPath, String>();
+ Set<String> projects = new HashSet<String>();
LibraryNames libraryNames = new LibraryNames();
@@ -58,11 +61,6 @@
}
private IProject getProjectResource() {
- try {
- EclipseResourceUtil.getProject(object);
- } catch (NullPointerException e) {
- e.printStackTrace();
- }
return EclipseResourceUtil.getProject(object);
}
@@ -107,17 +105,33 @@
private List<String> getNewPaths() {
List<String> result = null;
try {
- result = EclipseResourceUtil.getClassPath(getProjectResource());
+ result = EclipseResourceUtil.getAllVisibleLibraries(getProjectResource());
List<String> jre = EclipseResourceUtil.getJREClassPath(getProjectResource());
if(jre != null) result.removeAll(jre);
+ updateProjects();
} catch (CoreException e) {
ModelPlugin.getDefault().logError(e);
- } catch(IOException e) {
- ModelPlugin.getDefault().logError(e);
}
return result;
}
+ private void updateProjects() throws JavaModelException {
+ Set<String> result = new HashSet<String>();
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(getProjectResource());
+ if(javaProject != null) {
+ result.add(getProjectResource().getName());
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
+ if(p == null || !p.isAccessible()) continue;
+ result.add(p.getName());
+ }
+ }
+ }
+ projects = result;
+ }
+
private synchronized boolean updatePaths(List<String> newPaths, int cpv) {
if(cpv <= pathsVersion) {
return false;
@@ -247,32 +261,30 @@
return;
}
- IJavaElementDelta d = event.getDelta();
- IJavaElementDelta[] ds = d.getAffectedChildren();
- IJavaElementDelta p = null;
-
- for (IJavaElementDelta dc: ds) {
- if(dc.getElement() instanceof IJavaProject && ((IJavaProject)dc.getElement()).getProject() == project) {
- p = dc;
- }
- }
- if(p == null) return;
- int f = p.getFlags();
- if((f & (IJavaElementDelta.F_CLASSPATH_CHANGED
- | IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED)) != 0) {
- requestForUpdate();
- } else {
- IJavaElementDelta[] ds1 = p.getAffectedChildren();
- for (IJavaElementDelta d1: ds1) {
- IJavaElement e = d1.getElement();
- if(d1.getKind() == IJavaElementDelta.ADDED) {
+ for (IJavaElementDelta dc: event.getDelta().getAffectedChildren()) {
+ if(dc.getElement() instanceof IJavaProject && (isReleventProject(((IJavaProject)dc.getElement()).getProject()))) {
+ int f = dc.getFlags();
+ if((f & (IJavaElementDelta.F_CLASSPATH_CHANGED
+ | IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED)) != 0) {
requestForUpdate();
- break;
+ return;
+ } else {
+ for (IJavaElementDelta d1: dc.getAffectedChildren()) {
+ IJavaElement e = d1.getElement();
+ if(d1.getKind() == IJavaElementDelta.ADDED) {
+ requestForUpdate();
+ return;
+ }
+ }
}
}
}
}
+ private boolean isReleventProject(IProject p) {
+ return projects.contains(p.getName());
+ }
+
}
class LibraryNames {
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-10-14 18:56:11 UTC (rev 35676)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2011-10-14 20:30:20 UTC (rev 35677)
@@ -635,58 +635,58 @@
* @throws IOException
*/
public static List<String> getClassPath(IProject project) throws CoreException, IOException {
- if(project == null || !project.isAccessible() || !project.hasNature(JavaCore.NATURE_ID)) return null;
+ IJavaProject javaProject = getJavaProject(project);
+ if(javaProject == null) {
+ return null;
+ }
+
ArrayList<String> l = new ArrayList<String>();
- IJavaProject javaProject = JavaCore.create(project);
-
IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
for (int i = 0; i < es.length; i++) {
if(es[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
- String s = null;
- String path = es[i].getPath().toString();
- try {
- //First let's check if path is defined within Eclipse work space.
- if(path.startsWith(XModelObjectConstants.SEPARATOR) && path.indexOf(XModelObjectConstants.SEPARATOR, 1) > 1) {
- IResource findMember = ResourcesPlugin.getWorkspace().getRoot().findMember(es[i].getPath());
- if(findMember != null) {
- s = findMember.getLocation().toString();
- }
- }
- //If search in Eclipse work space has failed, this is a useless attempt, but
- //let keep it just in case (this is good old code that worked for a long while).
- if(s == null && path.startsWith(XModelObjectConstants.SEPARATOR + project.getName() + XModelObjectConstants.SEPARATOR)) {
- IResource findMember = project.findMember(es[i].getPath().removeFirstSegments(1));
- if(findMember != null) {
- s = findMember.getLocation().toString();
- }
- }
-
- //If we failed to find resource in Eclipse work space,
- //lets try the path as absolute on disk
- if(s == null && new java.io.File(path).exists()) {
- s = path;
- }
- if(s != null) {
- l.add(new java.io.File(s).getCanonicalPath());
- }
- } catch (IOException e) {
- //ignore - we do not care about malformed URLs in classpath here.
+ String s = expandPath(es[i].getPath(), project);
+ if(s != null) {
+ l.add(s);
}
- } else if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
-// IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
-// if(p == null || !p.isAccessible()) continue;
-// if(p.hasNature(JavaCore.NATURE_ID)
-// && !p.hasNature("org.jboss.tools.jst.web.kb.kbnature")
-// && project.hasNature("org.jboss.tools.jst.web.kb.kbnature")) {
-// String[] srcs = getJavaProjectSrcLocations(p);
-// for (String s: srcs) l.add(s);
-// }
-
}
}
return l;
}
+
+ static String expandPath(IPath ipath, IProject project) {
+ String s = null;
+ String path = ipath.toString();
+ //First let's check if path is defined within Eclipse work space.
+ if(path.startsWith(XModelObjectConstants.SEPARATOR) && path.indexOf(XModelObjectConstants.SEPARATOR, 1) > 1) {
+ IResource findMember = ResourcesPlugin.getWorkspace().getRoot().findMember(ipath);
+ if(findMember != null) {
+ s = findMember.getLocation().toString();
+ }
+ }
+ //If search in Eclipse work space has failed, this is a useless attempt, but
+ //let keep it just in case (this is good old code that worked for a long while).
+ if(s == null && path.startsWith(XModelObjectConstants.SEPARATOR + project.getName() + XModelObjectConstants.SEPARATOR)) {
+ IResource findMember = project.findMember(ipath.removeFirstSegments(1));
+ if(findMember != null) {
+ s = findMember.getLocation().toString();
+ }
+ }
+ //If we failed to find resource in Eclipse work space,
+ //lets try the path as absolute on disk
+ if(s == null && new java.io.File(path).exists()) {
+ s = path;
+ }
+ try {
+ if(s != null) {
+ return new java.io.File(s).getCanonicalPath();
+ }
+ } catch (IOException e) {
+ //ignore - we do not care about malformed URLs in classpath here.
+ }
+ return null;
+ }
+
public static List<String> getJREClassPath(IProject project) throws CoreException {
if(project == null || !project.isAccessible() || !project.hasNature(JavaCore.NATURE_ID)) return null;
ArrayList<String> l = new ArrayList<String>();
@@ -904,6 +904,56 @@
return new SourceFoldersCollector(project).folders;
}
+ private static class LibraryCollector {
+ IProject project;
+ List<String> ordered = new ArrayList<String>();
+ Set<String> paths = new HashSet<String>();
+ Set<IProject> processed = new HashSet<IProject>();
+
+ LibraryCollector(IProject project) {
+ this.project = project;
+ process(project);
+ }
+
+ void process(IProject project) {
+ if(processed.contains(project)) {
+ return;
+ }
+ processed.add(project);
+ IJavaProject javaProject = getJavaProject(project);
+ if(javaProject == null) {
+ return;
+ }
+ IClasspathEntry[] es = null;
+ try {
+ es = javaProject.getResolvedClasspath(true);
+ } catch (CoreException e) {
+ ModelPlugin.getDefault().logError(e);
+ return;
+ }
+ for (int i = 0; i < es.length; i++) {
+ if(project == this.project || es[i].isExported()) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+ IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(es[i].getPath().lastSegment());
+ if(p != null && p.isAccessible()) {
+ process(p);
+ }
+ } else if(es[i].getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
+ String s = expandPath(es[i].getPath(), project);
+ if(s != null && !paths.contains(s)) {
+ paths.add(s);
+ ordered.add(s);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public static List<String> getAllVisibleLibraries(IProject project) {
+ return new LibraryCollector(project).ordered;
+ }
+
public static void openResource(IResource resource) {
XModelObject o = getObjectByResource(resource);
if(o == null) o = createObjectForResource(resource);
13 years, 3 months
JBoss Tools SVN: r35676 - in trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central: editors and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-14 14:56:11 -0400 (Fri, 14 Oct 2011)
New Revision: 35676
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/NewsEntry.java
Log:
JBIDE-9368 Dashboard(s) for easy news aggregation, twitter and easy additional/3rd party plugin installation and project template/creation
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java 2011-10-14 18:53:24 UTC (rev 35675)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/dialogs/ProjectExamplesDialog.java 2011-10-14 18:56:11 UTC (rev 35676)
@@ -353,7 +353,7 @@
@Override
protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, "Run",
+ createButton(parent, IDialogConstants.OK_ID, "Start",
true);
createButton(parent, IDialogConstants.CANCEL_ID,
IDialogConstants.CANCEL_LABEL, false);
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-14 18:53:24 UTC (rev 35675)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-14 18:56:11 UTC (rev 35676)
@@ -419,6 +419,7 @@
IExtension[] extensions = extensionPoint.getExtensions();
List<String> wizardIDs = new ArrayList<String>();
+ wizardIDs.add("org.jboss.ide.eclipse.as.openshift.express.ui.wizard.NewServerAdapter");
wizardIDs.add("org.eclipse.jst.servlet.ui.project.facet.WebProjectWizard");
wizardIDs.add("org.jboss.tools.seam.ui.wizards.SeamProjectWizard");
wizardIDs.add("org.eclipse.m2e.core.wizards.Maven2ProjectWizard");
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-10-14 18:53:24 UTC (rev 35675)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/JBossCentralEditor.java 2011-10-14 18:56:11 UTC (rev 35676)
@@ -17,7 +17,6 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.swt.SWT;
@@ -28,7 +27,6 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
@@ -129,12 +127,12 @@
}
setPageImage(index, gettingStartedImage);
- /*softwarePage = new SoftwarePage(this);
+ softwarePage = new SoftwarePage(this);
index = addPage(softwarePage);
if (softwareImage == null) {
softwareImage = JBossCentralActivator.getImageDescriptor("/icons/software.png").createImage();
}
- setPageImage(index, softwareImage);*/
+ setPageImage(index, softwareImage);
} catch (PartInitException e) {
JBossCentralActivator.log(e, "Error adding page");
@@ -164,24 +162,24 @@
headerComposite.setLayout(new GridLayout(2, false));
headerComposite.setBackground(null);
- Button showOnStartup = getToolkit().createButton(headerComposite, "Show on Startup", SWT.CHECK);
- showOnStartup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
- showOnStartup.setBackground(null);
- showOnStartup.setSelection(JBossCentralActivator.getDefault().showJBossCentralOnStartup());
- showOnStartup.addSelectionListener(new SelectionAdapter() {
+// Button showOnStartup = getToolkit().createButton(headerComposite, "Show on Startup", SWT.CHECK);
+// showOnStartup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
+// showOnStartup.setBackground(null);
+// showOnStartup.setSelection(JBossCentralActivator.getDefault().showJBossCentralOnStartup());
+// showOnStartup.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// IEclipsePreferences preferences = JBossCentralActivator.getDefault().getPreferences();
+// boolean showOnStartup = preferences.getBoolean(JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP, JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
+// preferences.putBoolean(JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP, !showOnStartup);
+// JBossCentralActivator.getDefault().savePreferences();
+// }
+//
+// });
- @Override
- public void widgetSelected(SelectionEvent e) {
- IEclipsePreferences preferences = JBossCentralActivator.getDefault().getPreferences();
- boolean showOnStartup = preferences.getBoolean(JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP, JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE);
- preferences.putBoolean(JBossCentralActivator.SHOW_JBOSS_CENTRAL_ON_STARTUP, !showOnStartup);
- JBossCentralActivator.getDefault().savePreferences();
- }
-
- });
-
Composite searchComposite = getToolkit().createComposite(headerComposite);
- GridData gd = new GridData(SWT.END, SWT.FILL, true, true);
+ GridData gd = new GridData(SWT.BEGINNING, SWT.FILL, true, true);
gd.widthHint = 200;
searchComposite.setLayoutData(gd);
searchComposite.setBackground(null);
@@ -308,6 +306,7 @@
});
form.getForm().setHeadClient(headerComposite);
+ //form.getForm().setToolBarVerticalAlignment(SWT.BOTTOM);
IToolBarManager toolbar = form.getToolBarManager();
CommandContributionItem item = JBossCentralActivator.createContributionItem(getSite(), "org.jboss.tools.central.openJBossToolsHome");
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/NewsEntry.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/NewsEntry.java 2011-10-14 18:53:24 UTC (rev 35675)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/model/NewsEntry.java 2011-10-14 18:56:11 UTC (rev 35676)
@@ -3,6 +3,7 @@
import java.util.Date;
import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.commons.lang.StringUtils;
import org.jboss.tools.central.JBossCentralActivator;
import com.ocpsoft.pretty.time.PrettyTime;
@@ -74,7 +75,7 @@
buffer.append("<a href=\"");
buffer.append(link);
buffer.append("\">");
- buffer.append(title);
+ buffer.append(StringEscapeUtils.unescapeXml(title));
buffer.append("</a>");
} else {
buffer.append(title);
13 years, 3 months
JBoss Tools SVN: r35675 - trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-10-14 14:53:24 -0400 (Fri, 14 Oct 2011)
New Revision: 35675
Modified:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
Log:
Updated test in order to check images in Content Assistant https://issues.jboss.org/browse/JBIDE-9897
Modified: trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java 2011-10-14 18:39:46 UTC (rev 35674)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java 2011-10-14 18:53:24 UTC (rev 35675)
@@ -91,6 +91,9 @@
public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, Image[] images, boolean exactly) {
return checkProposals(fileName, substring, offset, proposals, images, exactly, false);
}
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly, boolean excludeELProposalsFromExactTest){
+ return checkProposals(fileName, substring, offset, proposals, null, exactly, excludeELProposalsFromExactTest);
+ }
public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, Image[] images, boolean exactly, boolean excludeELProposalsFromExactTest){
if(images != null){
13 years, 3 months
JBoss Tools SVN: r35674 - in trunk: common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-10-14 14:39:46 -0400 (Fri, 14 Oct 2011)
New Revision: 35674
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
Log:
Updated test in order to check images in Content Assistant https://issues.jboss.org/browse/JBIDE-9897
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java 2011-10-14 18:15:12 UTC (rev 35673)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/CATest.java 2011-10-14 18:39:46 UTC (rev 35674)
@@ -14,6 +14,8 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.cdi.core.CDIImages;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
@@ -26,7 +28,9 @@
private ContentAssistantTestCase caTest = new ContentAssistantTestCase();
private static final String PAGE_NAME = "WebContent/test.jsp";
private String[] beanProposals = new String[] {"example", "example.com", "fishJBT", "game", "haddock", "salmon", "sheep", "tunaFarm", "whitefishJBT", "wolf"};
+ private Image[] beanImages = new Image[] {CDIImages.BEAN_CLASS_IMAGE, CDIImages.BEAN_CLASS_IMAGE, CDIImages.BEAN_CLASS_IMAGE, CDIImages.BEAN_CLASS_IMAGE, CDIImages.BEAN_CLASS_IMAGE, CDIImages.BEAN_CLASS_IMAGE, CDIImages.BEAN_CLASS_IMAGE, CDIImages.BEAN_CLASS_IMAGE, CDIImages.BEAN_CLASS_IMAGE, CDIImages.BEAN_CLASS_IMAGE};
private String[] propertyProposals = new String[] {"game.value", "game.initialize()"};
+ private Image[] propertyImages = new Image[] {CDIImages.BEAN_FIELD_IMAGE, CDIImages.BEAN_METHOD_IMAGE};
public void setUp() {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(TCKTest.PROJECT_NAME);
@@ -34,7 +38,16 @@
}
public void testEL() {
- caTest.checkProposals(PAGE_NAME, "value=\"#{", 9, beanProposals, false);
- caTest.checkProposals(PAGE_NAME, "rendered=\"#{(game.", 18, propertyProposals, false);
+// System.out.println("BEAN_CLASS_IMAGE - "+CDIImages.BEAN_CLASS_IMAGE);
+// System.out.println("BEAN_METHOD_IMAGE - "+CDIImages.BEAN_METHOD_IMAGE);
+// System.out.println("BEAN_FIELD_IMAGE - "+CDIImages.BEAN_FIELD_IMAGE);
+//
+// System.out.println("INJECTION_POINT_IMAGE - "+CDIImages.INJECTION_POINT_IMAGE);
+// System.out.println("ANNOTATION_IMAGE - "+CDIImages.ANNOTATION_IMAGE);
+// System.out.println("CDI_EVENT_IMAGE - "+CDIImages.CDI_EVENT_IMAGE);
+// System.out.println("MESSAGE_BUNDLE_IMAGE - "+CDIImages.MESSAGE_BUNDLE_IMAGE);
+
+ caTest.checkProposals(PAGE_NAME, "value=\"#{", 9, beanProposals, beanImages, false);
+ caTest.checkProposals(PAGE_NAME, "rendered=\"#{(game.", 18, propertyProposals, propertyImages, false);
}
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java 2011-10-14 18:15:12 UTC (rev 35673)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java 2011-10-14 18:39:46 UTC (rev 35674)
@@ -23,6 +23,7 @@
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.texteditor.ITextEditor;
@@ -80,13 +81,22 @@
}
public ICompletionProposal[] checkProposals(String fileName, int offset, String[] proposals, boolean exactly) {
- return checkProposals(fileName, null, offset, proposals, exactly, true);
+ return checkProposals(fileName, null, offset, proposals, null, exactly, true);
}
public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly) {
- return checkProposals(fileName, substring, offset, proposals, exactly, false);
+ return checkProposals(fileName, substring, offset, proposals, null, exactly, false);
}
- public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, boolean exactly, boolean excludeELProposalsFromExactTest){
+
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, Image[] images, boolean exactly) {
+ return checkProposals(fileName, substring, offset, proposals, images, exactly, false);
+ }
+
+ public ICompletionProposal[] checkProposals(String fileName, String substring, int offset, String[] proposals, Image[] images, boolean exactly, boolean excludeELProposalsFromExactTest){
+ if(images != null){
+ assertEquals("number of images and number of proposals must be the same or images must be null", proposals.length, images.length);
+ }
+
openEditor(fileName);
int position = 0;
@@ -111,7 +121,12 @@
sb.append("]");
int foundCounter = 0;
for (int i = 0; i < proposals.length; i++) {
- boolean found = compareProposal(proposals[i], result);
+ Image image = null;
+ if(images != null){
+ image = images[i];
+ }
+ boolean found = compareProposal(proposals[i], image, result);
+
if (found)
foundCounter++;
assertTrue("Proposal " + proposals[i] + " not found! Found proposals: " + sb.toString(), found ); //$NON-NLS-1$ //$NON-NLS-2$
@@ -139,12 +154,12 @@
return false;
}
- public boolean compareProposal(String proposalName, ICompletionProposal[] proposals){
+ public boolean compareProposal(String proposalName, Image image, ICompletionProposal[] proposals){
for (int i = 0; i < proposals.length; i++) {
if (isRelevantProposal(proposals[i])) {
CustomCompletionProposal ap = (CustomCompletionProposal)proposals[i];
String replacementString = ap.getReplacementString().toLowerCase();
- if (replacementString.equalsIgnoreCase(proposalName)) return true;
+ if (replacementString.equalsIgnoreCase(proposalName)) return compareImages(image, proposals[i]);
// For a tag proposal there will be not only the the tag name but all others characters like default attributes, tag ending characters and so on
if (replacementString.indexOf("/>") != -1) {
@@ -153,36 +168,44 @@
if (replacementString.indexOf('>') != -1) {
replacementString = replacementString.substring(0, replacementString.indexOf('>'));
}
- if (replacementString.equalsIgnoreCase(proposalName)) return true;
+ if (replacementString.equalsIgnoreCase(proposalName)) return compareImages(image, proposals[i]);
String[] replacementStringParts = replacementString.split(" "); //$NON-NLS-1$
if (replacementStringParts != null && replacementStringParts.length > 0) {
- if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return compareImages(image, proposals[i]);
}
// for an attribute proposal there will be a pare of attribute-value (i.e. attrName="attrValue")
replacementStringParts = replacementString.split("="); //$NON-NLS-1$
if (replacementStringParts != null && replacementStringParts.length > 0) {
- if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return compareImages(image, proposals[i]);
}
// for an Unclosed EL the closing character is appended to the proposal string (i.e. person} )
// perform case insensitive compare operation
replacementStringParts = replacementString.split("}"); //$NON-NLS-1$
if (replacementStringParts != null && replacementStringParts.length > 0) {
- if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return true;
+ if (replacementStringParts[0].equalsIgnoreCase(proposalName)) return compareImages(image, proposals[i]);
}
// For an attribute value proposal there will be the quote characters
replacementString = Utils.trimQuotes(replacementString);
- if (replacementString.equalsIgnoreCase(proposalName)) return true;
+ if (replacementString.equalsIgnoreCase(proposalName)) return compareImages(image, proposals[i]);
} else {
- if(proposals[i].getDisplayString().toLowerCase().equals(proposalName.toLowerCase())) return true;
+ if(proposals[i].getDisplayString().toLowerCase().equals(proposalName.toLowerCase())) return compareImages(image, proposals[i]);
}
}
return false;
}
+
+ private boolean compareImages(Image expected, ICompletionProposal proposal){
+ if(expected != null){
+ //System.out.println("<"+proposal.getDisplayString()+"> completion proposal image - "+proposal.getImage());
+ assertEquals("<"+proposal.getDisplayString()+"> completion proposal returns wrong image", expected, proposal.getImage());
+ }
+ return true;
+ }
public void closeEditor() {
if (editorPart != null) {
13 years, 3 months
JBoss Tools SVN: r35673 - trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2011-10-14 14:15:12 -0400 (Fri, 14 Oct 2011)
New Revision: 35673
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java
Log:
Fixed failing test
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 17:07:21 UTC (rev 35672)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/international/BundleModelTest.java 2011-10-14 18:15:12 UTC (rev 35673)
@@ -35,9 +35,15 @@
}
public void testIncrementalBuildAtAddRemoveExtension() throws Exception {
+ IBundleModel originalBundleModel = BundleModelFactory.getBundleModel(getTestProject());
+ assertNotNull(originalBundleModel);
+
+ Set<String> originalBundles = originalBundleModel.getAllAvailableBundles();
+ assertFalse(originalBundles.isEmpty());
+
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());
@@ -47,6 +53,8 @@
bundleModel = BundleModelFactory.getBundleModel(getTestProject());
assertNotNull(bundleModel);
Set<String> bundles = bundleModel.getAllAvailableBundles();
- assertTrue(bundles.contains("com.sun.corba.se.impl.logging.LogStrings"));
+ for (String string : originalBundles) {
+ assertTrue(bundles.contains(string));
+ }
}
}
\ No newline at end of file
13 years, 3 months