Author: akazakov
Date: 2010-10-14 15:37:51 -0400 (Thu, 14 Oct 2010)
New Revision: 25839
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/el.jsp
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/lineNumbers.xhtml
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/validation/
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.properties
trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
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/esb/plugins/org.jboss.tools.esb.validator/plugin.properties
trunk/esb/plugins/org.jboss.tools.esb.validator/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBCoreValidator.java
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBValidationErrorManager.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/KBNaturesInfoDialog.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.properties
trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.properties
trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/action/EnableKBOnProject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatorManager.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/validation/IValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.properties
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
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/SeamEarProjectValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationErrorManager.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
Log:
https://jira.jboss.org/browse/JBIDE-7147 Limited the number of problem markers per file.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.properties 2010-10-14 19:14:12 UTC
(rev 25838)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.properties 2010-10-14 19:37:51 UTC
(rev 25839)
@@ -0,0 +1 @@
+KBProblemName=CDI Problem
\ No newline at end of file
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2010-10-14 19:14:12 UTC (rev
25838)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/plugin.xml 2010-10-14 19:37:51 UTC (rev
25839)
@@ -96,6 +96,13 @@
<initializer
class="org.jboss.tools.cdi.core.preferences.CDIPreferenceInitializer"/>
</extension>
+ <extension id="cdiproblem" name="%KBProblemName"
point="org.eclipse.core.resources.markers">
+ <super type="org.jboss.tools.jst.web.kb.kbproblemmarker">
+ </super>
+ <persistent value="true">
+ </persistent>
+ </extension>
+
<extension
point="org.jboss.tools.jst.web.kb.validator">
<validator
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-10-14
19:14:12 UTC (rev 25838)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -98,7 +98,8 @@
* @author Alexey Kazakov
*/
public class CDICoreValidator extends CDIValidationErrorManager implements IValidator {
- public static final String ID = "org.jboss.tools.cdi.core.CoreValidator";
+ 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$
ICDIProject cdiProject;
String projectName;
@@ -109,6 +110,15 @@
/*
* (non-Javadoc)
+ * @see
org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getMarkerType()
+ */
+ @Override
+ public String getMarkerType() {
+ return PROBLEM_TYPE;
+ }
+
+ /*
+ * (non-Javadoc)
*
* @see org.jboss.tools.jst.web.kb.validation.IValidator#getId()
*/
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-10-14
19:14:12 UTC (rev 25838)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationErrorManager.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -14,7 +14,7 @@
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
import org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager;
-public class CDIValidationErrorManager extends ValidationErrorManager {
+abstract public class CDIValidationErrorManager extends ValidationErrorManager {
/*
* (non-Javadoc)
Modified: trunk/esb/plugins/org.jboss.tools.esb.validator/plugin.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.validator/plugin.properties 2010-10-14 19:14:12
UTC (rev 25838)
+++ trunk/esb/plugins/org.jboss.tools.esb.validator/plugin.properties 2010-10-14 19:37:51
UTC (rev 25839)
@@ -1,4 +1,6 @@
providerName=JBoss by Red Hat
pluginName=ESB Validator Plugin
-PreferencePage_Validator=ESB Validator
\ No newline at end of file
+PreferencePage_Validator=ESB Validator
+
+KBProblemName=ESB Problem
\ No newline at end of file
Modified: trunk/esb/plugins/org.jboss.tools.esb.validator/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.validator/plugin.xml 2010-10-14 19:14:12 UTC
(rev 25838)
+++ trunk/esb/plugins/org.jboss.tools.esb.validator/plugin.xml 2010-10-14 19:37:51 UTC
(rev 25839)
@@ -6,6 +6,13 @@
<initializer
class="org.jboss.tools.esb.validator.ESBPreferenceInitializer"/>
</extension>
+ <extension id="esbproblem" name="%KBProblemName"
point="org.eclipse.core.resources.markers">
+ <super type="org.jboss.tools.jst.web.kb.kbproblemmarker">
+ </super>
+ <persistent value="true">
+ </persistent>
+ </extension>
+
<extension
point="org.jboss.tools.jst.web.kb.validator">
<validator
Modified:
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBCoreValidator.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBCoreValidator.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBCoreValidator.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -7,7 +7,6 @@
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
-import java.util.TreeSet;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
@@ -21,7 +20,6 @@
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.model.util.PositionSearcher;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
@@ -38,6 +36,7 @@
public class ESBCoreValidator extends ESBValidationErrorManager implements IValidator {
public static final String ID =
"org.jboss.tools.esb.validator.ESBCoreValidator"; //$NON-NLS-1$
+ public static final String PROBLEM_TYPE =
"org.jboss.tools.esb.validator.esbproblem"; //$NON-NLS-1$
static String XML_EXT = ".xml"; //$NON-NLS-1$
static String ATTR_PATH = "path"; //$NON-NLS-1$
@@ -46,6 +45,15 @@
String projectName;
Map<IProject, IValidationContext> contexts = new HashMap<IProject,
IValidationContext>();
+ /*
+ * (non-Javadoc)
+ * @see
org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getMarkerType()
+ */
+ @Override
+ public String getMarkerType() {
+ return PROBLEM_TYPE;
+ }
+
public String getId() {
return ID;
}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBValidationErrorManager.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBValidationErrorManager.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBValidationErrorManager.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -13,7 +13,7 @@
import org.eclipse.core.resources.IProject;
import org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager;
-public class ESBValidationErrorManager extends ValidationErrorManager {
+abstract public class ESBValidationErrorManager extends ValidationErrorManager {
/*
* (non-Javadoc)
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.properties 2010-10-14 19:14:12 UTC (rev
25838)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.properties 2010-10-14 19:37:51 UTC (rev
25839)
@@ -5,4 +5,6 @@
JSF2_ComponentsValidator.name = JSF2 Components Validator
-JSF2ProblemName = JSF 2 Problem
\ No newline at end of file
+JSF2ProblemName = JSF 2 Problem
+
+KBProblemName=JSF EL Problem
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2010-10-14 19:14:12 UTC (rev 25838)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/plugin.xml 2010-10-14 19:37:51 UTC (rev 25839)
@@ -488,6 +488,13 @@
<initializer
class="org.jboss.tools.jsf.preferences.JSFPreferenceInitializer"/>
</extension>
+ <extension id="elproblem" name="%KBProblemName"
point="org.eclipse.core.resources.markers">
+ <super type="org.jboss.tools.jst.web.kb.kbproblemmarker">
+ </super>
+ <persistent value="true">
+ </persistent>
+ </extension>
+
<extension
point="org.jboss.tools.jst.web.kb.validator">
<validator
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ELValidator.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -20,7 +20,6 @@
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -77,6 +76,7 @@
public class ELValidator extends ValidationErrorManager implements IValidator {
public static final String ID = "org.jboss.tools.jsf.ELValidator";
//$NON-NLS-1$
+ public static final String PROBLEM_TYPE = "org.jboss.tools.jsf.elproblem";
//$NON-NLS-1$
private ELResolver[] resolvers;
protected ELParserFactory mainFactory;
@@ -92,6 +92,15 @@
/*
* (non-Javadoc)
+ * @see
org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getMarkerType()
+ */
+ @Override
+ public String getMarkerType() {
+ return PROBLEM_TYPE;
+ }
+
+ /*
+ * (non-Javadoc)
* @see
org.jboss.tools.jst.web.kb.validation.IValidator#isEnabled(org.eclipse.core.resources.IProject)
*/
public boolean isEnabled(IProject project) {
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/KBNaturesInfoDialog.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/KBNaturesInfoDialog.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/KBNaturesInfoDialog.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -57,7 +57,7 @@
IMarker marker = markers[i];
String _type = marker.getType();
if (_type != null
- && _type.equals(KbProject.KB_PROBLEM_MARKER_TYPE)) {
+ && _type.equals(KbProject.KB_BUILDER_PROBLEM_MARKER_TYPE)) {
kbProblemMarker = marker;
break;
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -239,7 +239,7 @@
IMarker marker = markers[i];
String _type = marker.getType();
if (_type != null
- && _type.equals(KbProject.KB_PROBLEM_MARKER_TYPE)) {
+ && _type.equals(KbProject.KB_BUILDER_PROBLEM_MARKER_TYPE)) {
kbProblemMarker = marker;
break;
}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/el.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/el.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/el.jsp 2010-10-14
19:37:51 UTC (rev 25839)
@@ -0,0 +1,3 @@
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+
+<h:outputText value="#{user.name1}" />
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/el.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/lineNumbers.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/lineNumbers.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/lineNumbers.xhtml 2010-10-14
19:37:51 UTC (rev 25839)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+ <h:outputText value="#{wrongUserName}"/>
+
+</ui:composition>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.test/projects/JSFKickStartOldFormat/WebContent/pages/lineNumbers.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/ELValidatorTest.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -1,6 +1,8 @@
package org.jboss.tools.jsf.test.validation;
import java.text.MessageFormat;
+import java.util.HashSet;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
@@ -11,10 +13,15 @@
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.wst.validation.ValidationFramework;
import org.eclipse.wst.validation.internal.core.ValidationException;
+import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
import org.jboss.tools.common.preferences.SeverityPreferences;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.preferences.JSFSeverityPreferences;
+import org.jboss.tools.jsf.web.validation.ELValidator;
import org.jboss.tools.jsf.web.validation.JSFValidationMessages;
+import org.jboss.tools.jst.web.kb.internal.validation.ContextValidationHelper;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.jst.web.kb.validation.IValidator;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
public class ELValidatorTest extends AbstractResourceMarkerTest{
@@ -34,54 +41,88 @@
store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL,
JSFSeverityPreferences.ENABLE);
store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.ERROR);
- copyContentsFile("WebContent/WEB-INF/faces-config.xml",
"WebContent/WEB-INF/faces-config.1");
-
- assertMarkerIsCreatedForLine(
- "WebContent/testElRevalidation.xhtml",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
- new Object[] {"user"},
- 14);
-
- // Check if the validator was not invoked.
- copyContentsFile("WebContent/WEB-INF/faces-config.xml",
"WebContent/WEB-INF/faces-config.original");
-
- assertMarkerIsNotCreatedForLine(
- "WebContent/testElRevalidation.xhtml",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
- new Object[] {"user"},
- 14);
-
- store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL,
JSFSeverityPreferences.ENABLE);
- store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.IGNORE);
+ try {
+ copyContentsFile("WebContent/WEB-INF/faces-config.xml",
"WebContent/WEB-INF/faces-config.1");
+
+ assertMarkerIsCreatedForLine(
+ "WebContent/testElRevalidation.xhtml",
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ new Object[] {"user"},
+ 14);
+
+ // Check if the validator was not invoked.
+ copyContentsFile("WebContent/WEB-INF/faces-config.xml",
"WebContent/WEB-INF/faces-config.original");
+
+ assertMarkerIsNotCreatedForLine(
+ "WebContent/testElRevalidation.xhtml",
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ new Object[] {"user"},
+ 14);
+ } finally {
+ store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL,
JSFSeverityPreferences.ENABLE);
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.IGNORE);
+ }
}
public void testRevalidationUnresolvedELs() throws CoreException, ValidationException{
IPreferenceStore store = JSFModelPlugin.getDefault().getPreferenceStore();
store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL,
JSFSeverityPreferences.DISABLE);
store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.ERROR);
-
- copyContentsFile("WebContent/WEB-INF/faces-config.xml",
"WebContent/WEB-INF/faces-config.1");
-
- assertMarkerIsCreatedForLine(
- "WebContent/testElRevalidation.xhtml",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
- new Object[] {"user"},
- 14);
- // Check if the validator was not invoked.
- copyContentsFile("WebContent/WEB-INF/faces-config.xml",
"WebContent/WEB-INF/faces-config.original");
-
- assertMarkerIsNotCreatedForLine(
- "WebContent/testElRevalidation.xhtml",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
- new Object[] {"user"},
- 14);
+ try {
+ copyContentsFile("WebContent/WEB-INF/faces-config.xml",
"WebContent/WEB-INF/faces-config.1");
+
+ assertMarkerIsCreatedForLine(
+ "WebContent/testElRevalidation.xhtml",
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ new Object[] {"user"},
+ 14);
- store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL,
JSFSeverityPreferences.ENABLE);
- store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.IGNORE);
+ IFile file = project.getFile("WebContent/testElRevalidation.xhtml");
+ file.deleteMarkers(IValidator.KB_PROBLEM_MARKER_TYPE, true, IResource.DEPTH_ZERO);
+
+ // Check if the validator was not invoked.
+ copyContentsFile("WebContent/WEB-INF/faces-config.xml",
"WebContent/WEB-INF/faces-config.original");
+
+ assertMarkerIsNotCreatedForLine(
+ "WebContent/testElRevalidation.xhtml",
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ new Object[] {"user"},
+ 14);
+ } finally {
+ store.setValue(JSFSeverityPreferences.RE_VALIDATE_UNRESOLVED_EL,
JSFSeverityPreferences.ENABLE);
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.IGNORE);
+ }
}
/**
+ * See
https://jira.jboss.org/browse/JBIDE-7067
+ * @throws CoreException
+ * @throws ValidationException
+ */
+ public void testELValidationEnablement() throws CoreException, ValidationException {
+ JSFModelPlugin.getDefault().getPreferenceStore().setValue(JSFSeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME,
false);
+
+ try {
+ IFile file = project.getFile("WebContent/pages/el.jsp");
+
+ file.deleteMarkers(IValidator.KB_PROBLEM_MARKER_TYPE, true, IResource.DEPTH_ZERO);
+ validateFile("WebContent/pages/el.jsp", 0);
+
+ int number = getMarkersNumberByGroupName(IValidator.KB_PROBLEM_MARKER_TYPE, file,
IValidator.MARKED_RESOURCE_MESSAGE_GROUP);
+ assertEquals("Problem marker was found.", 0, number);
+
+ JSFModelPlugin.getDefault().getPreferenceStore().setValue(JSFSeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME,
true);
+ validateFile("WebContent/pages/el.jsp", 0);
+
+ number = getMarkersNumberByGroupName(IValidator.KB_PROBLEM_MARKER_TYPE, file,
IValidator.MARKED_RESOURCE_MESSAGE_GROUP);
+ assertEquals("Problem marker was not found.", 1, number);
+ } finally {
+ JSFModelPlugin.getDefault().getPreferenceStore().setValue(JSFSeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME,
true);
+ }
+ }
+
+ /**
* See
https://jira.jboss.org/browse/JBIDE-7147
* @throws CoreException
*/
@@ -95,12 +136,12 @@
try {
assertMarkerIsCreatedForLine(
"WebContent/pages/maxNumberOfMarkers.jsp",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_NAME,
new Object[] {"wrongUserName"},
3);
assertMarkerIsNotCreatedForLine(
"WebContent/pages/maxNumberOfMarkers.jsp",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_NAME,
new Object[] {"wrongUserName2"},
4);
@@ -108,12 +149,12 @@
assertMarkerIsCreatedForLine(
"WebContent/pages/maxNumberOfMarkers.jsp",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_NAME,
new Object[] {"wrongUserName"},
3);
assertMarkerIsCreatedForLine(
"WebContent/pages/maxNumberOfMarkers.jsp",
- JSFValidationMessages.UNKNOWN_EL_VARIABLE_PROPERTY_NAME,
+ JSFValidationMessages.UNKNOWN_EL_VARIABLE_NAME,
new Object[] {"wrongUserName2"},
4);
} finally {
@@ -122,6 +163,73 @@
}
}
+ /**
+ * See
https://jira.jboss.org/browse/JBIDE-7264
+ * @throws CoreException
+ * @throws ValidationException
+ */
+ public void testPerformanceOfCalculatingLineNumbers() throws CoreException,
ValidationException {
+ IPreferenceStore store = JSFModelPlugin.getDefault().getPreferenceStore();
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.ERROR);
+
+ try {
+ IFile file = project.getFile("WebContent/pages/lineNumbers.xhtml");
+ String messagePattern =
MessageFormat.format(JSFValidationMessages.UNKNOWN_EL_VARIABLE_NAME, new Object[]
{"wrongUserName"});
+
+ long time = validateFile("WebContent/pages/lineNumbers.xhtml", 100);
+ System.out.println("Time: " + time);
+ int[] lines = new int[100];
+ for (int i = 8; i < 108; i++) {
+ lines[i-8]=i;
+ }
+ assertMarkerIsCreated(file, ELValidator.PROBLEM_TYPE, messagePattern, lines);
+ time = validateFile("WebContent/pages/lineNumbers.xhtml", 100);
+ System.out.println("Time: " + time);
+ } finally {
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.IGNORE);
+ }
+ }
+
+ private long validateFile(String fileName, int numberOfMarkers) throws
ValidationException {
+ Set<String> files = new HashSet<String>();
+ files.add(fileName);
+ return validateFile(files, numberOfMarkers);
+ }
+
+ private long validateFile(Set<String> fileNames, int numberOfMarkers) throws
ValidationException {
+ IPreferenceStore store = JSFModelPlugin.getDefault().getPreferenceStore();
+ int max = store.getInt(SeverityPreferences.MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME);
+ if(numberOfMarkers>0) {
+ store.setValue(SeverityPreferences.MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME,
numberOfMarkers);
+ }
+ String errorSeverity =
store.getString(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME);
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME,
JSFSeverityPreferences.ERROR);
+
+ try {
+ ELValidator validator = new ELValidator();
+
+ ContextValidationHelper helper = new ContextValidationHelper();
+ helper.setProject(project);
+ helper.initialize();
+ Set<IFile> files = new HashSet<IFile>();
+ for (String fileName : fileNames) {
+ IFile file = project.getFile(fileName);
+ helper.registerResource(file);
+ files.add(file);
+ }
+ ValidatorManager manager = new ValidatorManager();
+ WorkbenchReporter reporter = new WorkbenchReporter(project, new
NullProgressMonitor());
+
+ long current = System.currentTimeMillis();
+ validator.validate(files, project, helper, manager, reporter);
+ long result = System.currentTimeMillis() - current;
+ return result;
+ } finally {
+ store.setValue(SeverityPreferences.MAX_NUMBER_OF_MARKERS_PREFERENCE_NAME, max);
+ store.setValue(JSFSeverityPreferences.UNKNOWN_EL_VARIABLE_NAME, errorSeverity);
+ }
+ }
+
private void assertMarkerIsCreatedForLine(String fileName, String template, Object[]
parameters, int lineNumber) throws CoreException{
String messagePattern = MessageFormat.format(template, parameters);
IFile file = project.getFile(fileName);
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -28,7 +28,6 @@
import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide6259Test;
import org.jboss.tools.jsf.jsp.ca.test.WebContentAssistProviderTest;
import org.jboss.tools.jsf.ui.test.refactoring.ELReferencesRenameTest;
-import org.jboss.tools.jsf.ui.test.validation.ELValidationTest;
import org.jboss.tools.test.util.ProjectImportTestSetup;
public class JsfUiAllTests {
@@ -80,10 +79,6 @@
"org.jboss.tools.jsf.ui.test",
new String[]{"projects/test_jsf_project"},
new String[]{"test_jsf_project"}));
- suite.addTest(new ProjectImportTestSetup(new TestSuite(
- ELValidationTest.class), "org.jboss.tools.jsf.ui.test", //$NON-NLS-1$
- new String[] { "projects/testJSFProject", }, //$NON-NLS-1$
- new String[] { "testJSFProject" })); //$NON-NLS-1$
return new TestWizardsProject(suite);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.properties 2010-10-14 19:14:12 UTC
(rev 25838)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.properties 2010-10-14 19:37:51 UTC
(rev 25839)
@@ -3,4 +3,5 @@
Bundle-Name.0 = Web KB
# END NON-TRANSLATABLE
-KBProblemName=KB Problem
\ No newline at end of file
+KBProblemName=KB Problem
+KBBuilderProblemName=KB Builder Problem
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2010-10-14 19:14:12 UTC (rev
25838)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/plugin.xml 2010-10-14 19:37:51 UTC (rev
25839)
@@ -125,19 +125,26 @@
</cssholder>
</extension>
- <extension id="kbproblemmarker" name="%KBProblemName"
point="org.eclipse.core.resources.markers">
+ <extension id="kbBuilderProblemMarker"
name="%KBBuilderProblemName"
point="org.eclipse.core.resources.markers">
<super type="org.eclipse.core.resources.problemmarker">
</super>
<persistent value="true">
</persistent>
</extension>
+ <extension id="kbproblemmarker" name="%KBProblemName"
point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.wst.validation.problemmarker">
+ </super>
+ <persistent value="true">
+ </persistent>
+ </extension>
+
<extension point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
- markerType="org.jboss.tools.jst.web.kb.kbproblemmarker"
+ markerType="org.jboss.tools.jst.web.kb.kbBuilderProblemMarker"
class="org.jboss.tools.jst.web.kb.action.KBProblemMarkerResolutionGenerator">
</markerResolutionGenerator>
- </extension>
+ </extension>
<extension
point="org.eclipse.wst.validation.validator"
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/action/EnableKBOnProject.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/action/EnableKBOnProject.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/action/EnableKBOnProject.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -44,7 +44,7 @@
try {
EclipseResourceUtil.addNatureToProject(project, IKbProject.NATURE_ID);
// Find existing KBNATURE problem marker and kill it if exists
- project.deleteMarkers(KbProject.KB_PROBLEM_MARKER_TYPE, true, IResource.DEPTH_ONE);
+ project.deleteMarkers(KbProject.KB_BUILDER_PROBLEM_MARKER_TYPE, true,
IResource.DEPTH_ONE);
} catch (CoreException e) {
WebKbPlugin.getDefault().logError(e);
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/KbProject.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -894,7 +894,7 @@
IMarker[] markers = getOwnedMarkers(project);
if (markers != null && markers.length > 0) {
try {
- project.deleteMarkers(KB_PROBLEM_MARKER_TYPE, true, IResource.DEPTH_ONE);
+ project.deleteMarkers(KB_BUILDER_PROBLEM_MARKER_TYPE, true, IResource.DEPTH_ONE);
project.setPersistentProperty(KbProjectFactory.NATURE_MOCK, null);
} catch (CoreException ex) {
WebKbPlugin.getDefault().logError(ex);
@@ -924,7 +924,7 @@
return false;
}
- public static final String KB_PROBLEM_MARKER_TYPE =
"org.jboss.tools.jst.web.kb.kbproblemmarker"; //$NON-NLS-1$
+ public static final String KB_BUILDER_PROBLEM_MARKER_TYPE =
"org.jboss.tools.jst.web.kb.kbBuilderProblemMarker"; //$NON-NLS-1$
private static IMarker[] getOwnedMarkers(IResource r) {
ArrayList<IMarker> l = null;
@@ -937,7 +937,7 @@
String _type = ms[i].getType();
if(_type == null) continue;
- if(!_type.equals(KB_PROBLEM_MARKER_TYPE)) continue;
+ if(!_type.equals(KB_BUILDER_PROBLEM_MARKER_TYPE)) continue;
if(!ms[i].isSubtypeOf(IMarker.PROBLEM)) continue;
if(l == null)
@@ -960,7 +960,7 @@
String message = MessageFormat.format(KbMessages.KBPROBLEM, args.toArray());
if (m == null) {
- m = r.createMarker(KB_PROBLEM_MARKER_TYPE);
+ m = r.createMarker(KB_BUILDER_PROBLEM_MARKER_TYPE);
r.setPersistentProperty(KbProjectFactory.NATURE_MOCK, "true");
//$NON-NLS-1$
KbProjectFactory.getKbProject(r.getProject(), true);
}
@@ -997,5 +997,4 @@
if(validationContext != null)
System.out.println("validationContext " +
validationContext.getModificationsSinceLastStore());
}
-
}
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidationErrorManager.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -40,7 +40,7 @@
*/
public abstract class ValidationErrorManager implements IValidationErrorManager {
- static String VALIDATION_MARKER = ValidationPlugin.PLUGIN_ID +
".problemmarker"; //$NON-NLS-1$
+ public static String DEFAULT_VALIDATION_MARKER = ValidationPlugin.PLUGIN_ID +
".problemmarker"; //$NON-NLS-1$
static String VALIDATION_MARKER_OWNER = "owner"; //$NON-NLS-1$
static String VALIDATION_MARKER_GROUP = "groupName"; //$NON-NLS-1$
@@ -209,7 +209,7 @@
return addError(message, severity, messageArguments, lineNumber, length, offset,
target, getDocumentProvider(), getMarkerId(), getMarkerOwner());
}
- public static IMarker addError(String message, int severity, Object[] messageArguments,
int lineNumber, int length, int offset, IResource target, TextFileDocumentProvider
documentProvider, String markerId, Class markerOwner, int maxNumberOfMarkersPerFile) {
+ public static IMarker addError(String message, int severity, Object[] messageArguments,
int lineNumber, int length, int offset, IResource target, TextFileDocumentProvider
documentProvider, String markerId, Class markerOwner, int maxNumberOfMarkersPerFile,
String markerType) {
IMarker marker = null;
try {
if(lineNumber<1) {
@@ -227,7 +227,7 @@
}
marker = addTask(markerOwner.getName().intern(), target, lineNumber,
MessageFormat.format(message, messageArguments),
- severity, null, markerId, offset, length, maxNumberOfMarkersPerFile);
+ severity, null, markerId, offset, length, maxNumberOfMarkersPerFile, markerType);
} catch (CoreException e) {
WebKbPlugin.getDefault().logError(
NLS.bind(KbMessages.EXCEPTION_DURING_CREATING_MARKER, target.getFullPath()), e);
@@ -254,28 +254,33 @@
* @return
*/
public IMarker addError(String message, int severity, Object[] messageArguments, int
lineNumber, int length, int offset, IResource target, TextFileDocumentProvider
documentProvider, String markerId, Class markerOwner) {
- return addError(message, severity, messageArguments, lineNumber, length, offset,
target, documentProvider, markerId, markerOwner,
getMaxNumberOfMarkersPerFile(target.getProject()));
+ return addError(message, severity, messageArguments, lineNumber, length, offset,
target, documentProvider, markerId, markerOwner,
getMaxNumberOfMarkersPerFile(target.getProject()), getMarkerType());
}
abstract public int getMaxNumberOfMarkersPerFile(IProject project);
+ public abstract String getMarkerType();
+
private static IMarker addTask(String pluginId, IResource resource, int location,
- String message, int markerType, String targetObjectName,
- String groupName, int offset, int length, int maxNumberOfMarkersPerFile) throws
CoreException {
+ String message, int severityEnumValue, String targetObjectName,
+ String groupName, int offset, int length, int maxNumberOfMarkersPerFile, String
markerType) throws CoreException {
if ((message == null) || (resource == null) || (!resource.exists())) {
return null;
}
- int severity = getSeverity(markerType);
+ int severity = getSeverity(severityEnumValue);
+ if(markerType==null) {
+ markerType = DEFAULT_VALIDATION_MARKER;
+ }
if(maxNumberOfMarkersPerFile>0) {
- int existingMarkers = resource.findMarkers(VALIDATION_MARKER, true,
IResource.DEPTH_ZERO).length;
+ int existingMarkers = resource.findMarkers(markerType, true,
IResource.DEPTH_ZERO).length;
if(existingMarkers>maxNumberOfMarkersPerFile) {
return null;
}
}
- IMarker item = resource.createMarker(VALIDATION_MARKER); // add a validation marker
+ IMarker item = resource.createMarker(markerType); // add a validation marker
boolean offsetSet = ((offset != IMessage.OFFSET_UNSET) && (length !=
IMessage.OFFSET_UNSET));
int size = (offsetSet) ? 7 : 5;
@@ -307,12 +312,6 @@
return item;
}
- private IMarker addTask(String pluginId, IResource resource, int location,
- String message, int markerType, String targetObjectName,
- String groupName, int offset, int length) throws CoreException {
- return addTask(pluginId, resource, location, message, markerType, targetObjectName,
groupName, offset, length, getMaxNumberOfMarkersPerFile(resource.getProject()));
- }
-
private static int getSeverity(int severityEnumValue) {
switch (severityEnumValue) {
case (IMessage.HIGH_SEVERITY) : {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatorManager.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatorManager.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/validation/ValidatorManager.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -16,12 +16,15 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.wst.validation.internal.core.ValidationException;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
+import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.jboss.tools.jst.web.kb.validation.IValidator;
/**
@@ -88,13 +91,25 @@
}
private IStatus validate(List<IValidator> validators, Set<IFile>
changedFiles, IProject rootProject, ContextValidationHelper validationHelper, IReporter
reporter) throws ValidationException {
+ removeMarkers(changedFiles);
for (IValidator validator : validators) {
validator.validate(changedFiles, rootProject, validationHelper, this, reporter);
}
return OK_STATUS;
}
+ private void removeMarkers(Set<IFile> files) {
+ try {
+ for (IFile file : files) {
+ file.deleteMarkers(IValidator.KB_PROBLEM_MARKER_TYPE, true, IResource.DEPTH_ZERO);
+ }
+ } catch (CoreException e) {
+ WebKbPlugin.getDefault().logError(e);
+ }
+ }
+
private IStatus validateAll(List<IValidator> validators, IProject rootProject,
ContextValidationHelper validationHelper, IReporter reporter) throws ValidationException
{
+ removeMarkers(validationHelper.getProjectSetRegisteredFiles());
for (IValidator validator : validators) {
validator.validateAll(rootProject, validationHelper, this, reporter);
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/validation/IValidator.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/validation/IValidator.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/validation/IValidator.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -26,6 +26,7 @@
*/
public interface IValidator {
+ public static final String KB_PROBLEM_MARKER_TYPE =
"org.jboss.tools.jst.web.kb.kbproblemmarker"; //$NON-NLS-1$
public static final String MARKED_RESOURCE_MESSAGE_GROUP = "markedKbResource";
//$NON-NLS-1$
public static final String RESOURCE_MESSAGE_ID = "org.jboss.tools.kb.problem";
//$NON-NLS-1$
public static final String EXTENSION_POINT_ID =
"org.jboss.tools.jst.web.kb.validator"; //$NON-NLS-1$
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.properties 2010-10-14 19:14:12 UTC
(rev 25838)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.properties 2010-10-14 19:37:51 UTC
(rev 25839)
@@ -2,4 +2,6 @@
pluginName=Seam Core
Bundle-Vendor.0 = JBoss by Red Hat
-Bundle-Name.0 = Seam Tools
\ No newline at end of file
+Bundle-Name.0 = Seam Tools
+
+KBProblemName=Seam Problem
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2010-10-14 19:14:12 UTC (rev
25838)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2010-10-14 19:37:51 UTC (rev
25839)
@@ -510,6 +510,13 @@
<project-set id="seam.searcher"
projectset-class="org.jboss.tools.seam.internal.core.refactoring.ELProjectSet"
/>
</extension>
+ <extension id="seamproblem" name="%KBProblemName"
point="org.eclipse.core.resources.markers">
+ <super type="org.jboss.tools.jst.web.kb.kbproblemmarker">
+ </super>
+ <persistent value="true">
+ </persistent>
+ </extension>
+
<extension
point="org.jboss.tools.jst.web.kb.validator">
<validator
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-10-14
19:14:12 UTC (rev 25838)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -83,8 +83,9 @@
* @author Alexey Kazakov
*/
public class SeamCoreValidator extends SeamValidationErrorManager implements IValidator
{
- public static final String ID = "org.jboss.tools.seam.core.CoreValidator";
-
+ public static final String ID = "org.jboss.tools.seam.core.CoreValidator";
//$NON-NLS-1$
+ public static final String PROBLEM_TYPE =
"org.jboss.tools.seam.core.seamproblem"; //$NON-NLS-1$
+
public static final String MESSAGE_ID_ATTRIBUTE_NAME = "Seam_message_id";
//$NON-NLS-1$
public static final int NONUNIQUE_COMPONENT_NAME_MESSAGE_ID = 1;
@@ -102,12 +103,20 @@
public static final int ENTITY_COMPONENT_WRONG_SCOPE_ID = 13;
public static final int UNKNOWN_COMPONENT_PROPERTY_ID = 14;
-
private ISeamProject seamProject;
private String projectName;
/*
* (non-Javadoc)
+ * @see
org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager#getMarkerType()
+ */
+ @Override
+ public String getMarkerType() {
+ return PROBLEM_TYPE;
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.validation.IValidator#getId()
*/
public String getId() {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamEarProjectValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamEarProjectValidator.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamEarProjectValidator.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -188,11 +188,11 @@
int position = offset + text.indexOf(jarName);
int length = jarName.length();
if(SEAM_JAR_NAME.equals(jarName)) {
- ValidationErrorManager.addError(SeamValidationMessages.INVALID_JAR_MODULE_IN_APPLICATION_XML,
IMessage.HIGH_SEVERITY, new String[]{jarName}, 0, length, position, file,
documentProvider, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP,
this.getClass(), 0);
+ ValidationErrorManager.addError(SeamValidationMessages.INVALID_JAR_MODULE_IN_APPLICATION_XML,
IMessage.HIGH_SEVERITY, new String[]{jarName}, 0, length, position, file,
documentProvider, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP,
this.getClass(), 0, null);
break;
}
if(jarName.startsWith(JARS[jarIndex])) {
- ValidationErrorManager.addError(SeamValidationMessages.INVALID_JAR_MODULE_IN_APPLICATION_XML,
IMessage.NORMAL_SEVERITY, new String[]{jarName}, 0, length, position, file,
documentProvider, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP,
this.getClass(), 0);
+ ValidationErrorManager.addError(SeamValidationMessages.INVALID_JAR_MODULE_IN_APPLICATION_XML,
IMessage.NORMAL_SEVERITY, new String[]{jarName}, 0, length, position, file,
documentProvider, SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP,
this.getClass(), 0, null);
break;
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamProjectPropertyValidator.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -37,6 +37,7 @@
import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
import org.jboss.tools.jst.web.kb.internal.validation.ContextValidationHelper;
import org.jboss.tools.jst.web.kb.internal.validation.ProblemMessage;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager;
import org.jboss.tools.jst.web.kb.validation.IValidationErrorManager;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -108,6 +109,11 @@
setReporter(reporter);
setMarkerId(SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
}
+
+ @Override
+ public String getMarkerType() {
+ return ValidationErrorManager.DEFAULT_VALIDATION_MARKER;
+ }
};
errorManager.init(project, null, this, reporter);
@@ -352,5 +358,4 @@
String[] messageArguments, IResource target) {
return errorManager.addError(message, preferenceKey, messageArguments, target);
}
-
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationErrorManager.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationErrorManager.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationErrorManager.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -17,7 +17,7 @@
/**
* @author Alexey Kazakov
*/
-public class SeamValidationErrorManager extends ValidationErrorManager {
+abstract public class SeamValidationErrorManager extends ValidationErrorManager {
public static final String MARKED_SEAM_PROJECT_MESSAGE_GROUP =
"markedSeamProject"; //$NON-NLS-1$
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/validation/SeamProjectPropertyValidatorWrapper.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -14,6 +14,7 @@
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.jboss.tools.common.text.ITextSourceReference;
import org.jboss.tools.jst.web.kb.internal.validation.ContextValidationHelper;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidationErrorManager;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
import org.jboss.tools.jst.web.kb.validation.IValidatingProjectSet;
import org.jboss.tools.jst.web.kb.validation.IValidationErrorManager;
@@ -88,6 +89,11 @@
setReporter(reporter);
setMarkerId(SeamValidationErrorManager.MARKED_SEAM_PROJECT_MESSAGE_GROUP);
}
+
+ @Override
+ public String getMarkerType() {
+ return ValidationErrorManager.DEFAULT_VALIDATION_MARKER;
+ }
};
//errorManager.init(project, null, this, reporter);
Modified:
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-10-14
19:14:12 UTC (rev 25838)
+++
trunk/tests/plugins/org.jboss.tools.tests/src/org/jboss/tools/tests/AbstractResourceMarkerTest.java 2010-10-14
19:37:51 UTC (rev 25839)
@@ -286,12 +286,9 @@
return numbers.toArray(new Integer[0]);
}
- public static int getMarkersNumberByGroupName(IResource resource, String messageGroup)
{
+ public static int getMarkersNumberByGroupName(String type, IResource resource, String
messageGroup) {
try{
- IMarker[] markers = resource.findMarkers(MARKER_TYPE, true,
IResource.DEPTH_INFINITE);
-// for(int i=0;i<markers.length;i++){
-// System.out.println("Marker - "+markers[i].getAttribute(IMarker.MESSAGE,
""));
-// }
+ IMarker[] markers = resource.findMarkers(type, true, IResource.DEPTH_INFINITE);
int length = markers.length;
for (int i = 0; i < markers.length; i++) {
String groupName = markers[i].getAttribute("groupName", null);
@@ -306,6 +303,10 @@
return -1;
}
+ public static int getMarkersNumberByGroupName(IResource resource, String messageGroup)
{
+ return getMarkersNumberByGroupName(MARKER_TYPE, resource, messageGroup);
+ }
+
/**
*
* @author eskimo