KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwtx > custom > validation > ValidatableJComboBox


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: ValidatableJComboBox.java,v $
11    Revision 1.1 2004/01/20 07:38:05 bobintetley
12    Bug fixes and compatibility methods
13
14    Revision 1.1 2004/01/13 11:14:25 bobintetley
15    ErrorProvider and validation implementation
16
17 */

18
19
20 package swingwtx.custom.validation;
21
22 import java.util.Vector JavaDoc;
23
24 import swingwtx.swing.ComboBoxModel;
25 import swingwtx.swing.JComboBox;
26 import swingwtx.swing.event.PopupMenuListener;
27
28 public class ValidatableJComboBox extends ValidatableComponent {
29
30     protected JComboBox ccomp = null;
31     
32     public ValidatableJComboBox() { ccomp = new JComboBox(); comp = ccomp; setupComponent();}
33     public ValidatableJComboBox(Object JavaDoc[] items) { ccomp = new JComboBox(items); comp = ccomp; setupComponent();}
34     public ValidatableJComboBox(Vector JavaDoc items) { ccomp = new JComboBox(items); comp = ccomp; setupComponent();}
35     public ValidatableJComboBox(ComboBoxModel model) { ccomp = new JComboBox(model); comp = ccomp; setupComponent();}
36     
37     public void addPopupMenuListener(PopupMenuListener l) { ccomp.addPopupMenuListener(l); }
38     public void removePopupMenuListener(PopupMenuListener l) { ccomp.removePopupMenuListener(l); }
39     public Object JavaDoc getSelectedItem() { return ccomp.getSelectedItem(); }
40     public void setSelectedItem(final Object JavaDoc text) { ccomp.setSelectedItem(text); }
41     public ComboBoxModel getModel() { return ccomp.getModel(); }
42     public void setModel(ComboBoxModel model) { ccomp.setModel(model); }
43     public void addItem(Object JavaDoc item) { ccomp.addItem(item); }
44     public void insertItemAt(final Object JavaDoc item, final int index) { ccomp.insertItemAt(item, index); }
45     public int getSelectedIndex() { return ccomp.getSelectedIndex(); }
46     public Object JavaDoc getItemAt(int index) { return ccomp.getItemAt(index); }
47     public int getItemCount() { return ccomp.getItemCount(); }
48     public void setSelectedIndex(final int index) { ccomp.setSelectedIndex(index); }
49     public void removeAllItems() { ccomp.removeAllItems(); }
50     public void removeItem(final Object JavaDoc item) { ccomp.removeItem(item); }
51     public void removeItemAt(final int index) { ccomp.removeItemAt(index); }
52     public void setEditable(boolean b) { ccomp.setEditable(b); }
53     public boolean getEditable() { return ccomp.getEditable(); }
54     public int getMaximumRowCount() { return ccomp.getMaximumRowCount(); }
55     public void setMaximumRowCount(int max) { ccomp.setMaximumRowCount(max); }
56 }
57
Popular Tags