jBPM Console NG - Generic Client 6.1.0-SNAPSHOT

org.jbpm.console.ng.gc.client.util
Class UTCTimeBoxImplHtml4

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.jbpm.console.ng.gc.client.util.UTCTimeBoxImplShared
                  extended by org.jbpm.console.ng.gc.client.util.UTCTimeBoxImplHtml4
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasValueChangeHandlers<Long>, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.TakesValue<Long>, com.google.gwt.user.client.ui.HasText, com.google.gwt.user.client.ui.HasValue<Long>, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget, UTCTimeBoxImpl

public class UTCTimeBoxImplHtml4
extends UTCTimeBoxImplShared

Time is represented as the number of milliseconds after midnight independent of time zone.

It will use the GWT DateTimeFormat to parse in the browser timezone, but it will then convert the time to be independent of timezone.

It will first parse a manually typed date using the time format specified (defaulting to TIME_SHORT). It will then attempt the following formats in order: "hh:mm a", "hh:mma", "HH:mm". If all of these fail, it will attempt to insert a colon in the right place (e.g. 12 -> 12:00, 123 -> 1:23, and 1234 -> 12:34) and try the specified time format and the fallback formats again.

The control supports an unspecified value of null with a blank textbox.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class org.jbpm.console.ng.gc.client.util.UTCTimeBoxImplShared
fallbackFormatStrings, fallbackTimeFormats, timeFormat
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
UTCTimeBoxImplHtml4()
          Allows a UTCTimeBox to be created with a specified format.
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Long> handler)
           
 void clearInvalidStyle()
           
 String getText()
           
 com.google.gwt.user.client.ui.TextBox getTextBox()
          Returns the TextBox on which this control is based.
 Long getValue()
          Returns the time value (as milliseconds since midnight independent of time zone)
 boolean hasValidValue()
          A valid value is either empty (null) or filled with a valid time.
 boolean hasValue()
           
 void hideMenu()
          Hides the time picker menu
protected  boolean isSameValue(Long a, Long b)
           
 void setTabIndex(int tabIndex)
          Sets the tab index for the control.
 void setText(String text)
           
 void setTimeFormat(com.google.gwt.i18n.client.DateTimeFormat timeFormat)
          Sets the DateTimeFormat for this UTCTimeBox.
 void setValue(Long value, boolean fireEvents)
          Sets the time value (as milliseconds since midnight independent of time zone)
protected  void setValue(Long value, boolean updateTextBox, boolean fireEvents)
           
 void setVisibleLength(int length)
          Sets the visible length of the time input.
 void showMenu()
          Displays the time picker menu
protected  void syncTextToValue(Long value)
           
protected  void syncValueToText()
           
 void validate()
          Validates the value that has been typed into the text input.
 
Methods inherited from class org.jbpm.console.ng.gc.client.util.UTCTimeBoxImplShared
formatUsingFormat, normalizeInLocalRange, parseUsingFallbacks, parseUsingFallbacksWithColon, parseUsingFormat, setValue, text2value, value2text
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.user.client.ui.IsWidget
asWidget
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

UTCTimeBoxImplHtml4

public UTCTimeBoxImplHtml4()
Allows a UTCTimeBox to be created with a specified format.

Method Detail

setTimeFormat

public void setTimeFormat(com.google.gwt.i18n.client.DateTimeFormat timeFormat)
Description copied from class: UTCTimeBoxImplShared
Sets the DateTimeFormat for this UTCTimeBox. The HTML5 implementation will ignore this.

Specified by:
setTimeFormat in interface UTCTimeBoxImpl
Overrides:
setTimeFormat in class UTCTimeBoxImplShared

getTextBox

public com.google.gwt.user.client.ui.TextBox getTextBox()
Returns the TextBox on which this control is based.


showMenu

public void showMenu()
Displays the time picker menu


hideMenu

public void hideMenu()
Hides the time picker menu


hasValue

public boolean hasValue()

hasValidValue

public boolean hasValidValue()
A valid value is either empty (null) or filled with a valid time.


getValue

public Long getValue()
Returns the time value (as milliseconds since midnight independent of time zone)


setValue

public void setValue(Long value,
                     boolean fireEvents)
Sets the time value (as milliseconds since midnight independent of time zone)


setValue

protected void setValue(Long value,
                        boolean updateTextBox,
                        boolean fireEvents)

isSameValue

protected boolean isSameValue(Long a,
                              Long b)

addValueChangeHandler

public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<Long> handler)

getText

public String getText()

setText

public void setText(String text)

syncTextToValue

protected void syncTextToValue(Long value)

syncValueToText

protected void syncValueToText()

validate

public void validate()
Description copied from class: UTCTimeBoxImplShared
Validates the value that has been typed into the text input. The HTML5 implementation will do nothing.

Specified by:
validate in interface UTCTimeBoxImpl
Overrides:
validate in class UTCTimeBoxImplShared

setVisibleLength

public void setVisibleLength(int length)
Description copied from class: UTCTimeBoxImplShared
Sets the visible length of the time input. The HTML5 implementation will ignore this.

Specified by:
setVisibleLength in interface UTCTimeBoxImpl
Overrides:
setVisibleLength in class UTCTimeBoxImplShared

setTabIndex

public void setTabIndex(int tabIndex)
Description copied from interface: UTCTimeBoxImpl
Sets the tab index for the control.


clearInvalidStyle

public void clearInvalidStyle()

jBPM Console NG - Generic Client 6.1.0-SNAPSHOT

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.