Class PivotDataEvent

java.lang.Object
org.zkoss.pivot.event.PivotDataEvent

public class PivotDataEvent extends Object
A data event is used to notify listeners that a pivot model has changed.
Author:
jumperchen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Specifies all columns in a row or rows.
    static final int
    Identifies the removal of rows or columns.
    static final int
    Identifies the header row.
    static final int
    Identifies the addition of new rows or columns.
    static final int
    Identifies a change to existing data.
  • Constructor Summary

    Constructors
    Constructor
    Description
    All row data in the pivot model has changed, listeners should discard any state that was based on the rows and requery the PivotModel to get the new row count and all the appropriate values.
    PivotDataEvent(PivotModel model, int row)
    This row of data has been updated.
    PivotDataEvent(PivotModel model, int firstRow, int lastRow)
    The data in rows [firstRow, lastRow] have been updated.
    PivotDataEvent(PivotModel model, int firstRow, int lastRow, int column)
    The cells in column column in the range [firstRow, lastRow] have been updated.
    PivotDataEvent(PivotModel model, int firstRow, int lastRow, int column, int type)
    The cells from (firstRow, column) to (lastRow, column) have been changed.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the column for the event.
    int
    Returns the first row that changed.
    int
    Returns the last row that changed.
    Returns the pivot model which fires the event.
    int
    Returns the type of event - one of: INSERT, UPDATE and DELETE.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • UPDATE

      public static final int UPDATE
      Identifies a change to existing data.
      See Also:
    • DELETE

      public static final int DELETE
      Identifies the removal of rows or columns.
      See Also:
    • INSERT

      public static final int INSERT
      Identifies the addition of new rows or columns.
      See Also:
    • HEADER_ROW

      public static final int HEADER_ROW
      Identifies the header row.
      See Also:
    • ALL_COLUMNS

      public static final int ALL_COLUMNS
      Specifies all columns in a row or rows.
      See Also:
  • Constructor Details

    • PivotDataEvent

      public PivotDataEvent(PivotModel model)
      All row data in the pivot model has changed, listeners should discard any state that was based on the rows and requery the PivotModel to get the new row count and all the appropriate values. The Pivottable will render the entire visible region on receiving this event, querying the model for the cell values that are visible. The structure of the pivot table i.e., the column names, types and order have not changed.
    • PivotDataEvent

      public PivotDataEvent(PivotModel model, int row)
      This row of data has been updated. To denote the arrival of a completely new pivot table with a different structure use HEADER_ROW as the value for the row. This is the same as calling setModel(PivotModel) on the Pivottable.
    • PivotDataEvent

      public PivotDataEvent(PivotModel model, int firstRow, int lastRow)
      The data in rows [firstRow, lastRow] have been updated.
    • PivotDataEvent

      public PivotDataEvent(PivotModel model, int firstRow, int lastRow, int column)
      The cells in column column in the range [firstRow, lastRow] have been updated.
    • PivotDataEvent

      public PivotDataEvent(PivotModel model, int firstRow, int lastRow, int column, int type)
      The cells from (firstRow, column) to (lastRow, column) have been changed. The column refers to the column index of the cell in the model's co-ordinate system. When column is ALL_COLUMNS, all cells in the specified range of rows are considered changed.

      The type should be one of: INSERT, UPDATE and DELETE.

  • Method Details

    • getPivotModel

      public PivotModel getPivotModel()
      Returns the pivot model which fires the event.
    • getFirstRow

      public int getFirstRow()
      Returns the first row that changed. HEADER_ROW means the meta data, ie. names, types and order of the columns.
    • getLastRow

      public int getLastRow()
      Returns the last row that changed.
    • getColumn

      public int getColumn()
      Returns the column for the event. If the return value is ALL_COLUMNS; it means every column in the specified rows changed.
    • getType

      public int getType()
      Returns the type of event - one of: INSERT, UPDATE and DELETE.