Ontimize 5.2072EN

com.ontimize.gui.table
Class DateCellEditor

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.ontimize.gui.table.CellEditor
                  extended bycom.ontimize.gui.table.DateCellEditor
All Implemented Interfaces:
javax.swing.CellEditor, FormComponent, java.awt.image.ImageObserver, Internationalization, java.awt.MenuContainer, OpenDialog, java.io.Serializable, javax.swing.table.TableCellEditor

public class DateCellEditor
extends CellEditor
implements OpenDialog

Class to manage edition of dates in table components. It wraps a DateDataField whose parameters are passed in Hashtable parameter in constructor. It allows to manage some date patterns: including date and hour.

Since:
5.2000, 5.2059EN. It has been added parameters: withhour, onlyhour, hourfirst
Author:
Imatia Innovation SL
See Also:
Serialized Form

Nested Class Summary
protected  class DateCellEditor.EditorComp
           
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  DateCellEditor.EditorComp editorAux
           
static java.lang.String HOUR_FIRST
           
static boolean hourDefaultValueFirst
          Variable that indicates the order to show date and hour.
static java.lang.String ONLY_HOUR
           
static boolean SHOW_CALENDAR
          Static variable to show a calendar for selecting date on the right of the cell editor.
 boolean showCalendar
           
static java.lang.String SHOWCALENDAR
           
static java.lang.String WITH_HOUR
           
 
Fields inherited from class com.ontimize.gui.table.CellEditor
backgroundColor, clickNumber, column, COLUMN_PARAMETER, currentEditor, DEBUG_RENDERER, EDIT_CELL_COMMAND, editor, field, focusBorder, focusBorderColor, font, fontColor, listeners, value
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.ontimize.gui.field.FormComponent
DEBUG
 
Fields inherited from interface com.ontimize.gui.i18n.Internationalization
DEBUG_LANGUAGE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DateCellEditor(java.util.Hashtable parameters)
          Constructor of class.
 
Method Summary
static DateDataField createDataField(java.util.Hashtable parameters)
          This method creates the data field for building the cell editor.
 java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
           
 void setParentFrame(java.awt.Frame f)
          This method is called from Form for each component that implements this interface.
 boolean stopCellEditing()
           
 
Methods inherited from class com.ontimize.gui.table.CellEditor
addCellEditorListener, addFocusListener, addKeyListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorValue, getConstraints, getDefaultFocusBorder, getEditorFont, getSQLDataType, getTextsToTranslate, init, installKeyListener, isCellEditable, removeCellEditorListener, requestFocus, setComponentLocale, setEnabled, setResourceBundle, setVisible, shouldSelectCell
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ontimize.gui.field.FormComponent
isEnabled
 

Field Detail

hourDefaultValueFirst

public static boolean hourDefaultValueFirst
Variable that indicates the order to show date and hour. By default hour is showed at first.


WITH_HOUR

public static final java.lang.String WITH_HOUR
See Also:
Constant Field Values

ONLY_HOUR

public static final java.lang.String ONLY_HOUR
See Also:
Constant Field Values

HOUR_FIRST

public static final java.lang.String HOUR_FIRST
See Also:
Constant Field Values

SHOW_CALENDAR

public static boolean SHOW_CALENDAR
Static variable to show a calendar for selecting date on the right of the cell editor.


SHOWCALENDAR

public static final java.lang.String SHOWCALENDAR
See Also:
Constant Field Values

showCalendar

public boolean showCalendar

editorAux

protected DateCellEditor.EditorComp editorAux
Constructor Detail

DateCellEditor

public DateCellEditor(java.util.Hashtable parameters)
Constructor of class.

Parameters:
parameters - the Hashtable with parameters. They are allowed parameters of DateDataField: DateDataField.init(Hashtable) and additionally:

attribute values default required meaning
column yes The column to apply the editor
showcalendar no no Shows a graphical calendar to choose the date from a calendar. It is also possible fix this parameter for all DateCellEditor objects with static variable SHOW_CALENDAR.
withhour yes/no no no Indicates wheter cell editor will contain the hour. Since 5.2059EN
hourfirst yes/no Value of variable hourDefaultValueFirst. By default, yes no Indicates whether hour must be showed at first. Since 5.2059EN
Method Detail

setParentFrame

public void setParentFrame(java.awt.Frame f)
Description copied from interface: OpenDialog
This method is called from Form for each component that implements this interface. It fixes the parent frame for element. This frame is needed to open the modal dialog.

Specified by:
setParentFrame in interface OpenDialog
Parameters:
f - the frame

getTableCellEditorComponent

public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table,
                                                      java.lang.Object value,
                                                      boolean isSelected,
                                                      int row,
                                                      int column)
Specified by:
getTableCellEditorComponent in interface javax.swing.table.TableCellEditor
Overrides:
getTableCellEditorComponent in class CellEditor

stopCellEditing

public boolean stopCellEditing()
Specified by:
stopCellEditing in interface javax.swing.CellEditor
Overrides:
stopCellEditing in class CellEditor

createDataField

public static DateDataField createDataField(java.util.Hashtable parameters)
This method creates the data field for building the cell editor.

Parameters:
parameters - Hashtable with parameters
Returns:
the data field

Ontimize