Search in sources :

Example 1 with PriorityDescriptorCache

use of net.sourceforge.pmd.eclipse.ui.priority.PriorityDescriptorCache in project pmd-eclipse-plugin by pmd.

the class UISettings method createRuleMarkerIcons.

public static void createRuleMarkerIcons(Display display) {
    ImageLoader loader = new ImageLoader();
    PriorityDescriptorCache pdc = PriorityDescriptorCache.INSTANCE;
    for (RulePriority priority : currentPriorities(true)) {
        Image image = pdc.descriptorFor(priority).getImage(display, MAX_MARKER_DIMENSION);
        loader.data = new ImageData[] { image.getImageData() };
        String fullPath = markerFilenameFor(priority);
        PMDPlugin.getDefault().logInformation("Writing marker icon to: " + fullPath);
        loader.save(fullPath, SWT.IMAGE_PNG);
        image.dispose();
    }
}
Also used : PriorityDescriptorCache(net.sourceforge.pmd.eclipse.ui.priority.PriorityDescriptorCache) RulePriority(net.sourceforge.pmd.RulePriority) ImageLoader(org.eclipse.swt.graphics.ImageLoader) Image(org.eclipse.swt.graphics.Image)

Aggregations

RulePriority (net.sourceforge.pmd.RulePriority)1 PriorityDescriptorCache (net.sourceforge.pmd.eclipse.ui.priority.PriorityDescriptorCache)1 Image (org.eclipse.swt.graphics.Image)1 ImageLoader (org.eclipse.swt.graphics.ImageLoader)1