use of net.sourceforge.pmd.lang.rule.RuleReference in project pmd-eclipse-plugin by pmd.
the class RuleSetUtil method addRuleSetByReference.
public static RuleSet addRuleSetByReference(RuleSet ruleSet, RuleSet sourceRuleSet, boolean allRules) {
RuleSetReference reference = new RuleSetReference(sourceRuleSet.getFileName(), allRules);
Collection<Rule> rules = new ArrayList<Rule>(ruleSet.getRules());
for (Rule rule : sourceRuleSet.getRules()) {
RuleReference ruleRef = new RuleReference(rule, reference);
rules.add(ruleRef);
}
RuleSetFactory factory = new RuleSetFactory();
return factory.createNewRuleSet(ruleSet.getName(), ruleSet.getDescription(), ruleSet.getFileName(), ruleSet.getExcludePatterns(), ruleSet.getIncludePatterns(), rules);
}
use of net.sourceforge.pmd.lang.rule.RuleReference in project pmd-eclipse-plugin by pmd.
the class XPathPanelManager method updateOverridenFields.
protected void updateOverridenFields() {
Rule rule = soleRule();
if (rule instanceof RuleReference) {
RuleReference ruleReference = (RuleReference) rule;
xpathField.setBackground(ruleReference.hasOverriddenProperty(XPathRule.XPATH_DESCRIPTOR) ? overridenColour : null);
}
}
use of net.sourceforge.pmd.lang.rule.RuleReference in project pmd-eclipse-plugin by pmd.
the class DescriptionPanelManager method updateOverridenFields.
protected void updateOverridenFields() {
Rule rule = soleRule();
if (rule instanceof RuleReference) {
RuleReference ruleReference = (RuleReference) rule;
messageField.setBackground(ruleReference.getOverriddenMessage() != null ? overridenColour : null);
descriptionBox.setBackground(ruleReference.getOverriddenDescription() != null ? overridenColour : null);
externalURLField.setBackground(ruleReference.getOverriddenExternalInfoUrl() != null ? overridenColour : null);
}
}
Aggregations