Author: abelevich
Date: 2007-05-28 14:11:14 -0400 (Mon, 28 May 2007)
New Revision: 898
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/ColumnVisualModel.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/DefaultColumnVisualModel.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/DefaultGridVisualModel.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/ScrollableGridVisualModel.java
Log:
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/ColumnVisualModel.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/ColumnVisualModel.java
(rev 0)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/ColumnVisualModel.java 2007-05-28
18:11:14 UTC (rev 898)
@@ -0,0 +1,41 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/visual/ColumnVisualModel.java,v
$
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.model.visual;
+
+import java.io.Serializable;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface ColumnVisualModel extends Serializable{
+
+ /**
+ * @return the sorted
+ */
+ public abstract boolean isSorted();
+
+ /**
+ * @param sorted the sorted to set
+ */
+ public abstract void setSorted(boolean sorted);
+
+ /**
+ * @return the width
+ */
+ public abstract String getWidth();
+
+ /**
+ * @param width the width to set
+ */
+ public abstract void setWidth(String width);
+
+}
\ No newline at end of file
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/DefaultColumnVisualModel.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/DefaultColumnVisualModel.java
(rev 0)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/DefaultColumnVisualModel.java 2007-05-28
18:11:14 UTC (rev 898)
@@ -0,0 +1,59 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/visual/DefaultColumnVisualModel.java,v
$
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.model.visual;
+
+import java.io.Serializable;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class DefaultColumnVisualModel implements Serializable, ColumnVisualModel {
+ private static final long serialVersionUID = -8111295442754146972L;
+
+ private String width;
+ private boolean sorted;
+
+ public DefaultColumnVisualModel() {
+ width = "100px";
+
+ }
+
+
+ /**
+ * @see com.exadel.jsf.model.visual.ColumnVisualModel#isSorted()
+ */
+ public boolean isSorted() {
+ return sorted;
+ }
+
+ /**
+ * @see com.exadel.jsf.model.visual.ColumnVisualModel#setSorted(boolean)
+ */
+ public void setSorted(boolean sorted) {
+ this.sorted = sorted;
+ }
+
+ /**
+ * @see com.exadel.jsf.model.visual.ColumnVisualModel#getWidth()
+ */
+ public String getWidth() {
+ return width;
+ }
+
+ /**
+ * @see com.exadel.jsf.model.visual.ColumnVisualModel#setWidth(java.lang.String)
+ */
+ public void setWidth(String width) {
+ this.width = width;
+ }
+
+}
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/DefaultGridVisualModel.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/DefaultGridVisualModel.java
(rev 0)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/DefaultGridVisualModel.java 2007-05-28
18:11:14 UTC (rev 898)
@@ -0,0 +1,257 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/visual/DefaultGridVisualModel.java,v
$
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.model.visual;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+
+import org.richfaces.component.UIDataGrid;
+import org.richfaces.component.UIScrollableGridColumn;
+import org.richfaces.model.SortOrder;
+
+
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class DefaultGridVisualModel implements Serializable, ScrollableGridVisualModel{
+
+ private static final long serialVersionUID = 3172834359783505358L;
+
+ private transient List columns;
+// private Selection selectedRows = new CascadeSelection();
+// private int horizontalScroll;
+// private int verticalScroll;
+ private String width;
+ private String height;
+ private int sortColumn = -1;
+ private boolean sortAscending;
+// private int activeRow;
+ private int bufferSize;
+ private int first;
+ private SortOrder sortOrder;
+
+ private transient UIDataGrid grid;
+
+ public DefaultGridVisualModel() {
+
+ }
+
+
+
+ /**
+ * @return the grid
+ */
+ public UIDataGrid getGrid() {
+ return grid;
+ }
+
+
+
+ /**
+ * @param grid the grid to set
+ */
+ public void setGrid(UIDataGrid grid) {
+ this.grid = grid;
+ }
+
+
+
+ /**
+ * @see com.exadel.jsf.model.visual.ScrollableGridVisualModel#getColumns()
+ */
+ public List getColumns() {
+ if (columns == null && this.grid != null) {
+ columns = new ArrayList();
+ List kids = grid.getChildren();
+
+ for (Iterator iter = kids.iterator(); iter.hasNext();) {
+ UIComponent component = (UIComponent) iter.next();
+ if (component instanceof UIScrollableGridColumn) {
+ columns.add(((UIScrollableGridColumn) component).getVisualModel());
+ }
+ }
+ }
+ return columns;
+ }
+ /**
+ * @see
com.exadel.jsf.model.visual.ScrollableGridVisualModel#setColumns(java.util.List)
+ */
+ public void setColumns(List columns) {
+ this.columns = columns;
+ }
+ /**
+ * @see com.exadel.jsf.model.visual.GridVisualModel#getHorizontalScroll()
+ */
+// public int getHorizontalScroll() {
+// return horizontalScroll;
+// }
+ /**
+ * @see com.exadel.jsf.model.visual.GridVisualModel#setHorizontalScroll(int)
+ */
+// public void setHorizontalScroll(int horizontalScroll) {
+// this.horizontalScroll = horizontalScroll;
+// }
+ /**
+ * @see com.exadel.jsf.model.visual.GridVisualModel#getSelection()
+ */
+// public Selection getSelection() {
+// return selectedRows;
+// }
+// /**
+// * @see com.exadel.jsf.model.visual.GridVisualModel#setSelection(java.util.List)
+// */
+// public void setSelection(Selection selectedRows) {
+// this.selectedRows = selectedRows;
+// }
+ /**
+ * @see com.exadel.jsf.model.visual.ScrollableGridVisualModel#isSortAscending()
+ */
+ public boolean isSortAscending() {
+ return sortAscending;
+ }
+ /**
+ * @see com.exadel.jsf.model.visual.ScrollableGridVisualModel#setSortAscending(boolean)
+ */
+ public void setSortAscending(boolean sortAscending) {
+ this.sortAscending = sortAscending;
+ }
+ /**
+ * @see com.exadel.jsf.model.visual.ScrollableGridVisualModel#getSortColumn()
+ */
+ public int getSortColumn() {
+ return sortColumn;
+ }
+ /**
+ * @see com.exadel.jsf.model.visual.ScrollableGridVisualModel#setSortColumn(int)
+ */
+ public void setSortColumn(int sortColumn) {
+ this.sortColumn = sortColumn;
+ }
+// /**
+// * @see com.exadel.jsf.model.visual.GridVisualModel#getVerticalScroll()
+// */
+// public int getVerticalScroll() {
+// return verticalScroll;
+// }
+// /**
+// * @see com.exadel.jsf.model.visual.GridVisualModel#setVerticalScroll(int)
+// */
+// public void setVerticalScroll(int verticalScroll) {
+// this.verticalScroll = verticalScroll;
+// }
+
+ /**
+ * @see com.exadel.jsf.model.visual.ScrollableGridVisualModel#getHeight()
+ */
+ public String getHeight() {
+ return height;
+ }
+
+ /**
+ * @see
com.exadel.jsf.model.visual.ScrollableGridVisualModel#setHeight(java.lang.String)
+ */
+ public void setHeight(String height) {
+ this.height = height;
+ }
+
+ /**
+ * @see com.exadel.jsf.model.visual.ScrollableGridVisualModel#getWidth()
+ */
+ public String getWidth() {
+ return width;
+ }
+
+ /**
+ * @see
com.exadel.jsf.model.visual.ScrollableGridVisualModel#setWidth(java.lang.String)
+ */
+ public void setWidth(String width) {
+ this.width = width;
+ }
+
+
+
+// /**
+// * @return the activeRow
+// */
+// public int getActiveRow() {
+// return activeRow;
+// }
+//
+//
+//
+// /**
+// * @param activeRow the activeRow to set
+// */
+// public void setActiveRow(int activeRow) {
+// this.activeRow = activeRow;
+// }
+
+
+
+ /**
+ * @return the bufferSize
+ */
+ public int getBufferSize() {
+ return bufferSize;
+ }
+
+
+
+ /**
+ * @param bufferSize the bufferSize to set
+ */
+ public void setBufferSize(int bufferSize) {
+ this.bufferSize = bufferSize;
+ }
+
+
+
+ /**
+ * @return the first
+ */
+ public int getFirst() {
+ return first;
+ }
+
+
+
+ /**
+ * @param first the first to set
+ */
+ public void setFirst(int first) {
+ this.first = first;
+ }
+
+
+
+ /**
+ * @return the sortOrder
+ */
+ public SortOrder getSortOrder() {
+ return sortOrder;
+ }
+
+
+
+ /**
+ * @param sortOrder the sortOrder to set
+ */
+ public void setSortOrder(SortOrder sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+}
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/ScrollableGridVisualModel.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/ScrollableGridVisualModel.java
(rev 0)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/visual/ScrollableGridVisualModel.java 2007-05-28
18:11:14 UTC (rev 898)
@@ -0,0 +1,123 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2006
+ * All rights reserved.
+ *
+ * History
+ * $Source:
/cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/visual/GridVisualModel.java,v
$
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.model.visual;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.richfaces.model.SortOrder;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface ScrollableGridVisualModel extends Serializable {
+
+
+public SortOrder getSortOrder();
+
+ public void setSortOrder(SortOrder sortOrder);
+
+// public int getActiveRow();
+
+ public int getBufferSize();
+
+ public void setBufferSize(int bufferSize);
+
+ public int getFirst();
+
+ public void setFirst(int first);
+
+ /**
+ * @return the columns
+ */
+ public abstract List getColumns();
+
+ /**
+ * @return the horizontalScroll
+ */
+// public abstract int getHorizontalScroll();
+
+ /**
+ * @param horizontalScroll the horizontalScroll to set
+ */
+// public abstract void setHorizontalScroll(int horizontalScroll);
+
+ /**
+ * @return the selectedRows
+ */
+// public abstract Selection getSelection();
+
+ /**
+ * @param columns the columns to set
+ */
+ public abstract void setColumns(List columns);
+
+ /**
+ * @param selectedRows the selectedRows to set
+ */
+// public abstract void setSelection(Selection selectedRows);
+
+ /**
+ * @return the sortAscending
+ */
+ public abstract boolean isSortAscending();
+
+// public void setActiveRow(int i);
+
+ /**
+ * @param sortAscending the sortAscending to set
+ */
+ public abstract void setSortAscending(boolean sortAscending);
+
+ /**
+ * @return the sortColumn
+ */
+ public abstract int getSortColumn();
+
+ /**
+ * @param sortColumn the sortColumn to set
+ */
+ public abstract void setSortColumn(int sortColumn);
+
+ /**
+ * @return the verticalScroll
+ */
+// public abstract int getVerticalScroll();
+
+ /**
+ * @param verticalScroll the verticalScroll to set
+ */
+// public abstract void setVerticalScroll(int verticalScroll);
+
+ /**
+ * @return the height
+ */
+ public abstract String getHeight();
+
+ /**
+ * @param height the height to set
+ */
+ public abstract void setHeight(String height);
+
+ /**
+ * @return the width
+ */
+ public abstract String getWidth();
+
+ /**
+ * @param width the width to set
+ */
+ public abstract void setWidth(String width);
+
+}
\ No newline at end of file
Show replies by date