public abstract class StandardFieldsDialog extends AbstractDialog
JDialog.AccessibleJDialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
thisDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
DEFAULT_MODALITY_TYPE
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
StandardFieldsDialog(Frame owner,
String titleLabel,
Dimension dim)
Constructs a
StandardFieldsDialog with the given owner, title and dimensions. |
StandardFieldsDialog(Frame owner,
String titleLabel,
Dimension dim,
String[] tabLabels)
Constructs a
StandardFieldsDialog with the given owner, title, dimensions and tab
names. |
StandardFieldsDialog(Window owner,
String titleLabel,
Dimension dim)
Constructs a
StandardFieldsDialog with the given owner, title and dimensions. |
StandardFieldsDialog(Window owner,
String titleLabel,
Dimension dim,
boolean modal)
Constructs a
StandardFieldsDialog with the given owner, title, dimensions and whether
or not it's modal. |
StandardFieldsDialog(Window owner,
String titleLabel,
Dimension dim,
String[] tabLabels)
Constructs a
StandardFieldsDialog with the given owner, title, dimensions and tab
names. |
StandardFieldsDialog(Window owner,
String titleLabel,
Dimension dim,
String[] tabLabels,
boolean modal)
Constructs a
StandardFieldsDialog with the given owner, title, dimensions, tab names
and whether or not it's modal. |
Modifier and Type | Method and Description |
---|---|
void |
addCheckBoxField(int tabIndex,
String fieldLabel,
boolean value) |
void |
addCheckBoxField(String fieldLabel,
boolean value) |
<E> void |
addComboField(int tabIndex,
String fieldLabel,
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,
String fieldLabel,
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(int tabIndex,
String fieldLabel,
List<String> choices,
String value) |
void |
addComboField(int tabIndex,
String fieldLabel,
List<String> choices,
String value,
boolean editable) |
void |
addComboField(int tabIndex,
String fieldLabel,
String[] choices,
String value) |
void |
addComboField(int tabIndex,
String fieldLabel,
String[] choices,
String value,
boolean editable) |
<E> void |
addComboField(String fieldLabel,
ComboBoxModel<E> comboBoxModel)
Adds a combo box field with the given label and model.
|
<E> void |
addComboField(String fieldLabel,
ComboBoxModel<E> comboBoxModel,
boolean editable)
Adds a combo box field, possibly editable, with the given label and model.
|
void |
addComboField(String fieldLabel,
int[] choices,
int value) |
void |
addComboField(String fieldLabel,
List<String> choices,
String value) |
void |
addComboField(String fieldLabel,
List<String> choices,
String value,
boolean editable) |
void |
addComboField(String fieldLabel,
String[] choices,
String value) |
void |
addComboField(String fieldLabel,
String[] choices,
String value,
boolean editable) |
void |
addContextSelectField(int tabIndex,
String fieldLabel,
Context selectedContext) |
void |
addContextSelectField(String fieldLabel,
Context selectedContext) |
void |
addCustomComponent(Component component)
Add a custom
Component to a StandardFieldsDialog without any label. |
void |
addCustomComponent(int tabIndex,
Component component)
Add a custom
Component to a tabbed StandardFieldsDialog without any label. |
void |
addCustomComponent(int tabIndex,
String componentLabel,
Component component)
Add a custom
Component to a tabbed StandardFieldsDialog with the given label. |
void |
addCustomComponent(String componentLabel,
Component component)
Add a custom
Component to StandardFieldsDialog with the given label. |
void |
addFieldListener(String fieldLabel,
ActionListener listener) |
void |
addFieldListener(String fieldLabel,
MouseAdapter listener) |
void |
addFileSelectField(int tabIndex,
String fieldLabel,
File dir,
int mode,
FileFilter filter) |
void |
addFileSelectField(String fieldLabel,
File dir,
int mode,
FileFilter filter) |
void |
addMultilineField(int tabIndex,
String fieldLabel,
String value) |
void |
addMultilineField(String fieldLabel,
String value) |
void |
addNodeSelectField(int tabIndex,
String fieldLabel,
SiteNode value,
boolean editable,
boolean allowRoot) |
void |
addNodeSelectField(String fieldLabel,
SiteNode value,
boolean editable,
boolean allowRoot) |
void |
addNumberField(int tabIndex,
String fieldLabel,
Integer min,
Integer max,
int value) |
void |
addNumberField(String fieldLabel,
Integer min,
Integer max,
int value) |
void |
addPadding() |
void |
addPadding(int tabIndex) |
void |
addPasswordField(int tabIndex,
String fieldLabel,
String value)
Adds a
JPasswordField field to the tab with the given index, with the given label
and, optionally, the given value. |
void |
addPasswordField(String fieldLabel,
String value)
Adds a
JPasswordField field, with the given label and, optionally, the given value. |
void |
addReadOnlyField(int tabIndex,
String fieldLabel,
String value,
boolean doubleWidth) |
void |
addReadOnlyField(String fieldLabel,
String value,
boolean doubleWidth) |
void |
addTableField(int tabIndex,
JTable field) |
void |
addTableField(int tabIndex,
JTable field,
List<JButton> buttons) |
void |
addTableField(JTable field,
List<JButton> buttons) |
void |
addTableField(String fieldLabel,
JTable field) |
void |
addTableField(String fieldLabel,
JTable field,
List<JButton> buttons)
Add a table field.
|
void |
addTargetSelectField(int tabIndex,
String fieldLabel,
Target value,
boolean editable,
boolean allowRoot) |
void |
addTargetSelectField(String fieldLabel,
Target value,
boolean editable,
boolean allowRoot)
Add a 'node select' field to a non tabbed dialog.
|
void |
addTextField(int tabIndex,
String fieldLabel,
String value) |
void |
addTextField(String fieldLabel,
String value) |
void |
addTextFieldReadOnly(int tabIndex,
String fieldLabel,
String value)
Adds a
ZapLabel field, with the given label and, optionally, the given value, to the
tab with the given index. |
void |
addTextFieldReadOnly(String fieldLabel,
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 JScrollPane |
createTabScrollable(String tabLabel,
JPanel tabPanel)
Creates and returns a
JScrollPane for the given panel. |
Boolean |
getBoolValue(String fieldLabel) |
String |
getCancelButtonText() |
Context |
getContextValue(String fieldLabel) |
JButton[] |
getExtraButtons()
Override if you need to add extra buttons inbetween the Cancel and Save ones
|
Component |
getField(String fieldLabel)
Allow the caller to get the field component in order to, for example, change its properties
|
String |
getHelpIndex() |
int |
getIntValue(String fieldLabel) |
char[] |
getPasswordValue(String fieldLabel)
Gets the contents of a
JPasswordField field. |
String |
getSaveButtonText() |
String |
getStringValue(String fieldLabel) |
protected static String |
getTargetText(Target target)
Returns the text representation of the given
target . |
boolean |
hasCancelSaveButtons() |
boolean |
isEmptyField(String fieldLabel) |
protected boolean |
isHideOnSave()
Tells whether or not the dialogue is automatically hidden when
saved . |
protected boolean |
isTabScrollable(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(String fieldLabel,
ComboBoxModel<E> comboBoxModel)
Sets the given combo box model into the combo box with the given label.
|
void |
setComboFields(String fieldLabel,
List<String> choices,
String value) |
void |
setComboFields(String fieldLabel,
String[] choices,
String value) |
void |
setContextValue(String fieldLabel,
Context context)
Sets the (selected) context of a
ContextSelectComboBox field. |
void |
setCustomTabPanel(int i,
JComponent panel) |
void |
setFieldMainPopupMenu(String fieldLabel)
Convenience method that sets the
main pop up
menu to the field with the given label. |
void |
setFieldPopupMenu(String fieldLabel,
JPopupMenu popup)
Sets the given pop up menu to the field with the given label.
|
void |
setFieldValue(String fieldLabel,
boolean value) |
void |
setFieldValue(String fieldLabel,
int value) |
void |
setFieldValue(String fieldLabel,
String value) |
protected void |
setHideOnSave(boolean hideOnSave)
Sets whether or not the dialogue is automatically hidden when
saved . |
protected void |
setTabScrollable(String tabLabel,
boolean scrollable)
Sets whether or not the tab with given label should be scrollable (that is, added to a
JScrollPane ). |
void |
setTabsVisible(String[] tabLabels,
boolean visible)
Set the visibility of the specified tabs.
|
void |
setXWeights(double labelWeight,
double fieldWeight) |
void |
siteNodeSelected(String field,
SiteNode node)
Notifies that a site node was selected.
|
void |
targetSelected(String field,
Target target)
Notifies that a target was selected.
|
abstract 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). |
centreDialog, setVisible
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
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
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
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
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, getPeer, 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, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public StandardFieldsDialog(Frame owner, String titleLabel, Dimension dim)
StandardFieldsDialog
with the given owner, title and dimensions.owner
- the owner of the dialoguetitleLabel
- the title of the dialoguedim
- the dimensions of the dialoguepublic StandardFieldsDialog(Window owner, String titleLabel, Dimension dim, boolean modal)
StandardFieldsDialog
with the given owner, title, dimensions and whether
or not it's modal.owner
- the owner of the dialoguetitleLabel
- the title of the dialoguedim
- the dimensions of the dialoguemodal
- true
if the dialogue should be modal, false
otherwisepublic StandardFieldsDialog(Window owner, String titleLabel, Dimension dim)
StandardFieldsDialog
with the given owner, title and dimensions.owner
- the owner of the dialoguetitleLabel
- the title of the dialoguedim
- the dimensions of the dialoguepublic StandardFieldsDialog(Frame owner, String titleLabel, Dimension dim, String[] tabLabels)
StandardFieldsDialog
with the given owner, title, dimensions and tab
names.owner
- the owner of the dialoguetitleLabel
- the title of the dialoguedim
- the dimensions of the dialoguetabLabels
- the names of the tabspublic StandardFieldsDialog(Window owner, String titleLabel, Dimension dim, String[] tabLabels)
StandardFieldsDialog
with the given owner, title, dimensions and tab
names.owner
- the owner of the dialoguetitleLabel
- the title of the dialoguedim
- the dimensions of the dialoguetabLabels
- the names of the tabspublic StandardFieldsDialog(Window owner, String titleLabel, Dimension dim, String[] tabLabels, boolean modal)
StandardFieldsDialog
with the given owner, title, dimensions, tab names
and whether or not it's modal.owner
- the owner of the dialoguetitleLabel
- the title of the dialoguedim
- the dimensions of the dialoguetabLabels
- the names of the tabsmodal
- true
if the dialogue should be modal, false
otherwiseprotected boolean isHideOnSave()
saved
.
The default is true
.
true
if the dialogue should be hidden, false
otherwise.setHideOnSave(boolean)
protected void setHideOnSave(boolean hideOnSave)
saved
.hideOnSave
- true
if the dialogue should be hidden, false
otherwise.isHideOnSave()
public void setXWeights(double labelWeight, double fieldWeight)
public boolean hasCancelSaveButtons()
public String getHelpIndex()
public String getSaveButtonText()
public JButton[] getExtraButtons()
null
if none needed.protected boolean validateFieldsCustomMessage()
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
.
true
if the fields are valid, false
otherwise.validateFields()
,
save()
public String getCancelButtonText()
public void cancelPressed()
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.
public void addPadding()
public void addPadding(int tabIndex)
public void addTextFieldReadOnly(String fieldLabel, String value)
ZapLabel
field, with the given label and, optionally, the given value.fieldLabel
- the name of the label of the read-only text field.value
- the value of the field, might be null
.IllegalArgumentException
- if any of the following conditions is true:
addTextFieldReadOnly(int, String, String)
,
addTextField(String, String)
public void addTextFieldReadOnly(int tabIndex, String fieldLabel, String value)
ZapLabel
field, with the given label and, optionally, the given value, to the
tab with the given index.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
.IllegalArgumentException
- if any of the following conditions is true:
addTextFieldReadOnly(String, String)
,
addTextField(int, String, String)
public void addPasswordField(String fieldLabel, String value)
JPasswordField
field, with the given label and, optionally, the given value.fieldLabel
- the label of the fieldvalue
- the value of the field, might be null
IllegalArgumentException
- if the dialogue is a tabbed dialogueaddPasswordField(int, String, String)
,
getPasswordValue(String)
public void addPasswordField(int tabIndex, String fieldLabel, String value)
JPasswordField
field to the tab with the given index, with the given label
and, optionally, the given value.tabIndex
- the index of the tabfieldLabel
- the label of the fieldvalue
- the value of the field, might be null
IllegalArgumentException
- if the dialogue is not a tabbed dialogue or if the index
does not correspond to an existing tabaddPasswordField(String, String)
,
getPasswordValue(String)
public void addComboField(String fieldLabel, String[] choices, String value, boolean editable)
public void addComboField(String fieldLabel, List<String> choices, String value, boolean editable)
public void addComboField(int tabIndex, String fieldLabel, String[] choices, String value)
public void addComboField(int tabIndex, String fieldLabel, String[] choices, String value, boolean editable)
public void addComboField(int tabIndex, String fieldLabel, List<String> choices, String value)
public void addComboField(int tabIndex, String fieldLabel, List<String> choices, String value, boolean editable)
public void addComboField(String fieldLabel, int[] choices, int value)
public <E> void addComboField(int tabIndex, String fieldLabel, ComboBoxModel<E> comboBoxModel)
Control of selection state (i.e. set/get selected item) is done through the combo box model.
E
- the type of the elements of the combo box model.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.IllegalArgumentException
- if any of the following conditions is true:
addComboField(String, ComboBoxModel)
,
addComboField(int, String, ComboBoxModel, boolean)
,
setComboBoxModel(String, ComboBoxModel)
public <E> void addComboField(int tabIndex, String fieldLabel, ComboBoxModel<E> comboBoxModel, boolean editable)
Control of selection state (i.e. set/get selected item) is done through the combo box model.
E
- the type of the elements of the combo box model.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.IllegalArgumentException
- if any of the following conditions is true:
addComboField(String, ComboBoxModel, boolean)
,
addComboField(int, String, ComboBoxModel)
,
setComboBoxModel(String, ComboBoxModel)
public <E> void addComboField(String fieldLabel, ComboBoxModel<E> comboBoxModel)
Control of selection state (i.e. set/get selected item) is done through the combo box model.
E
- the type of the elements of the combo box model.fieldLabel
- the name of the label of the combo box field.comboBoxModel
- the model to set into the combo box.IllegalArgumentException
- if any of the following conditions is true:
addComboField(String, ComboBoxModel, boolean)
,
addComboField(int, String, ComboBoxModel)
,
setComboBoxModel(String, ComboBoxModel)
public <E> void addComboField(String fieldLabel, ComboBoxModel<E> comboBoxModel, boolean editable)
Control of selection state (i.e. set/get selected item) is done through the combo box model.
E
- the type of the elements of the combo box model.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.IllegalArgumentException
- if any of the following conditions is true:
addComboField(String, ComboBoxModel)
,
addComboField(int, String, ComboBoxModel, boolean)
,
setComboBoxModel(String, ComboBoxModel)
public void addTableField(String fieldLabel, JTable field, List<JButton> buttons)
fieldLabel
- If null then the table will be full widthfield
- the table fieldbuttons
- if not null then the buttons will be added to the right of the tablepublic void addTableField(int tabIndex, JTable field)
public <E> void setComboBoxModel(String fieldLabel, ComboBoxModel<E> comboBoxModel)
Control of selection state (i.e. set/get selected item) is done through the combo box model.
E
- the type of the elements of the combo box model.fieldLabel
- the name of the label of the combo box fieldcomboBoxModel
- the model to set into the combo boxaddComboField(String, ComboBoxModel)
,
addComboField(int, String, ComboBoxModel)
public void addNumberField(int tabIndex, String fieldLabel, Integer min, Integer max, int value)
public void addCheckBoxField(String fieldLabel, boolean value)
public void addCheckBoxField(int tabIndex, String fieldLabel, boolean value)
public void addNodeSelectField(String fieldLabel, SiteNode value, boolean editable, boolean allowRoot)
public void addNodeSelectField(int tabIndex, String fieldLabel, SiteNode value, boolean editable, boolean allowRoot)
public void addTargetSelectField(String fieldLabel, Target value, boolean editable, boolean allowRoot)
fieldLabel
- the I18N
key for the field label, should not be nullvalue
- the selected Target
to show, can be nulleditable
- whether the field showing selected Target
is editable or notallowRoot
- whether to allow root SiteNode
to be selected as Target
value or notaddTargetSelectField(int, String, Target, boolean, boolean)
public void addTargetSelectField(int tabIndex, String fieldLabel, Target value, boolean editable, boolean allowRoot)
protected static String getTargetText(Target target)
target
.
If the target
is not null
it returns:
null
.target
- the target whose text representation will be returnedtarget
, might be null
Target.getStartNode()
,
Target.getContext()
,
Target.isInScopeOnly()
public void addContextSelectField(int tabIndex, String fieldLabel, Context selectedContext)
public void addFileSelectField(String fieldLabel, File dir, int mode, FileFilter filter)
public void addFileSelectField(int tabIndex, String fieldLabel, File dir, int mode, FileFilter filter)
public void addCustomComponent(int tabIndex, Component component)
Component
to a tabbed StandardFieldsDialog
without any label.tabIndex
- the index of the tab to which the Component
need to be addedcomponent
- the Component
to be addedaddCustomComponent(Component)
,
addCustomComponent(String, Component)
,
addCustomComponent(int, String, Component)
public void addCustomComponent(Component component)
Component
to a StandardFieldsDialog
without any label.component
- the Component
to be addedaddCustomComponent(int, Component)
,
addCustomComponent(String, Component)
,
addCustomComponent(int, String, Component)
public void addCustomComponent(int tabIndex, String componentLabel, Component component)
Component
to a tabbed StandardFieldsDialog
with the given label.tabIndex
- tabIndex the index of the tab to which the Component
need to be addedcomponentLabel
- the I18N
key for the component label, should not be nullcomponent
- the Component
to be addedaddCustomComponent(Component)
,
addCustomComponent(int, Component)
,
addCustomComponent(String, Component)
public void addCustomComponent(String componentLabel, Component component)
Component
to StandardFieldsDialog
with the given label.componentLabel
- the I18N
key for the component label, should not be nullcomponent
- the Component
to be addedaddCustomComponent(Component)
,
addCustomComponent(int, Component)
,
addCustomComponent(int, String, Component)
public void siteNodeSelected(String field, SiteNode node)
By default it does nothing.
field
- the name of the field that triggered the selectionnode
- the node selectedaddNodeSelectField(String, SiteNode, boolean, boolean)
public void targetSelected(String field, Target target)
By default it does nothing.
field
- the name of the field that triggered the selectiontarget
- the target selectedaddTargetSelectField(int, String, Target, boolean, boolean)
public Component getField(String fieldLabel)
fieldLabel
- the name of the fieldnull
if there's no field with the given namepublic char[] getPasswordValue(String fieldLabel)
JPasswordField
field.
For stronger security, it is recommended that the returned character array be cleared after use by setting each character to zero.
fieldLabel
- the label of the fieldnull
if not a JPassword
field.setFieldValue(String, String)
,
addPasswordField(String, String)
public void setContextValue(String fieldLabel, Context context)
ContextSelectComboBox
field.
The call to this method has no effect it the context is not present in the combo box.
fieldLabel
- the label of the fieldcontext
- the context to be set/selected, null
to clear the selection.getContextValue(String)
,
addContextSelectField(String, Context)
public void setFieldValue(String fieldLabel, boolean value)
public boolean isEmptyField(String fieldLabel)
public int getIntValue(String fieldLabel)
public void setFieldValue(String fieldLabel, int value)
public void addReadOnlyField(int tabIndex, String fieldLabel, String value, boolean doubleWidth)
public void setCustomTabPanel(int i, JComponent panel)
public void addFieldListener(String fieldLabel, ActionListener listener)
public void addFieldListener(String fieldLabel, MouseAdapter listener)
public void setFieldPopupMenu(String fieldLabel, JPopupMenu popup)
The pop up menu is only set to JComponent
fields.
fieldLabel
- the label of the field.popup
- the pop up menu.JComponent.setComponentPopupMenu(JPopupMenu)
public void setFieldMainPopupMenu(String fieldLabel)
main pop up
menu
to the field with the given label.
The same pop up menu instance is shared between all components.
fieldLabel
- the label of the field.setFieldPopupMenu(String, JPopupMenu)
public void removeAllFields()
public void requestTabFocus(int tabIndex)
public void setTabsVisible(String[] tabLabels, boolean visible)
tabLabels
- the names of the tabsvisible
- true
if the tabs should be visible, false
otherwiseprotected void setTabScrollable(String tabLabel, boolean scrollable)
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).
tabLabel
- the label of the tab, as set during construction of the dialogue.scrollable
- true
if the tab should be scrollable, false
otherwise.createTabScrollable(String, JPanel)
,
isTabScrollable(String)
protected boolean isTabScrollable(String tabLabel)
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)
.
tabLabel
- the label of the tab to check.true
if the tab is scrollable, false
otherwise.protected JScrollPane createTabScrollable(String tabLabel, JPanel tabPanel)
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.
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
.public abstract void save()
Whether or not the dialogue is automatically hidden depends on the value returned by
isHideOnSave()
.
public abstract String validateFields()
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.
String
containing the error message to be shown to the user, or null
if there are no errors.