Author: akazakov
Date: 2010-12-02 13:37:16 -0500 (Thu, 02 Dec 2010)
New Revision: 27123
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
Log:
https://jira.jboss.org/browse/JBIDE-7674
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 2010-12-02
18:28:13 UTC (rev 27122)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-12-02
18:37:16 UTC (rev 27123)
@@ -22,7 +22,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -105,12 +104,7 @@
public class CDICoreValidator extends CDIValidationErrorManager implements IValidator {
public static final String ID = "org.jboss.tools.cdi.core.CoreValidator";
//$NON-NLS-1$
public static final String PROBLEM_TYPE =
"org.jboss.tools.cdi.core.cdiproblem"; //$NON-NLS-1$
-
- public static final String MESSAGE_ID_ATTRIBUTE_NAME = "CDI_message_id";
//$NON-NLS-1$
-
- public static final int ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID = 1;
-
ICDIProject cdiProject;
String projectName;
CDIProjectSet projectSet;
@@ -186,7 +180,7 @@
@Override
public void init(IProject project, ContextValidationHelper validationHelper,
org.eclipse.wst.validation.internal.provisional.core.IValidator manager,
IReporter reporter) {
- super.init(project, validationHelper, manager, reporter);
+ super.init(project, validationHelper, manager, reporter, MESSAGE_ID_ATTRIBUTE_NAME);
if(projectSet==null) {
getValidatingProjects(project);
}
@@ -2191,18 +2185,4 @@
CDICorePlugin.getDefault().logError(e);
}
}
-
- public IMarker addError(String message, String preferenceKey,
- ITextSourceReference location, IResource target, int messageId) {
- IMarker marker = addError(message, preferenceKey, location, target);
- try{
- if(marker!=null) {
- marker.setAttribute(MESSAGE_ID_ATTRIBUTE_NAME, new Integer(messageId));
- }
- }catch(CoreException ex){
- CDICorePlugin.getDefault().logError(ex);
- }
- return marker;
- }
-
}
\ No newline at end of file
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 2010-12-02
18:28:13 UTC (rev 27122)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2010-12-02
18:37:16 UTC (rev 27123)
@@ -16,6 +16,10 @@
abstract public class CDIValidationErrorManager extends ValidationErrorManager {
+ public static final String MESSAGE_ID_ATTRIBUTE_NAME = "CDI_message_id";
//$NON-NLS-1$
+
+ public static final int ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID = 1;
+
/*
* (non-Javadoc)
* @see
org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getPreference(org.eclipse.core.resources.IProject,
java.lang.String)
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 2010-12-02
18:28:13 UTC (rev 27122)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2010-12-02
18:37:16 UTC (rev 27123)
@@ -21,7 +21,7 @@
import org.eclipse.jdt.core.IType;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator2;
-import org.jboss.tools.cdi.internal.core.validation.CDICoreValidator;
+import org.jboss.tools.cdi.internal.core.validation.CDIValidationErrorManager;
import org.jboss.tools.cdi.ui.CDIUIPlugin;
import org.jboss.tools.common.EclipseUtil;
@@ -44,7 +44,7 @@
private IMarkerResolution[] findResolutions(IMarker marker)
throws CoreException {
Integer attribute = ((Integer) marker
- .getAttribute(CDICoreValidator.MESSAGE_ID_ATTRIBUTE_NAME));
+ .getAttribute(CDIValidationErrorManager.MESSAGE_ID_ATTRIBUTE_NAME));
if (attribute == null)
return new IMarkerResolution[] {};
@@ -63,7 +63,7 @@
int end = attribute.intValue();
if (JAVA_EXTENSION.equals(file.getFileExtension())) {
- if (messageId == CDICoreValidator.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID) {
+ if (messageId == CDIValidationErrorManager.ILLEGAL_PRODUCER_FIELD_IN_SESSION_BEAN_ID)
{
IField field = findNonStaticField(file, start);
if(field != null){
return new IMarkerResolution[] {