Search in sources :

Example 1 with ProjectInformation

use of org.netbeans.api.project.ProjectInformation in project netbeans-mmd-plugin by raydac.

the class ProjectCellRenderer method getListCellRendererComponent.

@Override
public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
    if (!(value instanceof Project)) {
        return this;
    }
    setName("ComboBox.listRenderer");
    final ProjectInformation info = ProjectUtils.getInformation((Project) value);
    setText(info.getDisplayName());
    setIcon(info.getIcon());
    if (isSelected) {
        setBackground(list.getSelectionBackground());
        setForeground(list.getSelectionForeground());
    } else {
        setBackground(list.getBackground());
        setForeground(list.getForeground());
    }
    return this;
}
Also used : Project(org.netbeans.api.project.Project) ProjectInformation(org.netbeans.api.project.ProjectInformation)

Aggregations

Project (org.netbeans.api.project.Project)1 ProjectInformation (org.netbeans.api.project.ProjectInformation)1