1 19 20 package org.openharmonise.him.displaycomponents.search; 21 22 import java.awt.*; 23 24 import javax.swing.*; 25 26 import org.openharmonise.him.window.swing.SelfRenderListCell; 27 import org.openharmonise.vfs.gui.*; 28 29 30 38 public class OtherPathCell implements SelfRenderListCell { 39 40 43 private Color m_selectedColor = new Color(173,169,143); 44 45 48 public OtherPathCell() { 49 super(); 50 } 51 52 55 public Component getRenderComponent(boolean bIsSelected, boolean bHasFocus) { 56 57 JLabel label = new JLabel("Add path..."); 58 59 String fontName = "Dialog"; 60 int fontSize = 11; 61 Font font = new Font(fontName, Font.PLAIN, fontSize); 62 63 label.setFont(font); 64 label.setIcon( IconManager.getInstance().getIcon("16-blank.gif") ); 65 66 label.setOpaque(true); 67 label.setBackground(Color.WHITE); 68 label.setBorder(BorderFactory.createLineBorder(Color.WHITE)); 69 label.setBorder(BorderFactory.createLineBorder(Color.WHITE)); 70 71 if(bIsSelected) { 72 label.setBackground(m_selectedColor); 73 label.setBorder(BorderFactory.createLineBorder(Color.BLACK)); 74 } 75 76 if(bHasFocus) { 77 label.setBorder(BorderFactory.createLineBorder(Color.BLACK)); 78 } 79 80 return label; 81 } 82 83 } 84 | Popular Tags |