Class StandardFieldsDialog

    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JDialog

        javax.swing.JDialog.AccessibleJDialog
      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Field Summary

      • Fields inherited from class javax.swing.JDialog

        accessibleContext, rootPane, rootPaneCheckingEnabled
      • Fields inherited from class java.awt.Dialog

        DEFAULT_MODALITY_TYPE
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Constructor Summary

      Constructors 
      Constructor Description
      StandardFieldsDialog​(java.awt.Frame owner, java.lang.String titleLabel, java.awt.Dimension dim)
      Constructs a StandardFieldsDialog with the given owner, title and dimensions.
      StandardFieldsDialog​(java.awt.Frame owner, java.lang.String titleLabel, java.awt.Dimension dim, java.lang.String[] tabLabels)
      Constructs a StandardFieldsDialog with the given owner, title, dimensions and tab names.
      StandardFieldsDialog​(java.awt.Window owner, java.lang.String titleLabel, java.awt.Dimension dim)
      Constructs a StandardFieldsDialog with the given owner, title and dimensions.
      StandardFieldsDialog​(java.awt.Window owner, java.lang.String titleLabel, java.awt.Dimension dim, boolean modal)
      Constructs a StandardFieldsDialog with the given owner, title, dimensions and whether or not it's modal.
      StandardFieldsDialog​(java.awt.Window owner, java.lang.String titleLabel, java.awt.Dimension dim, java.lang.String[] tabLabels)
      Constructs a StandardFieldsDialog with the given owner, title, dimensions and tab names.
      StandardFieldsDialog​(java.awt.Window owner, java.lang.String titleLabel, java.awt.Dimension dim, java.lang.String[] tabLabels, boolean modal)
      Constructs a StandardFieldsDialog with the given owner, title, dimensions, tab names and whether or not it's modal.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addCheckBoxField​(int tabIndex, java.lang.String fieldLabel, boolean value)  
      void addCheckBoxField​(java.lang.String fieldLabel, boolean value)  
      void addComboField​(int tabIndex, java.lang.String fieldLabel, java.lang.String[] choices, java.lang.String value)  
      void addComboField​(int tabIndex, java.lang.String fieldLabel, java.lang.String[] choices, java.lang.String value, boolean editable)  
      void addComboField​(int tabIndex, java.lang.String fieldLabel, java.util.List<java.lang.String> choices, java.lang.String value)  
      void addComboField​(int tabIndex, java.lang.String fieldLabel, java.util.List<java.lang.String> choices, java.lang.String value, boolean editable)  
      <E> void addComboField​(int tabIndex, java.lang.String fieldLabel, javax.swing.ComboBoxModel<E> comboBoxModel)
      Adds a combo box field with the given label and model, to the tab with the given index.
      <E> void addComboField​(int tabIndex, java.lang.String fieldLabel, javax.swing.ComboBoxModel<E> comboBoxModel, boolean editable)
      Adds a combo box field, possibly editable, with the given label and model, to the tab with the given index.
      void addComboField​(java.lang.String fieldLabel, int[] choices, int value)  
      void addComboField​(java.lang.String fieldLabel, java.lang.String[] choices, java.lang.String value)  
      void addComboField​(java.lang.String fieldLabel, java.lang.String[] choices, java.lang.String value, boolean editable)  
      void addComboField​(java.lang.String fieldLabel, java.util.List<java.lang.String> choices, java.lang.String value)  
      void addComboField​(java.lang.String fieldLabel, java.util.List<java.lang.String> choices, java.lang.String value, boolean editable)  
      <E> void addComboField​(java.lang.String fieldLabel, javax.swing.ComboBoxModel<E> comboBoxModel)
      Adds a combo box field with the given label and model.
      <E> void addComboField​(java.lang.String fieldLabel, javax.swing.ComboBoxModel<E> comboBoxModel, boolean editable)
      Adds a combo box field, possibly editable, with the given label and model.
      void addContextSelectField​(int tabIndex, java.lang.String fieldLabel, Context selectedContext)  
      void addContextSelectField​(java.lang.String fieldLabel, Context selectedContext)  
      void addCustomComponent​(int tabIndex, java.awt.Component component)
      Add a custom Component to a tabbed StandardFieldsDialog without any label.
      void addCustomComponent​(int tabIndex, java.lang.String componentLabel, java.awt.Component component)
      Add a custom Component to a tabbed StandardFieldsDialog with the given label.
      void addCustomComponent​(java.awt.Component component)
      Add a custom Component to a StandardFieldsDialog without any label.
      void addCustomComponent​(java.lang.String componentLabel, java.awt.Component component)
      Add a custom Component to StandardFieldsDialog with the given label.
      void addFieldListener​(java.lang.String fieldLabel, java.awt.event.ActionListener listener)  
      void addFieldListener​(java.lang.String fieldLabel, java.awt.event.MouseAdapter listener)  
      void addFileSelectField​(int tabIndex, java.lang.String fieldLabel, java.io.File dir, int mode, javax.swing.filechooser.FileFilter filter)  
      void addFileSelectField​(java.lang.String fieldLabel, java.io.File dir, int mode, javax.swing.filechooser.FileFilter filter)  
      void addMultilineField​(int tabIndex, java.lang.String fieldLabel, java.lang.String value)  
      void addMultilineField​(java.lang.String fieldLabel, java.lang.String value)  
      void addNodeSelectField​(int tabIndex, java.lang.String fieldLabel, SiteNode value, boolean editable, boolean allowRoot)  
      void addNodeSelectField​(java.lang.String fieldLabel, SiteNode value, boolean editable, boolean allowRoot)  
      void addNumberField​(int tabIndex, java.lang.String fieldLabel, java.lang.Integer min, java.lang.Integer max, int value)  
      void addNumberField​(java.lang.String fieldLabel, java.lang.Integer min, java.lang.Integer max, int value)  
      void addPadding()  
      void addPadding​(int tabIndex)  
      void addPasswordField​(int tabIndex, java.lang.String fieldLabel, java.lang.String value)
      Adds a JPasswordField field to the tab with the given index, with the given label and, optionally, the given value.
      void addPasswordField​(java.lang.String fieldLabel, java.lang.String value)
      Adds a JPasswordField field, with the given label and, optionally, the given value.
      void addReadOnlyField​(int tabIndex, java.lang.String fieldLabel, java.lang.String value, boolean doubleWidth)  
      void addReadOnlyField​(java.lang.String fieldLabel, java.lang.String value, boolean doubleWidth)  
      void addTableField​(int tabIndex, javax.swing.JTable field)  
      void addTableField​(int tabIndex, javax.swing.JTable field, java.util.List<javax.swing.JButton> buttons)  
      void addTableField​(java.lang.String fieldLabel, javax.swing.JTable field)  
      void addTableField​(java.lang.String fieldLabel, javax.swing.JTable field, java.util.List<javax.swing.JButton> buttons)
      Add a table field.
      void addTableField​(javax.swing.JTable field, java.util.List<javax.swing.JButton> buttons)  
      void addTargetSelectField​(int tabIndex, java.lang.String fieldLabel, Target value, boolean editable, boolean allowRoot)  
      void addTargetSelectField​(java.lang.String fieldLabel, Target value, boolean editable, boolean allowRoot)
      Add a 'node select' field to a non tabbed dialog.
      void addTextField​(int tabIndex, java.lang.String fieldLabel, java.lang.String value)  
      void addTextField​(java.lang.String fieldLabel, java.lang.String value)  
      void addTextFieldReadOnly​(int tabIndex, java.lang.String fieldLabel, java.lang.String value)
      Adds a ZapLabel field, with the given label and, optionally, the given value, to the tab with the given index.
      void addTextFieldReadOnly​(java.lang.String fieldLabel, java.lang.String value)
      Adds a ZapLabel field, with the given label and, optionally, the given value.
      void cancelPressed()
      Called when the dialogue is cancelled (if it has a cancel/save button), for example, Cancel button is pressed or the dialogue is closed through the window decorations.
      protected javax.swing.JScrollPane createTabScrollable​(java.lang.String tabLabel, javax.swing.JPanel tabPanel)
      Creates and returns a JScrollPane for the given panel.
      java.lang.Boolean getBoolValue​(java.lang.String fieldLabel)  
      java.lang.String getCancelButtonText()  
      Context getContextValue​(java.lang.String fieldLabel)  
      javax.swing.JButton[] getExtraButtons()
      Override if you need to add extra buttons inbetween the Cancel and Save ones
      java.awt.Component getField​(java.lang.String fieldLabel)
      Allow the caller to get the field component in order to, for example, change its properties
      java.lang.String getHelpIndex()  
      int getIntValue​(java.lang.String fieldLabel)  
      char[] getPasswordValue​(java.lang.String fieldLabel)
      Gets the contents of a JPasswordField field.
      java.lang.String getSaveButtonText()  
      java.lang.String getStringValue​(java.lang.String fieldLabel)  
      protected static java.lang.String getTargetText​(Target target)
      Returns the text representation of the given target.
      boolean hasCancelSaveButtons()  
      boolean isEmptyField​(java.lang.String fieldLabel)  
      protected boolean isHideOnSave()
      Tells whether or not the dialogue is automatically hidden when saved.
      protected boolean isTabScrollable​(java.lang.String tabLabel)
      Tells whether or not the tab with the given label is scrollable.
      void removeAllFields()  
      void requestTabFocus​(int tabIndex)  
      abstract void save()
      Called when the dialogue is saved and after all validations have finished, to conclude the saving process.
      <E> void setComboBoxModel​(java.lang.String fieldLabel, javax.swing.ComboBoxModel<E> comboBoxModel)
      Sets the given combo box model into the combo box with the given label.
      void setComboFields​(java.lang.String fieldLabel, java.lang.String[] choices, java.lang.String value)  
      void setComboFields​(java.lang.String fieldLabel, java.util.List<java.lang.String> choices, java.lang.String value)  
      void setContextValue​(java.lang.String fieldLabel, Context context)
      Sets the (selected) context of a ContextSelectComboBox field.
      void setCustomTabPanel​(int i, javax.swing.JComponent panel)  
      void setFieldMainPopupMenu​(java.lang.String fieldLabel)
      Convenience method that sets the main pop up menu to the field with the given label.
      void setFieldPopupMenu​(java.lang.String fieldLabel, javax.swing.JPopupMenu popup)
      Sets the given pop up menu to the field with the given label.
      void setFieldValue​(java.lang.String fieldLabel, boolean value)  
      void setFieldValue​(java.lang.String fieldLabel, int value)  
      void setFieldValue​(java.lang.String fieldLabel, java.lang.String value)  
      protected void setHideOnSave​(boolean hideOnSave)
      Sets whether or not the dialogue is automatically hidden when saved.
      protected void setTabScrollable​(java.lang.String tabLabel, boolean scrollable)
      Sets whether or not the tab with given label should be scrollable (that is, added to a JScrollPane).
      void setTabsVisible​(java.lang.String[] tabLabels, boolean visible)
      Set the visibility of the specified tabs.
      void setXWeights​(double labelWeight, double fieldWeight)  
      void siteNodeSelected​(java.lang.String field, SiteNode node)
      Notifies that a site node was selected.
      void targetSelected​(java.lang.String field, Target target)
      Notifies that a target was selected.
      abstract java.lang.String validateFields()
      Called when the dialogue is saved, allowing to validate the fields and show an error message (as opposed to validations using the method validateFieldsCustomMessage(), which allow to show custom/complex information or warning dialogues).
      protected boolean validateFieldsCustomMessage()
      Called when the dialogue is saved, allowing to validate the fields and show custom error messages (as opposed to validations using the method validateFields(), which only allows to show a simple message).
      • Methods inherited from class javax.swing.JDialog

        addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Dialog

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StandardFieldsDialog

        public StandardFieldsDialog​(java.awt.Frame owner,
                                    java.lang.String titleLabel,
                                    java.awt.Dimension dim)
        Constructs a StandardFieldsDialog with the given owner, title and dimensions.
        Parameters:
        owner - the owner of the dialogue
        titleLabel - the title of the dialogue
        dim - the dimensions of the dialogue
      • StandardFieldsDialog

        public StandardFieldsDialog​(java.awt.Window owner,
                                    java.lang.String titleLabel,
                                    java.awt.Dimension dim,
                                    boolean modal)
        Constructs a StandardFieldsDialog with the given owner, title, dimensions and whether or not it's modal.
        Parameters:
        owner - the owner of the dialogue
        titleLabel - the title of the dialogue
        dim - the dimensions of the dialogue
        modal - true if the dialogue should be modal, false otherwise
      • StandardFieldsDialog

        public StandardFieldsDialog​(java.awt.Window owner,
                                    java.lang.String titleLabel,
                                    java.awt.Dimension dim)
        Constructs a StandardFieldsDialog with the given owner, title and dimensions.
        Parameters:
        owner - the owner of the dialogue
        titleLabel - the title of the dialogue
        dim - the dimensions of the dialogue
      • StandardFieldsDialog

        public StandardFieldsDialog​(java.awt.Frame owner,
                                    java.lang.String titleLabel,
                                    java.awt.Dimension dim,
                                    java.lang.String[] tabLabels)
        Constructs a StandardFieldsDialog with the given owner, title, dimensions and tab names.
        Parameters:
        owner - the owner of the dialogue
        titleLabel - the title of the dialogue
        dim - the dimensions of the dialogue
        tabLabels - the names of the tabs
      • StandardFieldsDialog

        public StandardFieldsDialog​(java.awt.Window owner,
                                    java.lang.String titleLabel,
                                    java.awt.Dimension dim,
                                    java.lang.String[] tabLabels)
        Constructs a StandardFieldsDialog with the given owner, title, dimensions and tab names.
        Parameters:
        owner - the owner of the dialogue
        titleLabel - the title of the dialogue
        dim - the dimensions of the dialogue
        tabLabels - the names of the tabs
      • StandardFieldsDialog

        public StandardFieldsDialog​(java.awt.Window owner,
                                    java.lang.String titleLabel,
                                    java.awt.Dimension dim,
                                    java.lang.String[] tabLabels,
                                    boolean modal)
        Constructs a StandardFieldsDialog with the given owner, title, dimensions, tab names and whether or not it's modal.
        Parameters:
        owner - the owner of the dialogue
        titleLabel - the title of the dialogue
        dim - the dimensions of the dialogue
        tabLabels - the names of the tabs
        modal - true if the dialogue should be modal, false otherwise
    • Method Detail

      • isHideOnSave

        protected boolean isHideOnSave()
        Tells whether or not the dialogue is automatically hidden when saved.

        The default is true.

        Returns:
        true if the dialogue should be hidden, false otherwise.
        Since:
        2.6.0
        See Also:
        setHideOnSave(boolean)
      • setHideOnSave

        protected void setHideOnSave​(boolean hideOnSave)
        Sets whether or not the dialogue is automatically hidden when saved.
        Parameters:
        hideOnSave - true if the dialogue should be hidden, false otherwise.
        Since:
        2.6.0
        See Also:
        isHideOnSave()
      • setXWeights

        public void setXWeights​(double labelWeight,
                                double fieldWeight)
      • hasCancelSaveButtons

        public boolean hasCancelSaveButtons()
      • getHelpIndex

        public java.lang.String getHelpIndex()
      • getSaveButtonText

        public java.lang.String getSaveButtonText()
      • getExtraButtons

        public javax.swing.JButton[] getExtraButtons()
        Override if you need to add extra buttons inbetween the Cancel and Save ones
        Returns:
        an array with the extra buttons, or null if none needed.
      • validateFieldsCustomMessage

        protected boolean validateFieldsCustomMessage()
        Called when the dialogue is saved, allowing to validate the fields and show custom error messages (as opposed to validations using the method validateFields(), which only allows to show a simple message). If this method returns false no further action is taken, if it returns true the normal validation is performed by calling validateFields().

        By default returns true.

        Returns:
        true if the fields are valid, false otherwise.
        Since:
        2.4.0
        See Also:
        validateFields(), save()
      • getCancelButtonText

        public java.lang.String getCancelButtonText()
      • cancelPressed

        public void cancelPressed()
        Called when the dialogue is cancelled (if it has a cancel/save button), for example, Cancel button is pressed or the dialogue is closed through the window decorations.

        Hides the dialogue by default.

      • addPadding

        public void addPadding()
      • addPadding

        public void addPadding​(int tabIndex)
      • addTextField

        public void addTextField​(java.lang.String fieldLabel,
                                 java.lang.String value)
      • addTextField

        public void addTextField​(int tabIndex,
                                 java.lang.String fieldLabel,
                                 java.lang.String value)
      • addTextFieldReadOnly

        public void addTextFieldReadOnly​(java.lang.String fieldLabel,
                                         java.lang.String value)
        Adds a ZapLabel field, with the given label and, optionally, the given value.
        Parameters:
        fieldLabel - the name of the label of the read-only text field.
        value - the value of the field, might be null.
        Throws:
        java.lang.IllegalArgumentException - if any of the following conditions is true:
        • the dialogue has tabs;
        • a field with the given label already exists.
        Since:
        2.8.0
        See Also:
        addTextFieldReadOnly(int, String, String), addTextField(String, String)
      • addTextFieldReadOnly

        public void addTextFieldReadOnly​(int tabIndex,
                                         java.lang.String fieldLabel,
                                         java.lang.String value)
        Adds a ZapLabel field, with the given label and, optionally, the given value, to the tab with the given index.
        Parameters:
        tabIndex - the index of the tab where the read-only text field should be added.
        fieldLabel - the name of the label of the read-only text field.
        value - the value of the field, might be null.
        Throws:
        java.lang.IllegalArgumentException - if any of the following conditions is true:
        • the dialogue does not have tabs;
        • the dialogue has tabs but the given tab index is not valid;
        • a field with the given label already exists.
        Since:
        2.8.0
        See Also:
        addTextFieldReadOnly(String, String), addTextField(int, String, String)
      • addPasswordField

        public void addPasswordField​(java.lang.String fieldLabel,
                                     java.lang.String value)
        Adds a JPasswordField field, with the given label and, optionally, the given value.
        Parameters:
        fieldLabel - the label of the field
        value - the value of the field, might be null
        Throws:
        java.lang.IllegalArgumentException - if the dialogue is a tabbed dialogue
        Since:
        2.6.0
        See Also:
        addPasswordField(int, String, String), getPasswordValue(String)
      • addPasswordField

        public void addPasswordField​(int tabIndex,
                                     java.lang.String fieldLabel,
                                     java.lang.String value)
        Adds a JPasswordField field to the tab with the given index, with the given label and, optionally, the given value.
        Parameters:
        tabIndex - the index of the tab
        fieldLabel - the label of the field
        value - the value of the field, might be null
        Throws:
        java.lang.IllegalArgumentException - if the dialogue is not a tabbed dialogue or if the index does not correspond to an existing tab
        Since:
        2.6.0
        See Also:
        addPasswordField(String, String), getPasswordValue(String)
      • addMultilineField

        public void addMultilineField​(java.lang.String fieldLabel,
                                      java.lang.String value)
      • addMultilineField

        public void addMultilineField​(int tabIndex,
                                      java.lang.String fieldLabel,
                                      java.lang.String value)
      • addComboField

        public void addComboField​(java.lang.String fieldLabel,
                                  java.lang.String[] choices,
                                  java.lang.String value)
      • addComboField

        public void addComboField​(java.lang.String fieldLabel,
                                  java.lang.String[] choices,
                                  java.lang.String value,
                                  boolean editable)
      • addComboField

        public void addComboField​(java.lang.String fieldLabel,
                                  java.util.List<java.lang.String> choices,
                                  java.lang.String value)
      • addComboField

        public void addComboField​(java.lang.String fieldLabel,
                                  java.util.List<java.lang.String> choices,
                                  java.lang.String value,
                                  boolean editable)
      • addComboField

        public void addComboField​(int tabIndex,
                                  java.lang.String fieldLabel,
                                  java.lang.String[] choices,
                                  java.lang.String value)
      • addComboField

        public void addComboField​(int tabIndex,
                                  java.lang.String fieldLabel,
                                  java.lang.String[] choices,
                                  java.lang.String value,
                                  boolean editable)
      • addComboField

        public void addComboField​(int tabIndex,
                                  java.lang.String fieldLabel,
                                  java.util.List<java.lang.String> choices,
                                  java.lang.String value)
      • addComboField

        public void addComboField​(int tabIndex,
                                  java.lang.String fieldLabel,
                                  java.util.List<java.lang.String> choices,
                                  java.lang.String value,
                                  boolean editable)
      • addComboField

        public void addComboField​(java.lang.String fieldLabel,
                                  int[] choices,
                                  int value)
      • addComboField

        public <E> void addComboField​(int tabIndex,
                                      java.lang.String fieldLabel,
                                      javax.swing.ComboBoxModel<E> comboBoxModel)
        Adds a combo box field with the given label and model, to the tab with the given index.

        Control of selection state (i.e. set/get selected item) is done through the combo box model.

        Type Parameters:
        E - the type of the elements of the combo box model.
        Parameters:
        tabIndex - the index of the tab where the combo box should be added.
        fieldLabel - the name of the label of the combo box field.
        comboBoxModel - the model to set into the combo box.
        Throws:
        java.lang.IllegalArgumentException - if any of the following conditions is true:
        • the dialogue does not have tabs;
        • the dialogue has tabs but the given tab index is not valid;
        • a field with the given label already exists.
        Since:
        2.6.0
        See Also:
        addComboField(String, ComboBoxModel), addComboField(int, String, ComboBoxModel, boolean), setComboBoxModel(String, ComboBoxModel)
      • addComboField

        public <E> void addComboField​(int tabIndex,
                                      java.lang.String fieldLabel,
                                      javax.swing.ComboBoxModel<E> comboBoxModel,
                                      boolean editable)
        Adds a combo box field, possibly editable, with the given label and model, to the tab with the given index.

        Control of selection state (i.e. set/get selected item) is done through the combo box model.

        Type Parameters:
        E - the type of the elements of the combo box model.
        Parameters:
        tabIndex - the index of the tab where the combo box should be added.
        fieldLabel - the name of the label of the combo box field.
        comboBoxModel - the model to set into the combo box.
        editable - true if the combo box should be editable, false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if any of the following conditions is true:
        • the dialogue does not have tabs;
        • the dialogue has tabs but the given tab index is not valid;
        • a field with the given label already exists.
        Since:
        2.6.0
        See Also:
        addComboField(String, ComboBoxModel, boolean), addComboField(int, String, ComboBoxModel), setComboBoxModel(String, ComboBoxModel)
      • addComboField

        public <E> void addComboField​(java.lang.String fieldLabel,
                                      javax.swing.ComboBoxModel<E> comboBoxModel)
        Adds a combo box field with the given label and model.

        Control of selection state (i.e. set/get selected item) is done through the combo box model.

        Type Parameters:
        E - the type of the elements of the combo box model.
        Parameters:
        fieldLabel - the name of the label of the combo box field.
        comboBoxModel - the model to set into the combo box.
        Throws:
        java.lang.IllegalArgumentException - if any of the following conditions is true:
        • the dialogue has tabs;
        • a field with the given label already exists.
        Since:
        2.6.0
        See Also:
        addComboField(String, ComboBoxModel, boolean), addComboField(int, String, ComboBoxModel), setComboBoxModel(String, ComboBoxModel)
      • addComboField

        public <E> void addComboField​(java.lang.String fieldLabel,
                                      javax.swing.ComboBoxModel<E> comboBoxModel,
                                      boolean editable)
        Adds a combo box field, possibly editable, with the given label and model.

        Control of selection state (i.e. set/get selected item) is done through the combo box model.

        Type Parameters:
        E - the type of the elements of the combo box model.
        Parameters:
        fieldLabel - the name of the label of the combo box field.
        comboBoxModel - the model to set into the combo box.
        editable - true if the combo box should be editable, false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if any of the following conditions is true:
        • the dialogue has tabs;
        • a field with the given label already exists.
        Since:
        2.6.0
        See Also:
        addComboField(String, ComboBoxModel), addComboField(int, String, ComboBoxModel, boolean), setComboBoxModel(String, ComboBoxModel)
      • addTableField

        public void addTableField​(java.lang.String fieldLabel,
                                  javax.swing.JTable field)
      • addTableField

        public void addTableField​(javax.swing.JTable field,
                                  java.util.List<javax.swing.JButton> buttons)
      • addTableField

        public void addTableField​(java.lang.String fieldLabel,
                                  javax.swing.JTable field,
                                  java.util.List<javax.swing.JButton> buttons)
        Add a table field.
        Parameters:
        fieldLabel - If null then the table will be full width
        field - the table field
        buttons - if not null then the buttons will be added to the right of the table
      • addTableField

        public void addTableField​(int tabIndex,
                                  javax.swing.JTable field)
      • addTableField

        public void addTableField​(int tabIndex,
                                  javax.swing.JTable field,
                                  java.util.List<javax.swing.JButton> buttons)
      • setComboFields

        public void setComboFields​(java.lang.String fieldLabel,
                                   java.lang.String[] choices,
                                   java.lang.String value)
      • setComboFields

        public void setComboFields​(java.lang.String fieldLabel,
                                   java.util.List<java.lang.String> choices,
                                   java.lang.String value)
      • setComboBoxModel

        public <E> void setComboBoxModel​(java.lang.String fieldLabel,
                                         javax.swing.ComboBoxModel<E> comboBoxModel)
        Sets the given combo box model into the combo box with the given label.

        Control of selection state (i.e. set/get selected item) is done through the combo box model.

        Type Parameters:
        E - the type of the elements of the combo box model.
        Parameters:
        fieldLabel - the name of the label of the combo box field
        comboBoxModel - the model to set into the combo box
        Since:
        2.6.0
        See Also:
        addComboField(String, ComboBoxModel), addComboField(int, String, ComboBoxModel)
      • addNumberField

        public void addNumberField​(java.lang.String fieldLabel,
                                   java.lang.Integer min,
                                   java.lang.Integer max,
                                   int value)
      • addNumberField

        public void addNumberField​(int tabIndex,
                                   java.lang.String fieldLabel,
                                   java.lang.Integer min,
                                   java.lang.Integer max,
                                   int value)
      • addCheckBoxField

        public void addCheckBoxField​(java.lang.String fieldLabel,
                                     boolean value)
      • addCheckBoxField

        public void addCheckBoxField​(int tabIndex,
                                     java.lang.String fieldLabel,
                                     boolean value)
      • addNodeSelectField

        public void addNodeSelectField​(java.lang.String fieldLabel,
                                       SiteNode value,
                                       boolean editable,
                                       boolean allowRoot)
      • addNodeSelectField

        public void addNodeSelectField​(int tabIndex,
                                       java.lang.String fieldLabel,
                                       SiteNode value,
                                       boolean editable,
                                       boolean allowRoot)
      • addTargetSelectField

        public void addTargetSelectField​(java.lang.String fieldLabel,
                                         Target value,
                                         boolean editable,
                                         boolean allowRoot)
        Add a 'node select' field to a non tabbed dialog. This includes a button for showing a Node Select Dialog and a field for showing the selected node.
        Parameters:
        fieldLabel - the I18N key for the field label, should not be null
        value - the selected Target to show, can be null
        editable - whether the field showing selected Target is editable or not
        allowRoot - whether to allow root SiteNode to be selected as Target value or not
        Since:
        2.8.0
        See Also:
        addTargetSelectField(int, String, Target, boolean, boolean)
      • addTargetSelectField

        public void addTargetSelectField​(int tabIndex,
                                         java.lang.String fieldLabel,
                                         Target value,
                                         boolean editable,
                                         boolean allowRoot)
      • getTargetText

        protected static java.lang.String getTargetText​(Target target)
        Returns the text representation of the given target.

        If the target is not null it returns:

        1. the URI, if it has a start node with an history reference;
        2. "Context: " followed by context's name, if it has a context;
        3. "Everything in scope", if it's only in scope.
        For remaining cases it returns null.
        Parameters:
        target - the target whose text representation will be returned
        Returns:
        the text representation of the given target, might be null
        Since:
        2.4.2
        See Also:
        Target.getStartNode(), Target.getContext(), Target.isInScopeOnly()
      • addContextSelectField

        public void addContextSelectField​(java.lang.String fieldLabel,
                                          Context selectedContext)
      • addContextSelectField

        public void addContextSelectField​(int tabIndex,
                                          java.lang.String fieldLabel,
                                          Context selectedContext)
      • addFileSelectField

        public void addFileSelectField​(java.lang.String fieldLabel,
                                       java.io.File dir,
                                       int mode,
                                       javax.swing.filechooser.FileFilter filter)
      • addFileSelectField

        public void addFileSelectField​(int tabIndex,
                                       java.lang.String fieldLabel,
                                       java.io.File dir,
                                       int mode,
                                       javax.swing.filechooser.FileFilter filter)
      • addCustomComponent

        public void addCustomComponent​(int tabIndex,
                                       java.lang.String componentLabel,
                                       java.awt.Component component)
        Add a custom Component to a tabbed StandardFieldsDialog with the given label.
        Parameters:
        tabIndex - tabIndex the index of the tab to which the Component need to be added
        componentLabel - the I18N key for the component label, should not be null
        component - the Component to be added
        Since:
        2.8.0
        See Also:
        addCustomComponent(Component), addCustomComponent(int, Component), addCustomComponent(String, Component)
      • siteNodeSelected

        public void siteNodeSelected​(java.lang.String field,
                                     SiteNode node)
        Notifies that a site node was selected.

        By default it does nothing.

        Parameters:
        field - the name of the field that triggered the selection
        node - the node selected
        See Also:
        addNodeSelectField(String, SiteNode, boolean, boolean)
      • getField

        public java.awt.Component getField​(java.lang.String fieldLabel)
        Allow the caller to get the field component in order to, for example, change its properties
        Parameters:
        fieldLabel - the name of the field
        Returns:
        the field, or null if there's no field with the given name
      • getStringValue

        public java.lang.String getStringValue​(java.lang.String fieldLabel)
      • getPasswordValue

        public char[] getPasswordValue​(java.lang.String fieldLabel)
        Gets the contents of a JPasswordField field.

        For stronger security, it is recommended that the returned character array be cleared after use by setting each character to zero.

        Parameters:
        fieldLabel - the label of the field
        Returns:
        the contents of the field, null if not a JPassword field.
        Since:
        2.6.0
        See Also:
        setFieldValue(String, String), addPasswordField(String, String)
      • getContextValue

        public Context getContextValue​(java.lang.String fieldLabel)
      • setContextValue

        public void setContextValue​(java.lang.String fieldLabel,
                                    Context context)
        Sets the (selected) context of a ContextSelectComboBox field.

        The call to this method has no effect it the context is not present in the combo box.

        Parameters:
        fieldLabel - the label of the field
        context - the context to be set/selected, null to clear the selection.
        Since:
        2.6.0
        See Also:
        getContextValue(String), addContextSelectField(String, Context)
      • setFieldValue

        public void setFieldValue​(java.lang.String fieldLabel,
                                  java.lang.String value)
      • setFieldValue

        public void setFieldValue​(java.lang.String fieldLabel,
                                  boolean value)
      • isEmptyField

        public boolean isEmptyField​(java.lang.String fieldLabel)
      • getIntValue

        public int getIntValue​(java.lang.String fieldLabel)
      • setFieldValue

        public void setFieldValue​(java.lang.String fieldLabel,
                                  int value)
      • addReadOnlyField

        public void addReadOnlyField​(java.lang.String fieldLabel,
                                     java.lang.String value,
                                     boolean doubleWidth)
      • addReadOnlyField

        public void addReadOnlyField​(int tabIndex,
                                     java.lang.String fieldLabel,
                                     java.lang.String value,
                                     boolean doubleWidth)
      • setCustomTabPanel

        public void setCustomTabPanel​(int i,
                                      javax.swing.JComponent panel)
      • getBoolValue

        public java.lang.Boolean getBoolValue​(java.lang.String fieldLabel)
      • addFieldListener

        public void addFieldListener​(java.lang.String fieldLabel,
                                     java.awt.event.ActionListener listener)
      • addFieldListener

        public void addFieldListener​(java.lang.String fieldLabel,
                                     java.awt.event.MouseAdapter listener)
      • setFieldPopupMenu

        public void setFieldPopupMenu​(java.lang.String fieldLabel,
                                      javax.swing.JPopupMenu popup)
        Sets the given pop up menu to the field with the given label.

        The pop up menu is only set to JComponent fields.

        Parameters:
        fieldLabel - the label of the field.
        popup - the pop up menu.
        Since:
        2.8.0
        See Also:
        JComponent.setComponentPopupMenu(JPopupMenu)
      • setFieldMainPopupMenu

        public void setFieldMainPopupMenu​(java.lang.String fieldLabel)
        Convenience method that sets the main pop up menu to the field with the given label.

        The same pop up menu instance is shared between all components.

        Parameters:
        fieldLabel - the label of the field.
        Since:
        2.8.0
        See Also:
        setFieldPopupMenu(String, JPopupMenu)
      • removeAllFields

        public void removeAllFields()
      • requestTabFocus

        public void requestTabFocus​(int tabIndex)
      • setTabsVisible

        public void setTabsVisible​(java.lang.String[] tabLabels,
                                   boolean visible)
        Set the visibility of the specified tabs. The labels must have been used to create the tabs in the constructor
        Parameters:
        tabLabels - the names of the tabs
        visible - true if the tabs should be visible, false otherwise
      • setTabScrollable

        protected void setTabScrollable​(java.lang.String tabLabel,
                                        boolean scrollable)
        Sets whether or not the tab with given label should be scrollable (that is, added to a JScrollPane).

        Note: The scrollable state of the tabs should be changed only to non-custom panels, or to custom panels, set through setCustomTabPanel(int, JComponent), if they are not already scrollable (otherwise it might happen that the contents of the panel have two scroll bars).

        Parameters:
        tabLabel - the label of the tab, as set during construction of the dialogue.
        scrollable - true if the tab should be scrollable, false otherwise.
        Since:
        2.7.0
        See Also:
        createTabScrollable(String, JPanel), isTabScrollable(String)
      • isTabScrollable

        protected boolean isTabScrollable​(java.lang.String tabLabel)
        Tells whether or not the tab with the given label is scrollable.

        Note: The scrollable state returned by this method only applies to tabs that were set to be (or not) scrollable through the method setTabScrollable(String, boolean), not to "panels" added directly to a tab with setCustomTabPanel(int, JComponent).

        Parameters:
        tabLabel - the label of the tab to check.
        Returns:
        true if the tab is scrollable, false otherwise.
        Since:
        2.7.0
      • createTabScrollable

        protected javax.swing.JScrollPane createTabScrollable​(java.lang.String tabLabel,
                                                              javax.swing.JPanel tabPanel)
        Creates and returns a JScrollPane for the given panel. Called when a tab is set to be scrollable.

        By default this method returns a JScrollPane that has the vertical and horizontal scrollbars shown as needed.

        Parameters:
        tabLabel - the label of the tab, as set during construction of the dialogue.
        tabPanel - the panel of the tab that should be scrollable, never null.
        Returns:
        the JScrollPane
        Since:
        2.7.0
      • validateFields

        public abstract java.lang.String validateFields()
        Called when the dialogue is saved, allowing to validate the fields and show an error message (as opposed to validations using the method validateFieldsCustomMessage(), which allow to show custom/complex information or warning dialogues).

        If no message is returned (that is, null), the saving process continues, otherwise it is shown a warning dialogue with the message.

        Returns:
        a String containing the error message to be shown to the user, or null if there are no errors.