JBoss Tools SVN: r33374 - in trunk/cdi: plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2011-07-29 17:56:42 -0400 (Fri, 29 Jul 2011)
New Revision: 33374
Added:
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.java
trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7680
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-07-29 20:57:50 UTC (rev 33373)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-07-29 21:56:42 UTC (rev 33374)
@@ -1665,9 +1665,9 @@
*/
if (decoratorDeclaration != null) {
addError(CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
- sessionDeclaration, bean.getResource());
+ sessionDeclaration, bean.getResource(), SESSION_BEAN_ANNOTATED_DECORATOR_ID);
addError(CDIValidationMessages.SESSION_BEAN_ANNOTATED_DECORATOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
- decoratorDeclaration, bean.getResource());
+ decoratorDeclaration, bean.getResource(), SESSION_BEAN_ANNOTATED_DECORATOR_ID);
}
/*
* 3.2. Session beans
@@ -1675,9 +1675,9 @@
*/
if (interceptorDeclaration != null) {
addError(CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
- sessionDeclaration, bean.getResource());
+ sessionDeclaration, bean.getResource(), SESSION_BEAN_ANNOTATED_INTERCEPTOR_ID);
addError(CDIValidationMessages.SESSION_BEAN_ANNOTATED_INTERCEPTOR, CDIPreferences.SESSION_BEAN_ANNOTATED_INTERCEPTOR_OR_DECORATOR,
- interceptorDeclaration, bean.getResource());
+ interceptorDeclaration, bean.getResource(), SESSION_BEAN_ANNOTATED_INTERCEPTOR_ID);
}
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2011-07-29 20:57:50 UTC (rev 33373)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2011-07-29 21:56:42 UTC (rev 33374)
@@ -59,6 +59,8 @@
public static final int OBSERVER_PARAMETER_ILLEGALLY_ANNOTATED_ID = 38;
public static final int OBSERVER_IN_DECORATOR_ID = 39;
public static final int OBSERVER_IN_INTERCEPTOR_ID = 40;
+ public static final int SESSION_BEAN_ANNOTATED_INTERCEPTOR_ID = 41;
+ public static final int SESSION_BEAN_ANNOTATED_DECORATOR_ID = 42;
/*
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-07-29 20:57:50 UTC (rev 33373)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-07-29 21:56:42 UTC (rev 33374)
@@ -419,6 +419,26 @@
};
}
}
+ }else if(messageId == CDIValidationErrorManager.SESSION_BEAN_ANNOTATED_INTERCEPTOR_ID){
+ IJavaElement element = findJavaElement(file, start);
+ if(element != null){
+ IJavaElement interceptorElement = findJavaElementByAnnotation(element, CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME);
+ if(interceptorElement != null){
+ return new IMarkerResolution[] {
+ new DeleteAnnotationMarkerResolution(interceptorElement, CDIConstants.INTERCEPTOR_ANNOTATION_TYPE_NAME)
+ };
+ }
+ }
+ }else if(messageId == CDIValidationErrorManager.SESSION_BEAN_ANNOTATED_DECORATOR_ID){
+ IJavaElement element = findJavaElement(file, start);
+ if(element != null){
+ IJavaElement decoratorElement = findJavaElementByAnnotation(element, CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME);
+ if(decoratorElement != null){
+ return new IMarkerResolution[] {
+ new DeleteAnnotationMarkerResolution(decoratorElement, CDIConstants.DECORATOR_STEREOTYPE_TYPE_NAME)
+ };
+ }
+ }
}
}
return new IMarkerResolution[] {};
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.java 2011-07-29 21:56:42 UTC (rev 33374)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.decorator.Decorator;
+import javax.ejb.Stateless;
+
+@Decorator
+@Stateless
+public class SessionBeanAnnotatedDecoratorBroken {
+
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult 2011-07-29 21:56:42 UTC (rev 33374)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class SessionBeanAnnotatedDecoratorBroken {
+
+}
\ No newline at end of file
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.java (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.java 2011-07-29 21:56:42 UTC (rev 33374)
@@ -0,0 +1,15 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Singleton;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.Interceptor;
+import javax.interceptor.InvocationContext;
+
+@Interceptor
+@Singleton
+public class SessionBeanAnnotatedInterceptorBroken {
+ @AroundInvoke
+ public Object alwaysReturnThis(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.core.test/resources/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult 2011-07-29 21:56:42 UTC (rev 33374)
@@ -0,0 +1,13 @@
+package org.jboss.jsr299.tck.tests.jbt.quickfixes;
+
+import javax.ejb.Singleton;
+import javax.interceptor.AroundInvoke;
+import javax.interceptor.InvocationContext;
+
+@Singleton
+public class SessionBeanAnnotatedInterceptorBroken {
+ @AroundInvoke
+ public Object alwaysReturnThis(InvocationContext ctx) throws Exception {
+ return ctx.proceed();
+ }
+}
\ No newline at end of file
Modified: trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-29 20:57:50 UTC (rev 33373)
+++ trunk/cdi/tests/org.jboss.tools.cdi.ui.test/src/org/jboss/tools/cdi/ui/test/marker/CDIMarkerResolutionTest.java 2011-07-29 21:56:42 UTC (rev 33374)
@@ -886,4 +886,32 @@
CDIValidationErrorManager.OBSERVER_IN_INTERCEPTOR_ID,
DeleteAnnotationMarkerResolution.class);
}
+
+ public void testSessionBeanAnnotatedDecoratorResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.java"
+ },
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/SessionBeanAnnotatedDecoratorBroken.qfxresult"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.SESSION_BEAN_ANNOTATED_DECORATOR_ID,
+ DeleteAnnotationMarkerResolution.class);
+ }
+
+ public void testSessionBeanAnnotatedInterceptorBrokenResolution() throws CoreException{
+ checkResolution(tckProject,
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.java"
+ },
+ new String[]{
+ "JavaSource/org/jboss/jsr299/tck/tests/jbt/quickfixes/SessionBeanAnnotatedInterceptorBroken.qfxresult"
+ },
+ CDICoreValidator.PROBLEM_TYPE,
+ CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME,
+ CDIValidationErrorManager.SESSION_BEAN_ANNOTATED_INTERCEPTOR_ID,
+ DeleteAnnotationMarkerResolution.class);
+ }
}
\ No newline at end of file
13 years, 5 months
JBoss Tools SVN: r33373 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-29 16:57:50 -0400 (Fri, 29 Jul 2011)
New Revision: 33373
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
Log:
FileSystemsHelper.getFile(object) method used.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2011-07-29 20:52:11 UTC (rev 33372)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/properties/SeamELAttributeContentProposalProvider.java 2011-07-29 20:57:50 UTC (rev 33373)
@@ -29,6 +29,7 @@
import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.meta.action.XEntityData;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.ui.attribute.AttributeContentProposalProviderFactory;
import org.jboss.tools.common.model.ui.attribute.IAttributeContentProposalProvider;
import org.jboss.tools.common.text.TextProposal;
@@ -73,7 +74,7 @@
public void init(XModelObject object, XEntityData data, XAttribute attribute) {
this.object = object;
this.attribute = attribute;
- while(object != null && object.getFileType() != XModelObject.FILE) object = object.getParent();
+ object = FileSystemsHelper.getFile(object);
if(object != null) {
IResource r = (IResource)object.getAdapter(IResource.class);
if(r instanceof IFile) {
13 years, 5 months
JBoss Tools SVN: r33372 - trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-29 16:52:11 -0400 (Fri, 29 Jul 2011)
New Revision: 33372
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java
Log:
FileSystemsHelper.getFile(object) method used.
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java 2011-07-29 20:39:09 UTC (rev 33371)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/SelectOnDiagramHandler.java 2011-07-29 20:52:11 UTC (rev 33372)
@@ -12,6 +12,7 @@
import java.util.*;
import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.util.FindObjectHelper;
import org.jboss.tools.common.meta.action.impl.*;
import org.jboss.tools.jst.web.model.ReferenceObject;
@@ -29,12 +30,8 @@
public boolean isEnabled(XModelObject object) {
if(object == null || !object.isActive()) return false;
- XModelObject f = object.getParent();
- while(f != null && f.getFileType() != XModelObject.FILE) f = f.getParent();
- if(f == null || !f.getModelEntity().getName().startsWith(SeamPagesConstants.ENT_FILE_SEAM_PAGES)) {
- return false;
- }
- return true;
+ XModelObject f = FileSystemsHelper.getFile(object);
+ return (f != null && f.getModelEntity().getName().startsWith(SeamPagesConstants.ENT_FILE_SEAM_PAGES));
}
public void executeHandler(XModelObject object, Properties p) throws XModelException {
13 years, 5 months
JBoss Tools SVN: r33371 - trunk/jst/plugins/org.jboss.tools.jst.web.verification/src/org/jboss/tools/jst/web/verification/vrules.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-29 16:39:09 -0400 (Fri, 29 Jul 2011)
New Revision: 33371
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.verification/src/org/jboss/tools/jst/web/verification/vrules/CheckResource.java
Log:
FileSystemsHelper.getFile(object) method used.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.verification/src/org/jboss/tools/jst/web/verification/vrules/CheckResource.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.verification/src/org/jboss/tools/jst/web/verification/vrules/CheckResource.java 2011-07-29 20:34:41 UTC (rev 33370)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.verification/src/org/jboss/tools/jst/web/verification/vrules/CheckResource.java 2011-07-29 20:39:09 UTC (rev 33371)
@@ -14,6 +14,7 @@
import java.util.StringTokenizer;
import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.common.verification.vrules.*;
import org.jboss.tools.common.verification.vrules.layer.VObjectImpl;
@@ -87,12 +88,11 @@
boolean isMappedToServlet(VObject object, String value) {
XModelObject o = ((VObjectImpl)object).getModelObject();
- while(o != null && o.getFileType() != XModelObject.FILE) o = o.getParent();
- return isMappedToServlet(o, value);
+ XModelObject webxml = FileSystemsHelper.getFile(o);
+ return webxml != null && isMappedToServlet(webxml, value);
}
boolean isMappedToServlet(XModelObject webxml, String value) {
- if(webxml == null) return false;
XModelObject[] ms = WebAppHelper.getServletMappings(webxml);
if(ms != null) for (XModelObject m: ms) {
String url = m.getAttributeValue("url-pattern"); //$NON-NLS-1$
13 years, 5 months
JBoss Tools SVN: r33370 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/attribute/adapter.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-29 16:34:41 -0400 (Fri, 29 Jul 2011)
New Revision: 33370
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/attribute/adapter/ServletNameListContentProvider.java
Log:
FileSystemsHelper.getFile(object) method used.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/attribute/adapter/ServletNameListContentProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/attribute/adapter/ServletNameListContentProvider.java 2011-07-29 20:26:56 UTC (rev 33369)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/attribute/adapter/ServletNameListContentProvider.java 2011-07-29 20:34:41 UTC (rev 33370)
@@ -13,6 +13,7 @@
import org.jboss.tools.common.model.*;
import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.ui.attribute.adapter.DefaultXAttributeListContentProvider;
/**
@@ -30,17 +31,15 @@
}
protected void loadTags() {
- XModelObject webxml = null;
- if(object != null) {
- XModelObject f = object;
- while(f != null && f.getFileType() != XModelObject.FILE) f = f.getParent();
- if(f != null) webxml = f;
+ XModelObject webxml = FileSystemsHelper.getFile(object);
+ if(webxml == null) {
+ webxml = WebAppHelper.getWebApp(model);
}
- if(webxml == null) webxml = WebAppHelper.getWebApp(model);
- if(webxml == null) return;
- XModelObject[] os = WebAppHelper.getServlets(webxml);
- tags = new String[os.length];
- for (int i = 0; i < tags.length; i++) tags[i] = os[i].getAttributeValue("servlet-name"); //$NON-NLS-1$
+ if(webxml != null) {
+ XModelObject[] os = WebAppHelper.getServlets(webxml);
+ tags = new String[os.length];
+ for (int i = 0; i < tags.length; i++) tags[i] = os[i].getAttributeValue("servlet-name"); //$NON-NLS-1$
+ }
}
}
13 years, 5 months
JBoss Tools SVN: r33369 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-29 16:26:56 -0400 (Fri, 29 Jul 2011)
New Revision: 33369
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageSelectionProvider.java
Log:
FileSystemsHelper.getFile(object) method used.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageSelectionProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageSelectionProvider.java 2011-07-29 20:25:16 UTC (rev 33368)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageSelectionProvider.java 2011-07-29 20:26:56 UTC (rev 33369)
@@ -19,6 +19,7 @@
import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.jface.viewers.*;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.filesystems.impl.FileAnyImpl;
import org.jboss.tools.common.model.util.PositionSearcher;
@@ -105,8 +106,7 @@
if(selection instanceof IStructuredSelection && !selection.isEmpty()
&& ((IStructuredSelection)selection).getFirstElement() instanceof XModelObject) {
XModelObject o = (XModelObject)((IStructuredSelection)selection).getFirstElement();
- XModelObject f = o;
- while(f != null && f.getFileType() != XModelObject.FILE) f = f.getParent();
+ XModelObject f = FileSystemsHelper.getFile(o);
if(((JSPMultiPageEditor)multiPageEditor).getModelObject() == f) {
String text = ((FileAnyImpl)f).getAsText();
PositionSearcher searcher = new PositionSearcher();
13 years, 5 months
JBoss Tools SVN: r33368 - trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/attribute/adapter.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-29 16:25:16 -0400 (Fri, 29 Jul 2011)
New Revision: 33368
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/attribute/adapter/DefinitionListContentProvider.java
Log:
FileSystemsHelper.getFile(object) method used.
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/attribute/adapter/DefinitionListContentProvider.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/attribute/adapter/DefinitionListContentProvider.java 2011-07-29 20:23:02 UTC (rev 33367)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/attribute/adapter/DefinitionListContentProvider.java 2011-07-29 20:25:16 UTC (rev 33368)
@@ -12,6 +12,7 @@
import java.util.*;
import org.jboss.tools.common.model.*;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.ui.attribute.adapter.DefaultXAttributeListContentProvider;
public class DefinitionListContentProvider extends DefaultXAttributeListContentProvider {
@@ -22,16 +23,15 @@
}
protected void loadTags() {
- XModelObject file = context;
- while(file != null && file.getFileType() != XModelObject.FILE) file = file.getParent();
+ XModelObject file = FileSystemsHelper.getFile(context);
if(file == null) return;
XModelObject[] os = file.getChildren("TilesDefinition"); //$NON-NLS-1$
- List list = new ArrayList();
+ List<String> list = new ArrayList<String>();
for (int i = 0; i < os.length; i++) {
if(os[i] == context) continue;
list.add(os[i].getAttributeValue("name")); //$NON-NLS-1$
}
- tags = (String[])list.toArray(new String[0]);
+ tags = list.toArray(new String[0]);
}
}
13 years, 5 months
JBoss Tools SVN: r33367 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-07-29 16:23:02 -0400 (Fri, 29 Jul 2011)
New Revision: 33367
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java
Log:
JBIDE-9422
org.jboss.tools.seam.ui.test JUnit Test failure
minor changes (sysouts commented out)
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java 2011-07-29 20:18:32 UTC (rev 33366)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/el/ELExprPartitionerTest.java 2011-07-29 20:23:02 UTC (rev 33367)
@@ -55,20 +55,20 @@
assertNull("An exception caught: " + (exception != null? exception.getMessage() : ""), exception);
if (project != null) {
isKbNatureCheck = project.getPersistentProperty(IS_KB_NATURES_CHECK_NEED);
- System.out.println("Before: Is KB natures check: '" + isKbNatureCheck + "'");
+// System.out.println("Before: Is KB natures check: '" + isKbNatureCheck + "'");
project.setPersistentProperty(IS_KB_NATURES_CHECK_NEED, //$NON-NLS-1$
Boolean.toString(false));
isJsfNatureCheck = project.getPersistentProperty(IS_JSF_NATURES_CHECK_NEED);
- System.out.println("Before: Is JSF natures check: '" + isJsfNatureCheck + "'");
+// System.out.println("Before: Is JSF natures check: '" + isJsfNatureCheck + "'");
project.setPersistentProperty(IS_JSF_NATURES_CHECK_NEED, //$NON-NLS-1$
Boolean.toString(false));
isJsfCheck = project.getPersistentProperty(IS_JSF_CHECK_NEED);
- System.out.println("Before: Is JSF check: '" + isJsfCheck + "'");
+// System.out.println("Before: Is JSF check: '" + isJsfCheck + "'");
project.setPersistentProperty(IS_JSF_CHECK_NEED, //$NON-NLS-1$
Boolean.toString(false));
- System.out.println("While Testing: Is KB natures check: '" + project.getPersistentProperty(IS_KB_NATURES_CHECK_NEED) + "'");
- System.out.println("While Testing: Is JSF natures check: '" + project.getPersistentProperty(IS_JSF_NATURES_CHECK_NEED) + "'");
- System.out.println("While Testing: Is JSF check: '" + project.getPersistentProperty(IS_JSF_CHECK_NEED) + "'");
+// System.out.println("While Testing: Is KB natures check: '" + project.getPersistentProperty(IS_KB_NATURES_CHECK_NEED) + "'");
+// System.out.println("While Testing: Is JSF natures check: '" + project.getPersistentProperty(IS_JSF_NATURES_CHECK_NEED) + "'");
+// System.out.println("While Testing: Is JSF check: '" + project.getPersistentProperty(IS_JSF_CHECK_NEED) + "'");
}
}
@@ -76,13 +76,13 @@
if (project != null) {
project.setPersistentProperty(IS_KB_NATURES_CHECK_NEED, //$NON-NLS-1$
isKbNatureCheck);
- System.out.println("Restored default: Is KB natures check: '" + project.getPersistentProperty(IS_KB_NATURES_CHECK_NEED) + "'");
+// System.out.println("Restored default: Is KB natures check: '" + project.getPersistentProperty(IS_KB_NATURES_CHECK_NEED) + "'");
project.setPersistentProperty(IS_JSF_NATURES_CHECK_NEED, //$NON-NLS-1$
isJsfNatureCheck);
- System.out.println("Restored default: Is JSF natures check: '" + project.getPersistentProperty(IS_JSF_NATURES_CHECK_NEED) + "'");
+// System.out.println("Restored default: Is JSF natures check: '" + project.getPersistentProperty(IS_JSF_NATURES_CHECK_NEED) + "'");
project.setPersistentProperty(IS_JSF_CHECK_NEED, //$NON-NLS-1$
isJsfCheck);
- System.out.println("Restored default: Is JSF check: '" + project.getPersistentProperty(IS_JSF_CHECK_NEED) + "'");
+// System.out.println("Restored default: Is JSF check: '" + project.getPersistentProperty(IS_JSF_CHECK_NEED) + "'");
}
if(provider != null) {
provider.dispose();
13 years, 5 months
JBoss Tools SVN: r33366 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-29 16:18:32 -0400 (Fri, 29 Jul 2011)
New Revision: 33366
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java
Log:
FileSystemsHelper.getFile(object) method used.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java 2011-07-29 20:15:54 UTC (rev 33365)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java 2011-07-29 20:18:32 UTC (rev 33366)
@@ -62,6 +62,7 @@
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.event.XModelTreeListener;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.forms.DefaultFormFactory;
import org.jboss.tools.common.model.ui.forms.FormFactory;
@@ -326,11 +327,10 @@
}
private String getErrors() {
- XModelObject f = installedObject;
- while(f != null && f.getFileType() != XModelObject.FILE) {
- f = f.getParent();
+ XModelObject f = FileSystemsHelper.getFile(installedObject);
+ if(f == null) {
+ f = installedObject;
}
- if(f == null) f = installedObject;
return f.get("errors"); //$NON-NLS-1$
}
13 years, 5 months
JBoss Tools SVN: r33365 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-29 16:15:54 -0400 (Fri, 29 Jul 2011)
New Revision: 33365
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
Log:
Code improved.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2011-07-29 20:06:57 UTC (rev 33364)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2011-07-29 20:15:54 UTC (rev 33365)
@@ -182,10 +182,8 @@
if(input instanceof IURIEditorInput) {
URI uri = ((IURIEditorInput)input).getURI();
String f = uri.getPath();
- XModelObject o = null;
- o = EclipseResourceUtil.createObjectForLocation(f);
- if(o != null && o.getFileType() != XModelObject.FILE) o = null;
- return (o == null) ? (IEditorInput)input : new ModelObjectLocationEditorInput(getMainObject(o), new Path(f));
+ XModelObject o = EclipseResourceUtil.createObjectForLocation(f);
+ return (o == null || o.getFileType() != XModelObject.FILE) ? (IEditorInput)input : new ModelObjectLocationEditorInput(getMainObject(o), new Path(f));
}
return input;
}
@@ -203,16 +201,13 @@
XModelObject o = EclipseResourceUtil.getObjectByResource(f);
if(o == null) {
o = EclipseResourceUtil.createObjectForResource(f);
- if(o != null && o.getFileType() != XModelObject.FILE) o = null;
}
- return (o == null) ? input : new XModelObjectEditorInput(getMainObject(o));
+ return (o == null || o.getFileType() != XModelObject.FILE) ? input : new XModelObjectEditorInput(getMainObject(o));
}
private static IEditorInput convertExternalInput(ILocationProvider input) {
- XModelObject o = null;
- o = EclipseResourceUtil.createObjectForLocation(input.getPath(input).toString());
- if(o != null && o.getFileType() != XModelObject.FILE) o = null;
- return (o == null) ? (IEditorInput)input : new ModelObjectLocationEditorInput(getMainObject(o), input.getPath(input));
+ XModelObject o = EclipseResourceUtil.createObjectForLocation(input.getPath(input).toString());
+ return (o == null || o.getFileType() != XModelObject.FILE) ? (IEditorInput)input : new ModelObjectLocationEditorInput(getMainObject(o), input.getPath(input));
}
private static IEditorInput convertStorageEditorInput(IStorageEditorInput input) {
13 years, 5 months