com.github.gwtbootstrap.datepicker.client.ui.base
Class DateBoxBase

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.github.gwtbootstrap.datepicker.client.ui.base.DateBoxBase
All Implemented Interfaces:
HasAlternateSize, HasId, HasPlaceholder, HasSize, HasStyle, HasVisibleHandlers, IsResponsive, IsSearchQuery, HasAllDatePickerHandlers, HasAutoclose, HasDateFormat, HasEndDate, HasLanguage, HasStartDate, HasStartView, HasWeekStart, IsEditor<TakesValueEditor<Date>>, HasChangeHandlers, HasAttachHandlers, HasValueChangeHandlers<Date>, HasHandlers, EventListener, TakesValue<Date>, HasValue<Date>, HasVisibility, IsWidget
Direct Known Subclasses:
DateBox

public class DateBoxBase
extends Widget
implements HasValue<Date>, HasValueChangeHandlers<Date>, HasVisibility, HasChangeHandlers, HasVisibleHandlers, HasAllDatePickerHandlers, IsEditor<TakesValueEditor<Date>>, HasPlaceholder, HasAlternateSize, IsSearchQuery, HasSize, HasId, IsResponsive, HasStyle

Base DatePicker component.

Since:
2.0.4.0
Author:
Carlos Alexandro Becker, ohashi keisuke

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.github.gwtbootstrap.datepicker.client.ui.base.HasStartView
HasStartView.ViewMode
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
DateBoxBase()
           
 
Method Summary
 HandlerRegistration addChangeHandler(ChangeHandler handler)
           
 HandlerRegistration addHiddenHandler(HiddenHandler handler)
          Adds a HiddenEvent handler.
 HandlerRegistration addHideHandler(HideHandler handler)
          Adds a HideEvent handler.
 HandlerRegistration addShowHandler(ShowHandler handler)
          Adds a ShowEvent handler.
 HandlerRegistration addShownHandler(ShownHandler handler)
          Adds a ShownEvent handler.
 void addStyle(Style style)
          Adds the provided style to the widget.
 HandlerRegistration addValueChangeHandler(ValueChangeHandler<Date> dateValueChangeHandler)
          
 TakesValueEditor<Date> asEditor()
          Retuen Editor
protected  void configure()
          configure this datepicker.
protected  void configure(Element e)
          call jquery datepicker plugin in a element.
protected  void configure(Widget w)
          Configure the elements for a specific widget.
protected  TextBox getBox()
          Returns the internal instance of textbox element.
 String getId()
          Get ID
 String getOriginalValue()
          Get un-tranceform text
 String getPlaceholder()
          Get a placeholder attribute (HTML5).
 Date getValue()
          
 void hide()
          Hides the widget if it was previously shown.
 boolean isSearchQuery()
          is the element search-query style?
 void onChange()
          dateChange event handler.
 void onHide()
           
protected  void onLoad()
          
 void onShow()
           
 void reconfigure()
           
protected  void removeDataIfExists(Element e)
           
 void removeStyle(Style style)
          Removes the provided style from the widget.
 void setAlternateSize(AlternateSize size)
          
 void setAutoClose(boolean autoclose)
          Determine if the element will autoclose in some events.
 void setEndDate_(Date endDate)
          Set the max date in the component.
 void setEndDate(String endDate)
          Set the max date in the component.
 void setFormat(String format)
          Set the format in the component.
 void setHideOn(Device device)
          Sets the kind of device, this widget is hidden on.
 void setId(String id)
          Set ID
 void setLanguage(String language)
          Setup the language of the component.
 void setPlaceholder(String placeholder)
          Set a placeholder attribute (HTML5).
 void setSearchQuery(boolean searchQuery)
          Set search-query style to the element.
 void setShowOn(Device device)
          Sets the kind of device, this widget is shown on.
 void setSize(int size)
          Sets the widget's size.
 void setStartDate_(Date startDate)
          Set the min date in the component.
 void setStartDate(String startDate)
          Set the min date in the component.
 void setStartView(HasStartView.ViewMode mode)
          Set the view mode of the datepicker.
 void setStartView(String mode)
          Set the view mode of the datepicker.
 void setStyle(Style style)
          Replaces the widet's style with the provided one.
 void setValue(Date value)
          
 void setValue(Date value, boolean fireEvents)
          
 void setWeekStart(int start)
          Define the first day of week in the datepicker.
 void show()
          Shows the widget if it was previously hidden.
 void toggle()
          Toggles the view state of the widget.
protected  void updateValue(Element e)
           
 
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, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, 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, resolvePotentialElement, 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.event.shared.HasHandlers
fireEvent
 

Constructor Detail

DateBoxBase

public DateBoxBase()
Method Detail

setFormat

public void setFormat(String format)
Set the format in the component.

Specified by:
setFormat in interface HasDateFormat

setLanguage

public void setLanguage(String language)
Description copied from interface: HasLanguage
Setup the language of the component. Depend on the JS plugin behavior, it can not work after the widget is already visible.

Specified by:
setLanguage in interface HasLanguage

getBox

protected TextBox getBox()
Returns the internal instance of textbox element. Use only if know what you are doing.

Returns:
internal textbox intance.

getValue

public Date getValue()

Specified by:
getValue in interface TakesValue<Date>
Specified by:
getValue in interface HasValue<Date>

getOriginalValue

public String getOriginalValue()
Get un-tranceform text

Returns:
text box value

setValue

public void setValue(Date value)

Specified by:
setValue in interface TakesValue<Date>
Specified by:
setValue in interface HasValue<Date>

setValue

public void setValue(Date value,
                     boolean fireEvents)

Specified by:
setValue in interface HasValue<Date>

updateValue

protected void updateValue(Element e)

addValueChangeHandler

public HandlerRegistration addValueChangeHandler(ValueChangeHandler<Date> dateValueChangeHandler)

Specified by:
addValueChangeHandler in interface HasValueChangeHandlers<Date>

onLoad

protected void onLoad()

Overrides:
onLoad in class Widget

configure

protected void configure(Widget w)
Configure the elements for a specific widget. Use only if you know what you are doing.

Parameters:
w: - the widget to configure.

onChange

public void onChange()
dateChange event handler.


onShow

public void onShow()

onHide

public void onHide()

reconfigure

public void reconfigure()

configure

protected void configure()
configure this datepicker.


removeDataIfExists

protected void removeDataIfExists(Element e)

configure

protected void configure(Element e)
call jquery datepicker plugin in a element.

Parameters:
e: - Element that will be transformed in a datepicker.

show

public void show()
Shows the widget if it was previously hidden.


hide

public void hide()
Hides the widget if it was previously shown.


toggle

public void toggle()
Toggles the view state of the widget.

It will be hidden if it was previously shown and shown if it was previously hidden.


addHideHandler

public HandlerRegistration addHideHandler(HideHandler handler)
Adds a HideEvent handler.

Specified by:
addHideHandler in interface HasVisibleHandlers
Parameters:
handler - the hide handler
Returns:
HandlerRegistration used to remove this handler

addHiddenHandler

public HandlerRegistration addHiddenHandler(HiddenHandler handler)
Adds a HiddenEvent handler.

Specified by:
addHiddenHandler in interface HasVisibleHandlers
Parameters:
handler - the hidden handler
Returns:
HandlerRegistration used to remove this handler

addShowHandler

public HandlerRegistration addShowHandler(ShowHandler handler)
Adds a ShowEvent handler.

Specified by:
addShowHandler in interface HasVisibleHandlers
Parameters:
handler - the show handler
Returns:
HandlerRegistration used to remove this handler

addShownHandler

public HandlerRegistration addShownHandler(ShownHandler handler)
Adds a ShownEvent handler.

Specified by:
addShownHandler in interface HasVisibleHandlers
Parameters:
handler - the shown handler
Returns:
HandlerRegistration used to remove this handler

setWeekStart

public void setWeekStart(int start)
Define the first day of week in the datepicker.

Specified by:
setWeekStart in interface HasWeekStart

setStartDate

public void setStartDate(String startDate)
Set the min date in the component.

Specified by:
setStartDate in interface HasStartDate

setStartDate_

public void setStartDate_(Date startDate)
Set the min date in the component.

Specified by:
setStartDate_ in interface HasStartDate

setEndDate

public void setEndDate(String endDate)
Set the max date in the component.

Specified by:
setEndDate in interface HasEndDate

setEndDate_

public void setEndDate_(Date endDate)
Set the max date in the component.

Specified by:
setEndDate_ in interface HasEndDate

setAutoClose

public void setAutoClose(boolean autoclose)
Determine if the element will autoclose in some events.

Specified by:
setAutoClose in interface HasAutoclose

setStartView

public void setStartView(HasStartView.ViewMode mode)
Set the view mode of the datepicker.

Specified by:
setStartView in interface HasStartView

setStartView

public void setStartView(String mode)
Set the view mode of the datepicker.

Specified by:
setStartView in interface HasStartView

asEditor

public TakesValueEditor<Date> asEditor()
Retuen Editor

Specified by:
asEditor in interface IsEditor<TakesValueEditor<Date>>
Returns:
editor

addChangeHandler

public HandlerRegistration addChangeHandler(ChangeHandler handler)
Specified by:
addChangeHandler in interface HasChangeHandlers

setPlaceholder

public void setPlaceholder(String placeholder)
Set a placeholder attribute (HTML5).

Specified by:
setPlaceholder in interface HasPlaceholder
Parameters:
placeholder - the String to show. Use a empty string or null to remove the attribute.

getPlaceholder

public String getPlaceholder()
Get a placeholder attribute (HTML5).

Specified by:
getPlaceholder in interface HasPlaceholder
Returns:
placeholder attribute.

setSearchQuery

public void setSearchQuery(boolean searchQuery)
Set search-query style to the element.

Specified by:
setSearchQuery in interface IsSearchQuery
Parameters:
searchQuery - true:add search-query css-class/false:remove search-query css-class

isSearchQuery

public boolean isSearchQuery()
is the element search-query style?

Specified by:
isSearchQuery in interface IsSearchQuery
Returns:
true:has search-query css-class/false:has no search-query cass-class.

setAlternateSize

public void setAlternateSize(AlternateSize size)

Specified by:
setAlternateSize in interface HasAlternateSize

setSize

public void setSize(int size)
Sets the widget's size.

Specified by:
setSize in interface HasSize
Parameters:
size - the size of the widget in the Bootstrap grid system

getId

public String getId()
Get ID

Specified by:
getId in interface HasId
Returns:
ID

setId

public void setId(String id)
Set ID

Specified by:
setId in interface HasId
Parameters:
id - set id

setShowOn

public void setShowOn(Device device)
Sets the kind of device, this widget is shown on.

The widget is not shown on any other device.

Only works if responsive design is turned on!

Specified by:
setShowOn in interface IsResponsive
See Also:
Configurator.hasResponsiveDesign(), IsResponsive.setHideOn(Device)

setHideOn

public void setHideOn(Device device)
Sets the kind of device, this widget is hidden on.

The widget is not hidden on any other device.

Only works if responsive design is turned on!

Specified by:
setHideOn in interface IsResponsive
See Also:
Configurator.hasResponsiveDesign(), IsResponsive.setShowOn(Device)

setStyle

public void setStyle(Style style)
Replaces the widet's style with the provided one.

Specified by:
setStyle in interface HasStyle
Parameters:
style - the style to be applied to the Widget.

addStyle

public void addStyle(Style style)
Adds the provided style to the widget.

Specified by:
addStyle in interface HasStyle
Parameters:
style - the style to be added to the Widget.

removeStyle

public void removeStyle(Style style)
Removes the provided style from the widget.

Specified by:
removeStyle in interface HasStyle
Parameters:
style - the style to be removed from the Widget.


Copyright © 2012 gwtbootstrap. All Rights Reserved.