com.vaadin.terminal.gwt.client.ui.
Class VTextualDate
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
com.google.gwt.user.client.ui.FlowPanel
com.vaadin.terminal.gwt.client.ui.VDateField
com.vaadin.terminal.gwt.client.ui.VTextualDate
All Implemented Interfaces:
com.google.gwt.event.dom.client.ChangeHandler, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget, com.google.gwt.user.client.ui.InsertPanel, com.google.gwt.user.client.ui.InsertPanel.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, ContainerResizedListener, Focusable, Paintable, Field, SubPartAware, Iterable<com.google.gwt.user.client.ui.Widget>
Direct Known Subclasses:
- extends VDateField
- implements Paintable, Field, com.google.gwt.event.dom.client.ChangeHandler, ContainerResizedListener, Focusable, SubPartAware
public class VTextualDate
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 |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.InsertPanel |
---|
com.google.gwt.user.client.ui.InsertPanel.ForIsWidget |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
---|
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget |
Field Summary | |
---|---|
protected int |
fieldExtraWidth
|
Fields inherited from class com.vaadin.terminal.gwt.client.ui.VDateField |
---|
CLASSNAME, currentLocale, currentResolution, dts, enabled, immediate, readonly, RESOLUTION_DAY, RESOLUTION_HOUR, RESOLUTION_MIN, RESOLUTION_MONTH, RESOLUTION_MSEC, RESOLUTION_SEC, RESOLUTION_YEAR, WEEK_NUMBERS |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
VTextualDate()
|
Method Summary | |
---|---|
protected void |
buildDate()
Updates the text field according to the current date (provided by VDateField.getDate() ). |
void |
focus()
Sets focus to this widget. |
protected int |
getFieldExtraWidth()
Returns pixels in x-axis reserved for other than textfield content. |
protected String |
getFormatString()
|
com.google.gwt.user.client.Element |
getSubPartElement(String subPart)
Locates an element inside a component using the identifier provided in subPart . |
String |
getSubPartName(com.google.gwt.user.client.Element subElement)
Provides an identifier that identifies the element within the component. |
protected String |
getText()
|
void |
iLayout()
This function is run when container box has been resized. |
void |
iLayout(boolean force)
|
protected boolean |
isUndefinedWidth()
|
void |
onChange(com.google.gwt.event.dom.client.ChangeEvent event)
|
protected void |
setPrompting(boolean prompting)
|
protected void |
setText(String text)
|
void |
setWidth(String newWidth)
|
void |
updateFromUIDL(UIDL uidl,
ApplicationConnection client)
|
void |
updateWidth()
Force an recalculation of the width of the component IF the width has been defined. |
Methods inherited from class com.vaadin.terminal.gwt.client.ui.VDateField |
---|
getClient, getCurrentDate, getCurrentLocale, getCurrentResolution, getDate, getDateTimeService, getId, getMilliseconds, isEnabled, isImmediate, isReadonly, isShowISOWeekNumbers, onBrowserEvent, setCurrentDate, setCurrentLocale, setCurrentResolution, setDate, setMilliseconds |
Methods inherited from class com.google.gwt.user.client.ui.FlowPanel |
---|
add, clear, insert, insert |
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel |
---|
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
add, adopt, adopt, disown, doAttachChildren, doDetachChildren, orphan, remove |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, 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, 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.InsertPanel.ForIsWidget |
---|
add |
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel |
---|
getWidget, getWidgetCount, getWidgetIndex, remove |
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget |
---|
getWidgetIndex |
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel |
---|
getWidget, getWidgetCount, getWidgetIndex, remove |
Field Detail |
---|
fieldExtraWidth
protected int fieldExtraWidth
Constructor Detail |
---|
VTextualDate
public VTextualDate()
Method Detail |
---|
updateFromUIDL
public void updateFromUIDL(UIDL uidl,
ApplicationConnection client)
- Specified by:
updateFromUIDL
in interfacePaintable
- Overrides:
updateFromUIDL
in classVDateField
getFormatString
protected String getFormatString()
buildDate
protected void buildDate()
Updates the text field according to the current date (provided by
VDateField.getDate()
). Takes care of updating text, enabling and disabling
the field, setting/removing readonly status and updating readonly styles.
TODO: Split part of this into a method that only updates the text as this
is what usually is needed except for updateFromUIDL.
setPrompting
protected void setPrompting(boolean prompting)
onChange
public void onChange(com.google.gwt.event.dom.client.ChangeEvent event)
- Specified by:
onChange
in interfacecom.google.gwt.event.dom.client.ChangeHandler
setWidth
public void setWidth(String newWidth)
- Overrides:
setWidth
in classcom.google.gwt.user.client.ui.UIObject
isUndefinedWidth
protected boolean isUndefinedWidth()
getFieldExtraWidth
protected int getFieldExtraWidth()
- Returns:
- extra width in pixels
Returns pixels in x-axis reserved for other than textfield content.
updateWidth
public void updateWidth()
Force an recalculation of the width of the component IF the width has been defined. Does nothing if width is undefined as the width will be automatically adjusted by the browser.
iLayout
public void iLayout()
- Specified by:
iLayout
in interfaceContainerResizedListener
Description copied from interface: ContainerResizedListener
This function is run when container box has been resized. Object implementing ContainerResizedListener is responsible to call the same function on its ancestors that implement NeedsLayout in case their container has resized. runAnchestorsLayout(HasWidgets parent) function from Util class may be a good helper for this.
iLayout
public void iLayout(boolean force)
focus
public void focus()
Description copied from interface: Focusable
Sets focus to this widget.
getText
protected String getText()
setText
protected void setText(String text)
getSubPartElement
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
- Specified by:
getSubPartElement
in interfaceSubPartAware
- Parameters:
subPart
- The identifier for the element inside the component- Returns:
- The element identified by subPart or null if the element could not be found.
Description copied from interface: SubPartAware
Locates an element inside a component using the identifier provided in
subPart
. The subPart
identifier is component specific and
may be any string of characters, numbers, space characters and brackets.
getSubPartName
public String getSubPartName(com.google.gwt.user.client.Element subElement)
- Specified by:
getSubPartName
in interfaceSubPartAware
- Parameters:
subElement
- The element the identifier string should uniquely identify- Returns:
- An identifier that uniquely identifies
subElement
or null if no identifier could be provided.
Description copied from interface: SubPartAware
Provides an identifier that identifies the element within the component.
The subElement
is a part of the component and must never be null.
Note!
getSubPartElement(getSubPartName(element)) == element
is not
always true. A component can choose to provide a more generic
identifier for any given element if the results of all interactions with
subElement
are the same as interactions with the element
identified by the return value. For example a button can return an
identifier for the root element even though a DIV inside the button was
passed as subElement
because interactions with the DIV and the
root button element produce the same result.