Author: nbelaevski
Date: 2007-07-19 18:42:56 -0400 (Thu, 19 Jul 2007)
New Revision: 1717
Added:
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java
Modified:
trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml
Log:
merged changes commit
Added:
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
===================================================================
--- trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
(rev 0)
+++
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-07-19
22:42:56 UTC (rev 1717)
@@ -0,0 +1,34 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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;
+
+import java.util.Locale;
+
+/**
+ * @author $Autor$
+ *
+ */
+public class CalendarBean {
+ public Locale getLocale() {
+ return Locale.US;
+ }
+}
\ No newline at end of file
Added:
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
===================================================================
---
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
(rev 0)
+++
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java 2007-07-19
22:42:56 UTC (rev 1717)
@@ -0,0 +1,79 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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;
+
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import org.richfaces.model.CalendarDataModel;
+import org.richfaces.model.CalendarDataModelItem;
+
+/**
+ * @author Nick Belaevski - mailto:nbelaevski@exadel.com
+ * created 30.06.2007
+ *
+ */
+public class CalendarDataModelImpl implements CalendarDataModel {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModel#getData(java.util.Date[])
+ */
+ public CalendarDataModelItem[] getData(Date[] dateArray) {
+ if (dateArray == null) {
+ return null;
+ }
+
+ CalendarDataModelItem[] items = new CalendarDataModelItem[dateArray.length];
+ for (int i = 0; i < dateArray.length; i++) {
+ items[i] = createDataModelItem(dateArray[i]);
+ }
+
+ return items;
+ }
+
+ protected CalendarDataModelItem createDataModelItem(Date date) {
+ CalendarDataModelItemImpl item = new CalendarDataModelItemImpl();
+ item.setDate(date);
+ Map data = new HashMap();
+ DateFormat enFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM,
Locale.ENGLISH);
+ DateFormat frFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.FRENCH);
+ DateFormat deFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.GERMAN);
+ data.put("enLabel", enFormatter.format(date));
+ data.put("frLabel", frFormatter.format(date));
+ data.put("deLabel", deFormatter.format(date));
+ item.setData(data);
+
+ return item;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModel#getToolTip(java.util.Date)
+ */
+ public Object getToolTip(Date date) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Added:
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java
===================================================================
---
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java
(rev 0)
+++
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java 2007-07-19
22:42:56 UTC (rev 1717)
@@ -0,0 +1,118 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * 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;
+
+import java.util.Date;
+
+import org.richfaces.model.CalendarDataModelItem;
+
+/**
+ * @author Nick Belaevski - mailto:nbelaevski@exadel.com
+ * created 04.07.2007
+ *
+ */
+public class CalendarDataModelItemImpl implements CalendarDataModelItem {
+
+ private Object data;
+ private Date date;
+ private String styleClass;
+ private Object toolTip;
+ private boolean enabled = true;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#getData()
+ */
+ public Object getData() {
+ return data;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#getDate()
+ */
+ public Date getDate() {
+ return date;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#getStyleClass()
+ */
+ public String getStyleClass() {
+ return styleClass;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#getToolTip()
+ */
+ public Object getToolTip() {
+ return toolTip;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#hasToolTip()
+ */
+ public boolean hasToolTip() {
+ return getToolTip() != null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#isEnabled()
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+ /**
+ * @param date the date to set
+ */
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ /**
+ * @param styleClass the styleClass to set
+ */
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ /**
+ * @param toolTip the toolTip to set
+ */
+ public void setToolTip(Object toolTip) {
+ this.toolTip = toolTip;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+}
Modified: trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/index.jsp 2007-07-19
22:34:53 UTC (rev 1716)
+++ trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/index.jsp 2007-07-19
22:42:56 UTC (rev 1717)
@@ -1,6 +1,6 @@
<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib
uri="http://richfaces.ajax4jsf.org/calendar"
prefix="calendar" %>
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/ui/calendar"
prefix="calendar" %>
<html>
<head>
<title></title>
Modified: trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml 2007-07-19 22:34:53
UTC (rev 1716)
+++ trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml 2007-07-19 22:42:56
UTC (rev 1717)
@@ -26,15 +26,59 @@
<classname>org.ajax4jsf.tag.TestHandler</classname>
</taghandler>
-->
+
&ui_component_attributes;
- <!--
<property>
- <name>param</name>
+ <name>width</name>
<classname>java.lang.String</classname>
<description>
</description>
- <defaultvalue>"default"</defaultvalue>
+ <defaultvalue>"400px;"</defaultvalue>
</property>
- -->
+ <property>
+ <name>height</name>
+ <classname>java.lang.String</classname>
+ <description>
+ </description>
+ <defaultvalue>"250px"</defaultvalue>
+ </property>
+ <property elonly="true">
+ <name>data</name>
+ <classname>org.richfaces.model.CalendarDataModel</classname>
+ <description>
+ </description>
+ </property>
+ <property elonly="true">
+ <name>locale</name>
+ <classname>java.util.Locale</classname>
+ <description>
+ </description>
+ <defaultvalue>getDefaultLocale()</defaultvalue>
+ </property>
+ <property elonly="true">
+ <name>timeZone</name>
+ <classname>java.util.TimeZone</classname>
+ <description>
+ </description>
+ <defaultvalue>getDefaultTimeZone()</defaultvalue>
+ </property>
+ <property elonly="true">
+ <name>preloadDateRangeBegin</name>
+ <classname>java.util.Date</classname>
+ <description></description>
+ <defaultvalue>getDefaultPreloadBegin(getCurrentDate())</defaultvalue>
+ </property>
+ <property elonly="true">
+ <name>preloadDateRangeEnd</name>
+ <classname>java.util.Date</classname>
+ <description></description>
+ <defaultvalue>getDefaultPreloadEnd(getCurrentDate())</defaultvalue>
+ </property>
+ <property elonly="true">
+ <name>currentDate</name>
+ <classname>java.util.Date</classname>
+ <description></description>
+ <defaultvalue>java.util.Calendar.getInstance(getTimeZone()).getTime()</defaultvalue>
+ </property>
</component>
</components>