JBoss Tools SVN: r36233 - in trunk/cdi/plugins: org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-11-08 20:06:56 -0500 (Tue, 08 Nov 2011)
New Revision: 36233
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactoringProcessor.java
Log:
Quickfix and Wizard for fixing ambigious injection warning is confusing https://issues.jboss.org/browse/JBIDE-9940
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java 2011-11-08 22:49:58 UTC (rev 36232)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java 2011-11-09 01:06:56 UTC (rev 36233)
@@ -31,6 +31,7 @@
public static String CDI_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE;
public static String CDI_RENAME_PROCESSOR_ERROR_BEAN_NOT_FOUND;
public static String CDI_RENAME_PROCESSOR_ERROR_INJECTION_POINT_NOT_FOUND;
+ public static String CDI_RENAME_PROCESSOR_ERROR_FILE_NOT_FOUND;
public static String CDI_RENAME_PROCESSOR_QUESTION_DIALOG_TITLE;
public static String CDI_RENAME_PROCESSOR_QUESTION_DIALOG_MESSAGE;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties 2011-11-08 22:49:58 UTC (rev 36232)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/messages.properties 2011-11-09 01:06:56 UTC (rev 36233)
@@ -6,6 +6,7 @@
CDI_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE=Cannot change read-only file: ''{0}''.
CDI_RENAME_PROCESSOR_ERROR_BEAN_NOT_FOUND=CDI Bean Class not found
CDI_RENAME_PROCESSOR_ERROR_INJECTION_POINT_NOT_FOUND=CDI Injection Point not found
+CDI_RENAME_PROCESSOR_ERROR_FILE_NOT_FOUND=File not found
CDI_RENAME_PROCESSOR_QUESTION_DIALOG_TITLE=Read-only File Encountered
CDI_RENAME_PROCESSOR_QUESTION_DIALOG_MESSAGE=File ''{0}'' is read-only. Do you wish to make it writable?
RENAME_NAMED_BEAN_PROCESSOR_TITLE=Rename @Named Bean
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-11-08 22:49:58 UTC (rev 36232)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-11-09 01:06:56 UTC (rev 36233)
@@ -687,7 +687,7 @@
else
beanPackage = beanTypeName.substring(0,dotLastIndex);
- if(isPublic || injectionPointPackage.equals(beanPackage))
+ if((isPublic || injectionPointPackage.equals(beanPackage)) && bean.getBeanClass().getResource() != null)
beans.add(bean);
}
}
@@ -719,7 +719,13 @@
private List<IBean> findBeans(IInjectionPoint injectionPoint){
ICDIProject cdiProject = injectionPoint.getCDIProject();
- return CDIUtil.getSortedBeans(cdiProject, false, injectionPoint);
+ List<IBean> beans = CDIUtil.getSortedBeans(cdiProject, false, injectionPoint);
+ for(int i = beans.size()-1;i>= 0;i--){
+ if(beans.get(i).getBeanClass().getResource() == null)
+ beans.remove(i);
+ }
+
+ return beans;
}
private IMethod findMethod(IFile file, int start){
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactoringProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactoringProcessor.java 2011-11-08 22:49:58 UTC (rev 36232)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactoringProcessor.java 2011-11-09 01:06:56 UTC (rev 36233)
@@ -106,7 +106,10 @@
}
protected boolean isFileCorrect(IFile file){
- if(!file.isSynchronized(IResource.DEPTH_ZERO)){
+ if(file == null){
+ status.addFatalError(CDICoreMessages.CDI_RENAME_PROCESSOR_ERROR_FILE_NOT_FOUND);
+ return false;
+ }else if(!file.isSynchronized(IResource.DEPTH_ZERO)){
status.addFatalError(NLS.bind(CDICoreMessages.CDI_RENAME_PROCESSOR_ERROR_OUT_OF_SYNC_PROJECT, file.getProject().getFullPath().toString()));
return false;
}else if(file.isPhantom()){
13 years, 1 month
JBoss Tools SVN: r36232 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-11-08 17:49:58 -0500 (Tue, 08 Nov 2011)
New Revision: 36232
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
Log:
Quickfix and Wizard for fixing ambigious injection warning is confusing https://issues.jboss.org/browse/JBIDE-9940
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-11-08 20:01:25 UTC (rev 36231)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/wizard/xpl/AddQualifiersToBeanComposite.java 2011-11-08 22:49:58 UTC (rev 36232)
@@ -12,14 +12,12 @@
*******************************************************************************/
package org.jboss.tools.cdi.ui.wizard.xpl;
-import java.lang.reflect.InvocationTargetException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.Job;
@@ -31,7 +29,6 @@
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IContentProvider;
@@ -434,21 +431,19 @@
createQualifier.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
- final Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
final IJobManager manager= Job.getJobManager();
// reload qualifiers
if (Display.getCurrent() != null) {
BusyIndicator.showWhile(Display.getCurrent(), new Runnable(){
public void run(){
- manager.endRule(ResourcesPlugin.getWorkspace().getRoot());
-
NewQualifierCreationWizard wizard = new NewQualifierCreationWizard();
StructuredSelection selection = new StructuredSelection(new Object[]{bean.getBeanClass()});
wizard.init(PlatformUI.getWorkbench(), selection);
- WizardDialog dialog = new WizardDialog(shell, wizard);
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
int status = dialog.open();
if(status == WizardDialog.OK){
+ manager.endRule(ResourcesPlugin.getWorkspace().getRoot());
try {
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
} catch (OperationCanceledException e) {
@@ -457,10 +452,9 @@
CDICorePlugin.getDefault().logError(e);
}
loadAvailableQualifiers();
+ manager.beginRule(ResourcesPlugin.getWorkspace().getRoot(), null);
}
- manager.beginRule(ResourcesPlugin.getWorkspace().getRoot(), null);
}
-
});
}
}
13 years, 1 month
JBoss Tools SVN: r36231 - trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-11-08 15:01:25 -0500 (Tue, 08 Nov 2011)
New Revision: 36231
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
Log:
JBIDE-10111
https://issues.jboss.org/browse/JBIDE-10111
Synchronization of set 'processedPaths' is improved.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2011-11-08 19:30:36 UTC (rev 36230)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ELValidator.java 2011-11-08 20:01:25 UTC (rev 36231)
@@ -465,7 +465,7 @@
public boolean shouldValidate(IProject project) {
boolean result = false;
try {
- if(validateBuilderOrder(project) && isEnabled(project)) {
+ if(project.isAccessible() && validateBuilderOrder(project) && isEnabled(project)) {
for (IELValidationDelegate delegate : DELEGATES) {
if(delegate.shouldValidate(project)) {
result = true;
13 years, 1 month
JBoss Tools SVN: r36230 - trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-11-08 14:30:36 -0500 (Tue, 08 Nov 2011)
New Revision: 36230
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/SeamResourceBundleHyperlinkTest.java
Log:
CDI OpenOns do not work on binary (.class) files https://issues.jboss.org/browse/JBIDE-9764
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/SeamResourceBundleHyperlinkTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/SeamResourceBundleHyperlinkTest.java 2011-11-08 19:10:15 UTC (rev 36229)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.text.ext.test/src/org/jboss/tools/cdi/seam/text/ext/test/SeamResourceBundleHyperlinkTest.java 2011-11-08 19:30:36 UTC (rev 36230)
@@ -47,7 +47,7 @@
assertTrue("Hyperlink found is not EL Hyperlink", (hyperlink instanceof ELHyperlink));
}
- CDIHyperlinkTestUtil.checkTestRegion(hyperlinks, testRegion);
+ CDIHyperlinkTestUtil.checkTestRegion(hyperlinks, testRegion, "");
}
}
}
\ No newline at end of file
13 years, 1 month
JBoss Tools SVN: r36229 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-11-08 14:10:15 -0500 (Tue, 08 Nov 2011)
New Revision: 36229
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java
Log:
JBIDE-10111
https://issues.jboss.org/browse/JBIDE-10111
Synchronization of set 'processedPaths' is improved.
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java 2011-11-08 19:09:59 UTC (rev 36228)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java 2011-11-08 19:10:15 UTC (rev 36229)
@@ -80,7 +80,7 @@
public void pathLoaded(IPath path) {
String p = paths2.get(path);
- if(p != null) synchronized (processedPaths) {
+ if(p != null) synchronized (this) {
processedPaths.add(p);
}
}
@@ -97,14 +97,14 @@
paths = new ArrayList<String>();
loaded = false;
if(paths2 != null) paths2.clear();
- synchronized (processedPaths) {
+ synchronized (this) {
processedPaths.clear();
}
}
protected List<String> syncProcessedPaths() {
ArrayList<String> removed = new ArrayList<String>();
- synchronized (processedPaths) {
+ synchronized (this) {
Iterator<String> it = processedPaths.iterator();
while(it.hasNext()) {
String p = it.next();
@@ -117,7 +117,7 @@
}
protected boolean requestForLoad(String p) {
- synchronized (processedPaths) {
+ synchronized (this) {
return processedPaths.add(p);
}
}
13 years, 1 month
JBoss Tools SVN: r36228 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-11-08 14:09:59 -0500 (Tue, 08 Nov 2011)
New Revision: 36228
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
Log:
JBIDE-10111
https://issues.jboss.org/browse/JBIDE-10111
Synchronization of set 'processedPaths' is improved.
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-11-08 18:48:23 UTC (rev 36227)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2011-11-08 19:09:59 UTC (rev 36228)
@@ -73,7 +73,10 @@
project.getExtensionManager().pathRemoved(p);
}
boolean newRuntimeDetected = false;
- Set<String> processed = new HashSet<String>(processedPaths);
+ Set<String> processed = new HashSet<String>();
+ synchronized(this) {
+ processed.addAll(processedPaths);
+ }
for (int i = 0; i < paths.size(); i++) {
String p = paths.get(i);
if(!requestForLoad(p)) continue;
13 years, 1 month
JBoss Tools SVN: r36227 - in trunk/cdi/tests: org.jboss.tools.cdi.core.test/projects/tck/ant and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-11-08 13:48:23 -0500 (Tue, 08 Nov 2011)
New Revision: 36227
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/WEB-INF/lib/openon_test.jar
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/ant/build.xml
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java
trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
Log:
CDI OpenOns do not work on binary (.class) files https://issues.jboss.org/browse/JBIDE-9764
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/WEB-INF/lib/openon_test.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/WebContent/WEB-INF/lib/openon_test.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/ant/build.xml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/ant/build.xml 2011-11-08 18:45:48 UTC (rev 36226)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/projects/tck/ant/build.xml 2011-11-08 18:48:23 UTC (rev 36227)
@@ -19,6 +19,7 @@
<pathelement path ="${webinf.dir}/lib/jsf-impl.jar"/>
<pathelement path ="${webinf.dir}/lib/jstl.jar"/>
<pathelement path ="${webinf.dir}/lib/standard.jar"/>
+ <pathelement path ="${webinf.dir}/lib/openon_test.jar"/>
<pathelement path ="${webinf.dir}/classes"/>
<pathelement path ="${classpath.external}"/>
<pathelement path ="${classpath}"/>
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java 2011-11-08 18:45:48 UTC (rev 36226)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/CDIHyperlinkTestUtil.java 2011-11-08 18:48:23 UTC (rev 36227)
@@ -9,6 +9,9 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
import org.eclipse.jdt.internal.ui.text.JavaWordFinder;
import org.eclipse.jface.text.BadLocationException;
@@ -19,14 +22,13 @@
import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.texteditor.DocumentProviderRegistry;
-import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
@@ -35,6 +37,7 @@
import org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart;
import org.jboss.tools.cdi.core.ICDIElement;
import org.jboss.tools.cdi.text.ext.hyperlink.ITestableCDIHyperlink;
+import org.jboss.tools.common.EclipseUtil;
import org.jboss.tools.common.editor.ObjectMultiPageEditor;
import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
import org.jboss.tools.common.model.ui.texteditors.XMLTextEditorStandAlone;
@@ -49,32 +52,51 @@
public class CDIHyperlinkTestUtil extends TestCase{
- public static void checkRegions(IProject project, String fileName, List<TestRegion> regionList, AbstractHyperlinkDetector elPartitioner) throws Exception {
+ public static void checkRegionsInJar(IProject project, String fullyQualifiedName, List<TestRegion> regionList, AbstractHyperlinkDetector hlDetector) throws Exception {
+ IJavaProject javaProject = EclipseUtil.getJavaProject(project);
+ assertNotNull("Java Project is null", javaProject);
+
+ IType type = javaProject.findType(fullyQualifiedName);
+ assertNotNull("Type is not found", type);
+ assertTrue("Type must be exist", type.exists());
+
+ IEditorInput editorInput = EditorUtility.getEditorInput(type);
+ IEditorPart editorPart = EditorUtility.openInEditor(type);
+
+ checkRegions(fullyQualifiedName, editorInput, editorPart, regionList, hlDetector);
+ }
+
+ public static void checkRegions(IProject project, String fileName, List<TestRegion> regionList, AbstractHyperlinkDetector hlDetector) throws Exception {
IFile file = project.getFile(fileName);
assertNotNull("The file \"" + fileName + "\" is not found", file);
assertTrue("The file \"" + fileName + "\" is not found", file.isAccessible());
- FileEditorInput editorInput = new FileEditorInput(file);
+ IEditorInput editorInput = new FileEditorInput(file);
+ IEditorPart editorPart = openFileInEditor(file);
- IDocumentProvider documentProvider = null;
- try {
- documentProvider = DocumentProviderRegistry.getDefault().getDocumentProvider(editorInput);
- } catch (Exception x) {
- x.printStackTrace();
- fail("An exception caught: " + x.getMessage());
- }
+ checkRegions(fileName, editorInput, editorPart, regionList, hlDetector);
+ }
+
+ private static void checkRegions(String fileName, IEditorInput editorInput, IEditorPart editorPart, List<TestRegion> regionList, AbstractHyperlinkDetector hlDetector) throws Exception {
+
+ ISourceViewer viewer = null;
+ if(editorPart instanceof JavaEditor){
+ viewer = ((JavaEditor)editorPart).getViewer();
+ hlDetector.setContext(new TestContext((ITextEditor)editorPart));
+ }else if(editorPart instanceof EditorPartWrapper){
+ if(((EditorPartWrapper)editorPart).getEditor() instanceof WebCompoundEditor){
+ WebCompoundEditor wce = (WebCompoundEditor)((EditorPartWrapper)editorPart).getEditor();
+ viewer = wce.getSourceEditor().getTextViewer();
+ hlDetector.setContext(new TestContext(wce.getSourceEditor()));
+ }else if(((EditorPartWrapper)editorPart).getEditor() instanceof XMLTextEditorStandAlone){
+ XMLTextEditorStandAlone xtesa = (XMLTextEditorStandAlone)((EditorPartWrapper)editorPart).getEditor();
+ viewer = xtesa.getTextViewer();
+ hlDetector.setContext(new TestContext(xtesa));
+ }else fail("unsupported editor type - "+((EditorPartWrapper)editorPart).getEditor().getClass());
+ }else fail("unsupported editor type - "+editorPart.getClass());
- assertNotNull("The document provider for the file \"" + fileName + "\" is not loaded", documentProvider);
-
- try {
- documentProvider.connect(editorInput);
- } catch (Exception x) {
- x.printStackTrace();
- fail("The document provider is not able to be initialized with the editor input\nAn exception caught: "+x.getMessage());
- }
-
- IDocument document = documentProvider.getDocument(editorInput);
+ IDocument document = viewer.getDocument();
assertNotNull("The document for the file \"" + fileName + "\" is not loaded", document);
@@ -84,26 +106,7 @@
int expected = 0;
for(TestRegion testRegion : regionList)
expected += testRegion.region.getLength()+1;
-
- IEditorPart part = openFileInEditor(file);
- ISourceViewer viewer = null;
- if(part instanceof JavaEditor){
- viewer = ((JavaEditor)part).getViewer();
- elPartitioner.setContext(new TestContext((ITextEditor)part));
- }else if(part instanceof EditorPartWrapper){
- if(((EditorPartWrapper)part).getEditor() instanceof WebCompoundEditor){
- WebCompoundEditor wce = (WebCompoundEditor)((EditorPartWrapper)part).getEditor();
- viewer = wce.getSourceEditor().getTextViewer();
- elPartitioner.setContext(new TestContext(wce.getSourceEditor()));
- }else if(((EditorPartWrapper)part).getEditor() instanceof XMLTextEditorStandAlone){
- XMLTextEditorStandAlone xtesa = (XMLTextEditorStandAlone)((EditorPartWrapper)part).getEditor();
- viewer = xtesa.getTextViewer();
- elPartitioner.setContext(new TestContext(xtesa));
- }else fail("unsupported editor type - "+((EditorPartWrapper)part).getEditor().getClass());
- }else fail("unsupported editor type - "+part.getClass());
-
-
int counter = 0;
for (int i = 0; i < document.getLength(); i++) {
int lineNumber = document.getLineOfOffset(i);
@@ -111,18 +114,18 @@
lineNumber++;
TestData testData = new TestData(document, i);
- IHyperlink[] links = elPartitioner.detectHyperlinks(viewer, testData.getHyperlinkRegion(), true);
+ IHyperlink[] links = hlDetector.detectHyperlinks(viewer, testData.getHyperlinkRegion(), true);
boolean recognized = links != null;
if (recognized) {
counter++;
- TestRegion testRegion = findOffsetInRegions(i, regionList);
+ TestRegion testRegion = findOffsetInRegions(i, regionList);
+ String information = findRegionInformation(document, i, regionList);
if(testRegion == null){
- String information = findRegionInformation(document, i, regionList);
fail("Wrong detection for offset - "+i+" (line - "+lineNumber+" position - "+position+") "+information);
}else{
- checkTestRegion(links, testRegion);
+ checkTestRegion(links, testRegion, information);
}
}
else {
@@ -135,21 +138,19 @@
}
assertEquals("Wrong recognized region count: ", expected, counter);
-
- documentProvider.disconnect(editorInput);
}
- public static void checkTestRegion(IHyperlink[] links, TestRegion testRegion){
+ public static void checkTestRegion(IHyperlink[] links, TestRegion testRegion, String information){
for(IHyperlink link : links){
TestHyperlink testLink = findTestHyperlink(testRegion.hyperlinks, link);
- assertNotNull("Unexpected hyperlink - "+link.getHyperlinkText(), testLink);
- assertEquals("Unexpected hyperlink type", testLink.hyperlink, link.getClass());
- assertTrue("Validation fails for hyperlink - "+link.getHyperlinkText(), testLink.validateHyperlink(link));
+ assertNotNull("Unexpected hyperlink - "+link.getHyperlinkText()+" "+information, testLink);
+ assertEquals("Unexpected hyperlink type "+information, testLink.hyperlink, link.getClass());
+ assertTrue("Validation fails for hyperlink - "+link.getHyperlinkText()+" "+information, testLink.validateHyperlink(link));
if(testLink.fileName != null){
- assertTrue("HyperLink must be inherited from AbstractHyperlink", link instanceof AbstractHyperlink);
+ assertTrue("HyperLink must be inherited from AbstractHyperlink "+information, link instanceof AbstractHyperlink);
IFile f = ((AbstractHyperlink)link).getReadyToOpenFile();
- assertNotNull("HyperLink must return not null file", f);
+ assertNotNull("HyperLink must return not null file "+information, f);
assertEquals(testLink.fileName, f.getName());
}
@@ -157,7 +158,7 @@
for(TestHyperlink testLink : testRegion.hyperlinks){
IHyperlink link = findHyperlink(links, testLink);
- assertNotNull("Hyperlink - "+testLink.name+" not found", link);
+ assertNotNull("Hyperlink - "+testLink.name+" not found "+information, link);
}
}
Modified: trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2011-11-08 18:45:48 UTC (rev 36226)
+++ trunk/cdi/tests/org.jboss.tools.cdi.text.ext.test/src/org/jboss/tools/cdi/text/ext/test/InjectedPointHyperlinkDetectorTest.java 2011-11-08 18:48:23 UTC (rev 36227)
@@ -10,7 +10,6 @@
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.cdi.core.IBean;
import org.jboss.tools.cdi.core.test.tck.TCKTest;
import org.jboss.tools.cdi.text.ext.CDIExtensionsMessages;
@@ -171,5 +170,31 @@
CDIHyperlinkTestUtil.checkRegions(tckProject, "JavaSource/org/jboss/jsr299/tck/tests/context/dependent/FoxHole.java", regionList, new InjectedPointHyperlinkDetector());
}
+
+ public void testInjectedPointHyperlinkDetectorForJAR() throws Exception {
+ ArrayList<TestRegion> regionList = new ArrayList<TestRegion>();
+ regionList.add(new TestRegion(/*115, 6*/"Inject", new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " JarBasicLogger"/*, bean*/),
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
+ })); // Inject
+ regionList.add(new TestRegion(/*133, 6*/"JarLogger", new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " JarBasicLogger"/*, bean*/),
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
+ })); // Logger
+ regionList.add(new TestRegion(/*140, 6*/"logger", new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " JarBasicLogger"/*, bean*/),
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
+ })); // logger
+ regionList.add(new TestRegion(/*196, 6*/"logger", new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " JarBasicLogger"/*, bean*/),
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
+ })); // logger
+ regionList.add(new TestRegion(/*250, 6*/"logger", new TestHyperlink[]{
+ new TestHyperlink(InjectedPointHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_OPEN_INJECT_BEAN+ " JarBasicLogger"/*, bean*/),
+ new TestHyperlink(AssignableBeansHyperlink.class, CDIExtensionsMessages.CDI_INJECTED_POINT_HYPERLINK_SHOW_ASSIGNABLE)
+ })); // logger
+
+ CDIHyperlinkTestUtil.checkRegionsInJar(tckProject, "org.jar.test.openon.JarLoggerConsumer", regionList, new InjectedPointHyperlinkDetector());
+ }
}
\ No newline at end of file
13 years, 1 month
JBoss Tools SVN: r36226 - trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-11-08 13:45:48 -0500 (Tue, 08 Nov 2011)
New Revision: 36226
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF
Log:
https://issues.jboss.org/browse/JBIDE-9679 - CLONE - Manifest cleanup
fixed in trunk for modeshape
Modified: trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF
===================================================================
--- trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF 2011-11-08 18:42:12 UTC (rev 36225)
+++ trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/META-INF/MANIFEST.MF 2011-11-08 18:45:48 UTC (rev 36226)
@@ -7,7 +7,7 @@
Bundle-Vendor: %bundleVendor
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
+ org.eclipse.core.runtime;bundle-version="3.7.0",
org.eclipse.core.resources,
org.eclipse.ui.console,
org.eclipse.jface.text,
13 years, 1 month
JBoss Tools SVN: r36225 - trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-11-08 13:42:12 -0500 (Tue, 08 Nov 2011)
New Revision: 36225
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
Log:
Quickfix and Wizard for fixing ambigious injection warning is confusing https://issues.jboss.org/browse/JBIDE-9940
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2011-11-08 18:37:43 UTC (rev 36224)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2011-11-08 18:42:12 UTC (rev 36225)
@@ -123,7 +123,7 @@
ADD_QUALIFIERS_TO_BEAN_WIZARD_REMOVE_ALL=<< Remove All
ADD_QUALIFIERS_TO_BEAN_WIZARD_CREATE_NEW_QUALIFIER=Create New Qualifier...
ADD_QUALIFIERS_TO_BEAN_WIZARD_EDIT_QUALIFIER_VALUE=Edit Value...
-ADD_QUALIFIERS_TO_BEAN_WIZARD_SET_IS_NOT_UNIQUE=We could not find a set of qualifiers that makes the ''{0}'' unique for @Injection ''{1}''
+ADD_QUALIFIERS_TO_BEAN_WIZARD_SET_IS_NOT_UNIQUE=The set of qualifiers that makes the ''{0}'' unique for @Injection ''{1}'' could not be found. You can make it unique by changing the qualifiers below.
ADD_QUALIFIERS_TO_BEAN_WIZARD_ENTER_QUALIFIER_NAME=Enter CDI Qualifier name prefix or pattern (? = any character, * = any string):
CDI_GENERATE_BEANS_XML=Generate beans.xml file:
13 years, 1 month
JBoss Tools SVN: r36224 - trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/handlers.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-11-08 13:37:43 -0500 (Tue, 08 Nov 2011)
New Revision: 36224
Modified:
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/handlers/MaterializeLibraryHandler.java
Log:
JBIDE-10125 : better guess the materialization output folder
Modified: trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/handlers/MaterializeLibraryHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/handlers/MaterializeLibraryHandler.java 2011-11-08 18:29:20 UTC (rev 36223)
+++ trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/handlers/MaterializeLibraryHandler.java 2011-11-08 18:37:43 UTC (rev 36224)
@@ -26,7 +26,6 @@
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
@@ -52,6 +51,10 @@
@SuppressWarnings("restriction")
public class MaterializeLibraryHandler extends AbstractHandler {
+ private static final String ECLIPSE_DEFAULT_WEBFOLDER = "WebContent";
+ private static final String MAVEN_DEFAULT_WEBFOLDER = "src/main/webapp";
+
+
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
@@ -76,7 +79,7 @@
MaterializeLibraryDialog dialog = new MaterializeLibraryDialog(window.getShell(),
project,
containerToMaterialize,
- getDefaultLib(libraryFromUI.getClasspathEntry())
+ getDefaultLib(project)
);
if(dialog.open() == Dialog.OK) {
Map<IPath, String> jarsToMaterialize = dialog.getSelectedClasspathEntryPaths();
@@ -138,12 +141,16 @@
return null;
}
- private String getDefaultLib(IClasspathEntry classpathEntry) {
- String defaultLib = "lib";
- //TODO look for the value of IClasspathAttribute "org.eclipse.jst.component.dependency"
- //TODO Even if we get WEB-INF/lib from IClasspathAttribute, how do we get the first mapped source folder
- //without depending on the component fwk? extension points (and new component adapter plugin)? reflection?
- return defaultLib;
+ private String getDefaultLib(IProject project) {
+ //Let's try to be smart and guess where we're gonna put all the dependencies
+ StringBuilder path = new StringBuilder();
+ if (project.getFolder(MAVEN_DEFAULT_WEBFOLDER).exists()) {
+ path.append(MAVEN_DEFAULT_WEBFOLDER).append("/");
+ } else if (project.getFolder(ECLIPSE_DEFAULT_WEBFOLDER).exists()) {
+ path.append(ECLIPSE_DEFAULT_WEBFOLDER).append("/");
+ }
+ path.append("lib");
+ return path.toString();
}
private ISchedulingRule getRule(IProject project) {
13 years, 1 month