com.sun.webui.jsf.component
Class Time

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by com.sun.webui.jsf.component.WebuiInput
                      extended by com.sun.webui.jsf.component.Time
All Implemented Interfaces:
com.sun.webui.jsf.component.ComplexComponent, javax.faces.component.EditableValueHolder, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class Time
extends WebuiInput
implements javax.faces.component.NamingContainer, com.sun.webui.jsf.component.ComplexComponent

This component is for internal use only


Field Summary
static java.lang.String HOUR_FACET
          The hour menu facet name.
static java.lang.String MINUTES_FACET
          The minutes menu facet name.
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
Time()
          Default constructor.
 
Method Summary
 void encodeEnd(javax.faces.context.FacesContext context)
           
 java.util.Calendar getCalendar()
          Returns a new Calendar instance corresponding to the user's current locale and the developer specified time zone (if any).
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.String getFocusElementId(javax.faces.context.FacesContext context)
          Returns the id of an HTML element suitable to receive the focus.
 DropDown getHourMenu()
          Return a DropDown component that implements an hour menu.
 java.lang.String getHourTooltipKey()
          Getter for property hourTooltipKey.
 javax.faces.component.UIComponent getIndicatorComponent(javax.faces.context.FacesContext context, Label label)
          Return a component instance that can be referenced by a Label in order to evaluate the required and valid states of this component.
 java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
          Returns the absolute ID of an HTML element suitable for use as the value of an HTML LABEL element's for attribute.
 DropDown getMinutesMenu()
          Return a DropDown component that implements a minutes menu.
 java.lang.String getMinutesTooltipKey()
          Getter for property minutesTooltipKey.
 java.lang.String getOffset()
          Get the time-zone as a string.
 java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
          Deprecated.  
 java.lang.String getStyle()
          CSS style(s) to be applied to the outermost HTML element when this component is rendered.
 java.lang.String getStyleClass()
          CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
 int getTabIndex()
          Position of this element in the tabbing order of the current document.
 java.util.TimeZone getTimeZone()
          A binding to a Time Zone instance to use for this Scheduler.
 boolean isDisabled()
          Standard HTML attribute which determines whether the web application user can change the the value of this component.
 boolean isReadOnly()
          If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined.
 boolean isVisible()
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 void processDecodes(javax.faces.context.FacesContext context)
          Specialized decode behavior on top of that provided by the superclass.
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setDisabled(boolean disabled)
          Standard HTML attribute which determines whether the web application user can change the the value of this component.
 void setHourTooltipKey(java.lang.String hourTooltipKey)
          Setter for property hourTooltipKey.
 void setMinutesTooltipKey(java.lang.String minutesTooltipKey)
          Setter for property minutesTooltipKey.
 void setReadOnly(boolean readOnly)
          If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined.
 void setStyle(java.lang.String style)
          CSS style(s) to be applied to the outermost HTML element when this component is rendered.
 void setStyleClass(java.lang.String styleClass)
          CSS style class(es) to be applied to the outermost HTML element when this component is rendered.
 void setTabIndex(int tabIndex)
          Position of this element in the tabbing order of the current document.
 void setTimeZone(java.util.TimeZone timeZone)
          A binding to a Time Zone instance to use for this Scheduler.
 void setVisible(boolean visible)
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 void validate(javax.faces.context.FacesContext context)
          Perform the following algorithm to validate the local value of this UIInput.
 
Methods inherited from class com.sun.webui.jsf.component.WebuiInput
broadcast, getValidator, getValidatorExpression, getValueChangeListener, getValueChangeListenerExpression, processUpdates, processValidators, setConverter, setId, setImmediate, setRendered, setRequired, setValidatorExpression, setValueChangeListenerExpression
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidatorMessage, getValidators, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setLocalValueSet, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue
 
Methods inherited from class javax.faces.component.UIComponentBase
encodeBegin, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, setValueExpression
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue
 

Field Detail

HOUR_FACET

public static final java.lang.String HOUR_FACET
The hour menu facet name.

See Also:
Constant Field Values

MINUTES_FACET

public static final java.lang.String MINUTES_FACET
The minutes menu facet name.

See Also:
Constant Field Values
Constructor Detail

Time

public Time()
Default constructor.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Overrides:
getFamily in class javax.faces.component.UIInput

getHourMenu

public DropDown getHourMenu()
Return a DropDown component that implements an hour menu. If ComponentUtilities.getPrivateFacet() returns a facet named hour that component is initialized every time this method is called and returned.

This is a private facet.

Otherwise a DropDown component is created and initialized. It is assigned the id
getId() + "_hour" and added to the facets map as a private facet.

Returns:
an hour menu DropDown component.

getMinutesMenu

public DropDown getMinutesMenu()
Return a DropDown component that implements a minutes menu. If ComponentUtilities.getPrivateFacet() returns a facet named minutes that component is initialized every time this method is called and returned.

This is a private facet.

Otherwise a DropDown component is created and initialized. It is assigned the id
getId() + "_minutes" and added to the facets map as a private facet.

Returns:
a minutes menu DropDown component.

getOffset

public java.lang.String getOffset()

Get the time-zone as a string.


getCalendar

public java.util.Calendar getCalendar()

Returns a new Calendar instance corresponding to the user's current locale and the developer specified time zone (if any).

Returns:
java.util.Calendar A new Calendar instance with the correct locale and time zone.

getHourTooltipKey

public java.lang.String getHourTooltipKey()
Getter for property hourTooltipKey.

Returns:
Value of property hourTooltipKey.

setHourTooltipKey

public void setHourTooltipKey(java.lang.String hourTooltipKey)
Setter for property hourTooltipKey.

Parameters:
hourTooltipKey - New value of property hourTooltipKey.

getMinutesTooltipKey

public java.lang.String getMinutesTooltipKey()
Getter for property minutesTooltipKey.

Returns:
Value of property minutesTooltipKey.

setMinutesTooltipKey

public void setMinutesTooltipKey(java.lang.String minutesTooltipKey)
Setter for property minutesTooltipKey.

Parameters:
minutesTooltipKey - New value of property minutesTooltipKey.

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)

Specialized decode behavior on top of that provided by the superclass. In addition to the standard processDecodes behavior inherited from UIComponentBase, calls validate() if the the immediate property is true; if the component is invalid afterwards or a RuntimeException is thrown, calls FacesContext.renderResponse().

Overrides:
processDecodes in class WebuiInput
Parameters:
context - FacesContext for this request.
Throws:
java.lang.NullPointerException

validate

public void validate(javax.faces.context.FacesContext context)

Perform the following algorithm to validate the local value of this UIInput.

Overrides:
validate in class javax.faces.component.UIInput
Parameters:
context - The FacesContext for the current request

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context)
               throws java.io.IOException
Overrides:
encodeEnd in class javax.faces.component.UIComponentBase
Throws:
java.lang.NullPointerException
java.io.IOException

getPrimaryElementID

public java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
Deprecated. 

Implement this method so that it returns the DOM ID of the HTML element which should receive focus when the component receives focus, and to which a component label should apply. Usually, this is the first element that accepts input.

Specified by:
getPrimaryElementID in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext for the request
Returns:
The client id, also the JavaScript element id
See Also:
getLabeledElementId(javax.faces.context.FacesContext), getFocusElementId(javax.faces.context.FacesContext)

getLabeledElementId

public java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
Returns the absolute ID of an HTML element suitable for use as the value of an HTML LABEL element's for attribute. If the ComplexComponent has sub-compoents, and one of the sub-components is the target of a label, if that sub-component is a ComplexComponent, then getLabeledElementId must called on the sub-component and the value returned. The value returned by this method call may or may not resolve to a component instance.

This implementation returns the id of the component returned by getHourMenu. If that method returns null null is returned.

Specified by:
getLabeledElementId in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext used for the request
Returns:
An abolute id suitable for the value of an HTML LABEL element's for attribute.

getFocusElementId

public java.lang.String getFocusElementId(javax.faces.context.FacesContext context)
Returns the id of an HTML element suitable to receive the focus. If the ComplexComponent has sub-compoents, and one of the sub-components is to reveive the focus, if that sub-component is a ComplexComponent, then getFocusElementId must called on the sub-component and the value returned. The value returned by this method call may or may not resolve to a component instance.

This implementation returns the value of getLabeledElementId.

Specified by:
getFocusElementId in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext used for the request

getIndicatorComponent

public javax.faces.component.UIComponent getIndicatorComponent(javax.faces.context.FacesContext context,
                                                               Label label)
Return a component instance that can be referenced by a Label in order to evaluate the required and valid states of this component.

Specified by:
getIndicatorComponent in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The current FacesContext instance
label - The Label that labels this component.
Returns:
a UIComponent in order to evaluate the required and valid states.

isDisabled

public boolean isDisabled()

Standard HTML attribute which determines whether the web application user can change the the value of this component.


setDisabled

public void setDisabled(boolean disabled)

Standard HTML attribute which determines whether the web application user can change the the value of this component.

See Also:
isDisabled()

isReadOnly

public boolean isReadOnly()

If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined.


setReadOnly

public void setReadOnly(boolean readOnly)

If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined.

See Also:
isReadOnly()

getStyle

public java.lang.String getStyle()

CSS style(s) to be applied to the outermost HTML element when this component is rendered.


setStyle

public void setStyle(java.lang.String style)

CSS style(s) to be applied to the outermost HTML element when this component is rendered.

See Also:
getStyle()

getStyleClass

public java.lang.String getStyleClass()

CSS style class(es) to be applied to the outermost HTML element when this component is rendered.


setStyleClass

public void setStyleClass(java.lang.String styleClass)

CSS style class(es) to be applied to the outermost HTML element when this component is rendered.

See Also:
getStyleClass()

getTabIndex

public int getTabIndex()

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.


setTabIndex

public void setTabIndex(int tabIndex)

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.

See Also:
getTabIndex()

getTimeZone

public java.util.TimeZone getTimeZone()

A binding to a Time Zone instance to use for this Scheduler. If none is specified, the Scheduler uses the default TimeZone from the Schedulers locale.


setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)

A binding to a Time Zone instance to use for this Scheduler. If none is specified, the Scheduler uses the default TimeZone from the Schedulers locale.

See Also:
getTimeZone()

isVisible

public boolean isVisible()

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.


setVisible

public void setVisible(boolean visible)

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

See Also:
isVisible()

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)

Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class WebuiInput

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)

Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class WebuiInput


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.