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;
}
Aggregations