Package ucar.unidata.ui
Class PersistentDataDialog
java.lang.Object
ucar.unidata.ui.PersistentDataDialog
- All Implemented Interfaces:
ActionListener
,EventListener
Provides common Linvalid input: '&F' for managing persistent data.
Calling routine must implement PersistentDataManager interface that provides
the services required.
- Version:
- $Id: PersistentDataDialog.java,v 1.20 2007/07/06 20:45:32 jeffmc Exp $
- Author:
- John Caron
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentDataDialog
(String name, JComponent view, JComponent list, PersistentDataManager manager) Create a new PersistentDataDialogPersistentDataDialog
(RootPaneContainer parent, boolean modal, String name, JComponent view, JComponent list, PersistentDataManager manager) Constructor.PersistentDataDialog
(RootPaneContainer parent, boolean modal, String name, JComponent view, JComponent list, PersistentDataManager manager, String helpId) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) Handle action eventsboolean
checkSaveOK
(String startingId, String id) Utility to provide validation of objects the user wants to savevoid
close()
Close this widgetvoid
destroy()
Called to cleanup.Get the GUI contentsGet the JDialog for thisprotected void
init
(String name, JComponent view, JComponent list, PersistentDataManager manager, boolean doWindow) Initialize the classprotected void
init
(String name, JComponent view, JComponent list, PersistentDataManager manager, boolean doWindow, String helpId) Initialize the classvoid
setCurrent
(String name) Set the namevoid
setEnabled
(boolean enabled) Set this widget enabledvoid
Set the help id for this window.void
show()
Show the dialog
-
Constructor Details
-
PersistentDataDialog
public PersistentDataDialog(String name, JComponent view, JComponent list, PersistentDataManager manager) Create a new PersistentDataDialog- Parameters:
name
- name of managed components (eg "Projections").view
- shows a view of the selected objectlist
- manages the list of objectsmanager
- abstraction of the services required
-
PersistentDataDialog
public PersistentDataDialog(RootPaneContainer parent, boolean modal, String name, JComponent view, JComponent list, PersistentDataManager manager) Constructor.- Parameters:
parent
- JFrame (application) or JApplet (applet)modal
- true for a modal dialogname
- name of managed components (eg "Projections").view
- shows a view of the selected objectlist
- manages the list of objectsmanager
- abstraction of the services required
-
PersistentDataDialog
public PersistentDataDialog(RootPaneContainer parent, boolean modal, String name, JComponent view, JComponent list, PersistentDataManager manager, String helpId) Constructor.- Parameters:
parent
- JFrame (application) or JApplet (applet)modal
- true for a modal dialogname
- name of managed components (eg "Projections").view
- shows a view of the selected objectlist
- manages the list of objectsmanager
- abstraction of the services requiredhelpId
- id for help page when help button is clicked
-
-
Method Details
-
getContents
Get the GUI contents- Returns:
- the GUI contents
-
init
protected void init(String name, JComponent view, JComponent list, PersistentDataManager manager, boolean doWindow) Initialize the class- Parameters:
name
- name of managed components (eg "Projections").view
- shows a view of the selected objectlist
- manages the list of objectsmanager
- abstraction of the services requireddoWindow
- true to show in a separate window
-
init
protected void init(String name, JComponent view, JComponent list, PersistentDataManager manager, boolean doWindow, String helpId) Initialize the class- Parameters:
name
- name of managed components (eg "Projections").view
- shows a view of the selected objectlist
- manages the list of objectsmanager
- abstraction of the services requireddoWindow
- true to show in a separate windowhelpId
- id for help page
-
destroy
public void destroy()Called to cleanup. -
show
public void show()Show the dialog -
getDialog
Get the JDialog for this- Returns:
- the dialog
-
close
public void close()Close this widget -
actionPerformed
Handle action events- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
event
- event to handle
-
setHelpId
Set the help id for this window. If not called, the name supplied at construction is used.- Parameters:
newId
- new help ID
-
setEnabled
public void setEnabled(boolean enabled) Set this widget enabled- Parameters:
enabled
- true to enable
-
setCurrent
Set the name- Parameters:
name
- new name
-
checkSaveOK
Utility to provide validation of objects the user wants to save- Parameters:
startingId
- the starting name of the edited objectid
- the current name of the edited object- Returns:
- true if okay to save
-