Search in sources :

Example 1 with LabelProvider

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

the class RulePanelManager method buildPriorityControls.

private void buildPriorityControls(Composite parent) {
    Label priorityLabel = buildLabel(parent, StringKeys.PREF_RULEEDIT_LABEL_PRIORITY);
    GridData data = new GridData();
    data.horizontalSpan = 1;
    priorityLabel.setLayoutData(data);
    priorityCombo = buildPriorityCombo(parent);
    priorityDisplay = new ShapePicker(parent, SWT.NONE, 14);
    priorityDisplay.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 4, 1));
    priorityDisplay.setShapeMap(UISettings.shapesByPriority());
    priorityDisplay.tooltipProvider(new LabelProvider() {

        public String labelFor(Object item) {
            return UISettings.labelFor((RulePriority) item);
        }
    });
    priorityDisplay.setSize(120, 25);
}
Also used : ShapePicker(net.sourceforge.pmd.eclipse.ui.ShapePicker) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) RulePriority(net.sourceforge.pmd.RulePriority) LabelProvider(net.sourceforge.pmd.eclipse.ui.LabelProvider)

Aggregations

RulePriority (net.sourceforge.pmd.RulePriority)1 LabelProvider (net.sourceforge.pmd.eclipse.ui.LabelProvider)1 ShapePicker (net.sourceforge.pmd.eclipse.ui.ShapePicker)1 GridData (org.eclipse.swt.layout.GridData)1 Label (org.eclipse.swt.widgets.Label)1