Author: maksimkaszynski
Date: 2007-06-14 13:20:40 -0400 (Thu, 14 Jun 2007)
New Revision: 1190
Added:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java
Removed:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel.java
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/SelectionBean.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/BufferedSequenceRange.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataRange.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/Entity.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModelFeatures.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridRange.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.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
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/SequenceDataModelExt.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/snapshot/
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel2.java
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java
Log:
removed most of intralinks legacy code
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-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/component/UIScrollableGrid.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -7,7 +7,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-import java.util.List;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -27,13 +26,10 @@
import org.apache.commons.collections.iterators.IteratorChain;
import org.richfaces.event.scroll.ScrollEvent;
import org.richfaces.event.sort.SortEvent;
-import org.richfaces.model.BufferedSequenceRange;
+import org.richfaces.model.ScrollableGridRange;
import org.richfaces.model.DataModelCache;
import org.richfaces.model.GridDataModel;
-import org.richfaces.model.ScrollableGridDataModel;
import org.richfaces.model.SortOrder;
-import org.richfaces.model.impl.ArrayDataModelExt;
-import org.richfaces.model.impl.ListDataModelExt;
@@ -104,34 +100,19 @@
rows = -1;
}
- BufferedSequenceRange range = new BufferedSequenceRange(curentRow,rows);
- range.setSortOrder(getSortOrder());
-
- return range;
+ return new ScrollableGridRange(curentRow,rows, getSortOrder());
}
};
}
protected ExtendedDataModel createDataModel() {
- ScrollableGridDataModel model = null;
Object value = getValue();
if (value instanceof GridDataModel) {
return new DataModelCache((GridDataModel) value);
}
- if (value instanceof ScrollableGridDataModel) {
- ScrollableGridDataModel dataModel = (ScrollableGridDataModel) value;
- model = dataModel;
- } else if (value instanceof List) {
- model = new ListDataModelExt((List)value);
- } else if (value instanceof Object []) {
- model = new ArrayDataModelExt((Object[]) value);
- } else {
- model = new ArrayDataModelExt(new Object[]{value});
- }
-
- return model;
+ return null;
}
Deleted:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/BufferedSequenceRange.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/BufferedSequenceRange.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/BufferedSequenceRange.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,67 +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/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/DataModelCache.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataModelCache.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -18,6 +18,8 @@
import org.apache.commons.logging.LogFactory;
/**
+ * Implementation stores last loaded data, so no additional requests to db will be
performed
+ * Acts as a proxy between the component and original data model
* @author Maksim Kaszynski
*
*/
@@ -64,6 +66,7 @@
private GridDataModel gridDataModel;
+ private int rowCount = Integer.MIN_VALUE;
public DataModelCache(GridDataModel gridDataModel) {
super();
@@ -87,7 +90,8 @@
if (log.isDebugEnabled()) {
log.debug("Trying to get object by id" + id);
}
-
+ //First try to find data in inner cache
+ //If not fo9und - get it from original model
Object cached = secondaryMapping.get(id);
if (cached == null) {
@@ -109,7 +113,10 @@
}
public int getRowCount() {
- return gridDataModel.getRowCount();
+ if (rowCount == Integer.MIN_VALUE) {
+ rowCount = gridDataModel.getRowCount();
+ }
+ return rowCount;
}
public Object getRowData() {
Deleted: 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-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/DataRange.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,76 +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/DataRange.java,v
$
- * $Revision: 1.5 $
- */
-
-package org.richfaces.model;
-
-
-/**
- * Data window wrapper.
- * Instance should be able to access any object within current data window.
- * Subclasses can be built around any data source, (e.g. ResultSet, ScrollableResult or
simple List).
- *
- *
- * @author Maksim Kaszynski
- *
- */
-public abstract class DataRange {
- private SortOrder sortOrder;
- private int startRow;
- private int endRow;
-
- /**
- * Construct a DataRange object.
- * @param startRow
- * @param endRow
- * @param sortOrder
- */
- public DataRange(int startRow, int endRow, SortOrder sortOrder) {
- super();
- this.sortOrder = sortOrder;
- this.startRow = startRow;
- this.endRow = endRow;
- }
- /**
- * @return the endRow
- */
- public int getEndRow() {
- return endRow;
- }
- /**
- * @return the sortOrder
- */
- public SortOrder getSortOrder() {
- return sortOrder;
- }
- /**
- * @return the startRow
- */
- public int getStartRow() {
- return startRow;
- }
-
- /**
- * test if specified absolute index lies within this data range
- * @param index
- * @return
- */
- public boolean hit(int index) {
- return index >= startRow && index < endRow;
- }
-
- /**
- * Implementations should define this method to get object at given absolute position.
- *
- * @param index - absolute index of record within entire recordset, NOT relative to the
start of data range.
- * @return object at given position within whole recordset.
- */
- public abstract Object getRowData(int index);
-
-}
Deleted: trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/Entity.java
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/Entity.java 2007-06-14
17:08:16 UTC (rev 1189)
+++ trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/Entity.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,13 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public interface Entity {
- public Object getId();
-}
Modified:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModel.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -18,11 +18,22 @@
import org.apache.commons.logging.LogFactory;
/**
+ * Base class for data models
+ * Subclasses must implement {@link #loadData(int, int, SortOrder)}
+ * For certain features (like selection and sorting) to work correctly together,
+ * {@link #getId(Object)} and {@link #getObjectById(Object)}
+ * methods need to be overriden
+ *
* @author Maksim Kaszynski
*
*/
public abstract class GridDataModel extends ExtendedDataModel {
-
+
+ /**
+ * Simple implementation - index-based row key
+ * @author Maksim Kaszynski
+ *
+ */
private static class SimpleRowKey implements Serializable{
private static final long serialVersionUID = 1L;
@@ -51,14 +62,20 @@
private SortOrder lastSortOrder;
- public Object getRowKey() {
- return rowKey;
- }
+ /**
+ * Load range of data items from the source.
+ * Starting from startRow, and up to but excluding endRow
+ * @param startRow
+ * @param endRow
+ * @param sortOrder
+ * @return list of ordered data
+ */
+ public abstract List loadData(int startRow, int endRow, SortOrder sortOrder);
- public void setRowKey(Object key) {
- rowKey = key;
- }
-
+
+ /**
+ * Load data range, and iterate over it
+ */
public void walk(FacesContext context, DataVisitor visitor, Range range,
Object argument) throws IOException {
@@ -66,7 +83,7 @@
log.trace("Starting walk");
}
- BufferedSequenceRange sequenceRange = (BufferedSequenceRange) range;
+ ScrollableGridRange sequenceRange = (ScrollableGridRange) range;
int startIndex = sequenceRange.getFirst();
int last = sequenceRange.getLast();
@@ -97,18 +114,10 @@
}
- /**
- * Load range of data items from the source
- * @param startRow
- * @param endRow
- * @param sortOrder
- * @return
- */
- public abstract List loadData(int startRow, int endRow, SortOrder sortOrder);
/**
- * This method is the reverse of getObjectId
- * Default implementation returns null anyway
+ * This method is the reverse of {@link #getId(Object)}
+ * If you override this method, you need to override {@link #getId(Object)} as well
* @param id
* @return
*/
@@ -130,6 +139,8 @@
* To get rid of Entity interface, method is introduced
* Implementations may override it to provide domain-specific searches
* Id should be serializable
+ * Default implementation returns <code>null</code> anyway
+ * If you override this method, you need to override {@link #getObjectById(Object)} as
well
* @param o
* @return
*/
@@ -138,22 +149,6 @@
}
- private Object loadAndMap(Object id) {
-
- if (log.isTraceEnabled()) {
- log.trace("loadAndMap " + id);
- }
-
- Object o = getObjectById(id);
- if (o != null) {
- if (mapping == null) {
- mapping = new HashMap();
- }
- mapping.put(id, o);
- }
- return o;
- }
-
public Object getRowData() {
if (mapping != null && mapping.containsKey(rowKey)) {
@@ -164,17 +159,50 @@
}
+ /**
+ * Row indexes navigation is no longer supported
+ */
public int getRowIndex() {
throw new UnsupportedOperationException("getRowIndex");
}
-
+
+ /**
+ * Quite simple implementation - data will be cached, so the call will be cheap
+ */
public boolean isRowAvailable() {
return getRowData() != null;
}
+ /**
+ * Row indexes navigation is no longer supported
+ */
public void setRowIndex(int arg0) {
throw new UnsupportedOperationException("setRowIndex");
}
+ public Object getRowKey() {
+ return rowKey;
+ }
+ public void setRowKey(Object key) {
+ rowKey = key;
+ }
+
+ private Object loadAndMap(Object id) {
+
+ if (log.isTraceEnabled()) {
+ log.trace("loadAndMap " + id);
+ }
+
+ Object o = getObjectById(id);
+ if (o != null) {
+ if (mapping == null) {
+ mapping = new HashMap();
+ }
+ mapping.put(id, o);
+ }
+ return o;
+ }
+
+
}
Deleted:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModelFeatures.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModelFeatures.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridDataModelFeatures.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,17 +0,0 @@
-package org.richfaces.model;
-
-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();
-
-}
Deleted: 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-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridRange.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,26 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-import org.ajax4jsf.ajax.repeat.Range;
-
-/**
- * @author maksim
- * @modidied by Anton Belevich
- *
- */
-public abstract class GridRange implements Range {
-
- private SortOrder sortOrder;
-
- public abstract IterationBounds getIterationBounds();
-
- public SortOrder getSortOrder() {
- return sortOrder;
- }
-
- public void setSortOrder(SortOrder sortOrder) {
- this.sortOrder = sortOrder;
- }
-}
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-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/IterationBounds.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,62 +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() {
- return "[" + startRow + "," + endRow + "]";
- }
-}
\ No newline at end of file
Deleted:
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-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridDataModel.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,196 +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/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 ScrollableGridDataModel extends ExtendedDataModel implements
- GridDataModelFeatures {
-
- private static final Log log = LogFactory.getLog(ScrollableGridDataModel.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 SerializableDataModel getSerializableModel(Range range) {
- BufferedSequenceRange sequenceRange = (BufferedSequenceRange) range;
- ObjectLocator locator = getObjectLocator();
- if (locator != null) {
- return new DataModelSnapshot(this, sequenceRange);
- }
- return super.getSerializableModel(range);
- }
-
-}
\ No newline at end of file
Copied:
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java
(from rev 1186,
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/GridRange.java)
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java
(rev 0)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/ScrollableGridRange.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -0,0 +1,66 @@
+/*
+ * 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/ScrollableGridRange.java,v
$
+ * $Revision: 1.7 $
+ */
+
+package org.richfaces.model;
+
+import org.ajax4jsf.ajax.repeat.Range;
+
+
+
+/**
+ * @author Maksim Kaszynski
+ * @modified by Anton Belevich
+ */
+public class ScrollableGridRange implements Range{
+
+ private int first = 0;
+ private int last = 0;
+ private SortOrder sortOrder;
+
+ public ScrollableGridRange(int first, int last, SortOrder sortOrder) {
+ super();
+ this.first = first;
+ this.last = last;
+ this.sortOrder = sortOrder;
+ }
+
+ /**
+ * @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;
+ }
+
+ public SortOrder getSortOrder() {
+ return sortOrder;
+ }
+
+ public void setSortOrder(SortOrder sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+}
Deleted:
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-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/SequenceRange.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,65 +0,0 @@
-/**
- *
- */
-package org.richfaces.model;
-
-/**
- * @author maksim
- *
- */
-public class SequenceRange extends GridRange {
-
- private int start;
- private int end;
-
- public SequenceRange(int start, int end) {
- super();
- this.start = start;
- this.end = end;
- }
-
- public int getStart() {
- return start;
- }
-
- public void setStart(int start) {
- this.start = start;
- }
-
- public int getEnd() {
- return end;
- }
-
- public void setEnd(int end) {
- this.end = end;
- }
-
- /* (non-Javadoc)
- * @see com.exadel.jsf.model.GridRange#getIterationBounds(int)
- */
- 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/impl/ArrayDataModelExt.java
===================================================================
---
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataModelExt.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataModelExt.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,82 +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/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;
- }
-
-}
Deleted:
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 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ArrayDataRange.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,45 +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/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];
- }
-
-}
Deleted:
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 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataModelExt.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,69 +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/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;
- }
-}
Deleted:
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 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/ListDataRange.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,56 +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/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();
- }
-
-}
Deleted:
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 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox/scrollable-grid/src/main/java/org/richfaces/model/impl/SequenceDataModelExt.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,64 +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/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.ScrollableGridDataModel;
-import org.richfaces.model.SortOrder;
-
-
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public abstract class SequenceDataModelExt extends ScrollableGridDataModel {
-
- 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
Deleted:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel.java
===================================================================
---
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,171 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/bean/ChannelDataModel.java,v
$
- * $Revision: 1.4 $
- */
-
-package org.richfaces.demo.datagrid.bean;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.richfaces.demo.datagrid.model.Channel;
-import org.richfaces.demo.datagrid.model.Issue;
-import org.richfaces.model.DataRange;
-import org.richfaces.model.ScrollableGridDataModel;
-import org.richfaces.model.SortOrder;
-import org.richfaces.model.snapshot.ObjectLocator;
-
-/**
- * Example data model. Uses {@link Channel} instance as data storage
- *
- * @author Maksim Kaszynski
- *
- */
-public class ChannelDataModel extends ScrollableGridDataModel {
-
- /**
- * Data range implementation. Wraps query result
- * @author Maksim Kaszynski
- *
- */
- public static class ChannelDataRange extends DataRange {
-
- private List <Issue> window;
-
- public ChannelDataRange(int startRow, int endRow, SortOrder sortOrder, List
<Issue> window) {
- super(startRow, endRow, sortOrder);
- this.window = window;
- }
-
- /**
- * get loaded object
- * @see com.exadel.jsf.model.DataRange#getRowData(int)
- */
- @Override
- public Object getRowData(int index) {
- return window.get(index - getStartRow());
- }
- }
-
- /**
- * Minimize LIST queries. Locate objects by their IDs
- * @author Maksim Kaszynski
- *
- */
- public class IssueLocator implements ObjectLocator {
-
- public Collection findObjects(Collection ids) {
- System.out.println("IssueLocator.findObjects()" + ids);
-
- //sort of find by ids
- List <Issue> issues = new ArrayList<Issue>(ids.size());
- for (Object key : ids) {
- Integer id = (Integer) key;
- Issue issue = getChannel().findById(id);
- issues.add(issue);
- }
-
- return issues;
- }
-
- public Serializable getObjectId(Object object) {
- Issue issue = (Issue) object;
- Integer id = issue.getIndex();
- return id;
- }
-
- }
-
- private ObjectLocator objectLocator = new IssueLocator();
- private Channel channel;
- private int rowIndex;
-
- /**
- * Load part of channel.
- */
- @Override
- protected DataRange createDataRange(int startRow, int endRow,
- SortOrder sortOrder) {
- //access storage to get data
- List <Issue> window = getChannel().executeQuery(startRow, endRow, sortOrder);
- System.out.println("ChannelDataModel.createDataRange()");
- return new ChannelDataRange(startRow, endRow, sortOrder, window);
- }
-
- /**
- * @see javax.faces.model.DataModel#getRowCount()
- */
- @Override
- public int getRowCount() {
- return getChannel().size();
- }
-
-
- @Override
- public Object getWrappedData() {
- return getChannel();
- }
-
- /**
- * @see javax.faces.model.DataModel#isRowAvailable()
- */
- @Override
- public boolean isRowAvailable() {
- return rowIndex < getRowCount();
- }
-
- @Override
- public void setWrappedData(Object data) {
- setChannel((Channel) data);
- }
-
- /**
- * @return the channel
- */
- public Channel getChannel() {
- return channel;
- }
-
- /**
- * @param channel the channel to set
- */
- public void setChannel(Channel channel) {
- this.channel = channel;
- }
-
- /**
- * @return the rowIndex
- */
- public int getRowIndex() {
- return rowIndex;
- }
-
- /**
- * @param rowIndex the rowIndex to set
- */
- public void setRowIndex(int rowIndex) {
- this.rowIndex = rowIndex;
- }
-
- /**
- * @return the objectLocator
- */
- public ObjectLocator getObjectLocator() {
- return objectLocator;
- }
-
- /**
- * @param objectLocator the objectLocator to set
- */
- public void setObjectLocator(ObjectLocator objectLocator) {
- this.objectLocator = objectLocator;
- }
-
-}
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel2.java
===================================================================
---
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel2.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/ChannelDataModel2.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -21,9 +21,9 @@
private final Log log = LogFactory.getLog(ChannelDataModel2.class);
- public static final int BIG_QUERY_DELAY = 1000;
+ public static final int BIG_QUERY_DELAY = 0*1000;
- public static final int SMALL_QUERY_DELAY = 500;
+ public static final int SMALL_QUERY_DELAY = 0*500;
private Channel channel;
@@ -37,16 +37,19 @@
log.trace(id);
}
- log.info("sleeping " + SMALL_QUERY_DELAY + "ms");
-
- try {
- Thread.sleep(SMALL_QUERY_DELAY);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ if (SMALL_QUERY_DELAY > 0) {
+ log.info("sleeping " + SMALL_QUERY_DELAY + "ms");
+
+ try {
+ Thread.sleep(SMALL_QUERY_DELAY);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ log.info("Awoke from slumber");
}
- log.info("Awoke from slumber");
return channel.findIssueByKey((Key) id);
}
@@ -61,15 +64,18 @@
log.trace("startRow=" + startRow + ", endRow=" + endRow +
",sortOrder=" + sortOrder);
}
- log.info("sleeping " + BIG_QUERY_DELAY);
-
- try {
- Thread.sleep(BIG_QUERY_DELAY);
- } catch (InterruptedException e) {
- e.printStackTrace();
+ if (BIG_QUERY_DELAY > 0) {
+ log.info("sleeping " + BIG_QUERY_DELAY);
+
+ try {
+ Thread.sleep(BIG_QUERY_DELAY);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ log.info("Awoke from slumber");
}
- log.info("Awoke from slumber");
return channel.executeQuery(startRow, endRow, sortOrder);
}
Deleted:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/SelectionBean.java
===================================================================
---
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/SelectionBean.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/bean/SelectionBean.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -1,85 +0,0 @@
-/*
- * Copyright
- * Copyright (c) Exadel,Inc. 2006
- * All rights reserved.
- *
- * History
- * $Source:
/cvs-master/intralinks-jsf-comps/web-projects/data-view-grid-demo/src/com/exadel/jsf/demo/datagrid/bean/SelectionBean.java,v
$
- * $Revision: 1.19 $
- */
-
-package org.richfaces.demo.datagrid.bean;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.faces.event.ActionEvent;
-import javax.faces.model.SelectItem;
-
-import org.richfaces.demo.datagrid.model.Channel;
-import org.richfaces.demo.datagrid.model.Issue;
-import org.richfaces.model.ScrollableGridDataModel;
-
-
-/**
- * @author Maksim Kaszynski
- *
- */
-public class SelectionBean {
-
- private ScrollableGridDataModel dataModel;
-
- private Channel channel;
-
- private String key;
-
- private int id;
-
-
- public ScrollableGridDataModel getDataModel() {
- return dataModel;
- }
-
- public void setDataModel(ScrollableGridDataModel dataModel) {
- this.dataModel = dataModel;
- }
-
- public SelectionBean() {
-
- }
-
- public void setKeyz(ActionEvent e) {
- System.out.println("SelectionBean.setKeyz() " + key + "id " + id);
- Channel channel = (Channel) getDataModel().getWrappedData ();
- Issue issue = channel.getIndex().get(id);
- if (issue != null) {
- channel.getIndex().remove(issue.getIndex());
- channel.getIssues().remove(issue);
- }
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getKey() {
- return key;
- }
-
- public void setKey(String key) {
- this.key = key;
- }
-
- public Channel getChannel() {
- return channel;
- }
-
- public void setChannel(Channel channel) {
- this.channel = channel;
- }
-}
-
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java
===================================================================
---
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Channel.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -234,6 +234,9 @@
}
public void addIssue(Issue issue) {
+ /*if (issues.size() > 5) {
+ return;
+ }*/
issues.add(issue);
index.put(issue.getIndex(), issue);
}
Modified:
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java
===================================================================
---
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2007-06-14
17:08:16 UTC (rev 1189)
+++
trunk/sandbox-samples/scrollable-grid-demo/src/main/java/org/richfaces/demo/datagrid/model/Issue.java 2007-06-14
17:20:40 UTC (rev 1190)
@@ -12,13 +12,11 @@
import java.io.Serializable;
-import org.richfaces.model.Entity;
-
/**
* @author Maksim Kaszynski
*
*/
-public class Issue implements Serializable{
+public class Issue {
private static int issueIndex = 0;
private int index = ++issueIndex;