01: /*
02: * SmoothGradientComboBoxEditor.java
03: *
04: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package org.underworldlabs.swing.plaf.smoothgradient;
23:
24: import javax.swing.JTextField;
25: import javax.swing.UIManager;
26: import javax.swing.plaf.basic.BasicComboBoxEditor;
27:
28: /* ----------------------------------------------------------
29: * CVS NOTE: Changes to the CVS repository prior to the
30: * release of version 3.0.0beta1 has meant a
31: * resetting of CVS revision numbers.
32: * ----------------------------------------------------------
33: */
34:
35: /**
36: *
37: * @author Takis Diakoumis
38: * @version $Revision: 1.4 $
39: * @date $Date: 2006/05/14 06:56:07 $
40: */
41: class SmoothGradientComboBoxEditor extends BasicComboBoxEditor {
42:
43: public SmoothGradientComboBoxEditor() {
44: editor = new JTextField("", 9) {
45: // workaround for 4530952
46: public void setText(String s) {
47: if (getText().equals(s)) {
48: return;
49: }
50: super .setText(s);
51: }
52: };
53:
54: editor.setBorder(UIManager.getBorder("ComboBox.editorBorder"));
55: }
56:
57: /**
58: * A subclass of BasicComboBoxEditor that implements UIResource.
59: * BasicComboBoxEditor doesn't implement UIResource
60: * directly so that applications can safely override the
61: * cellRenderer property with BasicListCellRenderer subclasses.
62: */
63: public static final class UIResource extends
64: SmoothGradientComboBoxEditor implements
65: javax.swing.plaf.UIResource {
66: }
67:
68: }
|