Author: dazarov
Date: 2010-08-27 12:48:15 -0400 (Fri, 27 Aug 2010)
New Revision: 24512
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteNameAnnotaionMarkerResolution.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-4064
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-08-27
16:09:56 UTC (rev 24511)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-08-27
16:48:15 UTC (rev 24512)
@@ -27,7 +27,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
@@ -87,8 +86,17 @@
public static final String ID = "org.jboss.tools.seam.core.CoreValidator";
public static final String MESSAGE_ID_ATTRIBUTE_NAME = "Seam_message_id";
//$NON-NLS-1$
+
public static final int NONUNIQUE_COMPONENT_NAME_MESSAGE_ID = 1;
-
+ public static final int DUPLICATE_REMOVE_MESSAGE_ID = 2;
+ public static final int DUPLICATE_DESTROY_MESSAGE_ID = 3;
+ public static final int DUPLICATE_CREATE_MESSAGE_ID = 4;
+ public static final int DUPLICATE_UNWRAP_MESSAGE_ID = 5;
+ public static final int DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN_MESSAGE_ID =
6;
+ public static final int CREATE_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID = 7;
+ public static final int UNWRAP_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID = 8;
+ public static final int OBSERVER_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID = 9;
+
private ISeamProject seamProject;
private String projectName;
@@ -755,7 +763,7 @@
ITextSourceReference location = getScopeLocation(component);
addError(SeamValidationMessages.STATEFUL_COMPONENT_WRONG_SCOPE,
SeamPreferences.STATEFUL_COMPONENT_WRONG_SCOPE, new String[]{component.getName()},
location, javaDeclaration.getResource());
}
- validateDuplicateComponentMethod(SeamComponentMethodType.REMOVE, component,
SeamValidationMessages.DUPLICATE_REMOVE, SeamPreferences.DUPLICATE_REMOVE);
+ validateDuplicateComponentMethod(SeamComponentMethodType.REMOVE, component,
SeamValidationMessages.DUPLICATE_REMOVE, SeamPreferences.DUPLICATE_REMOVE,
DUPLICATE_REMOVE_MESSAGE_ID);
}
}
@@ -769,12 +777,12 @@
}
private void validateDuplicateComponentMethods(ISeamComponent component) {
- validateDuplicateComponentMethod(SeamComponentMethodType.DESTROY, component,
SeamValidationMessages.DUPLICATE_DESTROY, SeamPreferences.DUPLICATE_DESTROY);
- validateDuplicateComponentMethod(SeamComponentMethodType.CREATE, component,
SeamValidationMessages.DUPLICATE_CREATE, SeamPreferences.DUPLICATE_CREATE);
- validateDuplicateComponentMethod(SeamComponentMethodType.UNWRAP, component,
SeamValidationMessages.DUPLICATE_UNWRAP, SeamPreferences.DUPLICATE_UNWRAP);
+ validateDuplicateComponentMethod(SeamComponentMethodType.DESTROY, component,
SeamValidationMessages.DUPLICATE_DESTROY, SeamPreferences.DUPLICATE_DESTROY,
DUPLICATE_DESTROY_MESSAGE_ID);
+ validateDuplicateComponentMethod(SeamComponentMethodType.CREATE, component,
SeamValidationMessages.DUPLICATE_CREATE, SeamPreferences.DUPLICATE_CREATE,
DUPLICATE_CREATE_MESSAGE_ID);
+ validateDuplicateComponentMethod(SeamComponentMethodType.UNWRAP, component,
SeamValidationMessages.DUPLICATE_UNWRAP, SeamPreferences.DUPLICATE_UNWRAP,
DUPLICATE_UNWRAP_MESSAGE_ID);
}
- private void validateDuplicateComponentMethod(SeamComponentMethodType methodType,
ISeamComponent component, String message, String preferenceKey) {
+ private void validateDuplicateComponentMethod(SeamComponentMethodType methodType,
ISeamComponent component, String message, String preferenceKey, int message_id) {
ISeamJavaComponentDeclaration javaDeclaration = component.getJavaDeclaration();
Set<ISeamComponentMethod> methods =
javaDeclaration.getMethodsByType(methodType);
if(methods!=null && methods.size()>1) {
@@ -783,7 +791,7 @@
IMethod javaMethod = (IMethod)method.getSourceMember();
String methodName = javaMethod.getElementName();
ITextSourceReference methodNameLocation = getNameLocation(method);
- addError(message, preferenceKey, new String[]{methodName}, methodNameLocation,
javaDeclaration.getResource());
+ addError(message, preferenceKey, new String[]{methodName}, methodNameLocation,
javaDeclaration.getResource(), message_id);
}
}
}
@@ -881,9 +889,9 @@
IMember member = declaration.getSourceMember();
try {
if(member!=null && !Flags.isAbstract(member.getFlags())) {
- validateMethodOfUnknownComponent(SeamComponentMethodType.CREATE, declaration,
SeamValidationMessages.CREATE_DOESNT_BELONG_TO_COMPONENT,
SeamPreferences.CREATE_DOESNT_BELONG_TO_COMPONENT);
- validateMethodOfUnknownComponent(SeamComponentMethodType.UNWRAP, declaration,
SeamValidationMessages.UNWRAP_DOESNT_BELONG_TO_COMPONENT,
SeamPreferences.UNWRAP_DOESNT_BELONG_TO_COMPONENT);
- validateMethodOfUnknownComponent(SeamComponentMethodType.OBSERVER, declaration,
SeamValidationMessages.OBSERVER_DOESNT_BELONG_TO_COMPONENT,
SeamPreferences.OBSERVER_DOESNT_BELONG_TO_COMPONENT);
+ validateMethodOfUnknownComponent(SeamComponentMethodType.CREATE, declaration,
SeamValidationMessages.CREATE_DOESNT_BELONG_TO_COMPONENT,
SeamPreferences.CREATE_DOESNT_BELONG_TO_COMPONENT,
CREATE_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID);
+ validateMethodOfUnknownComponent(SeamComponentMethodType.UNWRAP, declaration,
SeamValidationMessages.UNWRAP_DOESNT_BELONG_TO_COMPONENT,
SeamPreferences.UNWRAP_DOESNT_BELONG_TO_COMPONENT,
UNWRAP_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID);
+ validateMethodOfUnknownComponent(SeamComponentMethodType.OBSERVER, declaration,
SeamValidationMessages.OBSERVER_DOESNT_BELONG_TO_COMPONENT,
SeamPreferences.OBSERVER_DOESNT_BELONG_TO_COMPONENT,
OBSERVER_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID);
}
} catch (JavaModelException e) {
SeamCorePlugin.getPluginLog().logError(e);
@@ -905,13 +913,13 @@
if(javaDeclaration.getSourcePath().equals(javaMethod.getPath())) {
validationContext.addLinkedCoreResource(component.getName(),
javaDeclaration.getSourcePath(), true);
ITextSourceReference methodNameLocation = getNameLocation(method);
- addError(SeamValidationMessages.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN,
SeamPreferences.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN, new
String[]{methodName}, methodNameLocation, method.getResource());
+ addError(SeamValidationMessages.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN,
SeamPreferences.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN, new
String[]{methodName}, methodNameLocation, method.getResource(),
DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN_MESSAGE_ID);
}
}
}
}
- private void validateMethodOfUnknownComponent(SeamComponentMethodType methodType,
ISeamJavaComponentDeclaration declaration, String message, String preferenceKey) {
+ private void validateMethodOfUnknownComponent(SeamComponentMethodType methodType,
ISeamJavaComponentDeclaration declaration, String message, String preferenceKey, int
message_id) {
Set<ISeamComponentMethod> methods = declaration.getMethodsByType(methodType);
if(methods!=null && !methods.isEmpty()) {
for (ISeamComponentMethod method : methods) {
@@ -919,7 +927,7 @@
String methodName = javaMethod.getElementName();
if(declaration.getSourcePath().equals(javaMethod.getPath())) {
ITextSourceReference methodNameLocation = getNameLocation(method);
- addError(message, preferenceKey, new String[]{methodName}, methodNameLocation,
method.getResource());
+ addError(message, preferenceKey, new String[]{methodName}, methodNameLocation,
method.getResource(), message_id);
validationContext.addUnnamedCoreResource(declaration.getSourcePath());
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2010-08-27
16:09:56 UTC (rev 24511)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2010-08-27
16:48:15 UTC (rev 24512)
@@ -361,7 +361,19 @@
public static String SEAM_COMPONENT_RENAME_HANDLER_ERROR;
public static String DELETE_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE;
+
+ public static String DELETE_REMOVE_ANNOTATION_MARKER_RESOLUTION_TITLE;
+
+ public static String DELETE_DESTROY_ANNOTATION_MARKER_RESOLUTION_TITLE;
+ public static String DELETE_CREATE_ANNOTATION_MARKER_RESOLUTION_TITLE;
+
+ public static String DELETE_UNWRAP_ANNOTATION_MARKER_RESOLUTION_TITLE;
+
+ public static String DELETE_OBSERVER_ANNOTATION_MARKER_RESOLUTION_TITLE;
+
+ public static String ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE;
+
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, SeamUIMessages.class);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java 2010-08-27
16:09:56 UTC (rev 24511)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AbstractSeamMarkerResolution.java 2010-08-27
16:48:15 UTC (rev 24512)
@@ -82,16 +82,21 @@
}
private boolean checkImport(String text, String qualifiedName){
+ String name = getShortName(qualifiedName);
+
+ Pattern p = Pattern.compile(".*\\W"+name+"\\W.*",Pattern.DOTALL);
//$NON-NLS-1$ //$NON-NLS-2$
+ Matcher m = p.matcher(text);
+ return !m.matches();
+ }
+
+ protected String getShortName(String qualifiedName){
int lastDot = qualifiedName.lastIndexOf('.');
String name;
if(lastDot < 0)
name = qualifiedName;
else
name = qualifiedName.substring(lastDot+1);
-
- Pattern p = Pattern.compile(".*\\W"+name+"\\W.*",Pattern.DOTALL);
//$NON-NLS-1$ //$NON-NLS-2$
- Matcher m = p.matcher(text);
- return !m.matches();
+ return name;
}
protected void addAnnotation(String annotationTypeName, String annotationString){
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java 2010-08-27
16:48:15 UTC (rev 24512)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.marker;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+
+/**
+ * @author Daniel Azarov
+ */
+public class AddAnnotaionMarkerResolution extends
+ AbstractSeamMarkerResolution {
+ private String label;
+ private String qualifiedName;
+
+ public AddAnnotaionMarkerResolution(String label, String qualifiedName, IFile file, int
start, int end){
+ super(file, start, end);
+ this.label = label;
+ this.qualifiedName = qualifiedName;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void run(IMarker marker) {
+ addAnnotation(qualifiedName,"@"+getShortName(qualifiedName)); //$NON-NLS-1$
+ }
+
+}
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/AddAnnotaionMarkerResolution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java
(from rev 24500,
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteNameAnnotaionMarkerResolution.java)
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java 2010-08-27
16:48:15 UTC (rev 24512)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.marker;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+
+/**
+ * @author Daniel Azarov
+ */
+public class DeleteAnnotaionMarkerResolution extends
+ AbstractSeamMarkerResolution {
+ private String label;
+ private String qualifiedName;
+
+ public DeleteAnnotaionMarkerResolution(String label, String qualifiedName, IFile file,
int start, int end){
+ super(file, start, end);
+ this.label = label;
+ this.qualifiedName = qualifiedName;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void run(IMarker marker) {
+ deleteAnnotation(qualifiedName);
+ }
+
+}
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteAnnotaionMarkerResolution.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteNameAnnotaionMarkerResolution.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteNameAnnotaionMarkerResolution.java 2010-08-27
16:09:56 UTC (rev 24511)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/DeleteNameAnnotaionMarkerResolution.java 2010-08-27
16:48:15 UTC (rev 24512)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.ui.marker;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.jboss.tools.seam.ui.SeamUIMessages;
-
-/**
- * @author Daniel Azarov
- */
-public class DeleteNameAnnotaionMarkerResolution extends
- AbstractSeamMarkerResolution {
- public DeleteNameAnnotaionMarkerResolution(IFile file, int start, int end){
- super(file, start, end);
- }
-
- public String getLabel() {
- return SeamUIMessages.DELETE_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE;
- }
-
- public void run(IMarker marker) {
- deleteAnnotation("org.jboss.seam.annotations.Name"); //$NON-NLS-1$
- }
-
-}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java 2010-08-27
16:09:56 UTC (rev 24511)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/marker/SeamProblemMarkerResolutionGenerator.java 2010-08-27
16:48:15 UTC (rev 24512)
@@ -17,6 +17,7 @@
import org.eclipse.ui.IMarkerResolutionGenerator2;
import org.jboss.tools.seam.internal.core.validation.SeamCoreValidator;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
+import org.jboss.tools.seam.ui.SeamUIMessages;
/**
* @author Daniel Azarov
@@ -25,20 +26,17 @@
public IMarkerResolution[] getResolutions(IMarker marker) {
try{
- IMarkerResolution resolution = isOurCase(marker);
- if(resolution != null){
- return new IMarkerResolution[] {resolution};
- }
+ return findResolutions(marker);
}catch(CoreException ex){
SeamGuiPlugin.getPluginLog().logError(ex);
}
return new IMarkerResolution[]{};
}
- private IMarkerResolution isOurCase(IMarker marker) throws CoreException{
+ private IMarkerResolution[] findResolutions(IMarker marker) throws CoreException{
Integer attribute =
((Integer)marker.getAttribute(SeamCoreValidator.MESSAGE_ID_ATTRIBUTE_NAME));
if(attribute == null)
- return null;
+ return new IMarkerResolution[]{};
int messageId = attribute.intValue();
@@ -46,24 +44,49 @@
attribute = ((Integer)marker.getAttribute(IMarker.CHAR_START));
if(attribute == null)
- return null;
+ return new IMarkerResolution[]{};
int start = attribute.intValue();
attribute = ((Integer)marker.getAttribute(IMarker.CHAR_END));
if(attribute == null)
- return null;
+ return new IMarkerResolution[]{};
int end = attribute.intValue();
if(messageId == SeamCoreValidator.NONUNIQUE_COMPONENT_NAME_MESSAGE_ID)
- return new DeleteNameAnnotaionMarkerResolution(file, start, end);
-
- return null;
+ return new IMarkerResolution[]{new
DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Name",file, start, end)};
+ else if(messageId == SeamCoreValidator.DUPLICATE_REMOVE_MESSAGE_ID)
+ return new IMarkerResolution[]{new
DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_REMOVE_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Remove", file, start, end)};
+ else if(messageId == SeamCoreValidator.DUPLICATE_DESTROY_MESSAGE_ID)
+ return new IMarkerResolution[]{new
DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_DESTROY_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Destroy", file, start, end)};
+ else if(messageId == SeamCoreValidator.DUPLICATE_CREATE_MESSAGE_ID)
+ return new IMarkerResolution[]{new
DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_CREATE_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Create", file, start, end)};
+ else if(messageId == SeamCoreValidator.DUPLICATE_UNWRAP_MESSAGE_ID)
+ return new IMarkerResolution[]{new
DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_UNWRAP_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Unwrap", file, start, end)};
+ else if(messageId ==
SeamCoreValidator.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN_MESSAGE_ID)
+ return new IMarkerResolution[]{new
DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_DESTROY_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Destroy", file, start, end)};
+ else if(messageId == SeamCoreValidator.CREATE_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID)
+ return new IMarkerResolution[]{
+ new
AddAnnotaionMarkerResolution(SeamUIMessages.ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Name", file, start, end),
+ new
DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_CREATE_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Create", file, start, end)
+ };
+ else if(messageId == SeamCoreValidator.UNWRAP_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID)
+ return new IMarkerResolution[]{
+ new
AddAnnotaionMarkerResolution(SeamUIMessages.ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Name", file, start, end),
+ new
DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_UNWRAP_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Unwrap", file, start, end)
+ };
+ else if(messageId == SeamCoreValidator.OBSERVER_DOESNT_BELONG_TO_COMPONENT_MESSAGE_ID)
+ return new IMarkerResolution[]{
+ new
AddAnnotaionMarkerResolution(SeamUIMessages.ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Name", file, start, end),
+ new
DeleteAnnotaionMarkerResolution(SeamUIMessages.DELETE_OBSERVER_ANNOTATION_MARKER_RESOLUTION_TITLE,
"org.jboss.seam.annotations.Observer", file, start, end)
+ };
+
+ return new IMarkerResolution[]{};
}
public boolean hasResolutions(IMarker marker) {
try{
- if(isOurCase(marker) != null)
+ if(findResolutions(marker).length != 0)
return true;
}catch(CoreException ex){
SeamGuiPlugin.getPluginLog().logError(ex);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2010-08-27
16:09:56 UTC (rev 24511)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2010-08-27
16:48:15 UTC (rev 24512)
@@ -189,3 +189,9 @@
FIND_USAGES_IN_EL = Find Usages in Expression Language
SEAM_COMPONENT_RENAME_HANDLER_ERROR = Error
DELETE_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete @Name annotation
+DELETE_REMOVE_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete @Remove annotation
+DELETE_DESTROY_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete @Destroy annotation
+DELETE_CREATE_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete @Create annotation
+DELETE_UNWRAP_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete @Unwrap annotation
+DELETE_OBSERVER_ANNOTATION_MARKER_RESOLUTION_TITLE=Delete @Oserver annotation
+ADD_NAME_ANNOTATION_MARKER_RESOLUTION_TITLE=Add @Name annotation