use of net.sourceforge.pmd.RulePriority in project pmd-eclipse-plugin by pmd.
the class GeneralPreferencesPage method selectedPriorities.
private static void selectedPriorities(List<RulePriority> items, ShapePicker<Shape> ssc, ColorSelector colorPicker, Text nameField) {
if (items.size() != 1) {
ssc.setSelection((Shape) null);
nameField.setText("");
return;
}
RulePriority priority = items.get(0);
PriorityDescriptor desc = PriorityDescriptorCache.INSTANCE.descriptorFor(priority);
ssc.setSelection(desc.shape.shape);
nameField.setText(desc.label);
colorPicker.setColorValue(desc.shape.rgbColor);
}
use of net.sourceforge.pmd.RulePriority in project pmd-eclipse-plugin by pmd.
the class PriorityDescriptorCache method storeInPreferences.
public void storeInPreferences() {
IPreferencesManager mgr = preferencesManager();
IPreferences prefs = mgr.loadPreferences();
for (Map.Entry<RulePriority, PriorityDescriptor> entry : uiDescriptorsByPriority.entrySet()) {
prefs.setPriorityDescriptor(entry.getKey(), entry.getValue());
}
mgr.storePreferences(prefs);
}
use of net.sourceforge.pmd.RulePriority in project pmd-eclipse-plugin by pmd.
the class PriorityDescriptorCache method hasChanges.
public boolean hasChanges() {
IPreferences preferences = preferencesManager().reloadPreferences();
for (RulePriority rp : UISettings.currentPriorities(true)) {
PriorityDescriptor newOne = uiDescriptorsByPriority.get(rp);
PriorityDescriptor currentOne = preferences.getPriorityDescriptor(rp);
if (newOne.equals(currentOne)) {
continue;
}
return true;
}
return false;
}
Aggregations