|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.schlichtherle.swing.AbstractComboBoxBrowser
public abstract class AbstractComboBoxBrowser
An observer for a JComboBox
which provides auto completion
for the editable text in the drop down list in order to provide quick
browsing capabilities for the user.
Subclasses need to implement the update(java.lang.String)
method in order to update
the combo box model with the actual auto completion data.
This class is designed to be minimal intrusive: It works with any subclass
of JComboBox
and doesn't require a special
ComboBoxModel
, although its specific behaviour will only show
if the JComboBox
is editable
and uses an
instance of a MutableComboBoxModel
(which, apart from the
editable
property being set to true
, is the
default for a plain JComboBox
).
Constructor Summary | |
---|---|
AbstractComboBoxBrowser()
Creates a new combo box auto completion browser. |
|
AbstractComboBoxBrowser(JComboBox comboBox)
Creates a new combo box auto completion browser. |
Method Summary | |
---|---|
JComboBox |
getComboBox()
Returns the combo box which this object is auto completing. |
void |
setComboBox(JComboBox comboBox)
Sets the combo box which this object is auto completing and updates the drop down list with the auto completion for the currently selected item. |
protected abstract boolean |
update(String initials)
Subclasses are expected to update the auto completion elements in the model of this combo box based on the specified initials . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractComboBoxBrowser()
setComboBox(javax.swing.JComboBox)
must be called in order to use this object.
public AbstractComboBoxBrowser(JComboBox comboBox)
update(java.lang.String)
and hence the drop down list of the combo box is left unchanged.
comboBox
- The combo box to enable browsing for auto completions.
May be null
.Method Detail |
---|
public JComboBox getComboBox()
null
.
public void setComboBox(JComboBox comboBox)
comboBox
- The combo box to enable browsing for auto completions.
May be null
.protected abstract boolean update(String initials)
initials
.
They should not do any other work within this method.
In particular, they should not update the visual appearance of this
component.
getComboBox()
is guaranteed to return non-null
if
this method is called from this abstract base class.
initials
- The text to auto complete. May be null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |