1 19 20 package org.netbeans.modules.javadoc.search; 21 22 import java.awt.Component ; 23 import javax.swing.JList ; 24 import javax.swing.JLabel ; 25 import javax.swing.DefaultListCellRenderer ; 26 27 31 class IndexListCellRenderer extends DefaultListCellRenderer { 32 33 static final long serialVersionUID =543071118545614229L; 34 public Component getListCellRendererComponent( JList list, 35 Object value, 36 int index, 37 boolean isSelected, 38 boolean cellHasFocus) { 39 JLabel cr = (JLabel )super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus ); 40 41 cr.setIcon( DocSearchIcons.getIcon( ((DocIndexItem)value).getIconIndex() ) ); 42 43 try { 44 if ( ((DocIndexItem)value).getURL() == null ) 45 setForeground (java.awt.SystemColor.textInactiveText); 46 } 47 catch ( java.net.MalformedURLException e ) { 48 setForeground (java.awt.SystemColor.textInactiveText); 49 } 50 return cr; 51 } 52 } 53 | Popular Tags |