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

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Sep 11 12:41:15 EDT 2007


Author: ayanul
Date: 2007-09-11 12:41:15 -0400 (Tue, 11 Sep 2007)
New Revision: 2885

Added:
   trunk/test-applications/facelets/src/main/java/dataTable/
   trunk/test-applications/facelets/src/main/java/dataTable/ChildBean.java
   trunk/test-applications/facelets/src/main/java/dataTable/Data.java
   trunk/test-applications/facelets/src/main/java/dataTable/DataTable.java
Log:
update datatable

Added: trunk/test-applications/facelets/src/main/java/dataTable/ChildBean.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/dataTable/ChildBean.java	                        (rev 0)
+++ trunk/test-applications/facelets/src/main/java/dataTable/ChildBean.java	2007-09-11 16:41:15 UTC (rev 2885)
@@ -0,0 +1,41 @@
+package dataTable;
+
+/**
+ * @author shura
+ *
+ */
+public class ChildBean {
+	
+	private String name;
+	
+	private int qty;
+
+	/**
+	 * @return the name
+	 */
+	public String getName() {
+		return this.name;
+	}
+
+	/**
+	 * @param name the name to set
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * @return the qty
+	 */
+	public int getQty() {
+		return this.qty;
+	}
+
+	/**
+	 * @param qty the qty to set
+	 */
+	public void setQty(int qty) {
+		this.qty = qty;
+	}
+
+}

Added: trunk/test-applications/facelets/src/main/java/dataTable/Data.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/dataTable/Data.java	                        (rev 0)
+++ trunk/test-applications/facelets/src/main/java/dataTable/Data.java	2007-09-11 16:41:15 UTC (rev 2885)
@@ -0,0 +1,122 @@
+package dataTable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.event.ValueChangeEvent;
+
+
+public class Data {
+	private List detail = new ArrayList();
+	private String mounth;
+	private String town;
+	private String day;
+	private int total;
+	private int price;
+
+	private boolean checked=true;
+	/**
+	 * 
+	 */
+	public Data() {
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * @return the detail
+	 */
+	public List getDetail() {
+		return this.detail;
+	}
+
+	/**
+	 * @param detail the detail to set
+	 */
+	public void setDetail(List detail) {
+		this.detail = detail;
+	}
+
+	/**
+	 * @return the mounth
+	 */
+	public String getMounth() {
+		return this.mounth;
+	}
+
+	/**
+	 * @param mounth the mounth to set
+	 */
+	public void setMounth(String mounth) {
+		this.mounth = mounth;
+	}
+
+	/**
+	 * @return the total
+	 */
+	public int getTotal() {
+		return this.total;
+	}
+
+	/**
+	 * @param total the total to set
+	 */
+	public void setTotal(int total) {
+		this.total = total;
+	}
+
+	/**
+	 * @return the checked
+	 */
+	public boolean isChecked() {
+		System.out.println("Invoke get checked for mounth "+getMounth()+", checked:"+checked);
+		return this.checked;
+	}
+
+	/**
+	 * @param checked the checked to set
+	 */
+	public void setChecked(boolean checked) {
+		System.out.println("Invoke set checked for mounth "+getMounth()+", checked:"+checked);
+		this.checked = checked;
+	}
+	
+	public String check(){
+		checked = !checked;
+		System.out.println("Invoke check action for mounth "+getMounth()+", checked:"+checked);
+		return null;
+	}
+	
+	public void checkChanged(ValueChangeEvent event) {
+		System.out.println("Checked changed for mounth "+getMounth());		
+	}
+
+	/**
+	 * @return the price
+	 */
+	public int getPrice() {
+	    return price;
+	}
+
+	/**
+	 * @param price the price to set
+	 */
+	public void setPrice(int price) {
+	    this.price = price;
+	}
+
+	public String getTown() {
+		return town;
+	}
+
+	public void setTown(String town) {
+		this.town = town;
+	}
+
+	public String getDay() {
+		return day;
+	}
+
+	public void setDay(String day) {
+		this.day = day;
+	}
+}

Added: trunk/test-applications/facelets/src/main/java/dataTable/DataTable.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/dataTable/DataTable.java	                        (rev 0)
+++ trunk/test-applications/facelets/src/main/java/dataTable/DataTable.java	2007-09-11 16:41:15 UTC (rev 2885)
@@ -0,0 +1,151 @@
+package dataTable;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+
+public class DataTable {
+	
+	private static final String [] mNames={"Jan","Feb","Mar","Apr","May", "Jun", "Jul"};
+	private static final String [] mDay={"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
+	private static final String [] mTtown = {"Adrian", "Ailey", "Alamo", "Alapaha", "Albany", "Allenhurst", "Alma"}; 
+	private List mounths = new ArrayList(); 
+	private List numbers = new ArrayList();
+	private String align; 
+	private String bgcolor;
+	private String border;
+	private String width;
+	private String columnsWidth;
+	private boolean r2rendered;
+	private boolean rendered;
+	
+	public DataTable() {
+		align = "center";
+		bgcolor = "aqua";
+		border = "1";
+		width = "400px";
+		columnsWidth = "200px";
+		rendered = true;
+		r2rendered = true;
+		
+		Properties properties = System.getProperties();
+		Enumeration keys = properties.keys();
+		for(int i=0;i<7;i++){
+			Data bean = new Data();
+			int l = (int)(Math.random()*8)+1;
+			bean.setTotal(0);
+			bean.setMounth(DataTable.mNames[i]);
+			bean.setDay(DataTable.mDay[i]);
+			bean.setTown(DataTable.mTtown[i]);
+			mounths.add(bean);
+			for(int j=0;j<l;j++){
+				ChildBean child = new ChildBean();
+				child.setName((String) keys.nextElement());
+				int qty = (int)(Math.random()*10);
+				bean.setTotal(bean.getTotal()+qty);
+				child.setQty(qty);
+				bean.getDetail().add(child);
+			}
+		}
+		for(int i=0;i<16;i++){
+			numbers.add(new Integer(i));
+		}
+	}
+
+	public boolean isC1rendered() {
+		return r2rendered;
+	}
+	
+	public void setC1rendered(boolean c1rendered) {
+		this.r2rendered = c1rendered;
+	}
+	
+	public String toggleColumn() {
+		this.r2rendered = !this.r2rendered;
+		return null;
+	}
+	/**
+	 * @return the numbers
+	 */
+	public List getNumbers() {
+		return this.numbers;
+	}
+
+	public boolean isRendered() {
+		return rendered;
+	}
+
+	public void setRendered(boolean rendered) {
+		this.rendered = rendered;
+	}
+
+	/**
+	 * @param numbers the numbers to set
+	 */
+	public void setNumbers(List numbers) {
+		this.numbers = numbers;
+	}
+
+	/**
+	 * @return the mounths
+	 */
+	public List getMounths() {
+		return this.mounths;
+	}
+
+	/**
+	 * @param mounths the mounths to set
+	 */
+	public void setMounths(List mounths) {
+		this.mounths = mounths;
+	}
+
+	public String getAlign() {
+		return align;
+	}
+
+	public void setAlign(String align) {
+		this.align = align;
+	}
+
+	public String getBgcolor() {
+		return bgcolor;
+	}
+
+	public void setBgcolor(String bgcolor) {
+		this.bgcolor = bgcolor;
+	}
+
+	public String getBorder() {
+		return border;
+	}
+
+	public void setBorder(String border) {
+		this.border = border;
+	}
+
+	public String getWidth() {
+		return width;
+	}
+
+	public void setWidth(String width) {
+		this.width = width;
+	}
+
+	public String getColumnsWidth() {
+		return columnsWidth;
+	}
+
+	public void setColumnsWidth(String columnsWidth) {
+		this.columnsWidth = columnsWidth;
+	}
+
+	public boolean isR2rendered() {
+		return r2rendered;
+	}
+
+	public void setR2rendered(boolean r2rendered) {
+		this.r2rendered = r2rendered;
+	}
+}




More information about the richfaces-svn-commits mailing list