public class TimeSpanField extends AbstractFieldContainer
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponentaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
TimeSpanField(NlsDatabaseKey nls) |
TimeSpanField(NlsDatabaseKey nls,
int length) |
TimeSpanField(NlsDatabaseKey nls,
int length,
boolean isNotNull) |
TimeSpanField(NlsDatabaseKey nls,
int length,
boolean isNotNull,
java.util.EnumSet<TimeSpan> values) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the content
|
protected javax.swing.text.Document |
createDefaultModel() |
protected AbstractFieldDialog |
createEditor() |
java.sql.Timestamp |
createValue()
Creates the input Object typically from the textual String input.
|
int |
getAmount() |
java.sql.Timestamp |
getBaseTimestamp() |
protected IconKey |
getEditorIcon() |
IntegerField |
getField()
Returns a reference to the contained field.
|
java.lang.String |
getStringValue()
Returns the field value as a String - or an empty String if the field is empty.
|
TimeSpan |
getTimeSpan() |
java.sql.Timestamp |
getValue()
Returns the field value as an Object - or null if the field is empty.
|
IntegerField |
getWidget()
Returns a JComponent that represents the layoutable GUI component.
|
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 |
isRollForward() |
void |
setAmount(int value) |
void |
setLocked(boolean isLocked)
Locks the field for editing.
|
void |
setReferenceTimestamp(java.sql.Timestamp baseTs)
Defines from where on the resulting timestamp is calculated.
|
void |
setRollForward(boolean isForward)
Defines whether the resulting timestamp is calculated in the future or the past.
|
void |
setTimeSpan(TimeSpan second) |
void |
setValue(java.lang.Object obj)
Setting a Timestamp value sets the timespan choice to the next appropriate time unit
and the value field to the number of units.
|
java.lang.String |
toString(java.lang.Object tsObj)
Converts the object to a String according to the policy of the affected field component.
|
java.lang.Long |
toValue(java.lang.Object o)
Tries to convert any object value to the target data type of this field.
|
getActionOpenEditor, getFieldDialog, getJLabel, getLabel, getName, getNlsKey, getUnitComponent, isEmpty, isLocked, isNotNull, isPrimaryKey, isRecordTypeField, isStretchableX, isStretchableY, setInsertDefaultValue, setModifyFlag, setNotNull, setPrimaryKey, setStretchableX, setStretchableY, setUnitComponent, setUnitString, toStringalignFirstColumnsInSubPanels, getDefaultInsets, getFirstColumnMaxWidth, horizontalStretch, place, place, place, place, place, place, place, setDefaultInsets, setFirstColumnWidth, stretchX, stretchY, verticalStretchaddBorder, contains, getTileIcon, insertBorder, paintComponent, setTileIcon, setTileIcon, setTitledBordergetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, updateadd, 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, validateTreeaction, 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, transferFocus, transferFocusBackward, transferFocusUpCyclepublic TimeSpanField(NlsDatabaseKey nls)
public TimeSpanField(NlsDatabaseKey nls, int length)
public TimeSpanField(NlsDatabaseKey nls, int length, boolean isNotNull)
public TimeSpanField(NlsDatabaseKey nls, int length, boolean isNotNull, java.util.EnumSet<TimeSpan> values)
public IntegerField getField()
AbstractFieldContainergetField in class AbstractFieldContainerpublic IntegerField getWidget()
FieldgetWidget in interface FieldgetWidget in class AbstractFieldContainerpublic void setAmount(int value)
public int getAmount()
public TimeSpan getTimeSpan()
public void setTimeSpan(TimeSpan second)
protected AbstractFieldDialog createEditor()
createEditor in class AbstractFieldContainerprotected IconKey getEditorIcon()
getEditorIcon in class AbstractFieldContainerprotected javax.swing.text.Document createDefaultModel()
public java.sql.Timestamp createValue()
throws InvalidFieldInputException
FieldcreateValue in interface FieldcreateValue in class AbstractFieldContainerInvalidFieldInputException - If the input Object cannot be created due to a parsing error.public void setLocked(boolean isLocked)
FieldsetLocked in interface FieldsetLocked in class AbstractFieldContainerpublic void setValue(java.lang.Object obj)
Note also that the the field does not store whether the Timestamp is in the future or in the past.
setValue in interface FieldsetValue in class AbstractFieldContainersetRollForward(boolean)public void clear()
Clearableclear in interface Clearableclear in class AbstractFieldContainerpublic void setReferenceTimestamp(java.sql.Timestamp baseTs)
public java.sql.Timestamp getBaseTimestamp()
public void setRollForward(boolean isForward)
public boolean isRollForward()
public java.lang.String toString(java.lang.Object tsObj)
FieldtoString in interface FieldtoString in class AbstractFieldContainerpublic java.sql.Timestamp getValue()
FieldgetValue in interface FieldgetValue in class AbstractFieldContainerpublic java.lang.String getStringValue()
FieldgetStringValue in interface FieldgetStringValue in class AbstractFieldContainerpublic boolean inputEquals(java.lang.Object obj)
FieldinputEquals in interface FieldinputEquals in class AbstractFieldContainerpublic boolean inputEquals(int i)
FieldinputEquals in interface FieldinputEquals in class AbstractFieldContainerpublic boolean inputEquals(double d)
FieldinputEquals in interface FieldinputEquals in class AbstractFieldContainerpublic boolean inputEquals(boolean b)
FieldinputEquals in interface FieldinputEquals in class AbstractFieldContainerpublic java.lang.Long toValue(java.lang.Object o)
FieldIllegalArgumentException is thrown when the type is not supported by the field.toValue in interface FieldtoValue in class AbstractFieldContainerCopyright © 2014 EsprIT-Systems. All Rights Reserved.