JBoss Rich Faces SVN: r907 - trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:13:23 -0400 (Mon, 28 May 2007)
New Revision: 907
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
Log:
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-05-28 18:12:58 UTC (rev 906)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/pages/scrollable-grid.xhtml 2007-05-28 18:13:23 UTC (rev 907)
@@ -37,13 +37,14 @@
<h:form>
<sg:scrollable-grid id="grid"
- value="#{selectionBean.dataModel}"
+ value="#{dataModel}"
var="issues"
frozenColCount="3"
first="0"
rows="40"
width="800px"
- height="500px">
+ height="500px"
+ visualModel="#{selectionBean.visualModel}">
<sg:column width="200px">
<f:facet name="header">
@@ -54,7 +55,8 @@
<h:outputText value="footer0"></h:outputText>
</f:facet>
</sg:column>
- <sg:column width="200px">
+
+ <sg:column width="200px">
<f:facet name="header">
<h:outputText value="Key"></h:outputText>
</f:facet>
@@ -74,6 +76,7 @@
<h:outputText value="footer2"></h:outputText>
</f:facet>
</sg:column>
+
<sg:column width="200px">
<f:facet name="header">
<h:outputText value="Assignee"></h:outputText>
@@ -83,6 +86,7 @@
<h:outputText value="footer3"></h:outputText>
</f:facet>
</sg:column>
+
<sg:column width="200px">
<f:facet name="header">
<h:outputText value="Status"></h:outputText>
@@ -92,6 +96,7 @@
<h:outputText value="footer4"></h:outputText>
</f:facet>
</sg:column>
+
<sg:column width="200px">
<f:facet name="header">
<h:outputText value="Reporter"></h:outputText>
@@ -101,24 +106,17 @@
<h:outputText value="footer5"></h:outputText>
</f:facet>
</sg:column>
+
<sg:column width="200px">
<f:facet name="header">
- <h:outputText value="Created"></h:outputText>
+ <h:outputText value="Priority"></h:outputText>
</f:facet>
- <h:outputText value="#{issues.created}"></h:outputText>
+ <h:outputText value="#{issues.priority.name}"></h:outputText>
<f:facet name="footer">
<h:outputText value="footer6"></h:outputText>
</f:facet>
</sg:column>
- <sg:column width="200px">
- <f:facet name="header">
- <h:outputText value="Updated"></h:outputText>
- </f:facet>
- <h:outputText value="#{issues.updated}"></h:outputText>
- <f:facet name="footer">
- <h:outputText value="footer7"></h:outputText>
- </f:facet>
- </sg:column>
+
<sg:column width="200px">
<f:facet name="header">
<h:outputText value="Resolution"></h:outputText>
@@ -128,6 +126,7 @@
<h:outputText value="footer8"></h:outputText>
</f:facet>
</sg:column>
+
</sg:scrollable-grid>
</h:form>
17 years, 7 months
JBoss Rich Faces SVN: r906 - trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:12:58 -0400 (Mon, 28 May 2007)
New Revision: 906
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
Log:
Modified: trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-05-28 18:12:32 UTC (rev 905)
+++ trunk/sandbox-samples/scrollable-grid-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-05-28 18:12:58 UTC (rev 906)
@@ -204,19 +204,28 @@
</managed-bean>
<managed-bean>
- <managed-bean-name>selectionBean</managed-bean-name>
- <managed-bean-class>org.richfaces.demo.datagrid.bean.SelectionBean</managed-bean-class>
+ <managed-bean-name>dataModel</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.datagrid.bean.ChannelDataModel</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>channel</property-name>
+ <value>#{jiraService.channel}</value>
+ </managed-property>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>selectionBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.datagrid.bean.SelectionBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
- <property-name>dataModel</property-name>
- <property-class>java.util.List</property-class>
- <value>#{jiraService.channel.issues}</value>
+ <property-name> dataModel</property-name>
+ <property-class>org.richfaces.model.ScrollableGridDataModel2</property-class>
+ <value>#{dataModel}</value>
</managed-property>
<managed-property>
<property-name>channel</property-name>
<value>#{jiraService.channel}</value>
</managed-property>
- </managed-bean>
+ </managed-bean>
-
</faces-config>
17 years, 7 months
JBoss Rich Faces SVN: r905 - trunk/sandbox/scrollable-grid/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:12:32 -0400 (Mon, 28 May 2007)
New Revision: 905
Modified:
trunk/sandbox/scrollable-grid/src/main/config/component/scrollable-grid.xml
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/config/component/scrollable-grid.xml
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/config/component/scrollable-grid.xml 2007-05-28 18:12:21 UTC (rev 904)
+++ trunk/sandbox/scrollable-grid/src/main/config/component/scrollable-grid.xml 2007-05-28 18:12:32 UTC (rev 905)
@@ -42,7 +42,14 @@
<classname>java.lang.String</classname>
<description>grid width</description>
<defaultvalue>"700px"</defaultvalue>
- </property>
+ </property>
+
+ <property attachedstate="true">
+ <name>visualModel</name>
+ <classname>org.richfaces.model.visual.ScrollableGridVisualModel</classname>
+ <description>Visual model for data grid</description>
+ </property>
+
&ui_component_attributes;
</component>
@@ -70,6 +77,12 @@
<defaultvalue>"100px"</defaultvalue>
</property>
+ <property>
+ <name>sortable</name>
+ <classname>boolean</classname>
+ <description></description>
+ <defaultvalue>true</defaultvalue>
+ </property>
&ui_component_attributes;
&html_style_attributes;
17 years, 7 months
JBoss Rich Faces SVN: r904 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:12:21 -0400 (Mon, 28 May 2007)
New Revision: 904
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-28 18:12:13 UTC (rev 903)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-05-28 18:12:21 UTC (rev 904)
@@ -4,26 +4,37 @@
package org.richfaces.component;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Iterator;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
import javax.faces.model.DataModel;
+import org.ajax4jsf.ajax.repeat.DataComponentState;
import org.ajax4jsf.ajax.repeat.DataVisitor;
+import org.ajax4jsf.ajax.repeat.Range;
+import org.ajax4jsf.ajax.repeat.UIDataAdaptor;
import org.ajax4jsf.ajax.repeat.UIRepeat;
import org.ajax4jsf.framework.ajax.AjaxComponent;
import org.ajax4jsf.framework.ajax.AjaxContext;
import org.ajax4jsf.framework.ajax.AjaxEvent;
import org.apache.commons.collections.iterators.IteratorChain;
import org.richfaces.event.sort.SortEvent;
+import org.richfaces.model.BufferedSequenceRange;
+import org.richfaces.model.ScrollableGridDataModel2;
import org.richfaces.model.SortOrder;
+import org.richfaces.model.visual.DefaultGridVisualModel;
+import org.richfaces.model.visual.ScrollableGridVisualModel;
+
/**
* @author Anton Belevich
*
@@ -37,42 +48,131 @@
private Integer _startRow = new Integer(0);
+ private transient Collection partialUpdateChildren;
+ private ScrollableGridVisualModel visualModel;
+
+
+
+ protected DataComponentState createComponentState() {
+
+ return new DataComponentState(){
+
+ public Range getRange() {
+
+ int curentRow = getFirst();
+ int rows = getRows();
+ int rowsCount = getExtendedDataModel().getRowCount();
+
+ if(rows > 0){
+
+ rows += curentRow;
+
+ if(rows >=0){
+ rows = Math.min(rows, rowsCount);
+ }
+
+ } else if(rowsCount >=0 ){
+ rows = rowsCount;
+
+ } else {
+ rows = -1;
+ }
+
+ BufferedSequenceRange range = new BufferedSequenceRange(curentRow,rows);
+ range.setSortOrder(getVisualModel().getSortOrder());
+
+ return range;
+ }
+ };
+ }
+
+ public ScrollableGridVisualModel getVisualModel() {
+
+ FacesContext context = getFacesContext();
+ boolean needToUpdateBinding = false;
+ ValueBinding valueExpression = getValueBinding("visualModel");
+ if (valueExpression != null) {
+
+ ScrollableGridVisualModel viModel = (ScrollableGridVisualModel) valueExpression.getValue(context);
+ if(viModel == null) {
+ needToUpdateBinding = true;
+ } else {
+ setUpVisualModel(viModel);
+ return viModel;
+ }
+ }
+
+ if (visualModel == null) {
+ visualModel = new DefaultGridVisualModel();
+ setUpVisualModel(visualModel);
+
+ if (needToUpdateBinding) {
+ valueExpression.setValue(context, visualModel);
+ }
+ }
+
+ return visualModel;
+ }
+
+ private void setUpVisualModel(ScrollableGridVisualModel visualModel) {
+
+ }
+
+ public void setVisualModel(ScrollableGridVisualModel visualModel) {
+ if (visualModel != null) {
+ ValueBinding valueExpression = getValueBinding("visualModel");
+ if (valueExpression != null) {
+ ScrollableGridVisualModel anotherModel =
+ (ScrollableGridVisualModel) valueExpression.getValue(getFacesContext());
+ if (anotherModel == null) {
+ valueExpression.setValue(getFacesContext(), visualModel);
+ }
+ }
+ }
+ this.visualModel = visualModel;
+
+ }
+
+ public void setSortOrder(SortOrder sortOrder) {
+ getVisualModel().setSortOrder(sortOrder);
+ Object value = getValue();
+ if (value instanceof ScrollableGridDataModel2) {
+ ScrollableGridDataModel2 gridDataModel = (ScrollableGridDataModel2) value;
+ gridDataModel.setSortOrder(sortOrder);
+ }
+ }
+
+ public SortOrder getSortOrder() {
+ return getVisualModel().getSortOrder();
+ }
+
public Integer getDataIndex() {
return _dataIndex;
}
-
-
public void setDataIndex(Integer dataIndex) {
this._dataIndex = dataIndex;
}
-
-
public Integer getRow_count() {
return _row_count;
}
-
-
public void setRow_count(Integer row_count) {
this._row_count = row_count;
}
-
-
public Integer getStartRow() {
return _startRow;
}
-
-
public void setStartRow(Integer startRow) {
this._startRow = startRow;
}
public Object saveState(FacesContext context) {
+
Object values[] = new Object[4];
values[0] = super.saveState(context);
values[1] = _row_count;
@@ -84,6 +184,7 @@
}
public void restoreState(FacesContext context, Object state) {
+
Object values[] = (Object[])state;
super.restoreState(context, values[0]);
_row_count = (Integer)values[1];
@@ -122,33 +223,90 @@
}
public void broadcast(FacesEvent event) throws AbortProcessingException {
+
super.broadcast(event);
+
if(event instanceof AjaxEvent){
AjaxContext.getCurrentInstance().addComponentToAjaxRender(this);
+ }else if(event instanceof SortEvent){
+ processSortingChange(event);
+ new AjaxEvent(this).queue();
}
}
+ protected boolean broadcastLocal(FacesEvent event) {
+ return super.broadcastLocal(event) || event instanceof SortEvent;
+ }
+
public void queueEvent(FacesEvent event) {
+
if(event instanceof AjaxEvent){
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
}else if(event instanceof SortEvent){
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
}
+
super.queueEvent(event);
}
- public void walk(FacesContext faces, DataVisitor visitor, Object argument) throws IOException {
- super.walk(faces, visitor, argument);
+ public void processSortingChange(FacesEvent event){
+
+ SortEvent e = (SortEvent)event;
+ int sortColumn = e.getSortColumn();
+ int dataIndex = e.getDataIndex();
+ int startRow = e.getStartRow();
+
+ boolean asc = true;
+
+ SortOrder sortOrder = getSortOrder();
+ int oldSortColumn = -1;
+ int newSortColumn = sortColumn;
+
+ if (sortOrder != null) {
+ /**
+ * toggle sort direction
+ */
+ oldSortColumn = sortOrder.getSortColumn();
+ if (sortOrder.getSortColumn() == sortColumn) {
+ asc = !sortOrder.isAscending();
+ }
+ }
+
+ SortOrder newSortOrder = new SortOrder(sortColumn, startRow, dataIndex, asc);
+ setSortOrder(newSortOrder);
+ resetDataModel();
+
+// setSelection(new CascadeSelection());
+// addRequestStateKey(SORT_EVENT);
+ FacesContext context = getFacesContext();
+
+
+// TODO add to AjaxContext
+
+
+// if (log.isTraceEnabled()) {
+// log.trace("Sorting has changed " + sortOrder);
+// }
}
+ public void walk(FacesContext context, DataVisitor visitor, Object argument) throws IOException {
+ super.walk(context, visitor, argument);
+ }
+
public DataModel getStoredDataModel() {
return super.getDataModel();
}
- public SortOrder getSortOrder() {
- return null;
+
+ public Collection getPartialUpdateChildren() {
+
+ if (partialUpdateChildren == null) {
+ partialUpdateChildren = new ArrayList();
+ }
+ return partialUpdateChildren;
}
- public void setSortOrder(SortOrder sortOrder) {
+ public void encodeEnd(FacesContext context) throws IOException {
+ super.encodeEnd(context);
+ partialUpdateChildren = null;
}
-
}
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-05-28 18:12:13 UTC (rev 903)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGridColumn.java 2007-05-28 18:12:21 UTC (rev 904)
@@ -5,29 +5,25 @@
import java.util.Iterator;
+import javax.faces.context.FacesContext;
+import javax.faces.el.ValueBinding;
+
import org.richfaces.event.sort.SortListener;
import org.richfaces.event.sort.SortSource;
+import org.richfaces.model.visual.ColumnVisualModel;
+import org.richfaces.model.visual.DefaultColumnVisualModel;
/**
* @author Anton Belevich
*
*/
-public class UIScrollableGridColumn extends UIColumn implements SortSource{
+public abstract class UIScrollableGridColumn extends UIColumn implements SortSource{
- /* (non-Javadoc)
- * @see org.richfaces.component.Column#isBreakBefore()
- */
- public boolean isBreakBefore() {
- // TODO Auto-generated method stub
- return false;
+ private ColumnVisualModel visualModel;
+
+ static final class AutoCreatedVisualModel extends DefaultColumnVisualModel{
+ private static final long serialVersionUID = 8528834472198966115L;
}
-
- /* (non-Javadoc)
- * @see org.richfaces.component.Column#setBreakBefore(boolean)
- */
- public void setBreakBefore(boolean arg0) {
- // TODO Auto-generated method stub
- }
public Iterator getChildIterator(){
return getChildren().iterator();
@@ -49,4 +45,33 @@
removeFacesListener(listener);
}
+ /**
+ * @return the visualModel
+ */
+ public ColumnVisualModel getVisualModel() {
+
+ ValueBinding valueExpression = getValueBinding("visualModel");
+ if (valueExpression != null) {
+ return (ColumnVisualModel) valueExpression.getValue(FacesContext.getCurrentInstance());
+ }
+
+ if (visualModel == null) {
+ visualModel = new AutoCreatedVisualModel();
+ }
+
+ return visualModel;
+ }
+
+ /**
+ * @param visualModel the visualModel to set
+ */
+ public void setVisualModel(ColumnVisualModel visualModel) {
+ this.visualModel = visualModel;
+ }
+
+
+ public abstract boolean isSortable();
+
+ public abstract void setSortable(boolean sortable);
+
}
17 years, 7 months
JBoss Rich Faces SVN: r903 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:12:13 -0400 (Mon, 28 May 2007)
New Revision: 903
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java
Removed:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEventWrapper.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEvent.java
Log:
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEvent.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEvent.java 2007-05-28 18:12:02 UTC (rev 902)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEvent.java 2007-05-28 18:12:13 UTC (rev 903)
@@ -16,39 +16,33 @@
/**
* @author Maksim Kaszynski
+ * @modified by Anton Belevich
*
*/
public class SortEvent extends FacesEvent {
private static final long serialVersionUID = -1453867412542792281L;
- private int sortColumnIndex;
+ private int sortColumn;
- private boolean sortAsc;
+ private int startRow;
- /**
- * @param component
- * @param sortField
- * @param sortAscending
- */
+ private int dataIndex;
+
+ private boolean asc;
+
+
public SortEvent(
- UIComponent component,
- int sortColumnIndex,
- boolean sortAsc) {
-
+ UIComponent component, int sortColumn, int startRow, int dataIndex, boolean asc) {
+
super(component);
- this.sortColumnIndex = sortColumnIndex;
- this.sortAsc = sortAsc;
+ this.asc = asc;
+ this.sortColumn = sortColumn;
+ this.startRow = startRow;
+ this.dataIndex = dataIndex;
+
}
- public boolean isSortAsc() {
- return sortAsc;
- }
-
- public void setSortAsc(boolean sortAsc) {
- this.sortAsc = sortAsc;
- }
-
public boolean isAppropriateListener(FacesListener listener) {
return (listener instanceof SortListener);
}
@@ -60,14 +54,42 @@
/**
* @return the sortField
*/
- public int getSortField() {
- return sortColumnIndex;
+ public int getSortColumn() {
+ return sortColumn;
}
/**
* @see java.util.EventObject#toString()
*/
public String toString() {
- return "SortEvent: {sortField: " + sortColumnIndex + "}";
+ return "SortEvent: {sortColumn: " + sortColumn + "}";
}
+
+ public boolean isAsc() {
+ return asc;
+ }
+
+ public void setAsc(boolean asc) {
+ this.asc = asc;
+ }
+
+ public int getDataIndex() {
+ return dataIndex;
+ }
+
+ public void setDataIndex(int dataIndex) {
+ this.dataIndex = dataIndex;
+ }
+
+ public int getStartRow() {
+ return startRow;
+ }
+
+ public void setStartRow(int startRow) {
+ this.startRow = startRow;
+ }
+
+ public void setSortColumn(int sortColumn) {
+ this.sortColumn = sortColumn;
+ }
}
Deleted: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEventWrapper.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEventWrapper.java 2007-05-28 18:12:02 UTC (rev 902)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortEventWrapper.java 2007-05-28 18:12:13 UTC (rev 903)
@@ -1,42 +0,0 @@
-/*
- * 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/event/sort/SortEventWrapper.java,v $
- * $Revision: 1.2 $
- */
-
-package org.richfaces.event.sort;
-
-import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.FacesListener;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SortEventWrapper extends FacesEvent {
-
- private static final long serialVersionUID = -2882390997635668899L;
- private SortEvent wrapped;
-
- public SortEventWrapper(UIComponent component, SortEvent wrapped) {
- super(component);
- this.wrapped = wrapped;;
- }
-
- public boolean isAppropriateListener(FacesListener listener) {
- return wrapped.isAppropriateListener(listener);
- }
-
- public void processListener(FacesListener listener) {
- wrapped.processListener(listener);
- }
-
- public SortEvent getWrapped() {
- return wrapped;
- }
-}
Deleted: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java 2007-05-28 18:12:02 UTC (rev 902)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java 2007-05-28 18:12:13 UTC (rev 903)
@@ -1,21 +0,0 @@
-/*
- * 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/event/sort/SortListener.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.event.sort;
-
-import javax.faces.event.FacesListener;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface SortListener extends FacesListener {
- public void processSort(SortEvent e);
-}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortListener.java 2007-05-28 18:12:13 UTC (rev 903)
@@ -0,0 +1,21 @@
+/*
+ * 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/event/sort/SortListener.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.event.sort;
+
+import javax.faces.event.FacesListener;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface SortListener extends FacesListener {
+ public void processSort(SortEvent e);
+}
Deleted: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java 2007-05-28 18:12:02 UTC (rev 902)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java 2007-05-28 18:12:13 UTC (rev 903)
@@ -1,21 +0,0 @@
-/*
- * 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/event/sort/SortSource.java,v $
- * $Revision: 1.1 $
- */
-
-package org.richfaces.event.sort;
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface SortSource {
- public void addSortListener(SortListener listener);
- public void removeSortListener(SortListener listener);
- public SortListener[] getSortListeners();
-}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/event/sort/SortSource.java 2007-05-28 18:12:13 UTC (rev 903)
@@ -0,0 +1,21 @@
+/*
+ * 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/event/sort/SortSource.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.event.sort;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public interface SortSource {
+ public void addSortListener(SortListener listener);
+ public void removeSortListener(SortListener listener);
+ public SortListener[] getSortListeners();
+}
17 years, 7 months
JBoss Rich Faces SVN: r902 - trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:12:02 -0400 (Mon, 28 May 2007)
New Revision: 902
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/BufferedSequenceRange.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModelFeatures.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IOExceptionWrapper.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ModelContext.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ModelContextTask.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridDataModel2.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SortOrder.java
Removed:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SortOrder.java
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataRange.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridRange.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridDataModel.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SequenceRange.java
Log:
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/BufferedSequenceRange.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/BufferedSequenceRange.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/BufferedSequenceRange.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -0,0 +1,67 @@
+/*
+ * 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/BufferedSequenceRange.java,v $
+ * $Revision: 1.7 $
+ */
+
+package org.richfaces.model;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ * @modified by Anton Belevich
+ */
+public class BufferedSequenceRange extends GridRange{
+
+ private int first = 0;
+ private int last = 0;
+ private boolean readOnly;
+
+ public IterationBounds getIterationBounds() {
+ return new IterationBounds(this.first, this.last);
+ }
+
+ public boolean isReadOnly() {
+ return readOnly;
+ }
+
+ public void setReadOnly(boolean readOnly) {
+ this.readOnly = readOnly;
+ }
+
+ public BufferedSequenceRange(int first, int last) {
+ super();
+ this.first = first;
+ this.last = last;
+ }
+
+ /**
+ * @return the bufferSize
+ */
+ public int getLast() {
+ return last;
+ }
+ /**
+ * @param bufferSize the bufferSize to set
+ */
+ public void setLast(int lastRow) {
+ this.last = lastRow;
+ }
+ /**
+ * @return the first
+ */
+ public int getFirst() {
+ return first;
+ }
+ /**
+ * @param first the first to set
+ */
+ public void setFirst(int first) {
+ this.first = first;
+ }
+}
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataRange.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataRange.java 2007-05-28 18:11:47 UTC (rev 901)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataRange.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -18,6 +18,7 @@
*
*
* @author Maksim Kaszynski
+ *
*/
public abstract class DataRange {
private SortOrder sortOrder;
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModelFeatures.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModelFeatures.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModelFeatures.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -0,0 +1,19 @@
+package org.richfaces.model;
+
+import java.util.Collection;
+
+import org.richfaces.model.snapshot.ObjectLocator;
+
+
+
+public interface GridDataModelFeatures {
+ public ObjectLocator getObjectLocator();
+ public void setObjectLocator(ObjectLocator locator);
+ public void reset();
+// public Collection getSelectedObjects();
+
+// public void setSelection(Selection selection);
+//
+// public Selection getSelection();
+
+}
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridRange.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridRange.java 2007-05-28 18:11:47 UTC (rev 901)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridRange.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -7,13 +7,14 @@
/**
* @author maksim
+ * @modidied by Anton Belevich
*
*/
public abstract class GridRange implements Range {
private SortOrder sortOrder;
- public abstract IterationBounds getIterationBounds(int rowCount);
+ public abstract IterationBounds getIterationBounds();
public SortOrder getSortOrder() {
return sortOrder;
@@ -22,7 +23,5 @@
public void setSortOrder(SortOrder sortOrder) {
this.sortOrder = sortOrder;
}
-
-
-
+
}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IOExceptionWrapper.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IOExceptionWrapper.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IOExceptionWrapper.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -0,0 +1,28 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2007
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/IOExceptionWrapper.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.model;
+
+import java.io.IOException;
+
+public final class IOExceptionWrapper extends RuntimeException {
+ private static final long serialVersionUID = -1173652671552790659L;
+
+ private IOException wrappedException;
+
+ public IOExceptionWrapper(IOException wrapped) {
+ super();
+ this.wrappedException = wrapped;
+ }
+
+ public IOException getWrappedException() {
+ return wrappedException;
+ }
+}
\ No newline at end of file
Deleted: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.java 2007-05-28 18:11:47 UTC (rev 901)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -1,63 +0,0 @@
-/*
- * 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/IterationBounds.java,v $
- * $Revision: 1.3 $
- */
-
-package org.richfaces.model;
-
-import java.io.Serializable;
-
-public class IterationBounds implements Serializable {
-
- public interface RowVisitor {
- public void visit(int rowIndex);
- }
-
- private static final long serialVersionUID = 1L;
-
- private int startRow;
- private int endRow;
-
- public IterationBounds() {
- }
- public IterationBounds(int startRow, int endRow) {
- super();
- this.startRow = startRow;
- this.endRow = endRow;
- }
-
- public boolean within(int i) {
- return i >= startRow && i < endRow;
- }
-
- public void iterate(RowVisitor rowVisitor) {
- for (int i = startRow; i < endRow; i++) {
- rowVisitor.visit(i);
- }
- }
-
- public int size() {
- return endRow - startRow;
- }
-
- public int getEndRow() {
- return endRow;
- }
-
- public int getStartRow() {
- return startRow;
- }
- /**
- * @see java.lang.Object#toString()
- */
-
- public String toString() {
- // TODO Auto-generated method stub
- return "[" + startRow + "," + endRow + "]";
- }
-}
\ No newline at end of file
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -0,0 +1,62 @@
+/*
+ * 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/IterationBounds.java,v $
+ * $Revision: 1.3 $
+ */
+
+package org.richfaces.model;
+
+import java.io.Serializable;
+
+public class IterationBounds implements Serializable {
+
+ public interface RowVisitor {
+ public void visit(int rowIndex);
+ }
+
+ private static final long serialVersionUID = 1L;
+
+ private int startRow;
+ private int endRow;
+
+ public IterationBounds() {
+ }
+ public IterationBounds(int startRow, int endRow) {
+ super();
+ this.startRow = startRow;
+ this.endRow = endRow;
+ }
+
+ public boolean within(int i) {
+ return i >= startRow && i < endRow;
+ }
+
+ public void iterate(RowVisitor rowVisitor) {
+ for (int i = startRow; i < endRow; i++) {
+ rowVisitor.visit(i);
+ }
+ }
+
+ public int size() {
+ return endRow - startRow;
+ }
+
+ public int getEndRow() {
+ return endRow;
+ }
+
+ public int getStartRow() {
+ return startRow;
+ }
+ /**
+ * @see java.lang.Object#toString()
+ */
+
+ public String toString() {
+ return "[" + startRow + "," + endRow + "]";
+ }
+}
\ No newline at end of file
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ModelContext.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ModelContext.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ModelContext.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -0,0 +1,54 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2007
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/ModelContext.java,v $
+ * $Revision: 1.1 $
+ */
+
+package org.richfaces.model;
+
+import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ModelContext {
+
+ public class ModelState {
+ Object rowKey;
+ }
+
+ private ExtendedDataModel model;
+
+ public ModelContext(ExtendedDataModel model) {
+ this.model = model;
+ }
+
+ public void executeInContext(ModelContextTask task) {
+ ModelState modelState = createState();
+ recordState(modelState, model);
+
+
+ task.execute(model);
+
+ replayState(modelState, model);
+
+ }
+
+ protected ModelState createState() {
+ return new ModelState();
+ }
+
+ protected void recordState(ModelState modelState, ExtendedDataModel model) {
+ modelState.rowKey = model.getRowKey();
+ }
+
+ protected void replayState(ModelState modelState, ExtendedDataModel model) {
+ model.setRowKey(modelState.rowKey);
+ }
+
+}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ModelContextTask.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ModelContextTask.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ModelContextTask.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -0,0 +1,8 @@
+package org.richfaces.model;
+
+import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
+
+public interface ModelContextTask {
+
+ public void execute(ExtendedDataModel model);
+}
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridDataModel.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridDataModel.java 2007-05-28 18:11:47 UTC (rev 901)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridDataModel.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -11,23 +11,17 @@
public class ScrollableGridDataModel extends SequenceDataModel{
- private SortOrder sortOrder;
-
-
public ScrollableGridDataModel(DataModel model) {
super(model);
}
- public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) throws IOException {
+// public void createDataRange(GridVisualModel model){
+//
+// }
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) throws IOException {
super.walk(context, visitor, range, argument);
}
- public SortOrder getSortOrder(){
- return sortOrder;
- }
- public void setSortOrder(SortOrder sortOrder){
- this.sortOrder = sortOrder;
- }
}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridDataModel2.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridDataModel2.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridDataModel2.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -0,0 +1,215 @@
+/*
+ * 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/GridDataModel.java,v $
+ * $Revision: 1.14 $
+ */
+
+package org.richfaces.model;
+
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.ajax.repeat.DataVisitor;
+import org.ajax4jsf.ajax.repeat.ExtendedDataModel;
+import org.ajax4jsf.ajax.repeat.Range;
+import org.ajax4jsf.ajax.repeat.SerializableDataModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.component.UIDataGrid;
+import org.richfaces.model.snapshot.DataModelSnapshot;
+import org.richfaces.model.snapshot.ObjectLocator;
+
+
+
+/**
+ * To effectively use {@link UIDataGrid} component, a data model is to be
+ * defined.
+ *
+ * Data model to deal with underlying data source. Support for partial load of
+ * data window and sorting. Subclasses must implement
+ * {@link #createDataRange(int, int, SortOrder)} method. This class is mostly
+ * targetted to database fetches, where
+ * {@link #createDataRange(int, int, SortOrder)} method accesses underlying data
+ * source and wraps select result into DataRange object.
+ *
+ * <p>
+ * State saving/restore works as follows:
+ * </p>
+ * <ul>
+ * <li> If {@link #getObjectLocator()} call returns {@link ObjectLocator}
+ * instance, it is used to create a snapshot of model data with object
+ * identifiers instead of full-blown objects. Then the snapshot is saved within
+ * state, and on restore state ObjectLocator is employed to load objects by
+ * their ids. </li>
+ * <li> If there's no {@link ObjectLocator} instance, snapshot is not
+ * serialized. </li>
+ * </ul>
+ *
+ * @author Maksim Kaszynski
+ */
+public abstract class ScrollableGridDataModel2 extends ExtendedDataModel implements
+ GridDataModelFeatures {
+
+ private static final Log log = LogFactory.getLog(ScrollableGridDataModel2.class);
+
+ private final class BearerSettings {
+ SortOrder sortOrder;
+ int startRow = -1;
+ int endRow = -1;
+ public BearerSettings(int startRow, int endRow, SortOrder sortOrder) {
+ super();
+ this.sortOrder = sortOrder;
+ this.startRow = startRow;
+ this.endRow = endRow;
+ }
+
+
+ }
+
+ private ObjectLocator objectLocator;
+
+ private SortOrder sortOrder;
+
+// private Selection selection;
+
+ private DataRange bearer;
+
+ private BearerSettings bearerSettings = null;
+
+ /**
+ * Create new {@link DataRange} - i.e. load a new data window from data
+ * base. Subclasses need to define this method - for example to get
+ * {ResultSet} from database, or ScrollableResult from hibernate.
+ *
+ * @param startRow
+ * @param endRow
+ * @param sortOrder
+ * @return
+ */
+ protected abstract DataRange createDataRange(int startRow, int endRow,
+ SortOrder sortOrder);
+
+ /**
+ * reset data range - we need to load a new one
+ *
+ */
+ public void reset() {
+ bearer = null;
+ sortOrder = null;
+// selection = null;
+ bearerSettings = null;
+ }
+
+ public void setObjectLocator(ObjectLocator objectLocator) {
+ this.objectLocator = objectLocator;
+ }
+
+ public ObjectLocator getObjectLocator() {
+ return objectLocator;
+ }
+
+ public Object getRowData() {
+ int index = getRowIndex();
+ log.debug("GridDataModel.getRowData() " + index );
+ if (index == -1) {
+ return null;
+ }
+
+ if (bearer == null && bearerSettings != null) {
+ bearer = createDataRange(bearerSettings.startRow,
+ bearerSettings.endRow, bearerSettings.sortOrder);
+ bearerSettings = null;
+ }
+
+ if (bearer == null || !bearer.hit(index)) {
+ bearer = createDataRange(index, index + 1, sortOrder);
+ }
+
+ return bearer.getRowData(index);
+ }
+
+ public void walk(final FacesContext context, final DataVisitor visitor,
+ final Range range, final Object argument) throws IOException {
+
+ int rowCount = getRowCount();
+
+ if (rowCount == 0) {
+ return;
+ }
+
+ GridRange sequenceRange = (GridRange) range;
+
+ sortOrder = sequenceRange.getSortOrder();
+
+ IterationBounds bounds = sequenceRange.getIterationBounds();
+
+ bearer = null;
+ bearerSettings = new BearerSettings(bounds.getStartRow(), bounds.getEndRow(), sortOrder);
+
+ try {
+ bounds.iterate(new IterationBounds.RowVisitor() {
+ public void visit(int rowIndex) {
+ Integer rowKey = new Integer(rowIndex);
+ try {
+ visitor.process(context, rowKey, argument);
+ } catch (IOException e) {
+ throw new IOExceptionWrapper(e);
+ }
+ }
+ });
+
+ } catch (IOExceptionWrapper e) {
+ throw e.getWrappedException();
+ }
+ }
+
+ public Object getRowKey() {
+ int rowIndex = getRowIndex();
+ if (rowIndex == -1) {
+ return null;
+ }
+ return new Integer(rowIndex);
+ }
+
+ public void setRowKey(Object key) {
+ if (key == null) {
+ setRowIndex(-1);
+ } else {
+ setRowIndex(((Integer) key).intValue());
+ }
+ }
+
+// public Collection getSelectedObjects() {
+// return SelectionExtractor.extractSelection(this);
+// }
+//
+// public void setSelection(Selection selection) {
+// this.selection = selection;
+// }
+//
+// public Selection getSelection() {
+// return selection;
+// }
+
+ public SerializableDataModel getSerializableModel(Range range) {
+ BufferedSequenceRange sequenceRange = (BufferedSequenceRange) range;
+ ObjectLocator locator = getObjectLocator();
+ if (locator != null) {
+ return new DataModelSnapshot(this, sequenceRange);
+ }
+ return super.getSerializableModel(range);
+ }
+
+ public SortOrder getSortOrder() {
+ return sortOrder;
+ }
+
+ public void setSortOrder(SortOrder sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+}
\ No newline at end of file
Modified: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SequenceRange.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SequenceRange.java 2007-05-28 18:11:47 UTC (rev 901)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SequenceRange.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -37,29 +37,29 @@
/* (non-Javadoc)
* @see com.exadel.jsf.model.GridRange#getIterationBounds(int)
*/
- public IterationBounds getIterationBounds(int rowCount) {
- int a = start, b = end;
-
- if (start > rowCount) {
- a = rowCount;
- }
-
- if (end > rowCount) {
- b = rowCount;
- }
- if (b < 0) {
- b = rowCount;
- }
-
- if (a > b) {
- int c = a;
-
- a = b;
- b = c;
- }
-
-
- return new IterationBounds(a,b);
+ public IterationBounds getIterationBounds() {
+// int a = start, b = end;
+//
+// if (start > rowCount) {
+// a = rowCount;
+// }
+//
+// if (end > rowCount) {
+// b = rowCount;
+// }
+// if (b < 0) {
+// b = rowCount;
+// }
+//
+// if (a > b) {
+// int c = a;
+//
+// a = b;
+// b = c;
+// }
+//
+//
+ return new IterationBounds(0,0);
}
}
Deleted: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SortOrder.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SortOrder.java 2007-05-28 18:11:47 UTC (rev 901)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SortOrder.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -1,72 +0,0 @@
-package org.richfaces.model;
-
-import java.io.Serializable;
-/**
- *
- * @author Maksim Kaszynski
- *
- */
-public class SortOrder implements Serializable {
-
- private static final long serialVersionUID = 2423450561570551363L;
-
- private String sortField;
-
- private boolean ascending;
-
- public SortOrder(String sortField, boolean _ascending) {
- super();
- this.sortField = sortField;
- this.ascending = _ascending;
- }
-
- public SortOrder() {
- super();
- }
-
- public boolean isAscending() {
- return ascending;
- }
-
- public void setAscending(boolean ascending) {
- this.ascending = ascending;
- }
-
- public String getSortField() {
- return sortField;
- }
-
- public void setSortField(String sortField) {
- this.sortField = sortField;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "SortOrder: {field:" + sortField + ", ascending: " + ascending
- + "}";
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj) {
-
- if (obj instanceof SortOrder) {
- SortOrder sortOrder = (SortOrder) obj;
- return sortField.equals(sortOrder.sortField)
- && ascending == sortOrder.ascending;
- }
-
- return super.equals(obj);
- }
-
- public int hashCode() {
- int c = sortField.hashCode();
- if (ascending) {
- c = -c;
- }
- return c;
- }
-}
\ No newline at end of file
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SortOrder.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SortOrder.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SortOrder.java 2007-05-28 18:12:02 UTC (rev 902)
@@ -0,0 +1,82 @@
+package org.richfaces.model;
+
+import java.io.Serializable;
+/**
+ *
+ * @author Maksim Kaszynski
+ *
+ *
+ */
+public class SortOrder implements Serializable {
+
+ private static final long serialVersionUID = 2423450561570551363L;
+
+ private boolean ascending;
+
+ private int sortColumn = -1;
+
+ private int startRow = -1;
+
+ private int dataIndex = -1;
+
+
+ public SortOrder( int sortColumn, int startRow, int dataIndex, boolean ascending) {
+ super();
+ this.sortColumn = sortColumn;
+ this.ascending = ascending;
+ this.startRow = startRow;
+ this.dataIndex = dataIndex;
+ }
+
+ public SortOrder() {
+ super();
+ }
+
+ public boolean isAscending() {
+ return ascending;
+ }
+
+ public void setAscending(boolean ascending) {
+ this.ascending = ascending;
+ }
+
+ public int getSortColumn() {
+ return sortColumn;
+ }
+
+ public void setSortColumn(int sortColumn) {
+ this.sortColumn = sortColumn;
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return "SortOrder: {field:" + sortColumn + ", ascending: " + ascending
+ + "}";
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+
+ if (obj instanceof SortOrder) {
+ SortOrder sortOrder = (SortOrder) obj;
+ return sortColumn == sortOrder.sortColumn
+ && startRow == sortOrder.startRow
+ && dataIndex == sortOrder.dataIndex
+ && ascending == sortOrder.ascending;
+
+ }
+ return super.equals(obj);
+ }
+
+ public int hashCode() {
+ int c = (new Integer(sortColumn)).hashCode();
+ if (ascending) {
+ c = -c;
+ }
+ return c;
+ }
+}
\ No newline at end of file
17 years, 7 months
JBoss Rich Faces SVN: r901 - in trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model: cashe and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:11:47 -0400 (Mon, 28 May 2007)
New Revision: 901
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/cashe/
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/cashe/DataGridCache.java
Log:
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/cashe/DataGridCache.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/cashe/DataGridCache.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/cashe/DataGridCache.java 2007-05-28 18:11:47 UTC (rev 901)
@@ -0,0 +1,158 @@
+/*
+ * Copyright
+ * Copyright (c) Exadel,Inc. 2007
+ * All rights reserved.
+ *
+ * History
+ * $Source: /cvs-master/intralinks-jsf-comps/components/data-view-grid/src/component/com/exadel/jsf/model/cache/DataGridCache.java,v $
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.model.cashe;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.DataModelListener;
+
+import org.ajax4jsf.ajax.repeat.DataVisitor;
+import org.ajax4jsf.ajax.repeat.Range;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.model.DataRange;
+import org.richfaces.model.ScrollableGridDataModel2;
+import org.richfaces.model.SortOrder;
+import org.richfaces.model.snapshot.ObjectLocator;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class DataGridCache extends ScrollableGridDataModel2 {
+
+ private final static Log log = LogFactory.getLog(DataGridCache.class);
+
+ private ScrollableGridDataModel2 dataModel;
+ private Map cache = new HashMap();
+
+ public DataGridCache(ScrollableGridDataModel2 model) {
+ dataModel = model;
+ }
+
+ public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) throws IOException {
+ dataModel.walk(context, visitor, range, argument);
+ }
+
+ /**
+ * @see com.exadel.jsf.model.ScrollableGridDataModel2#createDataRange(int, int, com.exadel.jsf.model.SortOrder)
+ */
+ protected DataRange createDataRange(int startRow, int endRow,
+ SortOrder sortOrder) {
+ return null;
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#getRowCount()
+ */
+ public int getRowCount() {
+ return dataModel.getRowCount();
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#getRowIndex()
+ */
+ public int getRowIndex() {
+ return dataModel.getRowIndex();
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#getWrappedData()
+ */
+ public Object getWrappedData() {
+ return dataModel;
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#isRowAvailable()
+ */
+ public boolean isRowAvailable() {
+ return dataModel.isRowAvailable();
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#setRowIndex(int)
+ */
+ public void setRowIndex(int rowIndex) {
+ dataModel.setRowIndex(rowIndex);
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
+ */
+ public void setWrappedData(Object data) {
+ dataModel = (ScrollableGridDataModel2) data;
+ }
+
+ public ObjectLocator getObjectLocator() {
+ return dataModel.getObjectLocator();
+ }
+
+ public Object getRowData() {
+ Object rowKey = getRowKey();
+ Object data = null;
+ if (rowKey != null) {
+ data = cache.get(rowKey);
+ if (data == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("DataGridCache.getRowData() - cache miss: rowKey " + rowKey);
+ }
+ data = dataModel.getRowData();
+ cache.put(rowKey, data);
+ } else {
+ log.debug("DataGridCache.getRowData() - cache hit: rowKey " + rowKey);
+ }
+ } else {
+ log.debug("DataGridCache.getRowData() rowKey is null");
+ }
+ return data;
+ }
+
+ public Object getRowKey() {
+ return dataModel.getRowKey();
+ }
+
+// public Collection getSelectedObjects() {
+// return dataModel.getSelectedObjects();
+// }
+
+// public Selection getSelection() {
+// return dataModel.getSelection();
+// }
+
+ public void removeDataModelListener(DataModelListener listener) {
+ dataModel.removeDataModelListener(listener);
+ }
+
+ public void reset() {
+ dataModel.reset();
+ }
+
+ public void setObjectLocator(ObjectLocator objectLocator) {
+ dataModel.setObjectLocator(objectLocator);
+ }
+
+ public void setRowKey(Object key) {
+ dataModel.setRowKey(key);
+ }
+
+// public void setSelection(Selection selection) {
+// dataModel.setSelection(selection);
+// }
+
+
+}
17 years, 7 months
JBoss Rich Faces SVN: r900 - in trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model: impl and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:11:36 -0400 (Mon, 28 May 2007)
New Revision: 900
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataModelExt.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataRange.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataModelExt.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataRange.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/PropertyResolverComparator.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/SequenceDataModelExt.java
Log:
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataModelExt.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataModelExt.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataModelExt.java 2007-05-28 18:11:36 UTC (rev 900)
@@ -0,0 +1,82 @@
+/*
+ * 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/impl/ArrayDataModelExt.java,v $
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.model.impl;
+
+import java.util.Arrays;
+
+import org.richfaces.model.DataRange;
+import org.richfaces.model.SortOrder;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ArrayDataModelExt extends SequenceDataModelExt {
+
+ private Object [] wrappedData;
+ private int rowIndex;
+ public ArrayDataModelExt(Object [] array) {
+ wrappedData = array;
+ }
+
+ protected DataRange createDataRange(int startRow, int endRow,
+ SortOrder sortOrder) {
+
+ if (sortOrder != null && sortOrder.getSortColumn() != -1) {
+ Arrays.sort(wrappedData, getComparator(sortOrder)) ;
+ }
+
+ return new ArrayDataRange(0, getRowCount(), sortOrder, wrappedData);
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#getRowCount()
+ */
+ public int getRowCount() {
+ return wrappedData.length;
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#getRowIndex()
+ */
+ public int getRowIndex() {
+ return rowIndex;
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#getWrappedData()
+ */
+ public Object getWrappedData() {
+ return wrappedData;
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#isRowAvailable()
+ */
+ public boolean isRowAvailable() {
+ return rowIndex < wrappedData.length;
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#setRowIndex(int)
+ */
+ public void setRowIndex(int rowIndex) {
+ this.rowIndex = rowIndex;
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
+ */
+ public void setWrappedData(Object data) {
+ wrappedData = (Object[]) data;
+ }
+
+}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataRange.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataRange.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataRange.java 2007-05-28 18:11:36 UTC (rev 900)
@@ -0,0 +1,45 @@
+/*
+ * 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/impl/ArrayDataRange.java,v $
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.model.impl;
+
+import org.richfaces.model.DataRange;
+import org.richfaces.model.SortOrder;
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ArrayDataRange extends DataRange {
+
+ private Object [] wrapped;
+
+ /**
+ * @param startRow
+ * @param endRow
+ * @param sortOrder
+ * @param wrappedData
+ */
+ public ArrayDataRange(int startRow, int endRow, SortOrder sortOrder,
+ Object [] wrappedData) {
+ super(startRow, endRow, sortOrder);
+ wrapped = wrappedData;
+ }
+
+ /**
+ * @see com.exadel.jsf.model.DataRange#getRowData(int)
+ */
+ public Object getRowData(int index) {
+ // TODO Auto-generated method stub
+ return ((Object[]) wrapped)[index];
+ }
+
+}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataModelExt.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataModelExt.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataModelExt.java 2007-05-28 18:11:36 UTC (rev 900)
@@ -0,0 +1,69 @@
+/*
+ * 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/impl/ListDataModelExt.java,v $
+ * $Revision: 1.5 $
+ */
+
+package org.richfaces.model.impl;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.richfaces.model.DataRange;
+import org.richfaces.model.SortOrder;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ListDataModelExt extends SequenceDataModelExt {
+ private List wrappedData;
+ private int rowIndex;
+
+ public ListDataModelExt(List wrappedData) {
+ this.wrappedData = wrappedData;
+ }
+
+ protected DataRange createDataRange(int startRow, int endRow, SortOrder sortOrder) {
+ List wrapped = (List) getWrappedData();
+ boolean shouldSort = sortOrder != null && sortOrder.getSortColumn() != -1;
+ if (shouldSort) {
+ Comparator comparator = getComparator(sortOrder);
+ if (comparator != null) {
+ Collections.sort(wrapped, comparator);
+ }
+ }
+ return new ListDataRange(0, getRowCount(), sortOrder, wrapped);
+ }
+
+ public int getRowCount() {
+ return wrappedData.size();
+ }
+
+ public int getRowIndex() {
+ return rowIndex;
+ }
+
+ public Object getWrappedData() {
+ return wrappedData;
+ }
+
+ public boolean isRowAvailable() {
+ return rowIndex < wrappedData.size();
+ }
+
+ public void setRowIndex(int rowIndex) {
+ this.rowIndex = rowIndex;
+ }
+
+ public void setWrappedData(Object data) {
+ wrappedData = (List) data;
+ }
+}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataRange.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataRange.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataRange.java 2007-05-28 18:11:36 UTC (rev 900)
@@ -0,0 +1,56 @@
+/*
+ * 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/impl/ListDataRange.java,v $
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.model.impl;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.richfaces.model.DataRange;
+import org.richfaces.model.SortOrder;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ListDataRange extends DataRange {
+
+ private int lastIndex = -1;;
+ private transient Iterator wrappedIterator;
+ private List list;
+ /**
+ * @param startRow
+ * @param endRow
+ * @param sortOrder
+ * @param wrappedData
+ */
+ public ListDataRange(int startRow, int endRow, SortOrder sortOrder, List wrappedData) {
+ super(startRow, endRow, sortOrder);
+ list = wrappedData;
+ }
+
+ /**
+ * @see com.exadel.jsf.model.DataRange#getRowData(int)
+ */
+ public Object getRowData(int index) {
+
+ if (index >= 0 && index - lastIndex == 1 && wrappedIterator != null) {
+
+ } else {
+ wrappedIterator = list.listIterator(index);
+ }
+
+ lastIndex = index;
+ return wrappedIterator.next();
+ }
+
+}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/PropertyResolverComparator.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/PropertyResolverComparator.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/PropertyResolverComparator.java 2007-05-28 18:11:36 UTC (rev 900)
@@ -0,0 +1,84 @@
+/*
+ * 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/impl/PropertyResolverComparator.java,v $
+ * $Revision: 1.2 $
+ */
+
+package org.richfaces.model.impl;
+
+import java.util.Comparator;
+
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+import javax.faces.el.EvaluationException;
+import javax.faces.el.PropertyResolver;
+
+import org.richfaces.model.SortOrder;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class PropertyResolverComparator implements Comparator {
+
+ private PropertyResolver resolver;
+
+ private SortOrder sortOrder;
+
+ public PropertyResolverComparator(SortOrder sortOrder) {
+ ApplicationFactory factory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
+ Application application = factory.getApplication();
+ resolver = application.getPropertyResolver();
+ this.sortOrder = sortOrder;
+ }
+
+ public int compare(Object arg0, Object arg1) {
+ int result = 0;
+ Object prop1 = null;
+
+ try {
+ prop1 = resolver.getValue(arg0, sortOrder.getSortColumn());
+ } catch (EvaluationException e) {
+ //prop1 remains null
+ }
+
+ Object prop2 = null;
+
+ try {
+ prop2 = resolver.getValue(arg1, sortOrder.getSortColumn());
+ } catch (EvaluationException e) {
+ //prop1 remains null
+ }
+
+ if (prop1 == null) {
+ if (prop2 == null) {
+ result = 0;
+ } else {
+ result = -1;
+ }
+ } else {
+ if (prop2 == null) {
+ result = 1;
+ } else {
+ if (prop1 instanceof Comparable && prop2 instanceof Comparable) {
+ result = ((Comparable) prop1).compareTo(prop2);
+ } else {
+ result = prop1.toString().compareTo(prop2.toString());
+ }
+
+ }
+ }
+ if (!sortOrder.isAscending()) {
+ result = -result;
+ }
+ return result;
+ }
+
+}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/SequenceDataModelExt.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/SequenceDataModelExt.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/SequenceDataModelExt.java 2007-05-28 18:11:36 UTC (rev 900)
@@ -0,0 +1,64 @@
+/*
+ * 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/impl/SequenceDataModelExt.java,v $
+ * $Revision: 1.4 $
+ */
+
+package org.richfaces.model.impl;
+
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.richfaces.model.ScrollableGridDataModel2;
+import org.richfaces.model.SortOrder;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public abstract class SequenceDataModelExt extends ScrollableGridDataModel2 {
+
+ private transient Map comparators;
+
+
+ /**
+ *
+ */
+ public SequenceDataModelExt() {
+ super();
+ }
+
+ protected Comparator getComparator(SortOrder sortOrder) {
+ Comparator comp = (Comparator) getComparators().get(sortOrder);
+ if (comp == null) {
+ comp = createComparator(sortOrder);
+ }
+
+ if (comp != null) {
+ getComparators().put(sortOrder, comp);
+ }
+
+ return comp;
+ }
+
+ protected Comparator createComparator(SortOrder sortOrder) {
+ return new PropertyResolverComparator(sortOrder);
+ }
+
+ protected Map getComparators() {
+ if (comparators == null) {
+ comparators = new HashMap();
+
+ }
+ return comparators;
+ }
+
+
+}
\ No newline at end of file
17 years, 7 months
JBoss Rich Faces SVN: r899 - in trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model: snapshot and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-05-28 14:11:25 -0400 (Mon, 28 May 2007)
New Revision: 899
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/DataModelSnapshot.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/ObjectLocator.java
Log:
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/DataModelSnapshot.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/DataModelSnapshot.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/DataModelSnapshot.java 2007-05-28 18:11:25 UTC (rev 899)
@@ -0,0 +1,274 @@
+/*
+ * 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/snapshot/DataModelSnapshot.java,v $
+ * $Revision: 1.14 $
+ */
+
+package org.richfaces.model.snapshot;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.ajax.repeat.DataVisitor;
+import org.ajax4jsf.ajax.repeat.Range;
+import org.ajax4jsf.ajax.repeat.SerializableDataModel;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.richfaces.model.BufferedSequenceRange;
+import org.richfaces.model.ScrollableGridDataModel2;
+import org.richfaces.model.GridDataModelFeatures;
+import org.richfaces.model.GridRange;
+import org.richfaces.model.IOExceptionWrapper;
+import org.richfaces.model.IterationBounds;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class DataModelSnapshot extends SerializableDataModel implements
+ GridDataModelFeatures {
+
+ private static final Log log = LogFactory.getLog(DataModelSnapshot.class);
+
+ private static final long serialVersionUID = -4868285117998717494L;
+
+ private int rowIndex;
+
+ private IterationBounds bounds;
+
+ private int rowCount;
+
+ private Serializable[] keys;
+
+ private transient ObjectLocator locator;
+
+ private transient Object dataObjects[];
+
+// private transient Selection selection;
+
+ public DataModelSnapshot() {
+ }
+
+ public DataModelSnapshot(final ScrollableGridDataModel2 model,
+ BufferedSequenceRange range) {
+
+ locator = model.getObjectLocator();
+
+ if (locator == null) {
+ throw new NullPointerException("Object Locator can not be null");
+ }
+
+
+ rowCount = model.getRowCount();
+
+ bounds = range.getIterationBounds();
+
+ //keys = new Serializable[bounds.size()];
+ final List kiz = new ArrayList();
+
+ try {
+ model.walk(FacesContext.getCurrentInstance(), new DataVisitor() {
+ public void process(FacesContext context, Object rowKey, Object argument) throws IOException {
+ model.setRowKey(rowKey);
+ Object data = model.getRowData();
+ Serializable key = locator.getObjectId(data);
+ kiz.add(key);
+ }
+ },
+ range,
+ null);
+ } catch (IOException e) {
+ log.error("Failed to initialize data cache", e);
+ }
+
+ keys = (Serializable[]) kiz.toArray(new Serializable[kiz.size()]);
+
+ }
+
+ public ObjectLocator getObjectLocator() {
+ return locator;
+ }
+
+ public int getRowCount() {
+ return rowCount;
+ }
+
+ public Object getRowData() {
+ int indx = getRowIndex() - bounds.getStartRow();
+ if (dataObjects != null && indx >= 0 && indx < dataObjects.length) {
+ if(log.isDebugEnabled()) {
+ log.debug("Found data " + indx);
+ }
+ return dataObjects[indx];
+ }
+ if(log.isDebugEnabled()) {
+ log.debug("No data loaded " + indx );
+ }
+ return null;
+ }
+
+ public int getRowIndex() {
+ return rowIndex;
+ }
+
+ public Object getRowKey() {
+ int index = getRowIndex();
+ if (index == -1) {
+ return null;
+ }
+
+ return new Integer(index);
+ }
+
+ public Collection getSelectedObjects() {
+// initStorage();
+// return SelectionExtractor.extractSelection(this);
+ return null;
+ }
+//
+// public Selection getSelection() {
+// return selection;
+// }
+
+ /**
+ * @see org.ajax4jsf.ajax.repeat.ExtendedDataModel#getSerializableModel(org.ajax4jsf.ajax.repeat.Range)
+ */
+ public SerializableDataModel getSerializableModel(Range range) {
+ return null;
+ }
+
+ public Object getWrappedData() {
+ return dataObjects;
+ }
+
+ private void initStorage() {
+ if (dataObjects == null && locator != null) {
+ if (keys == null) {
+ log.error("No identifiers were stored - where are they?");
+ return;
+ }
+ List keyz = Arrays.asList(keys);
+ Collection objectz = locator.findObjects(keyz);
+ Map objectMapping = new HashMap();
+ for (Iterator iter = objectz.iterator(); iter.hasNext();) {
+ Object dataObject = iter.next();
+ Serializable key = locator.getObjectId(dataObject);
+ if (key != null) {
+ objectMapping.put(key, dataObject);
+ }
+ }
+ dataObjects = new Object[keys.length];
+ for (int i = 0; i < keys.length; i++) {
+ dataObjects[i] = objectMapping.get(keys[i]);
+ }
+ }
+ }
+
+ /**
+ * @see javax.faces.model.DataModel#isRowAvailable()
+ */
+ public boolean isRowAvailable() {
+ return bounds.within(rowIndex);
+ }
+
+ /**
+ * @see com.exadel.jsf.model.BufferedSequenceModel#reset()
+ */
+ public void reset() {
+// selection = null;
+ locator = null;
+ }
+
+ public void setObjectLocator(ObjectLocator locator) {
+ this.locator = locator;
+ }
+
+ public void setRowCount(int rowCount) {
+ this.rowCount = rowCount;
+ }
+
+ public void setRowIndex(int rowIndex) {
+ this.rowIndex = rowIndex;
+ }
+
+ public void setRowKey(Object key) {
+ if (key == null) {
+ setRowIndex(-1);
+ } else {
+ setRowIndex(((Integer) key).intValue());
+ }
+
+ }
+
+// public void setSelection(Selection selection) {
+// this.selection = selection;
+// //new Throwable().printStackTrace();
+// }
+
+ /**
+ * @see javax.faces.model.DataModel#setWrappedData(java.lang.Object)
+ */
+ public void setWrappedData(Object data) {
+ dataObjects = (Object[]) data;
+ }
+
+ public void update() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void walk(final FacesContext context, final DataVisitor visitor,
+ Range range, Object argument) throws IOException {
+
+ log.debug("DataModelSnapshot.walk()");
+
+ if (rowCount == 0) {
+ return;
+ }
+
+ GridRange sequenceRange = (GridRange) range;
+
+ if (sequenceRange instanceof BufferedSequenceRange && ((BufferedSequenceRange) sequenceRange).isReadOnly()) {
+
+ } else {
+ initStorage();
+ }
+
+ IterationBounds bounds = sequenceRange.getIterationBounds();
+
+ try {
+
+ bounds.iterate(new IterationBounds.RowVisitor() {
+
+ public void visit(int rowIndex) {
+ Integer rowKey = new Integer(rowIndex);
+ try {
+ visitor.process(context, rowKey, rowKey);
+ } catch (IOException e) {
+ throw new IOExceptionWrapper(e);
+ }
+ }
+
+ });
+ } catch (IOExceptionWrapper e) {
+ throw e.getWrappedException();
+ }
+
+ }
+
+}
Added: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/ObjectLocator.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/ObjectLocator.java (rev 0)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/ObjectLocator.java 2007-05-28 18:11:25 UTC (rev 899)
@@ -0,0 +1,37 @@
+/*
+ * 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/snapshot/ObjectLocator.java,v $
+ * $Revision: 1.3 $
+ */
+
+package org.richfaces.model.snapshot;
+
+import java.io.Serializable;
+import java.util.Collection;
+
+/**
+ * Base interface for data locator object responsible
+ * for both getting Identifiers from objects and finding objects by their identifiers.
+ * <li>Identifiers must be {@link Serializable}</li>
+ * @author Maksim Kaszynski
+ */
+public interface ObjectLocator {
+
+ /**
+ * get identifier from specific object.
+ * @param object
+ * @return
+ */
+ public Serializable getObjectId(Object object);
+
+ /**
+ * find objects by their identifiers.
+ * @param ids
+ * @return
+ */
+ public Collection findObjects(Collection ids);
+}
17 years, 7 months
JBoss Rich Faces SVN: r898 - in trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model: visual and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
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
17 years, 7 months