|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.antelmann.util.gui.JFileField
public class JFileField
A text component that denotes a file path; supports mouse drops from file system and provides a convenient JFileChooser. To be notified for changes, best use a DocumentListener on the JTextField component.
JFileChooser,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JFileField()
|
|
JFileField(File initialFile)
|
|
JFileField(File initialFile,
int columns)
|
|
JFileField(File initialFile,
JTextField field)
|
|
JFileField(int columns)
|
|
JFileField(JTextField field)
|
|
| Method Summary | |
|---|---|
void |
addChoosableFileFilter(FileFilter filter)
|
File |
getBaseDir()
|
File |
getFile()
returns the file or null if the field is null or empty |
FileFilter |
getFileFilter()
|
int |
getFileSelectionMode()
|
JFileChooser |
getJFileChooser()
provides access to the chooser of the component |
JTextField |
getJTextField()
provides access to the text field of the component |
File |
getRelevantValue()
returns the relevant value for this instance at the time of calling |
boolean |
isEditable()
|
void |
setBaseDir(File baseDir)
if set to a non-null vaule, the text will show the relative path to this given dir |
void |
setEditable(boolean flag)
|
void |
setEnabled(boolean flag)
|
boolean |
setFile(File file)
returns true only if the file was accepted by the filter and hence the file was actually set; null is always accepted |
void |
setFileFilter(FileFilter filter)
|
void |
setFileSelectionMode(int mode)
|
void |
setRelevantValue(File file)
sets the relevant value for this instance with the given value |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JFileField()
public JFileField(int columns)
public JFileField(File initialFile)
public JFileField(JTextField field)
public JFileField(File initialFile,
int columns)
public JFileField(File initialFile,
JTextField field)
| Method Detail |
|---|
public void setEnabled(boolean flag)
setEnabled in class JComponentpublic boolean isEditable()
isEditable in interface EditableComponentpublic void setEditable(boolean flag)
setEditable in interface EditableComponentpublic void setFileSelectionMode(int mode)
mode - the type of files to be chosen:
IllegalArgumentException - if mode is illegalJFileChooserpublic int getFileSelectionMode()
JFileChooserpublic void addChoosableFileFilter(FileFilter filter)
public void setFileFilter(FileFilter filter)
public FileFilter getFileFilter()
public File getRelevantValue()
ValueRetriever
getRelevantValue in interface ValueRetriever<File>
public void setRelevantValue(File file)
throws IllegalArgumentException
ValueSetter
setRelevantValue in interface ValueSetter<File>IllegalArgumentExceptionpublic File getFile()
public boolean setFile(File file)
public File getBaseDir()
public void setBaseDir(File baseDir)
public JFileChooser getJFileChooser()
public JTextField getJTextField()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||