com.vaadin.client.widget.escalator.

Class FlyweightRow

    • Constructor Detail

      • FlyweightRow

        public FlyweightRow()
    • Method Detail

      • setup

        public void setup​(com.google.gwt.dom.client.TableRowElement e,
                          int row,
                          double[] columnWidths)

        Configure this FlyweightRow for the current use. This method is expected to be called multiple times during the Grid's life-cycle.

        Parameters:

        e - the root element for this row

        row - the row index

        columnWidths - widths for each column on the row

        See Also:

        FlyweightRow

      • teardown

        public boolean teardown()

        Tear down the state of the Row.

        This is an internal check method, to prevent retrieving uninitialized data by calling getRow(), getElement() or getCells() at an improper time.

        This should only be used with asserts (" assert flyweightRow.teardown() ") so that the code is never run when asserts aren't enabled.

        Returns:

        always true

      • getRow

        public int getRow()

        Description copied from interface: Row

        Gets the row index.

        Specified by:

        getRow in interface Row

        Returns:

        the row index

      • getElement

        public com.google.gwt.dom.client.TableRowElement getElement()

        Description copied from interface: Row

        Gets the root element for this row.

        The EscalatorUpdater may update the class names of the element and add inline styles, but may not modify the contained DOM structure.

        If you wish to modify the cells within this row element, access them via the List<Cell> objects passed in to EscalatorUpdater.updateCells(Row, List)

        Specified by:

        getElement in interface Row

        Returns:

        the root element of the row

      • addCells

        public void addCells​(int index,
                             int numberOfColumns)

        Adds cell representations (i.e. new columns) for the indicated cell range and updates the subsequent indexing.

        Parameters:

        index - start index of the range

        numberOfColumns - length of the range

      • removeCells

        public void removeCells​(int index,
                                int numberOfColumns)

        Removes cell representations (i.e. removed columns) from the indicated cell range and updates the subsequent indexing.

        Parameters:

        index - start index of the range

        numberOfColumns - length of the range

      • getCells

        public Iterable<FlyweightCell> getCells()

        Returns flyweight cells for the client code to render. The cells get their associated elements from the row element.

        Precondition: each cell has a corresponding element in the row

        Returns:

        an iterable of flyweight cells

        See Also:

        #setup(TableRowElement, int, int[]), teardown()

      • getCells

        public Iterable<FlyweightCell> getCells​(int offset,
                                                int numberOfCells)

        Returns a subrange of flyweight cells for the client code to render. The cells get their associated elements from the row element.

        Precondition: each cell has a corresponding element in the row

        Parameters:

        offset - the index of the first cell to return

        numberOfCells - the number of cells to return

        Returns:

        an iterable of flyweight cells

      • getUnattachedCells

        public Iterable<FlyweightCell> getUnattachedCells​(int offset,
                                                          int numberOfCells)

        Returns a subrange of unattached flyweight cells. Unattached cells do not have elements associated. Note that FlyweightRow does not keep track of whether cells in actuality have corresponding DOM elements or not; it is the caller's responsibility to invoke this method with correct parameters.

        Precondition: the range [offset, offset + numberOfCells) must be valid

        Parameters:

        offset - the index of the first cell to return

        numberOfCells - the number of cells to return

        Returns:

        an iterable of flyweight cells