public class FieldPanel extends GridBagPanel implements Clearable, Dumpable
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 |
---|
FieldPanel()
Creates an empty field panel.
|
FieldPanel(EditMode mode) |
FieldPanel(EditMode mode,
Field... fields) |
FieldPanel(Field... fields) |
FieldPanel(NlsKey titleKey) |
FieldPanel(NlsKey titleKey,
EditMode mode,
Field... fields) |
Modifier and Type | Method and Description |
---|---|
<F extends Field> |
addField(F field)
Adds a input Field to the internal field list.
|
void |
checkInput()
Requests all fields to check their input.
|
void |
checkInput(boolean withPK)
Same as
checkInput() but allows to in/exclude checking
of primary key fields. |
void |
clear()
Clears the content of all fields except of the primary key fields.
|
void |
clearAll()
Clears the content of all fields including the primary key fields.
|
protected void |
configureField(Field field)
Initializes the field such that all fields which want to be not-null are set to not-null and
all fields which want to be locked are set to be locked.
|
protected java.awt.LayoutManager |
createLayout()
Creates the layout manager for this container.
|
boolean |
existsField(java.lang.String name)
Checks whether the field with the given name exists in the panel.
|
void |
focusFirstField()
Requests the focus to be grabbed by the first field.
|
EditMode |
getEditMode() |
Field |
getField(int index) |
Field |
getField(java.lang.String name)
Accesses the field by name - returns null if none was found.
|
int |
getFieldCount() |
Field[] |
getFields()
Returns the field array that is managed by this FieldPanel.
|
int |
getMaxLabelWidth()
Returns the width of the biggest label.
|
ModifyFlag |
getModifyFlag()
Returns the ModifyFlag assiociated to this fieldpanel.
|
boolean |
hasInput()
Returns true when any of the fields is not empty.
|
boolean |
isCreateMode() |
protected boolean |
isFieldLocked(java.lang.String fieldName)
Defines which fields are to be configured as read-only fields.
|
protected boolean |
isFieldNotNull(java.lang.String fieldName)
Defines which fields are to be configured as not-null fields.
|
protected boolean |
isFieldVisible(java.lang.String fieldName)
Defines whether this field should be displayed in the fieldpanel.
|
boolean |
isModified()
Tells wasCancelled the modify flag is set.
|
boolean |
isSearchMode() |
boolean |
isUpdateMode() |
void |
layoutFields()
Performs the layout and initialization of the fields.
|
protected void |
placeField(Field field,
int y)
Places the field and it's field-label in the container.
|
void |
setApplier(Applier applier)
Sets this Applier instance for all CharFields within this panel
|
void |
setEditMode(EditMode mode) |
void |
setFields(Field[] fields)
This method must be called once (and only once) on a FieldPanel instance in order
to give it some fields to manage.
|
void |
setInsertDefaultValues()
Requests all fields to lookup for their insert-default values.
|
void |
setLocked(boolean state)
Sets the locked state (read-only) of all fields.
|
void |
setModified(boolean state)
Sets the modify flag to the given state.
|
void |
setModifyFlag(ModifyFlag flag)
Sets the ModifyFlag reference in all fields.
|
void |
setNotNull(boolean state)
Sets all field to not-null.
|
void |
setPrimaryKeysLocked(boolean state)
Sets the locked state (read-only) of all fields.
|
java.lang.String |
toDumpString()
Returns a multi-line String that shows the values (name=value) of all important
state variables of this object.
|
DumpString |
toDumpString(DumpString s)
This method allows subclasses to add values to the existing DumpString of the superclass.
|
java.lang.String |
toString()
Returns a single line String that shows the values of the most important
state variables of this object.
|
ToString |
toString(ToString s)
This method allows subclasses to add values to the existing ToString of the superclass.
|
alignFirstColumnsInSubPanels, getDefaultInsets, getFirstColumnMaxWidth, horizontalStretch, place, place, place, place, place, place, place, setDefaultInsets, setFirstColumnWidth, stretchX, stretchY, verticalStretch
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, getName, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
public FieldPanel()
public FieldPanel(NlsKey titleKey)
public FieldPanel(EditMode mode)
public FieldPanel(Field... fields)
public void setApplier(Applier applier)
public void setEditMode(EditMode mode)
public EditMode getEditMode()
public boolean isCreateMode()
public boolean isUpdateMode()
public boolean isSearchMode()
protected java.awt.LayoutManager createLayout()
public <F extends Field> F addField(F field)
layoutFields()
public void setFields(Field[] fields)
public Field[] getFields()
public Field getField(int index)
public int getFieldCount()
public void layoutFields()
Note that if the fields have been added with addField(Field) then this method must be called once after all fields have been added.
setFields(Field[])
protected void configureField(Field field)
layoutFields()
protected void placeField(Field field, int y)
public int getMaxLabelWidth()
public Field getField(java.lang.String name)
public boolean existsField(java.lang.String name)
public void clear()
isCreateMode()
the
ModifyFlag is reset after clearing.public void clearAll()
public void checkInput() throws java.lang.Exception
java.lang.Exception
public void checkInput(boolean withPK) throws java.lang.Exception
checkInput()
but allows to in/exclude checking
of primary key fields.java.lang.Exception
public boolean hasInput()
public void setInsertDefaultValues()
public void setPrimaryKeysLocked(boolean state)
public void setLocked(boolean state)
public void setNotNull(boolean state)
protected boolean isFieldNotNull(java.lang.String fieldName)
protected boolean isFieldLocked(java.lang.String fieldName)
protected boolean isFieldVisible(java.lang.String fieldName)
public void focusFirstField()
public void setModifyFlag(ModifyFlag flag)
public ModifyFlag getModifyFlag()
public void setModified(boolean state)
public boolean isModified()
public java.lang.String toString()
Dumpable
public ToString toString(ToString s)
Dumpable
public java.lang.String toDumpString()
Dumpable
toDumpString
in interface Dumpable
public DumpString toDumpString(DumpString s)
Dumpable
toDumpString
in interface Dumpable
Copyright © 2014 EsprIT-Systems. All Rights Reserved.