|
12 | 12 | import org.apache.log4j.Level; |
13 | 13 | import org.eclipse.core.resources.IFile; |
14 | 14 | import org.eclipse.core.resources.ResourcesPlugin; |
| 15 | +import org.eclipse.core.runtime.preferences.InstanceScope; |
15 | 16 | import org.eclipse.jface.preference.ColorSelector; |
16 | 17 | import org.eclipse.jface.preference.PreferenceDialog; |
17 | 18 | import org.eclipse.jface.preference.PreferencePage; |
|
48 | 49 | import org.eclipse.ui.IWorkbench; |
49 | 50 | import org.eclipse.ui.IWorkbenchPreferencePage; |
50 | 51 | import org.eclipse.ui.dialogs.PreferencesUtil; |
| 52 | +import org.eclipse.ui.preferences.ScopedPreferenceStore; |
51 | 53 |
|
52 | 54 | import net.sourceforge.pmd.PMD; |
53 | 55 | import net.sourceforge.pmd.RulePriority; |
@@ -821,13 +823,23 @@ private void updateMarkerIcons() { |
821 | 823 |
|
822 | 824 | PriorityDescriptorCache.INSTANCE.storeInPreferences(); |
823 | 825 |
|
| 826 | + // refresh the resources so that the rule label decorator is updated |
824 | 827 | RootRecord root = new RootRecord(ResourcesPlugin.getWorkspace().getRoot()); |
825 | 828 | Set<IFile> files = MarkerUtil.allMarkedFiles(root); |
826 | 829 | PMDPlugin.getDefault().changedFiles(files); |
827 | 830 |
|
828 | | - /* Refresh the views to pick up the marker change */ |
| 831 | + // Refresh the views to pick up the marker change |
829 | 832 | PMDPlugin.getDefault().refreshView(PMDPlugin.VIOLATIONS_OVERVIEW_ID); |
830 | | - PMDPlugin.getDefault().refreshView(PMDPlugin.VIOLATIONS_OUTLINE_ID); |
| 833 | + PMDPlugin.getDefault().refreshView(PMDPlugin.VIOLATIONS_OUTLINE_ID); |
| 834 | + |
| 835 | + // Take the color to set the overview ruler color |
| 836 | + // net.sourceforge.pmd.eclipse.plugin.annotation.prio1.color |
| 837 | + ScopedPreferenceStore editorsPreferenceStore = new ScopedPreferenceStore(InstanceScope.INSTANCE, "org.eclipse.ui.editors"); |
| 838 | + for (RulePriority priority : RulePriority.values()) { |
| 839 | + PriorityDescriptor descriptor = PriorityDescriptorCache.INSTANCE.descriptorFor(priority); |
| 840 | + editorsPreferenceStore.setValue("net.sourceforge.pmd.eclipse.plugin.annotation.prio" + priority.getPriority() + ".color", |
| 841 | + descriptor.shape.rgbColor.red + "," + descriptor.shape.rgbColor.green + "," + descriptor.shape.rgbColor.blue); |
| 842 | + } |
831 | 843 | } |
832 | 844 |
|
833 | 845 | public boolean performCancel() { |
|
0 commit comments