Package docking.widgets.values
Class ValuesMapDialog
java.lang.Object
docking.DialogComponentProvider
docking.widgets.values.ValuesMapDialog
- All Implemented Interfaces:
ActionContextProvider
,StatusListener
,TaskListener
Dialog for displaying and editing values defined in a
GValuesMap
. The dialog consists
of an option message, followed by a list of name / value pairs. The name / value pairs will
be display in the order they were defined in the ValuesMap.-
Field Summary
Fields inherited from class docking.DialogComponentProvider
applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel
-
Constructor Summary
ConstructorDescriptionValuesMapDialog
(String title, String message) Creates the dialog with the given title and optional message.ValuesMapDialog
(String title, String message, GValuesMap valuesMap) Creates the dialog with the given title and optional message. -
Method Summary
Modifier and TypeMethodDescriptionaddValue
(AbstractValue<?> value) Adds a new value to the ValuesMap being edited by this dialog.protected void
The callback method for when the "Cancel" button is pressed.Returns the ValuesMap being edited.boolean
Returns true if the dialog was cancelled.protected void
The callback method for when the "OK" button is pressed.void
setValidator
(ValuesMapValidator validator) Sets theValuesMapValidator
on the ValuesMap being edited.Methods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, close, closeDialog, dialogClosed, dialogShown, dismissCallback, dispose, doInitialize, escapeCallback, executeProgressTask, getActionContext, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getHelpLocation, getId, getInitialLocation, getLocationOnScreen, getParent, getPreferredSize, getRememberLocation, getRememberSize, getStatusColor, getStatusLabel, getStatusText, getTaskMonitorComponent, getTaskScheduler, getTitle, getUseSharedLocation, hideTaskMonitorComponent, isApplyEnabled, isCancelEnabled, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, notifyContextChanged, removeAction, removeButton, removeWorkPanel, repack, setAccessibleDescription, 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 Details
-
ValuesMapDialog
Creates the dialog with the given title and optional message. The message will be display at the top of the dialog before the list of name / value pairs. This form of the dialog requires that theaddValue(AbstractValue)
method be called to populate the ValuesMap.- Parameters:
title
- the title for the dialogmessage
- the optional message to display before the list of name value pairs
-
ValuesMapDialog
Creates the dialog with the given title and optional message. The message will be display at the top of the dialog before the list of name / value pairs. The values are provided at construction time.- Parameters:
title
- the title for the dialogmessage
- the optional message to display before the list of name value pairsvaluesMap
- the ValuesMap whose values are to be displayed.
-
-
Method Details
-
addValue
Adds a new value to the ValuesMap being edited by this dialog.- Parameters:
value
- the new AbstractValue to be added- Returns:
- the value that was added
-
setValidator
Sets theValuesMapValidator
on the ValuesMap being edited. This is usually set on the ValuesMap before the dialog is constructed. This method is for uses where it wasn't constructed with a ValueMap, but values were added directly to the dialog after dialog construction.- Parameters:
validator
- the ValuesMapValidator
-
getValues
Returns the ValuesMap being edited.- Returns:
- the ValuesMap being edited.
-
isCancelled
public boolean isCancelled()Returns true if the dialog was cancelled.- Returns:
- true if the dialog was cancelled.
-
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
-