Package docking.widgets.dialogs
Class BigIntegerNumberInputDialog
java.lang.Object
docking.DialogComponentProvider
docking.widgets.dialogs.AbstractNumberInputDialog
docking.widgets.dialogs.BigIntegerNumberInputDialog
- All Implemented Interfaces:
ActionContextProvider
,StatusListener
,TaskListener
DialogComponentProvider that provides information to create a modal dialog
to prompt for a number larger than an int
or long
to be input by the user.
Note: if you intend to only work with number values less than Integer.MAX_VALUE
,
then you should use the NumberInputDialog
.
If an initial value is specified it is not in the range of min,max, it will be set to the min.
If the maximum value indicated is less than the minimum then the max is the largest positive integer. Otherwise the maximum valid value is as indicated.
This dialog component provider class can be used by various classes and therefore should not have its size or position remembered by the tool.showDialog() call parameters.
To display the dialog call:
String entryType = "items";
BigInteger initial = 5; // initial value in text field
BigInteger min = BigInteger.valueOf(1); // minimum valid value in text field
BigInteger max = BigInteger.valueOf(10); // maximum valid value in text field
BigIntegerNumberInputDialog provider =
new BigIntegerNumberInputDialog("Title", entryType, initial, min, max);
if (numInputProvider.show()) {
// not cancelled
BigInteger result = provider.getValue();
long longResult = provider.getLongValue();
}
-
Field Summary
Fields inherited from class docking.widgets.dialogs.AbstractNumberInputDialog
defaultMessage, label, max, min, numberInputField, wasCancelled
Fields inherited from class docking.DialogComponentProvider
applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel
-
Constructor Summary
ConstructorDescriptionBigIntegerNumberInputDialog
(String title, String prompt, BigInteger initialValue, BigInteger min, BigInteger max, boolean showAsHex) -
Method Summary
Methods inherited from class docking.widgets.dialogs.AbstractNumberInputDialog
buildDefaultPrompt, buildMainPanel, cancelCallback, getBigIntegerValue, getIntValue, getLongValue, getMax, getMin, okCallback, setDefaultMessage, setInput, show, toBig, updateOKButtonEnablement, wasCancelled
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
-
BigIntegerNumberInputDialog
public BigIntegerNumberInputDialog(String title, String prompt, BigInteger initialValue, BigInteger min, BigInteger max, boolean showAsHex)
-
-
Method Details
-
getValue
Get the current input value- Returns:
- the value
- Throws:
NumberFormatException
- if entered value cannot be parsedIllegalStateException
- if the dialog was cancelled
-