public class RecordFieldPanel<C extends ApplicationContext,R extends DBRecord> extends FieldPanel implements ApplicationObject<C>
DBRecord
for user input. It is used for modifying the values
of a record as well as for creating new record instances from the users input.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 |
---|
RecordFieldPanel(C ctx,
R masterRec,
EditMode mode)
Constructs the panel for the given type of DBRecord.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkRecordTypeField(Field field)
Sets this field the record-type column of a ComposedRecord (inheritance type).
|
protected Field |
createInputField(java.lang.Class fieldClass,
int jdbcType,
java.lang.String fieldName,
int fieldLength,
boolean isNotNull,
boolean isPK)
Creates the Field component with the given parameters.
|
R |
createRecordFromInput()
Tries to create a DBObject of the managed type from the input fields.
|
ZAction |
getActionRehashRecord()
This action rehashes the current record from the database
without changing its reference.
|
C |
getApplicationContext() |
R |
getCurrentRecord()
Returns the current DBRecord which has been set with
setCurrentRecord(DBRecord) . |
R |
getMasterRecord()
Returns the master DBRecord that was used to create this form panel.
|
DBRecord |
getParentRecord() |
void |
insertRecord(RecordCollection recColl)
Creates the new
DBRecord from the users input and calls
performRecordInsert(DBRecord, RecordCollection) . |
protected boolean |
isFieldVisible(java.lang.String fieldName)
Tells whether the field with the given name should be visible in the form.
|
protected boolean |
isPrimaryKeyFieldLocked()
Tells whether the PK field should be locked.
|
R |
modifyRecordFromInput()
Returns a copy of the current DBRecord modified according the values of the input fields.
|
R |
modifyRecordFromInput(R newRec)
Tries to create a DBRecord of the managed type from the input fields.
|
protected void |
performRecordInsert(R newRec,
RecordCollection recColl)
Performs the actual database INSERT operation and if successful
adds the newly inserted record into the record collection.
|
protected R |
performRecordRehash(R currRec)
Performs the database REHASH request.
|
protected void |
performRecordUpdate(R modifiedRec,
RecordCollection recColl)
Performs the database UPDATE request and modifies the RecordCollection accordingly
|
void |
rehashRecord()
Rehashes the current record from the database by calling
performRecordRehash(DBRecord) . |
void |
reset()
Sets all input field values from the current DBRecord.
|
void |
setCurrentRecord(R record)
Makes the given DBRecord the current one and displays it's values.
|
void |
setParentRecord(DBRecord record)
Sets the parent record from which the current record may depend
|
protected R |
setPrimaryKeyValues(R newRec) |
void |
setRecordType()
Sets the value of the record-type field
|
void |
updateRecord(RecordCollection recColl)
Creates a copy of the current record, modifies it from the users input
and calls
performRecordUpdate(DBRecord, RecordCollection) . |
addField, checkInput, checkInput, clear, clearAll, configureField, createLayout, existsField, focusFirstField, getEditMode, getField, getField, getFieldCount, getFields, getMaxLabelWidth, getModifyFlag, hasInput, isCreateMode, isFieldLocked, isFieldNotNull, isModified, isSearchMode, isUpdateMode, layoutFields, placeField, setApplier, setEditMode, setFields, setInsertDefaultValues, setLocked, setModified, setModifyFlag, setNotNull, setPrimaryKeysLocked, toDumpString, toDumpString, toString, toString
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 final C getApplicationContext()
getApplicationContext
in interface ApplicationObject<C extends ApplicationContext>
public R getMasterRecord()
protected boolean isPrimaryKeyFieldLocked()
EditMode.UPDATE
.protected Field createInputField(java.lang.Class fieldClass, int jdbcType, java.lang.String fieldName, int fieldLength, boolean isNotNull, boolean isPK)
protected void checkRecordTypeField(Field field)
public R createRecordFromInput() throws java.lang.Exception
java.lang.Exception
public ZAction getActionRehashRecord()
public void setCurrentRecord(R record)
getCurrentRecord()
public void setParentRecord(DBRecord record)
public DBRecord getParentRecord()
public R getCurrentRecord()
setCurrentRecord(DBRecord)
.protected R setPrimaryKeyValues(R newRec) throws java.lang.Exception
java.lang.Exception
public R modifyRecordFromInput() throws java.lang.Exception
java.lang.Exception
public R modifyRecordFromInput(R newRec) throws java.lang.Exception
java.lang.Exception
public void reset()
setCurrentRecord(DBRecord r)
protected boolean isFieldVisible(java.lang.String fieldName)
isFieldVisible
in class FieldPanel
DBRecord.isFieldVirtual(String)
,
DBRecord.isPrimaryKey(String)
public final void insertRecord(RecordCollection recColl) throws java.lang.Exception
DBRecord
from the users input and calls
performRecordInsert(DBRecord, RecordCollection)
.java.lang.Exception
public final void updateRecord(RecordCollection recColl) throws java.lang.Exception
performRecordUpdate(DBRecord, RecordCollection)
.java.lang.Exception
public final void rehashRecord() throws java.lang.Exception
performRecordRehash(DBRecord)
.java.lang.Exception
public void setRecordType()
protected void performRecordInsert(R newRec, RecordCollection recColl) throws java.lang.Exception
java.lang.Exception
protected void performRecordUpdate(R modifiedRec, RecordCollection recColl) throws java.lang.Exception
java.lang.Exception
Copyright © 2014 EsprIT-Systems. All Rights Reserved.