|
||||||||||
| 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
javax.swing.JPanel
org.xnap.commons.gui.FileChooserPanel
public class FileChooserPanel
Provides a panel with a JTextField and a button for file
selection.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| 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.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 | |
|---|---|
FileChooserPanel(File file,
int columns)
Constructs a file chooser panel with an initial text. |
|
FileChooserPanel(int columns)
Constructs a file chooser panel. |
|
| Method Summary | |
|---|---|
protected void |
fileSelected(File file)
Sub classes can overwrite this. |
Completion |
getCompletion()
Returns the completion object associated with the file text field. |
Component |
getDialogParent()
Returns the parent of the file chooser dialog. |
File |
getFile()
Returns a file having the path name of the currently set text in the text field. |
JFileChooser |
getFileChooser()
Returns the file chooser that is used to select the file. |
Action |
getFileChooserAction()
|
String |
getFilename()
Deprecated. |
JTextField |
getTextField()
Returns the text field used internally. |
void |
setDialogParent(Component dialogParent)
Sets the parent of the file chooser dialog that is used internally. |
void |
setEnabled(boolean enabled)
Enables/disables this component and all of its subcomponents. |
void |
setFile(File file)
Sets the text in the text field to the absolute path of file. |
void |
setFileChooser(JFileChooser chooser)
Sets the file chooser to use that is used by the file chooser action. |
void |
setFilename(String filename)
Deprecated. |
protected boolean |
showChooser()
The default implementation shows a JFileChooser. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FileChooserPanel(File file,
int columns)
file - the filename to display
can be nullcolumns - the number of columns for calculating the preferred
width of the text field, can be 0setFile(File)public FileChooserPanel(int columns)
columns - the number of columns for calculating the preferred
width of the text field, can be 0| Method Detail |
|---|
protected void fileSelected(File file)
public File getFile()
public JFileChooser getFileChooser()
public void setFile(File file)
file.
file - can be null the text field is cleared then.public void setFileChooser(JFileChooser chooser)
chooser - the file chooser; if null, a default file chooser will be
created when the action is performedpublic String getFilename()
Use getFile().
public void setFilename(String filename)
Use setFile(File).
filename - the textpublic JTextField getTextField()
public Completion getCompletion()
Thus, you can disable
completion or
save
the used completion mode in a setting.
public Action getFileChooserAction()
public Component getDialogParent()
public void setEnabled(boolean enabled)
setEnabled in class JComponentpublic void setDialogParent(Component dialogParent)
See JFileChooser.showDialog(java.awt.Component, java.lang.String)
for details on dialog parents.
protected boolean showChooser()
JFileChooser.
This method can be overriden in a subclass, so other file choosers can be provided
true if a file was successfully selected and
set using setFile(File), false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||