Class VScrollTable.VScrollTableBody

  • All Implemented Interfaces:
    com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, Iterable<com.google.gwt.user.client.ui.Widget>
    Direct Known Subclasses:
    VTreeTable.VTreeTableScrollBody
    Enclosing class:
    VScrollTable

    public class VScrollTable.VScrollTableBody
    extends com.google.gwt.user.client.ui.Panel
    This Panel can only contain VScrollTableRow type of widgets. This "simulates" very large table, keeping spacers which take room of unrendered rows.
    • Constructor Detail

      • VScrollTableBody

        protected VScrollTableBody()
    • Method Detail

      • setLastRendered

        public void setLastRendered​(int lastRendered)
      • getLastRendered

        public int getLastRendered()
      • getFirstRendered

        public int getFirstRendered()
      • getRequiredHeight

        public int getRequiredHeight()
        Returns:
        the height of scrollable body, subpixels ceiled.
      • updateStyleNames

        protected void updateStyleNames​(String primaryStyleName)
      • getAvailableWidth

        public int getAvailableWidth()
      • renderInitialRows

        public void renderInitialRows​(UIDL rowData,
                                      int firstIndex,
                                      int rows)
      • renderRows

        public void renderRows​(UIDL rowData,
                               int firstIndex,
                               int rows)
      • ensureCacheFilled

        protected void ensureCacheFilled()
        Ensure we have the correct set of rows on client side, e.g. if the content on the server side has changed, or the client scroll position has changed since the last request.
      • insertRows

        protected List<VScrollTable.VScrollTableBody.VScrollTableRow> insertRows​(UIDL rowData,
                                                                                 int firstIndex,
                                                                                 int rows)
        Inserts rows as provided in the rowData starting at firstIndex.
        Parameters:
        rowData -
        firstIndex -
        rows - the number of rows
        Returns:
        a list of the rows added.
      • insertRowsDeleteBelow

        protected void insertRowsDeleteBelow​(UIDL rowData,
                                             int firstIndex,
                                             int rows)
      • iterator

        public Iterator<com.google.gwt.user.client.ui.Widget> iterator()
      • unlinkRow

        protected boolean unlinkRow​(boolean fromBeginning)
        Returns:
        false if couldn't remove row
      • unlinkRows

        protected void unlinkRows​(int firstIndex,
                                  int count)
      • unlinkAndReindexRows

        protected void unlinkAndReindexRows​(int firstIndex,
                                            int count)
      • unlinkAllRowsStartingAt

        protected void unlinkAllRowsStartingAt​(int index)
      • remove

        public boolean remove​(com.google.gwt.user.client.ui.Widget w)
        Specified by:
        remove in interface com.google.gwt.user.client.ui.HasWidgets
        Specified by:
        remove in class com.google.gwt.user.client.ui.Panel
      • getRowHeight

        public double getRowHeight()
      • getRowHeight

        public double getRowHeight​(boolean forceUpdate)
      • getTableHeight

        public int getTableHeight()
      • getColWidth

        public int getColWidth​(int columnIndex)
        Returns the width available for column content.
        Parameters:
        columnIndex -
        Returns:
      • setColWidth

        public void setColWidth​(int colIndex,
                                int w)
        Sets the content width of a column. Due IE limitation, we must set the width to a wrapper elements inside table cells (with overflow hidden, which does not work on td elements). To get this work properly crossplatform, we will also set the width of td.
        Parameters:
        colIndex -
        w -
      • getMaxIndent

        protected int getMaxIndent()
        This method exists for the needs of VTreeTable only. May be removed or replaced in the future.

        Returns the maximum indent of the hierarcyColumn, if applicable.
        Returns:
        maximum indent in pixels
        See Also:
        VScrollTable.getHierarchyColumnIndex()
      • calculateMaxIndent

        protected void calculateMaxIndent()
        This method exists for the needs of VTreeTable only. May be removed or replaced in the future.

        Calculates the maximum indent of the hierarcyColumn, if applicable.
      • moveCol

        public void moveCol​(int oldIndex,
                            int newIndex)
      • indexOf

        public int indexOf​(com.google.gwt.user.client.ui.Widget row)
      • ensureFocus

        protected void ensureFocus()
        Ensure the component has a focus. TODO the current implementation simply always calls focus for the component. In case the Table at some point implements focus/blur listeners, this method needs to be evolved to conditionally call focus only if not currently focused.