Package cern.accsoft.steering.util.gui
Class SwingUserInteractor
- java.lang.Object
-
- cern.accsoft.steering.util.gui.SwingUserInteractor
-
- All Implemented Interfaces:
UserInteractor
public class SwingUserInteractor extends java.lang.Object implements UserInteractor
This class provides methods for user-interaction through swing-dialogs.
-
-
Constructor Summary
Constructors Constructor Description SwingUserInteractor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
askForString(java.lang.String question)
java.lang.String
askForString(java.lang.String question, java.lang.String defaultInput)
java.lang.String
askForString(java.lang.String question, java.lang.String defaultInput, java.awt.Component parent)
boolean
showPanelDialog(PanelProvider panelProvider, java.awt.Component parent)
opens a dialog with the panel of the given panelProviderboolean
showPanelDialog(javax.swing.JPanel panel, java.awt.Component parent)
opens a dialog with the given panel
-
-
-
Method Detail
-
askForString
public java.lang.String askForString(java.lang.String question, java.lang.String defaultInput)
- Specified by:
askForString
in interfaceUserInteractor
- Parameters:
question
- the the String, which describes to the user, what to enter.defaultInput
- the string to display as default for the input- Returns:
- the answer. Null, if aborted
-
askForString
public java.lang.String askForString(java.lang.String question, java.lang.String defaultInput, java.awt.Component parent)
-
askForString
public java.lang.String askForString(java.lang.String question)
- Specified by:
askForString
in interfaceUserInteractor
- Parameters:
question
- the the String, which describes to the user, what to enter.- Returns:
- the answer. Null, if aborted
-
showPanelDialog
public boolean showPanelDialog(javax.swing.JPanel panel, java.awt.Component parent)
Description copied from interface:UserInteractor
opens a dialog with the given panel- Specified by:
showPanelDialog
in interfaceUserInteractor
- Parameters:
panel
- the panel to show in the dialogparent
- the parent of the dialog- Returns:
- true, if the ok-button was pressed, false if not
-
showPanelDialog
public boolean showPanelDialog(PanelProvider panelProvider, java.awt.Component parent)
Description copied from interface:UserInteractor
opens a dialog with the panel of the given panelProvider- Specified by:
showPanelDialog
in interfaceUserInteractor
- Parameters:
panelProvider
- the panelProvider which provides the panel to showparent
- the parent of the dialog- Returns:
- true, if the ok button was pressed, false otherwise
-
-