org.portletfaces.liferay.faces.model
Class RowMarkerDataModel<E>

java.lang.Object
  extended by javax.faces.model.DataModel<E>
      extended by org.portletfaces.liferay.faces.model.RowMarkerDataModel<E>
All Implemented Interfaces:
java.lang.Iterable<E>, RowMarker
Direct Known Subclasses:
LazyDataModel

public abstract class RowMarkerDataModel<E>
extends javax.faces.model.DataModel<E>
implements RowMarker

This class extends the DataModel class and provides a convenient base implementation of the RowMarker interface.

Author:
Neil Griffin

Nested Class Summary
protected  class RowMarkerDataModel.RowMarksObserver
           
 
Field Summary
protected  boolean allRowsMarked
           
 
Constructor Summary
RowMarkerDataModel()
           
 
Method Summary
 int deleteMarkedRows()
          Deletes the rows that are marked according to the value of RowMarker.getRowMarks() and returns the number of deleted rows.
abstract  void deleteRow(java.lang.Object primaryKey)
          Deletes the row associated with the specified primary key.
abstract  java.lang.Object getPrimaryKey(E e)
          Retrieves the primary key from the specified object.
 RowMarks getRowMarks()
          Returns an instance of RowMarks that represents rows that are marked.
 boolean isAllRowsMarked()
          Returns a boolean flag indicating whether or not all rows are marked.
abstract  boolean isReset()
          Indicates whether or not the underlying cache of rows has been reset/cleared.
abstract  void reset()
          Resets (clears) the underlying cache of rows.
 void setAllRowsMarked(boolean allRowsMarked)
          Sets the flag indicating whether or not all rows are marked, according to the specified value.
 void setRowMarks(RowMarks rowMarks)
          Sets an instance of RowMarks that represents rows that are marked.
 
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, getRowCount, getRowData, getRowIndex, getWrappedData, isRowAvailable, iterator, removeDataModelListener, setRowIndex, setWrappedData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allRowsMarked

protected boolean allRowsMarked
Constructor Detail

RowMarkerDataModel

public RowMarkerDataModel()
Method Detail

deleteRow

public abstract void deleteRow(java.lang.Object primaryKey)
                        throws java.io.IOException
Deletes the row associated with the specified primary key.

Throws:
java.io.IOException - When any type of exception occurs during the delete process.

reset

public abstract void reset()
Resets (clears) the underlying cache of rows.


deleteMarkedRows

public int deleteMarkedRows()
                     throws java.io.IOException
Description copied from interface: RowMarker
Deletes the rows that are marked according to the value of RowMarker.getRowMarks() and returns the number of deleted rows.

Specified by:
deleteMarkedRows in interface RowMarker
Throws:
java.io.IOException - When any kind of exception occurs during the delete process.
See Also:
RowMarker#deleteMarkedRows()}

setAllRowsMarked

public void setAllRowsMarked(boolean allRowsMarked)
Description copied from interface: RowMarker
Sets the flag indicating whether or not all rows are marked, according to the specified value.

Specified by:
setAllRowsMarked in interface RowMarker
See Also:
RowMarker#setAllRowsMarked(boolean)}

isAllRowsMarked

public boolean isAllRowsMarked()
Description copied from interface: RowMarker
Returns a boolean flag indicating whether or not all rows are marked.

Specified by:
isAllRowsMarked in interface RowMarker
See Also:
RowMarker#isAllRowsMarked()}

getPrimaryKey

public abstract java.lang.Object getPrimaryKey(E e)
Retrieves the primary key from the specified object.


getRowMarks

public RowMarks getRowMarks()
Description copied from interface: RowMarker
Returns an instance of RowMarks that represents rows that are marked.

Specified by:
getRowMarks in interface RowMarker
See Also:
RowMarker#getRowMarks()}

setRowMarks

public void setRowMarks(RowMarks rowMarks)
Description copied from interface: RowMarker
Sets an instance of RowMarks that represents rows that are marked.

Specified by:
setRowMarks in interface RowMarker
See Also:
RowMarker#setRowMarks(RowMarks)}

isReset

public abstract boolean isReset()
Indicates whether or not the underlying cache of rows has been reset/cleared.



Copyright © 2011 portletfaces.org. All Rights Reserved.