Package docking.widgets.dialogs
Class InputWithChoicesDialog
- java.lang.Object
-
- docking.DialogComponentProvider
-
- docking.widgets.dialogs.InputWithChoicesDialog
-
- All Implemented Interfaces:
ActionContextProvider
,StatusListener
,TaskListener
public class InputWithChoicesDialog extends DialogComponentProvider
A dialog that has text fields to get user input.
-
-
Field Summary
-
Fields inherited from class docking.DialogComponentProvider
applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel
-
-
Constructor Summary
Constructors Constructor Description InputWithChoicesDialog(java.lang.String dialogTitle, java.lang.String label, java.lang.String[] optionValues, java.lang.String initialValue, boolean allowEdits, javax.swing.Icon messageIcon)
Creates a provider for a generic input dialog with the specified title, a label and a editable comboBox pre-populated with selectable values.InputWithChoicesDialog(java.lang.String dialogTitle, java.lang.String label, java.lang.String[] optionValues, java.lang.String initialValue, javax.swing.Icon messageIcon)
Creates a provider for a generic input dialog with the specified title, a label and a editable comboBox pre-populated with selectable values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cancelCallback()
The callback method for when the "Cancel" button is pressed.protected void
dialogShown()
Override this method if you want to do something when the dialog is made visiblejava.lang.String
getValue()
return the value of the first combo boxboolean
isCanceled()
Returns if this dialog is canceled.protected void
okCallback()
The callback method for when the "OK" button is pressed.void
setValue(java.lang.String value)
Set the current choice to value.-
Methods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, close, dialogClosed, dismissCallback, dispose, doInitialize, escapeCallback, executeProgressTask, getActionContext, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getHelpLocatdion, getId, getIntialLocation, getLocationOnScreen, getParent, getPreferredSize, getRemberSize, getRememberLocation, getStatusColor, getStatusLabel, getStatusText, getTaskMonitorComponent, getTaskScheduler, getTitle, getUseSharedLocation, hideTaskMonitorComponent, isApplyEnabled, isCancelEnabled, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, notifyContextChanged, removeAction, removeButton, removeWorkPanel, repack, setApplyEnabled, setApplyToolTip, setBackground, setCancelButtonText, setCancelEnabled, setCancelToolTip, setCursor, setDefaultButton, setDefaultSize, setDialogSize, setDismissToolTip, setFocusComponent, setGlassPane, setHelpLocation, setInitialLocation, setMinimumSize, setMinimumSize, setOkButtonText, setOkEnabled, setOkToolTip, setPreferredSize, setRememberLocation, setRememberSize, setResizable, setStatusJustification, setStatusText, setStatusText, setStatusText, setTitle, setTransient, setUseSharedLocation, showProgressBar, showTaskMonitorComponent, stopProgressTimer, taskCancelled, taskCompleted, toFront, toString, waitForCurrentTask
-
-
-
-
Constructor Detail
-
InputWithChoicesDialog
public InputWithChoicesDialog(java.lang.String dialogTitle, java.lang.String label, java.lang.String[] optionValues, java.lang.String initialValue, javax.swing.Icon messageIcon)
Creates a provider for a generic input dialog with the specified title, a label and a editable comboBox pre-populated with selectable values. The user can check the value ofisCanceled()
to know whether or not the user canceled the operation. To get the user selected value use thegetValue()
value(s) entered by the user. If the user cancelled the operation, then null will be returned fromgetValue()
.- Parameters:
dialogTitle
- used as the name of the dialog's title barlabel
- value to use for the label of the text fieldoptionValues
- values to populate the combo boxinitialValue
- the initial value - can be nullmessageIcon
- the icon to display on the dialog--can be null
-
InputWithChoicesDialog
public InputWithChoicesDialog(java.lang.String dialogTitle, java.lang.String label, java.lang.String[] optionValues, java.lang.String initialValue, boolean allowEdits, javax.swing.Icon messageIcon)
Creates a provider for a generic input dialog with the specified title, a label and a editable comboBox pre-populated with selectable values. The user can check the value ofisCanceled()
to know whether or not the user canceled the operation. To get the user selected value use thegetValue()
value(s) entered by the user. If the user cancelled the operation, then null will be returned fromgetValue()
.- Parameters:
dialogTitle
- used as the name of the dialog's title barlabel
- value to use for the label of the text fieldoptionValues
- values to populate the combo boxinitialValue
- the initial value - can be nullallowEdits
- true allows the user to add custom entries to the combo box by entering textmessageIcon
- the icon to display on the dialog--can be null
-
-
Method Detail
-
dialogShown
protected void dialogShown()
Description copied from class:DialogComponentProvider
Override this method if you want to do something when the dialog is made visible- Overrides:
dialogShown
in classDialogComponentProvider
-
okCallback
protected void okCallback()
Description copied from class:DialogComponentProvider
The callback method for when the "OK" button is pressed.- Overrides:
okCallback
in classDialogComponentProvider
-
cancelCallback
protected void cancelCallback()
Description copied from class:DialogComponentProvider
The callback method for when the "Cancel" button is pressed. The default behavior is to call setVisible(false) and dispose() on the dialog.- Overrides:
cancelCallback
in classDialogComponentProvider
-
isCanceled
public boolean isCanceled()
Returns if this dialog is canceled.
-
getValue
public java.lang.String getValue()
return the value of the first combo box
-
setValue
public void setValue(java.lang.String value)
Set the current choice to value.- Parameters:
value
- updated choice- Throws:
java.util.NoSuchElementException
- if choice does not permit edits and value is not a valid choice.
-
-