public class RadioButtonField extends BorderLayoutPanel implements Field<java.lang.Integer>
getValue()
is the index of the selected RadioButton.
It may have an optional nullify Button.
The RadioButtons can be aligned horizontal or vertical as needed.javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
RadioButtonField(NlsDatabaseKey nls) |
RadioButtonField(NlsDatabaseKey nls,
boolean isNotNull) |
RadioButtonField(NlsDatabaseKey nls,
Orientation orientation,
boolean isNotNull) |
Modifier and Type | Method and Description |
---|---|
void |
addOption(NlsKey nlsKey) |
void |
clear()
Clears the content
|
protected AbstractFieldDialog |
createEditor() |
java.lang.Integer |
createValue()
Creates the input Object typically from the textual String input.
|
protected IconKey |
getEditorIcon() |
javax.swing.JLabel |
getJLabel()
Returns a JLabel component labeled with the translated field name.
|
java.lang.String |
getLabel()
Returns the translated name for the field.
|
java.lang.String |
getName()
Returns the unique name of the field.
|
NlsDatabaseKey |
getNlsKey()
Returns the translation key used to name this Field
|
java.lang.String |
getStringValue()
Returns the field value as a String - or an empty String if the field is empty.
|
java.awt.Component |
getUnitComponent()
Not supported on this field
|
java.lang.Integer |
getValue()
Returns the index of the selected RadioButton or null if none is selected
|
javax.swing.JComponent |
getWidget()
Returns a JComponent that represents the layoutable GUI component.
|
protected boolean |
hasNullifyButton() |
boolean |
inputEquals(boolean b)
Tests if the field input is equal to the given boolean value.
|
boolean |
inputEquals(double d)
Tests if the field input is equal to the given double number.
|
boolean |
inputEquals(int i)
Tests if the field input is equal to the given int number.
|
boolean |
inputEquals(java.lang.Object obj)
Tests if the field input is equal to the given object.
|
boolean |
isEmpty()
Tests if the field has input.
|
boolean |
isLocked()
Tells wasCancelled the field is locked for editing.
|
boolean |
isNotNull()
Tells wasCancelled the field requires input.
|
boolean |
isPrimaryKey()
Tells whether this field is (or is part of) the primary key.
|
boolean |
isRecordTypeField()
Tells whether this field defines the record type (only valid for composed persistent
objects).
|
boolean |
isStretchableX()
Tells whether this field should fill all the horizontal space in it's container.
|
boolean |
isStretchableY()
Tells whether this field should fill all the vertical space in it's container.
|
void |
setInsertDefaultValue()
Requests the field to search for insert-default values in the 'insert_defaults' database table.
|
void |
setLocked(boolean isLocked)
Locks the field for editing.
|
void |
setModifyFlag(ModifyFlag flag)
Gives the field a reference to a ModifyFlag which is set if the field was edited.
|
void |
setNotNull(boolean isNotNull)
Sets the field to not-null.
|
void |
setPrimaryKey(boolean isPk)
Tells this field to be the primary key (affects input checking).
|
void |
setStretchableX(boolean isStretchableX)
Tells whether this field should fill all the horizontal space in it's container.
|
void |
setStretchableY(boolean isStretchableY)
Tells whether this field should fill all the vertical space in it's container.
|
void |
setUnitComponent(java.awt.Component comp)
Sets the unit component for this field which is placed behind the field,
when the field is added to a FieldPanel
|
void |
setUnitString(java.lang.String unit)
Sets the unit string for this field which is placed as a JLabel behind the field,
when the field is added to a FieldPanel
|
void |
setValue(java.lang.Integer value)
Selected the RadioButton at the given index or deselects all if the value is null
|
java.lang.String |
toString(java.lang.Object obj)
Converts the object to a String according to the policy of the affected field component.
|
java.lang.Integer |
toValue(java.lang.Object o)
Tries to convert any object value to the target data type of this field.
|
addBorder, contains, getTileIcon, insertBorder, paintComponent, setTileIcon, setTileIcon, setTitledBorder
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public RadioButtonField(NlsDatabaseKey nls)
public RadioButtonField(NlsDatabaseKey nls, boolean isNotNull)
public RadioButtonField(NlsDatabaseKey nls, Orientation orientation, boolean isNotNull)
protected boolean hasNullifyButton()
public void addOption(NlsKey nlsKey)
protected AbstractFieldDialog createEditor()
protected IconKey getEditorIcon()
public java.lang.Integer createValue() throws InvalidFieldInputException
Field
createValue
in interface Field<java.lang.Integer>
InvalidFieldInputException
- If the input Object cannot be created due to a parsing error.public javax.swing.JLabel getJLabel()
Field
public java.lang.String getLabel()
Field
getLabel
in interface Field<java.lang.Integer>
Translation
public java.lang.String getName()
Field
table.column
.public NlsDatabaseKey getNlsKey()
Field
public java.lang.String getStringValue()
Field
getStringValue
in interface Field<java.lang.Integer>
public final java.awt.Component getUnitComponent()
getUnitComponent
in interface Field<java.lang.Integer>
Field.setUnitComponent(Component)
public final void setUnitComponent(java.awt.Component comp)
Field
setUnitComponent
in interface Field<java.lang.Integer>
public final void setUnitString(java.lang.String unit)
Field
setUnitString
in interface Field<java.lang.Integer>
Field.setUnitComponent(Component)
public java.lang.Integer getValue()
public void setValue(java.lang.Integer value)
public javax.swing.JComponent getWidget()
Field
public boolean inputEquals(java.lang.Object obj)
Field
inputEquals
in interface Field<java.lang.Integer>
public boolean inputEquals(int i)
Field
inputEquals
in interface Field<java.lang.Integer>
public boolean inputEquals(double d)
Field
inputEquals
in interface Field<java.lang.Integer>
public boolean inputEquals(boolean b)
Field
inputEquals
in interface Field<java.lang.Integer>
public boolean isEmpty()
Field
public boolean isPrimaryKey()
Field
isPrimaryKey
in interface Field<java.lang.Integer>
public final boolean isRecordTypeField()
Field
isRecordTypeField
in interface Field<java.lang.Integer>
public boolean isStretchableX()
Field
isStretchableX
in interface Field<java.lang.Integer>
public void setStretchableX(boolean isStretchableX)
Field
setStretchableX
in interface Field<java.lang.Integer>
public boolean isStretchableY()
Field
isStretchableY
in interface Field<java.lang.Integer>
public void setStretchableY(boolean isStretchableY)
Field
setStretchableY
in interface Field<java.lang.Integer>
public void setInsertDefaultValue()
Field
setInsertDefaultValue
in interface Field<java.lang.Integer>
public boolean isLocked()
Field
public void setLocked(boolean isLocked)
Field
public void setModifyFlag(ModifyFlag flag)
Field
setModifyFlag
in interface Field<java.lang.Integer>
public boolean isNotNull()
Field
public void setNotNull(boolean isNotNull)
Field
setNotNull
in interface Field<java.lang.Integer>
public void setPrimaryKey(boolean isPk)
Field
setPrimaryKey
in interface Field<java.lang.Integer>
public java.lang.String toString(java.lang.Object obj)
Field
public void clear()
Clearable
public java.lang.Integer toValue(java.lang.Object o)
Field
IllegalArgumentException
is thrown when the type is not supported by the field.Copyright © 2014 EsprIT-Systems. All Rights Reserved.