Class InputWithChoicesDialog

    • 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 of isCanceled() to know whether or not the user canceled the operation. To get the user selected value use the getValue() value(s) entered by the user. If the user cancelled the operation, then null will be returned from getValue().

        Parameters:
        dialogTitle - used as the name of the dialog's title bar
        label - value to use for the label of the text field
        optionValues - values to populate the combo box
        initialValue - the initial value - can be null
        messageIcon - 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 of isCanceled() to know whether or not the user canceled the operation. To get the user selected value use the getValue() value(s) entered by the user. If the user cancelled the operation, then null will be returned from getValue().

        Parameters:
        dialogTitle - used as the name of the dialog's title bar
        label - value to use for the label of the text field
        optionValues - values to populate the combo box
        initialValue - the initial value - can be null
        allowEdits - true allows the user to add custom entries to the combo box by entering text
        messageIcon - the icon to display on the dialog--can be null
    • Method Detail

      • 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 class DialogComponentProvider
      • 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.