|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
org.gwtwidgets.client.ui.cal.SimpleCalendar
public class SimpleCalendar
Renders a simple calendar with (or optionally) without) controls to change the month and year of the calendar displayed. Allows events to be added to the calender, and a ClickListener may be added in order to receve notification when a date cell is clicked.
SimpleCalendar ships with three sample CSS stylesheets that can be injected or linked in the HTML file. The following stylesheets are available.
Style information
See CalendarPanel for a list of styles that apply to the calendar grid.
NOTE: If you are using the supplied CSS files in conjunction with CalendarEvent objects that have CSS class names, you may encounder rending issues. For example, an event with the class name of "holiday" may not render as expected when you use the CSS selector, e.g. ".holiday". To work around this, include the parent class selector for the SimpleCalendar as well, e.g. ".gwl-simpleCalendar .holiday".
| Constructor Summary | |
|---|---|
SimpleCalendar()
Render a SimpleCalendar for the current month. |
|
SimpleCalendar(java.util.Date date,
boolean showControls)
Render a SimpleCalendar for the month specified Date. |
|
SimpleCalendar(int month,
int year,
boolean showControls)
Render a SimpleCalendar for the month specified month/year. |
|
SimpleCalendar(int month,
int year,
boolean showControls,
CalendarFactory factory)
Render a SimpleCalendar for the month specified month/year. |
|
| Method Summary | |
|---|---|
void |
addClickListener(com.google.gwt.user.client.ui.ClickListener listener)
Add a ClickListener that will receive events when a user clicks on a day cell. |
CalendarEvent |
addEvent(java.util.Date date,
boolean timeSignificant)
|
CalendarEvent |
addEvent(java.util.Date start,
java.util.Date end,
boolean timeSignificant)
|
int |
getCurrentMonth()
|
java.lang.String |
getCurrentMonthName()
|
java.lang.String |
getCurrentYear()
|
CalendarDate |
getDateSelected()
Returns the CalendarDate object for the last date cell that was clicked. |
java.util.List |
getEvents()
|
void |
redraw()
|
void |
removeClickListener(com.google.gwt.user.client.ui.ClickListener listener)
|
void |
setCalendarMonth(java.util.Date date)
|
void |
setCalendarMonth(int month,
int year)
|
void |
setMonthNames(java.lang.String[] inMonthNames)
|
void |
setWeekDayNames(java.lang.String[] inWeekDayNames)
|
| Methods inherited from class com.google.gwt.user.client.ui.Composite |
|---|
getElement, getWidget, initWidget, isAttached, onAttach, onDetach, setWidget |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
doAttachChildren, doDetachChildren, getParent, onBrowserEvent, onLoad, onUnload, removeFromParent, setElement |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleCalendar()
public SimpleCalendar(java.util.Date date,
boolean showControls)
date - showControls - pass false to hide next/prev controls
public SimpleCalendar(int month,
int year,
boolean showControls)
month - 0-11year - e.g. 2008showControls - pass false to hide next/prev controls
public SimpleCalendar(int month,
int year,
boolean showControls,
CalendarFactory factory)
month - 0-11year - e.g. 2008showControls - pass false to hide next/prev controlsfactory - the CalendarFactory to use for tracking events| Method Detail |
|---|
public void addClickListener(com.google.gwt.user.client.ui.ClickListener listener)
For example: the following code adds a listener that will popup a message with the date that was clicked.
SimpleCalendar cal = new SimpleCalendar();
cal.addClickListener(new ClickListener() {
public void onClick (Widget sender) {
CalendarDate date = ((SimpleCalendar) sender).getDateSelected();
Window.alert(date.toString());
}
});
addClickListener in interface com.google.gwt.user.client.ui.SourcesClickEventspublic void removeClickListener(com.google.gwt.user.client.ui.ClickListener listener)
removeClickListener in interface com.google.gwt.user.client.ui.SourcesClickEventspublic CalendarDate getDateSelected()
public CalendarEvent addEvent(java.util.Date date,
boolean timeSignificant)
date - timeSignificant -
CalendarPanel.addEvent(java.util.Date, boolean)
public CalendarEvent addEvent(java.util.Date start,
java.util.Date end,
boolean timeSignificant)
start - end - timeSignificant -
CalendarPanel.addEvent(java.util.Date, java.util.Date, boolean)public int getCurrentMonth()
CalendarPanel.getCurrentMonth()public java.lang.String getCurrentMonthName()
CalendarPanel.getCurrentMonthName()public java.lang.String getCurrentYear()
CalendarPanel.getCurrentYear()public void setCalendarMonth(java.util.Date date)
date - CalendarPanel.setCalendarMonth(java.util.Date)
public void setCalendarMonth(int month,
int year)
month - year - CalendarPanel.setCalendarMonth(int, int)public void setMonthNames(java.lang.String[] inMonthNames)
inMonthNames - CalendarPanel.setMonthNames(java.lang.String[])public void setWeekDayNames(java.lang.String[] inWeekDayNames)
inWeekDayNames - CalendarPanel.setWeekDayNames(java.lang.String[])public void redraw()
CalendarPanel.redraw()public java.util.List getEvents()
CalendarPanel.getEvents()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||