Author: akushunin
Date: 2007-06-19 13:14:11 -0400 (Tue, 19 Jun 2007)
New Revision: 1226
Added:
trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModel.java
trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModelItem.java
Log:
Calendar data Model initial draft.
Added:
trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModel.java
===================================================================
--- trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModel.java
(rev 0)
+++
trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModel.java 2007-06-19
17:14:11 UTC (rev 1226)
@@ -0,0 +1,44 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component;
+
+import java.util.Date;
+/**
+ * @author Alexej Kushunin
+ * created 19.06.2007
+ *
+ */
+public interface CalendarDataModel {
+
+ /**
+ * @return array of CalendarDataModelItems for selected dates.
+ * This method will be called every time when components will need next block of
CalendarDataItems.
+ * That may happens when calendar rendered, or when user navigate to next(previous)
month or in any other case when calendar renders.
+ * This method will be called in Ajax mode when Calendar renders new page.
+ * */
+ public CalendarDataModelItem[] getData(Date[] dateArray);
+
+ /**
+ * @return tool tip when it's used in "single" mode
+ * This method used when tool tips are displayed in "single" mode
+ * */
+ public Object getToolTip(Date date);
+}
Property changes on:
trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModelItem.java
===================================================================
---
trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModelItem.java
(rev 0)
+++
trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModelItem.java 2007-06-19
17:14:11 UTC (rev 1226)
@@ -0,0 +1,65 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.component;
+
+import java.util.Date;
+
+
+/**
+ * @author Alexej Kushunin
+ * created 19.06.2007
+ *
+ */
+
+public interface CalendarDataModelItem {
+
+ /**
+ * @return date that this item for, default implementation return Date
+ * */
+ public Date getDate();
+
+ /**
+ *@return true if date is �selectable� on calendar, default implementation return true
+ **/
+ public boolean isEnabled();
+
+ /**
+ * @return String that will be appended to style class for that date span.
+ * For example it may be �relevant holyday� � that mean class will be like �rich-cal-day
relevant holyday�.
+ * Default implementation return empty string.
+ * */
+ public String getStyleClass();
+
+ /**
+ * @return any additional payload that must be JSON-serialazable object.
+ * May be used in custom date representation on calendar (inside custom facet).*/
+ public Object getData();
+
+ /**
+ * @return true if given date has an associated with it tooltip data.
+ * Default implementation return false.*/
+ public boolean hasToolTip();
+
+ /**
+ *@return tool tip data that will be used in �batch� tooltip loading mode.
+ **/
+ public Object getToolTip();
+}
Property changes on:
trunk/sandbox/calendar/src/main/java/org/richfaces/component/CalendarDataModelItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Show replies by date