Decision Center API

ilog.webui.dhtml.components
Class IlxWCalendar

java.lang.Object
  extended by ilog.webui.dhtml.IlxWContainer
      extended by ilog.webui.dhtml.IlxWComponent
          extended by ilog.webui.dhtml.components.IlxWCalendar
All Implemented Interfaces:
ilog.webui.dhtml.IlxWConstants, ilog.webui.dhtml.IlxWCSSModelProvider, ilog.webui.dhtml.IlxWDependencyProvider, ilog.webui.dhtml.IlxWJSObject, Serializable

public class IlxWCalendar
extends IlxWComponent

A calendar component that allows the user to view and edit a date.

The calendar can be displayed in several modes, which can be set by changing the date-format CSS style. Available modes are:

By default, the date-format style is defined to "datetime" by the calendar user agent style sheet.

To change the current date format to "date", you could write the following code:

 IlxWCalendar myCalendar = new IlxWCalendar();
 myCalendar.getStyle().set("dateFormat", "date");
 ...
 

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.webui.dhtml.IlxWComponent
IlxWComponent.DynamicStyleMap
 
Field Summary
static String CSS_RESOURCE_NAME
          Resource path to the user-agent CSS.
static int firstYear
           
static int lastYear
           
 
Fields inherited from class ilog.webui.dhtml.IlxWContainer
listenerList
 
Constructor Summary
IlxWCalendar()
          Creates a calendar component initialized with the current date.
IlxWCalendar(Date date)
          Creates a calendar component initialized with the given date.
IlxWCalendar(Date date, com.ibm.icu.util.TimeZone timezone)
          Creates a calendar component initialized with the given date.
IlxWCalendar(com.ibm.icu.util.TimeZone timezone)
           
 
Method Summary
 void addChangeListener(ChangeListener l)
          Adds the specified change listener to receive change events from this calendar.
protected  void fireStateChanged()
          Notifies all listeners that have registered interest for notification on this event type.
 Date getDate()
          Gets the date currently displayed in the calendar.
protected  IlxWCSSRuleset getUserAgentRules()
          Gets the "user-agent" CSS rules.
protected  void printComponent(IlxWPort port)
          Prints the HTML code that will display the graphical representation of this component.
 void removeChangeListener(ChangeListener l)
          Removes the specified change listener so that it no longer receives change events from this calendar.
 void setDate(Date date)
          Sets the date to display in the calendar.
 
Methods inherited from class ilog.webui.dhtml.IlxWComponent
addPropertyChangeListener, addPropertyChangeListener, detach, doPrint, firePropertyChange, firePropertyChange, getName, getRealHtmlTagName, getStyle, invalidate, isInvalidated, notifyDependencies, print, removePropertyChangeListener, removePropertyChangeListener, setName, validate
 
Methods inherited from class ilog.webui.dhtml.IlxWContainer
add, add, getAttribute, getAttributeNames, getComponent, getComponentCount, getComponentNamed, getComponents, getManager, getParent, indexOf, isAncestorOf, remove, remove, removeAll, removeAttribute, setAttribute, setAuthorRules, setFinalizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

firstYear

public static int firstYear

lastYear

public static int lastYear

CSS_RESOURCE_NAME

public static final String CSS_RESOURCE_NAME
Resource path to the user-agent CSS.

See Also:
Constant Field Values
Constructor Detail

IlxWCalendar

public IlxWCalendar()
Creates a calendar component initialized with the current date.


IlxWCalendar

public IlxWCalendar(Date date)
Creates a calendar component initialized with the given date.

Parameters:
date - The date to display. Must not be null.

IlxWCalendar

public IlxWCalendar(com.ibm.icu.util.TimeZone timezone)

IlxWCalendar

public IlxWCalendar(Date date,
                    com.ibm.icu.util.TimeZone timezone)
Creates a calendar component initialized with the given date.

Parameters:
date - The date to display. Must not be null.
Method Detail

setDate

public void setDate(Date date)
Sets the date to display in the calendar.

Parameters:
date - The date to display. Must not be null.

getDate

public Date getDate()
Gets the date currently displayed in the calendar.

Returns:
The calendar current date.

addChangeListener

public void addChangeListener(ChangeListener l)
Adds the specified change listener to receive change events from this calendar.

A change event is fired when the date changes.

Parameters:
l - The change listener.

removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes the specified change listener so that it no longer receives change events from this calendar.

Parameters:
l - The change listener.

fireStateChanged

protected void fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type.

The event instance is lazily created using the parameters passed into the fire method. The listener list is processed in last to first order.


printComponent

protected void printComponent(IlxWPort port)
                       throws IOException
Description copied from class: IlxWComponent
Prints the HTML code that will display the graphical representation of this component. This method is called by the IlxWComponent.print(ilog.webui.dhtml.IlxWPort) method.

Specified by:
printComponent in class IlxWComponent
Throws:
IOException
Parameters:
port - The port on which the component will be printed.
See Also:
IlxWComponent.print(ilog.webui.dhtml.IlxWPort)

getUserAgentRules

protected IlxWCSSRuleset getUserAgentRules()
Description copied from class: IlxWContainer
Gets the "user-agent" CSS rules.
User agent rules are a set of CSS rules which will apply by default to each instance of this container. They may be completed or overridden by the author rules, set via the setAuthorRules method.

This method returns null by default but is intended to be redefined by subclasses.

Overrides:
getUserAgentRules in class IlxWContainer
Returns:
a CSS ruleset.
See Also:
IlxWContainer.setAuthorRules(ilog.webui.dhtml.IlxWCSSRuleset)

Decision Center API

© Copyright IBM Corp. 1987, 2013