org.apache.batik.util.gui

Class URIChooser

public class URIChooser extends JDialog implements ActionMap

This class is a dialog used to enter an URI or to choose a local file.
Nested Class Summary
protected classURIChooser.BrowseButtonAction
The action associated with the 'browse' button
protected classURIChooser.CancelButtonAction
The action associated with the 'Cancel' button of the URI chooser
protected classURIChooser.ClearButtonAction
The action associated with the 'Clear' button of the URI chooser
protected classURIChooser.DocumentAdapter
To listen to the document changes
protected classURIChooser.OKButtonAction
The action associated with the 'OK' button of the URI chooser
Field Summary
protected static ResourceBundlebundle
The resource bundle
protected ButtonFactorybuttonFactory
The button factory
protected StringchosenPath
The last chosen path.
protected JButtonclearButton
The Clear button
protected StringcurrentPath
The current path.
static intCANCEL_OPTION
The return value if 'Cancel' is chosen.
protected FileFilterfileFilter
The file filter.
protected Maplisteners
The map that contains the listeners
protected JButtonokButton
The OK button
static intOK_OPTION
The return value if 'OK' is chosen.
protected static ResourceManagerresources
The resource manager
protected intreturnCode
The last return code.
protected static StringRESOURCES
The resource file name
protected JTextFieldtextField
The text field
Constructor Summary
URIChooser(JDialog d)
Creates a new URIChooser.
URIChooser(JFrame f)
Creates a new URIChooser.
Method Summary
protected JPanelcreateButtonsPanel()
Creates the buttons panel
protected JPanelcreateURISelectionPanel()
Creates the URI selection panel
ActiongetAction(String key)
Returns the action associated with the given string or null on error
StringgetText()
Returns the text entered by the user.
protected voidinitialize()
Initializes the dialog
voidsetFileFilter(FileFilter ff)
Sets the file filter to use with the file selector.
intshowDialog()
Shows the dialog.
protected voidupdateClearButtonAction()
To update the state of the Clear button
protected voidupdateOKButtonAction()
To update the state of the OK button

Field Detail

bundle

protected static ResourceBundle bundle
The resource bundle

buttonFactory

protected ButtonFactory buttonFactory
The button factory

chosenPath

protected String chosenPath
The last chosen path.

clearButton

protected JButton clearButton
The Clear button

currentPath

protected String currentPath
The current path.

CANCEL_OPTION

public static final int CANCEL_OPTION
The return value if 'Cancel' is chosen.

fileFilter

protected FileFilter fileFilter
The file filter.

listeners

protected Map listeners
The map that contains the listeners

okButton

protected JButton okButton
The OK button

OK_OPTION

public static final int OK_OPTION
The return value if 'OK' is chosen.

resources

protected static ResourceManager resources
The resource manager

returnCode

protected int returnCode
The last return code.

RESOURCES

protected static final String RESOURCES
The resource file name

textField

protected JTextField textField
The text field

Constructor Detail

URIChooser

public URIChooser(JDialog d)
Creates a new URIChooser.

Parameters: d the parent dialog

URIChooser

public URIChooser(JFrame f)
Creates a new URIChooser.

Parameters: f the parent frame

Method Detail

createButtonsPanel

protected JPanel createButtonsPanel()
Creates the buttons panel

createURISelectionPanel

protected JPanel createURISelectionPanel()
Creates the URI selection panel

getAction

public Action getAction(String key)
Returns the action associated with the given string or null on error

Parameters: key the key mapped with the action to get

Throws: MissingListenerException if the action is not found

getText

public String getText()
Returns the text entered by the user.

initialize

protected void initialize()
Initializes the dialog

setFileFilter

public void setFileFilter(FileFilter ff)
Sets the file filter to use with the file selector.

showDialog

public int showDialog()
Shows the dialog.

Returns: OK_OPTION or CANCEL_OPTION.

updateClearButtonAction

protected void updateClearButtonAction()
To update the state of the Clear button

updateOKButtonAction

protected void updateOKButtonAction()
To update the state of the OK button
Copyright B) 2007 Apache Software Foundation. All Rights Reserved.