Author: akushunin
Date: 2007-10-04 06:56:28 -0400 (Thu, 04 Oct 2007)
New Revision: 3253
Modified:
branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java
Log:
additional for RF-1031
Modified:
branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
===================================================================
---
branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java 2007-10-04
10:34:00 UTC (rev 3252)
+++
branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java 2007-10-04
10:56:28 UTC (rev 3253)
@@ -22,10 +22,12 @@
package org.richfaces;
import java.text.DateFormat;
+import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
+import java.util.Random;
import org.richfaces.model.CalendarDataModel;
import org.richfaces.model.CalendarDataModelItem;
@@ -62,8 +64,20 @@
data.put("enLabel", enFormatter.format(date));
data.put("frLabel", frFormatter.format(date));
data.put("deLabel", deFormatter.format(date));
+ /*Calendar c = Calendar.getInstance();
+ c.setTime(date);
+ item.setDay(c.get(Calendar.DAY_OF_MONTH));*/
+
+ if (new Random().nextInt(10) > 5) {
+ item.setEnabled(true);
+ } else {
+ item.setEnabled(false);
+ }
+
item.setData(data);
-
+
+ System.out.println(item.getData() + " " + item.isEnabled());
+
return item;
}
Modified:
branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java
===================================================================
---
branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java 2007-10-04
10:34:00 UTC (rev 3252)
+++
branches/3.1.x/samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java 2007-10-04
10:56:28 UTC (rev 3253)
@@ -33,8 +33,18 @@
private Object data;
private String styleClass;
private Object toolTip;
+ private int day;
private boolean enabled = true;
+
+ public int getDay() {
+ return day;
+ }
+
+ public void setDay(int day) {
+ this.day = day;
+ }
+
/* (non-Javadoc)
* @see org.richfaces.component.CalendarDataModelItem#getData()
*/
@@ -97,5 +107,5 @@
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
-
+
}
Show replies by date