|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.schlichtherle.swing.AbstractComboBoxBrowser
de.schlichtherle.io.swing.FileComboBoxBrowser
public class FileComboBoxBrowser
Subclasses AbstractComboBoxBrowser
to complete relative and
absolute path names of files and directories.
This class uses instances of TrueZIP's custom File
class in
order to support the browsing of archive files for auto completion.
To use it, use something like this:
JComboBox box = new JComboBox(); new FileComboBoxBrowser(box); box.setEditable(true);
Constructor Summary | |
---|---|
FileComboBoxBrowser()
Creates a new combo box auto completion browser. |
|
FileComboBoxBrowser(JComboBox comboBox)
Creates a new combo box auto completion browser. |
Method Summary | |
---|---|
File |
getDirectory()
Returns the directory which is used to complete relative path names. |
void |
setDirectory(File directory)
Returns the directory which is used to complete relative path names. |
protected boolean |
update(String initials)
Interpretes the specified initials as the initial
characters of an absolute or relative path name of a node in the file
system and updates the contents of the combo box model with possible
completions. |
Methods inherited from class de.schlichtherle.swing.AbstractComboBoxBrowser |
---|
getComboBox, setComboBox |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileComboBoxBrowser()
AbstractComboBoxBrowser.setComboBox(javax.swing.JComboBox)
must be called in order to use this object.
public FileComboBoxBrowser(JComboBox comboBox)
comboBox
- The combo box to enable browsing for auto completions.
May be null
.Method Detail |
---|
public File getDirectory()
null
is never
returned.
public void setDirectory(File directory)
directory
- The directory to use for completion.
If this is null
, the directory is reset to the
current directory.protected boolean update(String initials)
initials
as the initial
characters of an absolute or relative path name of a node in the file
system and updates the contents of the combo box model with possible
completions.
The elements in the combo box model are sorted according to their
natural comparison order.
update
in class AbstractComboBoxBrowser
initials
- The initial characters of a file or directory path name.
May be null
.
true
if and only if the file system contains a
node with initials
as its initial characters and
hence the popup window with the completions should be shown.
NullPointerException
- If the comboBox
property is
null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |