Author: scabanovich
Date: 2009-03-05 11:08:09 -0500 (Thu, 05 Mar 2009)
New Revision: 14024
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VRuleImpl.java
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VRuleSetImpl.java
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleModel.java
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleSetModel.java
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleSetsLoader.java
Log:
JBIDE-3926
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VRuleImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VRuleImpl.java 2009-03-05
15:54:59 UTC (rev 14023)
+++
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VRuleImpl.java 2009-03-05
16:08:09 UTC (rev 14024)
@@ -22,6 +22,7 @@
protected String name;
protected VResult[] results;
protected boolean enabled;
+ protected boolean defaultEnabled = true;
protected VAction action;
protected VRuleSet ruleSet;
protected int significance;
@@ -85,6 +86,14 @@
propertyChangeSupport.firePropertyChange("enabled", oldEnabled,
enabled);
}
+ public void setDefaultEnabled(boolean b) {
+ defaultEnabled = b;
+ }
+
+ public boolean isDefaultEnabled() {
+ return defaultEnabled;
+ }
+
public VAction getAction() {
return action;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VRuleSetImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VRuleSetImpl.java 2009-03-05
15:54:59 UTC (rev 14023)
+++
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/impl/VRuleSetImpl.java 2009-03-05
16:08:09 UTC (rev 14024)
@@ -29,6 +29,7 @@
protected String vendor;
protected String version;
protected boolean enabled;
+ protected boolean defaultEnabled = true;
protected ResourceBundle bundle;
protected PropertyChangeSupport propertyChangeSupport;
protected Object managerKey;
@@ -88,6 +89,14 @@
this.enabled = enabled;
propertyChangeSupport.firePropertyChange("enabled", oldEnabled,
enabled);
}
+
+ public void setDefaultEnabled(boolean b) {
+ defaultEnabled = b;
+ }
+
+ public boolean isDefaultEnabled() {
+ return defaultEnabled;
+ }
public VRuleSet getParentRuleSet() {
return parentRuleSet;
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleModel.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleModel.java 2009-03-05
15:54:59 UTC (rev 14023)
+++
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleModel.java 2009-03-05
16:08:09 UTC (rev 14024)
@@ -51,6 +51,10 @@
rule.setDescription(getAttributeValue("description"));
rule.setCategory(getAttributeValue("category"));
rule.setEnabled(Boolean.valueOf(getAttributeValue("enabled")).booleanValue());
+ String defaultEnabled = get("default-enabled");
+ if("false".equals(defaultEnabled)) {
+ rule.setDefaultEnabled(false);
+ }
rule.setResults(new VResult[0]);
VEntity[] entities = getEntities(getAttributeValue("entities"));
rule.setEntities(entities);
@@ -116,6 +120,17 @@
return new VActionWrapper(className);
}
+ public void set(String name, String value) {
+ super.set(name, value);
+ if (rule != null) {
+ if ("default-enabled".equals(name)) {
+ if("false".equals(value)) {
+ rule.setDefaultEnabled(false);
+ }
+ }
+ }
+ }
+
public String setAttributeValue(String name, String value) {
String result = super.setAttributeValue(name, value);
if (rule != null) {
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleSetModel.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleSetModel.java 2009-03-05
15:54:59 UTC (rev 14023)
+++
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleSetModel.java 2009-03-05
16:08:09 UTC (rev 14024)
@@ -51,6 +51,10 @@
ruleSet.setName(getAttributeValue("name"));
ruleSet.setDescription(getAttributeValue("description"));
ruleSet.setEnabled(Boolean.valueOf(getAttributeValue("enabled")).booleanValue());
+ String defaultEnabled = get("default-enabled");
+ if("false".equals(defaultEnabled)) {
+ ruleSet.setDefaultEnabled(false);
+ }
ruleSet.setURL(getAttributeValue("url"));
ruleSet.setVendor(getAttributeValue("vendor"));
ruleSet.setVersion(getAttributeValue("version"));
@@ -111,6 +115,17 @@
return null;
}
+ public void set(String name, String value) {
+ super.set(name, value);
+ if (ruleSet != null) {
+ if ("default-enabled".equals(name)) {
+ if("false".equals(value)) {
+ ruleSet.setDefaultEnabled(false);
+ }
+ }
+ }
+ }
+
public String setAttributeValue(String name, String value) {
String result = super.setAttributeValue(name, value);
if (ruleSet != null) {
Modified:
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleSetsLoader.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleSetsLoader.java 2009-03-05
15:54:59 UTC (rev 14023)
+++
trunk/common/plugins/org.jboss.tools.common.verification/src/org/jboss/tools/common/verification/vrules/model/VRuleSetsLoader.java 2009-03-05
16:08:09 UTC (rev 14024)
@@ -94,6 +94,10 @@
org.jboss.tools.common.meta.XAttribute[] as =
object.getModelEntity().getAttributes();
for (int i = 0; i < as.length; i++) {
String n = as[i].getName();
+ if ("enabled".equals(n)) {
+ String nv = update.getAttributeValue(n);
+ object.set("default-enabled", nv);
+ }
if ("enabled".equals(n) || "installed".equals(n))
continue;
String ov = object.getAttributeValue(n);
String nv = update.getAttributeValue(n);
Show replies by date