Interface Table

  • All Superinterfaces:
    Control, Defined

    public interface Table
    extends Control
    A Table represents a collection of rows and columns, often spanning multiple 'pages'. The primary retrieval APIs are visitRows and getRows. TODO Discuss pros/cons of nesting a bunch of interfaces in here rather than exposing them at the top level of the package. I like having them in here because (1) they are specific to Table, I don't think they are useful outside of Table, and (2) they keep the top level from getting too cluttered.
    Version:
    $Id$
    • Method Detail

      • visitRows

        void visitRows​(Table.RowVisitor visitor,
                       boolean includeBlankRows,
                       Runnable eachPage)
                throws NoSuchFieldException,
                       TableScrollException
        Call the RowVisitor for each row in the table. Continue until either RowVisitor>visit returns false or to the end of the table.
        Parameters:
        visitor - method to call for each row
        includeBlankRows - obvious
        eachPage - an optional method that will be called once for each page
        Throws:
        NoSuchFieldException - if one of the columns does not exist on the screen
        TableScrollException - if the screen changes during the visit.
      • visitRows

        void visitRows​(Table.RowVisitor visitor,
                       boolean includeBlankRows,
                       boolean forUpdate,
                       Runnable eachPage)
                throws NoSuchFieldException,
                       TableScrollException
        Call the RowVisitor for each row in the table. Continue until either RowVisitor>visit returns false or to the end of the table.
        Parameters:
        visitor - method to call for each row
        includeBlankRows - obvious
        eachPage - an optional method that will be called once for each page
        forUpdate - set to true if you are going to be updating the rows, default is false.
        Throws:
        NoSuchFieldException - if one of the columns does not exist on the screen
        TableScrollException - if the screen changes during the visit.
      • getRows

        List<Table.Row> getRows​(boolean includeBlankRows)
                         throws NoSuchFieldException
        Retrieve all the rows of the table. Impl note: This just calls visitRows collecting all the rows.
        Parameters:
        includeBlankRows - a flag to indicate whether or not to include blank rows
        Returns:
        all the rows
        Throws:
        NoSuchFieldException - if one of the columns does not exist on the screen
      • findRow

        int findRow​(Map<String,​String> searchCriteria)
        Find a row by the given search criteria. The searchCriteria entries are fieldName => fieldValue. The table is scrolled as needed. The value returned is a zero-based index within the current page.
        Parameters:
        searchCriteria - The content to find.
        Returns:
        The zero-based index of the found row within the current page. -1 if not found.
      • addRow

        void addRow​(List<String> columnNames,
                    List<String> rowData)
        Add a row to the table. First, the table is searched to find an empty row, scrolling forward if needed, then the given data is inserted into that row.
        Parameters:
        columnNames - The names of the column fields that the rowData goes into.
        rowData - A value to insert into each table cell in the row, corresponding to the columnNames.
      • updateRow

        void updateRow​(List<String> columnNames,
                       List<String> rowData,
                       int rowNumber)
        Update a row of the table. The given data is inserted into the given zero-based rowNumber.
        Parameters:
        columnNames - The names of the column fields that the rowData goes into.
        rowData - A value to insert into each table cell in the row, corresponding to the columnNames.
        rowNumber - The row to update.
      • getColumnNames

        List<String> getColumnNames()
        Returns the names of the table's columns.
        Returns:
        the names of the table's columns.
      • getStopCondition

        Table.StopCondition getStopCondition()
        Returns the StopCondition for the Table.
        Returns:
        the StopCondition for the Table.
      • getNextPageScrollAction

        Table.ScrollAction getNextPageScrollAction()
        Returns the ScrollAction for moving forward through the pages of the Table.
        Returns:
        the ScrollAction for moving forward through the pages of the Table.