ewe.ui
Class DateTimeInput

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.ButtonControl
              extended byewe.ui.mButton
                  extended byewe.ui.TextDisplayButton
                      extended byewe.ui.DateTimeInput
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, ImageRefresher, TimerProc, UIConstants

public class DateTimeInput
extends TextDisplayButton


Field Summary
 Locale locale
          The Locale associated with this input.
 Time time
          This variable holds the time value being displayed/edited.
 boolean useFullPopup
          Set this false if you only want simple single line input for the date/time.
 
Fields inherited from class ewe.ui.TextDisplayButton
isPassword, passwordCharacter
 
Fields inherited from class ewe.ui.mButton
action, buttonObject, insideColor, textPosition
 
Fields inherited from class ewe.ui.ButtonControl
actionOnPress, alignment, anchor, arrowDirection, flatInside, imageAnchor, inPress, pressState, shouldRepeat, state
 
Fields inherited from class ewe.ui.Control
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y
 
Fields inherited from class ewe.ui.ControlBase
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Fields inherited from interface ewe.fx.ImageRefresher
KEEP_VISIBLE
 
Constructor Summary
DateTimeInput()
           
DateTimeInput(boolean isTime)
           
 
Method Summary
 boolean acceptsData(Object data, DragContext how)
          This should indicate whether this control will accept the data either via a drag and drop or via a paste operation.
protected  void calculateSizes()
          Override this to calculate the preferred, minimum and maximum size of your control.
protected  Object getDataToCopy()
          This is called to get data from the control to put into the clipboard.
 String getFormat()
           
 Time getTime(Time dest)
          Get the time.
protected static String getTimeFormatFor(boolean showSeconds, boolean is24hours)
           
 void getValue(Value value)
          Get the date.
 void setDateFormat(String dateFormat)
          Set the date format string.
 void setShowCalendar(boolean showCalendar)
           
 void setTime(Time time)
          Set the time.
 void setTimeFormat(boolean showSeconds, boolean is24hours)
          Set the format for display/input of a Time of day value.
 void setValue(Value value)
          Set the date.
 boolean takeData(Object data, DragContext how)
          This tells the Control to take the data which has either come from a clipboard operation or from a DragAndDrop.
 
Methods inherited from class ewe.ui.TextDisplayButton
getDisplayText, getPasswordCharacter, setBorderStyle
 
Methods inherited from class ewe.ui.mButton
doPaint, getImageColor, getImageColor, gotFocus, lostFocus, make
 
Methods inherited from class ewe.ui.ButtonControl
activate, deactivate, doAction, doPenHeld, doPenPress, dragged, fullAction, fullAction, penHeld, penPressed, penReleased, penRightReleased, startDragging, startDropMenu, stopDragging
 
Methods inherited from class ewe.ui.Control
addListener, addTimer, amOnTopFrame, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, defaultTo, doActionKey, doBackground, doBorder, doHotKey, doMenu, dontAcceptDrop, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, exitEntry, fillBackground, formClosing, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataRect, getDataToDragAndDrop, getDim, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getNextKeyFocus, getParent, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onEvent, onKeyEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, repaintDataNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, resizeTo, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setText, setTextSize, setToolTip, show, shown, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, takeFocus, takeFromClipboard, takePromptControl, testDim, ticked, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop, willShowFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 

Field Detail

locale

public Locale locale
The Locale associated with this input.


useFullPopup

public boolean useFullPopup
Set this false if you only want simple single line input for the date/time.


time

public Time time
This variable holds the time value being displayed/edited. You can change the format of it and the format of the display will also change.

Constructor Detail

DateTimeInput

public DateTimeInput()

DateTimeInput

public DateTimeInput(boolean isTime)
Method Detail

getTimeFormatFor

protected static String getTimeFormatFor(boolean showSeconds,
                                         boolean is24hours)

getFormat

public String getFormat()

setShowCalendar

public void setShowCalendar(boolean showCalendar)

setDateFormat

public void setDateFormat(String dateFormat)
Set the date format string. This marks the input as being a date input rather than a time input.

Parameters:
dateFormat - the new date format.

setTimeFormat

public void setTimeFormat(boolean showSeconds,
                          boolean is24hours)
Set the format for display/input of a Time of day value.

Parameters:
is24hours - show 24 hour time.
showSeconds - show the seconds value.

calculateSizes

protected void calculateSizes()
Description copied from class: Control
Override this to calculate the preferred, minimum and maximum size of your control. This is only called once unless the modifier flag AlwaysRecalculateSizes is true. During the calculation you will set the variables preferredWidth, preferredHeight, etc. directly.

Overrides:
calculateSizes in class mButton

setValue

public void setValue(Value value)
Set the date. Value must be a Time object value.


getValue

public void getValue(Value value)
Get the date. Value must be a Time object value.


setTime

public void setTime(Time time)
Set the time.


getTime

public Time getTime(Time dest)
Get the time.

Parameters:
dest - an optional destination Time object.
Returns:
the destination Time object, or a new one if dest is null.

acceptsData

public boolean acceptsData(Object data,
                           DragContext how)
Description copied from class: Control
This should indicate whether this control will accept the data either via a drag and drop or via a paste operation.

Overrides:
acceptsData in class Control
Parameters:
data - The data to be transferred.
how - if the transfer is via DragAndDrop this will be a DragContext object, otherwise it will be null to indicate a clipboard operation.
Returns:
true if the data will be accepted by this control.

takeData

public boolean takeData(Object data,
                        DragContext how)
Description copied from class: Control
This tells the Control to take the data which has either come from a clipboard operation or from a DragAndDrop.

Overrides:
takeData in class Control
Parameters:
data - The data to accept.
how - if the transfer is via DragAndDrop this will be a DragContext object, otherwise it will be null to indicate a clipboard operation.
Returns:
true if the data was successfully accepted.

getDataToCopy

protected Object getDataToCopy()
Description copied from class: Control
This is called to get data from the control to put into the clipboard.

Overrides:
getDataToCopy in class Control