public class TimeSpanField extends AbstractFieldContainer
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 |
---|
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, 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, 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 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()
AbstractFieldContainer
getField
in class AbstractFieldContainer
public IntegerField getWidget()
Field
getWidget
in interface Field
getWidget
in class AbstractFieldContainer
public void setAmount(int value)
public int getAmount()
public TimeSpan getTimeSpan()
public void setTimeSpan(TimeSpan second)
protected AbstractFieldDialog createEditor()
createEditor
in class AbstractFieldContainer
protected IconKey getEditorIcon()
getEditorIcon
in class AbstractFieldContainer
protected javax.swing.text.Document createDefaultModel()
public java.sql.Timestamp createValue() throws InvalidFieldInputException
Field
createValue
in interface Field
createValue
in class AbstractFieldContainer
InvalidFieldInputException
- If the input Object cannot be created due to a parsing error.public void setLocked(boolean isLocked)
Field
setLocked
in interface Field
setLocked
in class AbstractFieldContainer
public 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 Field
setValue
in class AbstractFieldContainer
setRollForward(boolean)
public void clear()
Clearable
clear
in interface Clearable
clear
in class AbstractFieldContainer
public 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)
Field
toString
in interface Field
toString
in class AbstractFieldContainer
public java.sql.Timestamp getValue()
Field
getValue
in interface Field
getValue
in class AbstractFieldContainer
public java.lang.String getStringValue()
Field
getStringValue
in interface Field
getStringValue
in class AbstractFieldContainer
public boolean inputEquals(java.lang.Object obj)
Field
inputEquals
in interface Field
inputEquals
in class AbstractFieldContainer
public boolean inputEquals(int i)
Field
inputEquals
in interface Field
inputEquals
in class AbstractFieldContainer
public boolean inputEquals(double d)
Field
inputEquals
in interface Field
inputEquals
in class AbstractFieldContainer
public boolean inputEquals(boolean b)
Field
inputEquals
in interface Field
inputEquals
in class AbstractFieldContainer
public java.lang.Long toValue(java.lang.Object o)
Field
IllegalArgumentException
is thrown when the type is not supported by the field.toValue
in interface Field
toValue
in class AbstractFieldContainer
Copyright © 2014 EsprIT-Systems. All Rights Reserved.