|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itmill.toolkit.terminal.Identifiable
com.itmill.toolkit.ui.AbstractComponent
com.itmill.toolkit.ui.AbstractField
com.itmill.toolkit.ui.DateField
public class DateField
A date editor component that can be bound to any bindable Property. that is
compatible with java.util.Date.
Since DateField extends AbstractField it
implements the Bufferedinterface. A
DateField is in write-through mode by default, so
AbstractField.setWriteThrough(boolean)must be
called to enable buffering.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractField |
|---|
AbstractField.ReadOnlyStatusChangeEvent |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Field |
|---|
Field.ValueChangeEvent |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Component |
|---|
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.Paintable |
|---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Buffered |
|---|
Buffered.SourceException |
| Nested classes/interfaces inherited from interface com.itmill.toolkit.data.Property |
|---|
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
| Field Summary | |
|---|---|
static int |
RESOLUTION_DAY
Resolution identifier: days. |
static int |
RESOLUTION_HOUR
Resolution identifier: hours. |
static int |
RESOLUTION_MIN
Resolution identifier: minutes. |
static int |
RESOLUTION_MONTH
Resolution identifier: months. |
static int |
RESOLUTION_MSEC
Resolution identifier: milliseconds. |
static int |
RESOLUTION_SEC
Resolution identifier: seconds. |
static int |
RESOLUTION_YEAR
Resolution identifier: years. |
| Constructor Summary | |
|---|---|
DateField()
Constructs an empty DateField with no caption. |
|
DateField(Property dataSource)
Constructs a new DateField that's bound to the specified
Property and has no caption. |
|
DateField(String caption)
Constructs an empty DateField with caption. |
|
DateField(String caption,
Date value)
Constructs a new DateField with the given caption and
initial text contents. |
|
DateField(String caption,
Property dataSource)
Constructs a new DateField that's bound to the specified
Property and has the given caption String. |
|
| Method Summary | |
|---|---|
void |
changeVariables(Object source,
Map variables)
Called when one or more variables handled by the implementing class are changed. |
int |
getResolution()
Gets the resolution. |
int |
getTabIndex()
Gets the Tabulator index of this Focusable component. |
String |
getTag()
Gets the UIDL tag corresponding to the component. |
Class |
getType()
Returns the type of the Property. |
void |
paintContent(PaintTarget target)
Paints any needed component-specific things to the given UIDL stream. |
void |
setPropertyDataSource(Property newDataSource)
Sets the DateField datasource. |
void |
setResolution(int resolution)
Sets the resolution of the DateField. |
void |
setTabIndex(int tabIndex)
Deprecated. Use setTabIndexes() |
int |
setTabIndexes(int startingIndex)
Sets the Tabulator indexes for all of the focusable fields within this component, and returns the next available Tabulator index. |
void |
setValue(Object newValue)
Sets the value of the field. |
String |
toString()
Returns the value of the Property in human readable textual format. |
| Methods inherited from class com.itmill.toolkit.ui.AbstractField |
|---|
addListener, addListener, addValidator, attach, commit, constructField, discard, finalize, fireReadOnlyStatusChange, fireValueChange, focus, getErrorMessage, getFocusableId, getPropertyDataSource, getValidators, getValue, isInvalidAllowed, isInvalidCommitted, isModified, isReadOnly, isReadThrough, isRequired, isValid, isWriteThrough, removeListener, removeListener, removeValidator, setInternalValue, setInvalidAllowed, setInvalidCommitted, setReadOnly, setReadThrough, setRequired, setWriteThrough, validate, valueChange |
| Methods inherited from class com.itmill.toolkit.ui.AbstractComponent |
|---|
addListener, addListener, addListener, addListener, childRequestedRepaint, dependsOn, detach, fireComponentErrorEvent, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getData, getDescription, getDirectDependencies, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setStyle, setVisible |
| Methods inherited from class com.itmill.toolkit.terminal.Identifiable |
|---|
getDebugId, getUIID, setDebugId, setUIID |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.itmill.toolkit.ui.Field |
|---|
getDescription, setCaption, setDescription |
| Methods inherited from interface com.itmill.toolkit.ui.Component |
|---|
addListener, childRequestedRepaint, detach, getApplication, getCaption, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isVisible, removeListener, setEnabled, setParent, setStyle, setVisible |
| Methods inherited from interface com.itmill.toolkit.terminal.Paintable |
|---|
addListener, paint, removeListener, requestRepaint, requestRepaintRequests |
| Methods inherited from interface com.itmill.toolkit.terminal.VariableOwner |
|---|
dependsOn, getDirectDependencies, isImmediate, removeDirectDependency |
| Field Detail |
|---|
public static final int RESOLUTION_MSEC
public static final int RESOLUTION_SEC
public static final int RESOLUTION_MIN
public static final int RESOLUTION_HOUR
public static final int RESOLUTION_DAY
public static final int RESOLUTION_MONTH
public static final int RESOLUTION_YEAR
| Constructor Detail |
|---|
public DateField()
DateField with no caption.
public DateField(String caption)
DateField with caption.
caption - the caption of the datefield.
public DateField(String caption,
Property dataSource)
DateField that's bound to the specified
Property and has the given caption String.
caption - the caption String for the editor.dataSource - the Property to be edited with this editor.
public DateField(Property dataSource)
throws IllegalArgumentException
DateField that's bound to the specified
Property and has no caption.
dataSource - the Property to be edited with this editor.
IllegalArgumentException
public DateField(String caption,
Date value)
DateField with the given caption and
initial text contents. The editor constructed this way will not be bound
to a Property unless
Property.Viewer.setPropertyDataSource(Property)
is called to bind it.
caption - the caption String for the editor.value - the Date value.| Method Detail |
|---|
public void paintContent(PaintTarget target)
throws PaintException
AbstractComponentAbstractComponent.paint(PaintTarget) method handles all general
attributes common to all components, and it calls this method to paint
any component-specific attributes to the UIDL stream.
paintContent in class AbstractFieldtarget - the target UIDL stream where the component should paint itself
to
PaintException - if the paint operation failed.public String getTag()
AbstractComponent
getTag in class AbstractComponentString
public void changeVariables(Object source,
Map variables)
VariableOwner
changeVariables in interface VariableOwnerchangeVariables in class AbstractComponentsource - the Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables - the Mapping from variable names to new variable values.public Class getType()
PropertygetValue and
setValue must be compatible with this type: one must be
able to safely cast the value returned from getValue to
the given type and pass any variable assignable to this type as an
argument to setValue.
getType in interface PropertygetType in class AbstractFieldpublic String toString()
AbstractField
toString in interface PropertytoString in class AbstractFieldString representation of the value stored in the
PropertyObject.toString()
public void setValue(Object newValue)
throws Property.ReadOnlyException,
Property.ConversionException
AbstractField
setValue in interface PropertysetValue in class AbstractFieldnewValue - the New value of the field.
Property.ReadOnlyException - if the object is in read-only mode
Property.ConversionException - if newValue can't be converted into the Property's native
type directly or through Stringpublic void setPropertyDataSource(Property newDataSource)
setPropertyDataSource in interface Property.ViewersetPropertyDataSource in class AbstractFieldnewDataSource - the new data source Property.Property.Viewer.setPropertyDataSource(Property)public int getResolution()
public void setResolution(int resolution)
resolution - the resolution to set.public void setTabIndex(int tabIndex)
AbstractField
setTabIndex in interface Component.FocusablesetTabIndex in class AbstractFieldtabIndex - the tab order of this component. Negative value means
unspecified.AbstractField.setTabIndex(int)public int setTabIndexes(int startingIndex)
startingIndex -
public int getTabIndex()
getTabIndex in interface Component.FocusablegetTabIndex in class AbstractFieldComponent.Focusable.getTabIndex()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||