/** Create a ComboBoxUI that does not display borders on the combo box. * Since the property sheet is rendered as a table, this looks better. * This UI also delegates closing of its popup to the property sheet, which * has better knowledge of when this is appropriate, in the case of focus * changes. Inplace editors which employ a combo box should use the UI * returned by this method, rather than the default for the look and feel. * Thus the appearance will be consistent with the rest of the property * sheet. */ public static javax.swing.plaf.ComboBoxUI createComboUI (JComboBox box, boolean tableUI) { return new CleanComboUI(tableUI); }
@Override protected void installDefaults() { LookAndFeel.installColorsAndFont(comboBox, "ComboBox.background", "ComboBox.foreground", "ComboBox.font"); //NOI18N if (tableUI) { comboBox.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0)); } else { comboBox.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(PropUtils.getShadowColor()), //leave room for the focus rect on the left, so it doesn't //overpaint the first pixel column of text BorderFactory.createEmptyBorder(0, 2, 0, 0) ) ); } installComboDefaults(comboBox); }
public void layoutContainer(Container parent) { super.layoutContainer (parent); if (editor != null) { java.awt.Rectangle r = rectangleForCurrentValue(); r.x = 0; r.y = 0; r.height = comboBox.getHeight(); editor.setBounds (r); } } }
protected void installDefaults() { LookAndFeel.installColorsAndFont( comboBox, "ComboBox.background", "ComboBox.foreground", "ComboBox.font" ); //NOI18N if (tableUI) { comboBox.setBorder (BorderFactory.createEmptyBorder (0,3,0,0)); } else { comboBox.setBorder ( BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(PropUtils.getShadowColor()), //leave room for the focus rect on the left, so it doesn't //overpaint the first pixel column of text BorderFactory.createEmptyBorder(0, 2, 0, 0))); } installComboDefaults(comboBox); }
public void layoutContainer(Container parent) { super.layoutContainer (parent); if (editor != null) { java.awt.Rectangle r = rectangleForCurrentValue(); r.x = 0; r.y = 0; r.height = comboBox.getHeight(); editor.setBounds (r); } } }
/** Create a ComboBoxUI that does not display borders on the combo box. * Since the property sheet is rendered as a table, this looks better. * This UI also delegates closing of its popup to the property sheet, which * has better knowledge of when this is appropriate, in the case of focus * changes. Inplace editors which employ a combo box should use the UI * returned by this method, rather than the default for the look and feel. * Thus the appearance will be consistent with the rest of the property * sheet. */ public static javax.swing.plaf.ComboBoxUI createComboUI(JComboBox box, boolean tableUI) { return new CleanComboUI(tableUI); }
protected void installDefaults() { LookAndFeel.installColorsAndFont( comboBox, "ComboBox.background", "ComboBox.foreground", "ComboBox.font" ); //NOI18N if (tableUI) { comboBox.setBorder (BorderFactory.createEmptyBorder (0,3,0,0)); } else { comboBox.setBorder ( BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(PropUtils.getShadowColor()), //leave room for the focus rect on the left, so it doesn't //overpaint the first pixel column of text BorderFactory.createEmptyBorder(0, 2, 0, 0))); } installComboDefaults(comboBox); }
/** Create a ComboBoxUI that does not display borders on the combo box. * Since the property sheet is rendered as a table, this looks better. * This UI also delegates closing of its popup to the property sheet, which * has better knowledge of when this is appropriate, in the case of focus * changes. Inplace editors which employ a combo box should use the UI * returned by this method, rather than the default for the look and feel. * Thus the appearance will be consistent with the rest of the property * sheet. */ public static javax.swing.plaf.ComboBoxUI createComboUI (JComboBox box, boolean tableUI) { return new CleanComboUI(tableUI); }
private void prepareCustomEditor( Object customEditorObj ) { JComboBox comboBox = null; if( customEditorObj instanceof DefaultCellEditor ) { if( ((DefaultCellEditor)customEditorObj).getComponent() instanceof JComboBox ) { comboBox = ( JComboBox ) ((DefaultCellEditor)customEditorObj).getComponent(); } } else if( customEditorObj instanceof JComboBox ) { comboBox = ( JComboBox ) customEditorObj; } if( null != comboBox ) { if( !(comboBox.getUI() instanceof CleanComboUI) ) { comboBox.setUI( new CleanComboUI( true ) ); ComboBoxAutoCompleteSupport.install( comboBox ); } } }