Class MultiInputDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
DualPaneInputDialog, MultiTabInputDialog

public class MultiInputDialog extends AbstractMultiInputDialog
Flexible generic dialog for prompting the user to type in several values. This Dialog is a refactoring of the previous vividsolutions MultiInputDialog
See Also:
  • Field Details

    • mainComponent

      protected Container mainComponent
    • currentPanel

      protected JPanel currentPanel
    • okCancelApplyPanel

      protected final OKCancelApplyPanel okCancelApplyPanel
  • Constructor Details

    • MultiInputDialog

      public MultiInputDialog(Frame frame, String title, boolean modal)
      Parameters:
      frame - the frame on which to make this dialog modal and centred
    • MultiInputDialog

      public MultiInputDialog()
  • Method Details

    • setMainComponent

      protected void setMainComponent()
    • setMainComponent

      public void setMainComponent(Container container)
    • getCurrentPanel

      public JPanel getCurrentPanel()
      Returns:
      the JPanel where new Rows are added
    • setCurrentPanel

      public void setCurrentPanel(JPanel panel)
      Parameters:
      panel - the JPanel where new Rows are added
    • getConsole

      public MultiInputDialogConsole getConsole()
      Returns:
      the MultiInputDialogConsole panel.
    • setVisible

      public void setVisible(boolean visible)
      Overrides:
      setVisible in class Dialog
      Parameters:
      visible - if true, the MultiInputDialog will be visible.
    • getDescriptionPanel

      public MultiInputDialogInfoPanel getDescriptionPanel()
      Returns:
      the MultiInputDialogInfoPanel.
    • setSideBarImage

      public void setSideBarImage(Icon icon)
    • setSideBarDescription

      public void setSideBarDescription(String description)
    • showConsole

      public void showConsole()
    • setApplyVisible

      public void setApplyVisible(boolean applyVisible)
    • setCancelVisible

      public void setCancelVisible(boolean cancelVisible)
    • setOKVisible

      public void setOKVisible(boolean okVisible)
    • setApplyEnabled

      public void setApplyEnabled(boolean applyEnabled)
    • setCancelEnabled

      public void setCancelEnabled(boolean cancelEnabled)
    • setOKEnabled

      public void setOKEnabled(boolean okEnabled)
    • wasApplyPressed

      public boolean wasApplyPressed()
    • wasOKPressed

      public boolean wasOKPressed()
    • addOKCancelApplyPanelActionListener

      public void addOKCancelApplyPanelActionListener(ActionListener actionListener)
    • addRow

      public void addRow(String fieldName, JComponent label, JComponent component, EnableCheck[] enableChecks, String toolTipText, int labelPos, int fillMode)
      Add a row to the current JPanel. The GridBagLayout is used as follows :
      • For JCheckBox, JRadioButton and JLabel and JPanel the component spreads over 3 columns. Empty label is in the fourth column.
      • For JComboBox and JTextField, label is in first column and component in second column. Third and fourth column or empty.
      |---|------------------------|----------------------|-----|---| | 0 | 1 | 2 | 3 | 4 | |---|-----------------------------------------------------|---| | | JCheckBox with label associated | | |---|-----------------------------------------------------|---| | | JRadioButton with label associated | | |---|-----------------------------------------------------|---| | | JLabel | | |---|-----------------------------------------------------|---| | | JPanel | | |---|------------------------|----------------------------|---| | | Label | JComboBox | | |---|------------------------|----------------------------|---| | | Label | JTextField | | |---|------------------------|----------------------|-----|---| /** Adds a row (containing either a control or a label) to the Dialog.
      Specified by:
      addRow in class AbstractMultiInputDialog
      Parameters:
      fieldName - field name of the control (used as a key)
      label - label of the control
      component - the control itself (may also be a label or a separator)
      enableChecks - checks to validate inputs
      toolTipText - a ToolTipText associated to the field
      labelPos - position of the label in the row (see AbstractMultiInputDialog)
      fillMode - fillMode of the label (see GridBagConstraints)
    • addRow

      public void addRow(String fieldName, JComponent component, EnableCheck[] enableChecks, String toolTipText)
    • addRow

      public void addRow(String fieldName, JLabel label, JTextField component, EnableCheck[] enableChecks, String toolTipText)
    • addRow

      public void addRow(String fieldName, JLabel label, JComponent component, EnableCheck[] enableChecks, String toolTipText)
    • addRow

      public void addRow(JComponent component)
      Specified by:
      addRow in class AbstractMultiInputDialog
    • addRow

      public void addRow()
      Specified by:
      addRow in class AbstractMultiInputDialog
    • setInset

      public void setInset(int inset)
    • indentLabel

      public void indentLabel(String fieldName)
      Indent the label of a field with a MatteBorder having the width of a JCheckBox and the color of the component background. This helps to align JCheckBox label (text on the right of the CheckBox) with other component labels (text on the left of the component).
      Parameters:
      fieldName - the field to indent
    • startNewColumn

      public void startNewColumn()
      Deprecated.
    • main

      public static void main(String[] args)