Author: scabanovich
Date: 2010-10-04 06:21:14 -0400 (Mon, 04 Oct 2010)
New Revision: 25446
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/ESBPreferenceInitializer.java
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBPreferences.java
Log:
JBIDE-7235
https://jira.jboss.org/browse/JBIDE-7235
Enabling/Disabling ESB validation.
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-04
09:49:08 UTC (rev 25445)
+++
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBCoreValidator.java 2010-10-04
10:21:14 UTC (rev 25446)
@@ -68,10 +68,10 @@
//ignore
}
- if(esbContentFolder != null) return true;
+ if(esbContentFolder != null) return isEnabled(project);
try {
- return project != null && project.isAccessible() &&
project.hasNature(ESBProjectConstant.ESB_PROJECT_NATURE);
+ return project != null && project.isAccessible() &&
project.hasNature(ESBProjectConstant.ESB_PROJECT_NATURE) && isEnabled(project);
} catch (CoreException e) {
ESBValidatorPlugin.log(e);
}
@@ -224,7 +224,7 @@
}
public boolean isEnabled(IProject project) {
- return true;
+ return ESBPreferences.isValidationEnabled(project);
}
void validateActions(XModelObject object, IFile file) {
Modified:
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBPreferenceInitializer.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBPreferenceInitializer.java 2010-10-04
09:49:08 UTC (rev 25445)
+++
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBPreferenceInitializer.java 2010-10-04
10:21:14 UTC (rev 25446)
@@ -27,6 +27,7 @@
@Override
public void initializeDefaultPreferences() {
IEclipsePreferences defaultPreferences = ((IScopeContext) new
DefaultScope()).getNode(ESBValidatorPlugin.PLUGIN_ID);
+ defaultPreferences.putBoolean(SeverityPreferences.ENABLE_BLOCK_PREFERENCE_NAME, true);
for (String name : ESBPreferences.SEVERITY_OPTION_NAMES) {
defaultPreferences.put(name, SeverityPreferences.ERROR);
}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBPreferences.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBPreferences.java 2010-10-04
09:49:08 UTC (rev 25445)
+++
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBPreferences.java 2010-10-04
10:21:14 UTC (rev 25446)
@@ -70,4 +70,9 @@
public static boolean shouldValidateCore(IProject project) {
return true;
}
+
+ public static boolean isValidationEnabled(IProject project) {
+ return INSTANCE.isEnabled(project);
+ }
+
}
\ No newline at end of file