[richfaces-svn-commits] JBoss Rich Faces SVN: r2472 - in trunk/test-applications/facelets/src/main: webapp/Calendar and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Aug 24 09:14:21 EDT 2007


Author: ayanul
Date: 2007-08-24 09:14:21 -0400 (Fri, 24 Aug 2007)
New Revision: 2472

Added:
   trunk/test-applications/facelets/src/main/java/calendar/Bean.java
Modified:
   trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java
   trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-697

Added: trunk/test-applications/facelets/src/main/java/calendar/Bean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/calendar/Bean.java	                        (rev 0)
+++ trunk/test-applications/facelets/src/main/java/calendar/Bean.java	2007-08-24 13:14:21 UTC (rev 2472)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - 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 calendar;
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+	
+}

Modified: trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java	2007-08-24 13:14:17 UTC (rev 2471)
+++ trunk/test-applications/facelets/src/main/java/calendar/CalendarBean.java	2007-08-24 13:14:21 UTC (rev 2472)
@@ -29,24 +29,30 @@
 
 /**
  * 20/07/2007
- * @author Alexej Kushunin 
- * @mailto: akushunin at exadel.com 
- *
+ * 
+ * @author Alexej Kushunin
+ * @mailto: akushunin at exadel.com
+ * 
  */
 public class CalendarBean {
-	
-	private static final String[] WEEK_DAY_LABELS = new String[] {"Sun *", "Mon +", "Tue +", "Wed +", "Thu +", "Fri +", "Sat *"};
+
+	private static final String[] WEEK_DAY_LABELS = new String[] { "Sun *",
+			"Mon +", "Tue +", "Wed +", "Thu +", "Fri +", "Sat *" };
 	private Locale locale;
-	
+
 	private boolean popup;
+	private boolean readonly;
+	private boolean showInput;
+	private boolean enableManualInput;	
 	private String pattern;
 	private Date currentDate;
 	private Date selectedDate;
 	private String jointPoint;
 	private String direction;
-	
+	private String boundary;
+
 	private boolean useCustomDayLabels;
-	
+
 	public Locale getLocale() {
 		return locale;
 	}
@@ -55,7 +61,6 @@
 		this.locale = locale;
 	}
 
-	
 	public boolean isPopup() {
 		return popup;
 	}
@@ -63,7 +68,6 @@
 	public void setPopup(boolean popup) {
 		this.popup = popup;
 	}
-	
 
 	public String getPattern() {
 		return pattern;
@@ -74,21 +78,50 @@
 	}
 
 	public CalendarBean() {
-		
+
 		locale = Locale.US;
 		popup = true;
 		pattern = "MMM d, yyyy";
 		jointPoint = "bottom-left";
 		direction = "bottom-right";
+		readonly = true;
+		enableManualInput=false;
+		showInput=true;
+		boundary = "inactive";
 	}
 	
-	public void selectLocale(ValueChangeEvent event){
-		
+	
+	public boolean isShowInput() {
+		return showInput;
+	}
+
+	public void setShowInput(boolean showInput) {
+		this.showInput = showInput;
+	}
+
+	public boolean isEnableManualInput() {
+		return enableManualInput;
+	}
+
+	public void setEnableManualInput(boolean enableManualInput) {
+		this.enableManualInput = enableManualInput;
+	}
+
+	public boolean isReadonly() {
+		return readonly;
+	}
+
+	public void setReadonly(boolean readonly) {
+		this.readonly = readonly;
+	}
+
+	public void selectLocale(ValueChangeEvent event) {
+
 		String tLocale = (String) event.getNewValue();
 		if (tLocale != null) {
-			String lang = tLocale.substring(0,2);
+			String lang = tLocale.substring(0, 2);
 			String country = tLocale.substring(3);
-			locale = new Locale(lang,country,"");
+			locale = new Locale(lang, country, "");
 		}
 	}
 
@@ -99,7 +132,7 @@
 	public void setUseCustomDayLabels(boolean useCustomDayLabels) {
 		this.useCustomDayLabels = useCustomDayLabels;
 	}
-	
+
 	public Object getWeekDayLabelsShort() {
 		if (isUseCustomDayLabels()) {
 			return WEEK_DAY_LABELS;
@@ -111,9 +144,10 @@
 	public String getCurrentDateAsText() {
 		Date currentDate = getCurrentDate();
 		if (currentDate != null) {
-			return DateFormat.getDateInstance(DateFormat.FULL).format(currentDate);
+			return DateFormat.getDateInstance(DateFormat.FULL).format(
+					currentDate);
 		}
-		
+
 		return null;
 	}
 
@@ -132,23 +166,37 @@
 	public void setSelectedDate(Date selectedDate) {
 		this.selectedDate = selectedDate;
 	}
-	
+
 	public String getJointPoint() {
 		return jointPoint;
 	}
+
 	public void setJointPoint(String jointPoint) {
 		this.jointPoint = jointPoint;
 	}
-	public void selectJointPoint(ValueChangeEvent event){
+
+	public void selectJointPoint(ValueChangeEvent event) {
 		jointPoint = (String) event.getNewValue();
 	}
+
 	public String getDirection() {
 		return direction;
 	}
+
 	public void setDirection(String direction) {
 		this.direction = direction;
 	}
-	public void selectDirection(ValueChangeEvent event){
+
+	public void selectDirection(ValueChangeEvent event) {
 		direction = (String) event.getNewValue();
 	}
-}
\ No newline at end of file
+
+	public String getBoundary() {
+		return boundary;
+	}
+
+	public void setBoundary(String boundary) {
+		this.boundary = boundary;
+	}
+
+}

Modified: trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml	2007-08-24 13:14:17 UTC (rev 2471)
+++ trunk/test-applications/facelets/src/main/webapp/Calendar/Calendar.xhtml	2007-08-24 13:14:21 UTC (rev 2472)
@@ -9,17 +9,18 @@
 	<head>
 	<title></title>
 	<style type="text/css">
-			.smallText {
-				font-size: xx-small;
-			}
-			.largeText {
-				font-size: xx-large;
-			}
-			
-			.Selecteddayclass {
-				background-color: #0087FF;
-			}
-		</style>
+.smallText {
+	font-size: xx-small;
+}
+
+.largeText {
+	font-size: xx-large;
+}
+
+.Selecteddayclass {
+	background-color: #0087FF;
+}
+</style>
 	</head>
 
 	<body>
@@ -35,11 +36,20 @@
 			value="#{calendarBean.selectedDate}"
 			currentDate="#{calendarBean.currentDate}"
 			jointPoint="#{calendarBean.jointPoint}"
-			direction="#{calendarBean.direction}" buttonLabel="PopUp">
-
+			direction="#{calendarBean.direction}" buttonLabel="PopUp"
+			enableManualInput="#{calendarBean.enableManualInput}"
+			showInput="#{calendarBean.showInput}"
+			boundaryDatesMode="#{calendarBean.boundary}">
+			<f:facet name="optionalHeader">
+				<h:outputText value="optionalHeader Facet" />
+			</f:facet>
+			<f:facet name="optionalFooter">
+				<h:outputText value="optionalFooter Facet" />
+			</f:facet>
 			<f:validator validatorId="org.richfaces.CalendarValidator" />
 
 			<h:panelGrid columns="2">
+
 				<f:verbatim>
 					<p style="padding: 2px;" class="largeText">{day}</p>
 				</f:verbatim>
@@ -95,24 +105,40 @@
 				<f:selectItem itemLabel="top-left" itemValue="top-left" />
 				<f:selectItem itemLabel="auto" itemValue="auto" />
 			</h:selectOneRadio>
+			<h:outputText value="BoundaryDatesMode:" />
+			<h:selectOneRadio onclick="submit()" value="#{calendarBean.boundary}">
+				<f:selectItem itemLabel="inactive" itemValue="inactive" />
+				<f:selectItem itemLabel="select" itemValue="select" />
+				<f:selectItem itemLabel="scroll" itemValue="scroll" />
+			</h:selectOneRadio>
+			<h:outputText value="EnableManualInput:"></h:outputText>
+			<h:selectBooleanCheckbox value="#{calendarBean.enableManualInput}"
+				onclick="submit()">
+			</h:selectBooleanCheckbox>
+			<h:outputText value="ShowInput:"></h:outputText>
+			<h:selectBooleanCheckbox value="#{calendarBean.showInput}"
+				onclick="submit()">
+			</h:selectBooleanCheckbox>
 
 			<!-- 	<h:commandButton id="calendarPopup" type="button" value="popup" onclick="$(this.form.id+':calendar').component.doSwitch();"/>-->
-	
+
 		</h:panelGrid>
 
 		<h:outputText value="Current date: " />
 		<h:outputText value="#{calendarBean.currentDateAsText}" />
+
 		<f:verbatim>
 			<br />
 		</f:verbatim>
+
 		<h:outputText value="Selected date: " />
 		<h:outputText value="#{calendarBean.selectedDate}" />
+
 		<f:verbatim>
 			<br />
 		</f:verbatim>
 
 		<h:commandButton value="Submit" />
-
 	</h:form>
 
 	<h:form>




More information about the richfaces-svn-commits mailing list