Author: akazakov
Date: 2007-07-23 12:10:07 -0400 (Mon, 23 Jul 2007)
New Revision: 2612
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
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/SeamELValidator.java
Log:
http://jira.jboss.com/jira/browse/EXIN-327
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-23
15:47:18 UTC (rev 2611)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamPreferences.java 2007-07-23
16:10:07 UTC (rev 2612)
@@ -39,7 +39,7 @@
* @author Viacheslav Kabanovich
*/
public class SeamPreferences {
-
+
public static final String ERROR = "error";
public static final String WARNING = "warning";
public static final String IGNORE = "ignore";
@@ -87,21 +87,21 @@
severityOptionNames.add(name);
return name;
}
-
+
public static final Set<String> allOptionNames = new HashSet<String>();
-
+
static {
allOptionNames.addAll(severityOptionNames);
}
-
+
public static IEclipsePreferences getProjectPreferences(ISeamProject project) {
return new ProjectScope(project.getProject()).getNode(SeamCorePlugin.PLUGIN_ID);
}
-
+
public static IEclipsePreferences getDefaultPreferences() {
return new DefaultScope().getNode(SeamCorePlugin.PLUGIN_ID);
}
-
+
public static IEclipsePreferences getInstancePreferences() {
return new InstanceScope().getNode(SeamCorePlugin.PLUGIN_ID);
}
@@ -124,4 +124,32 @@
if(p == null) return null;
return p.get(key, null);
}
+
+ public static boolean isValidateCore(ISeamProject project) {
+ return !(SeamPreferences.IGNORE.equals(getProjectPreference(project,
NONUNIQUE_COMPONENT_NAME)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
STATEFUL_COMPONENT_DOES_NOT_CONTENT_REMOVE)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
STATEFUL_COMPONENT_DOES_NOT_CONTENT_DESTROY)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
STATEFUL_COMPONENT_WRONG_SCOPE)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
UNKNOWN_COMPONENT_CLASS_NAME)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
UNKNOWN_COMPONENT_PROPERTY)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
ENTITY_COMPONENT_WRONG_SCOPE)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_REMOVE))
&&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_DESTROY))
&&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_CREATE))
&&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_UNWRAP))
&&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
DESTROY_DOESNT_BELONG_TO_COMPONENT)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
CREATE_DOESNT_BELONG_TO_COMPONENT)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
UNWRAP_DOESNT_BELONG_TO_COMPONENT)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
OBSERVER_DOESNT_BELONG_TO_COMPONENT)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_FACTORY_NAME))
&&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, MULTIPLE_DATA_BINDER))
&&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_DATA_MODEL))
&&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, DUPLICATE_VARIABLE_NAME))
&&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project, UNKNOWN_VARIABLE_NAME)));
+ }
+
+ public static boolean isValidateEL(ISeamProject project) {
+ return !(SeamPreferences.IGNORE.equals(getProjectPreference(project,
INVALID_EXPRESSION)) &&
+ SeamPreferences.IGNORE.equals(getProjectPreference(project,
UNPAIRED_GETTER_OR_SETTER)));
+ }
}
\ No newline at end of file
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 2007-07-23
15:47:18 UTC (rev 2611)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2007-07-23
16:10:07 UTC (rev 2612)
@@ -64,6 +64,9 @@
*/
@Override
public IStatus validate(Set<IFile> changedFiles) throws ValidationException {
+ if(!SeamPreferences.isValidateCore(project)) {
+ return OK_STATUS;
+ }
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
Set<ISeamComponent> checkedComponents = new HashSet<ISeamComponent>();
Set<String> markedDuplicateFactoryNames = new HashSet<String>();
@@ -137,22 +140,23 @@
public IStatus validateAll() throws ValidationException {
reporter.removeAllMessages(this);
validationContext.clear();
- Set<ISeamComponent> components = project.getComponents();
- for (ISeamComponent component : components) {
- validateComponent(component);
- }
- Set<ISeamFactory> factories = project.getFactories();
- Set<String> markedDuplicateFactoryNames = new HashSet<String>();
- for (ISeamFactory factory : factories) {
- validateFactory(factory, markedDuplicateFactoryNames);
- }
+ if(SeamPreferences.isValidateCore(project)) {
+ Set<ISeamComponent> components = project.getComponents();
+ for (ISeamComponent component : components) {
+ validateComponent(component);
+ }
+ Set<ISeamFactory> factories = project.getFactories();
+ Set<String> markedDuplicateFactoryNames = new HashSet<String>();
+ for (ISeamFactory factory : factories) {
+ validateFactory(factory, markedDuplicateFactoryNames);
+ }
- Map<String,SeamJavaComponentDeclaration> declarations =
((SeamProject)project).getAllJavaComponentDeclarations();
- Collection<SeamJavaComponentDeclaration> values = declarations.values();
- for (SeamJavaComponentDeclaration d : values) {
- validateMethodsOfUnknownComponent(d);
+ Map<String,SeamJavaComponentDeclaration> declarations =
((SeamProject)project).getAllJavaComponentDeclarations();
+ Collection<SeamJavaComponentDeclaration> values = declarations.values();
+ for (SeamJavaComponentDeclaration d : values) {
+ validateMethodsOfUnknownComponent(d);
+ }
}
-
return OK_STATUS;
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-07-23
15:47:18 UTC (rev 2611)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2007-07-23
16:10:07 UTC (rev 2612)
@@ -69,11 +69,13 @@
@Override
public IStatus validateAll() throws ValidationException {
reporter.removeAllMessages(this);
- SeamELValidationHelper vlh = (SeamELValidationHelper)coreHelper;
- Collection files = vlh.getAllFilesForValidation();
- for (Object file : files) {
- if(file instanceof IFile && !reporter.isCancelled()) {
- validateFile((IFile)file);
+ if(SeamPreferences.isValidateEL(project)) {
+ SeamELValidationHelper vlh = (SeamELValidationHelper)coreHelper;
+ Collection files = vlh.getAllFilesForValidation();
+ for (Object file : files) {
+ if(file instanceof IFile && !reporter.isCancelled()) {
+ validateFile((IFile)file);
+ }
}
}
return OK_STATUS;