com.vaadin.terminal.gwt.client.ui.table
Class VScrollTable.VScrollTableBody

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Panel
              extended by com.vaadin.terminal.gwt.client.ui.table.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>
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.


Nested Class Summary
protected  class VScrollTable.VScrollTableBody.VScrollTableGeneratedRow
           
 class VScrollTable.VScrollTableBody.VScrollTableRow
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
 
Field Summary
static int DEFAULT_ROW_HEIGHT
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
protected VScrollTable.VScrollTableBody()
           
 
Method Summary
protected  VScrollTable.VScrollTableBody.VScrollTableRow createRow(UIDL uidl, char[] aligns2)
           
protected  void ensureCacheFilled()
          Ensure we have the correct set of rows on client side, e.g.
protected  void ensureFocus()
          Ensure the component has a focus.
 int getAvailableWidth()
           
 int getColWidth(int columnIndex)
          Returns the width available for column content.
 int getFirstRendered()
           
 int getLastRendered()
           
 int getRequiredHeight()
           
 VScrollTable.VScrollTableBody.VScrollTableRow getRowByRowIndex(int indexInTable)
           
 double getRowHeight()
           
 double getRowHeight(boolean forceUpdate)
           
 int getTableHeight()
           
protected  List<VScrollTable.VScrollTableBody.VScrollTableRow> insertAndReindexRows(UIDL rowData, int firstIndex, int rows)
           
protected  List<VScrollTable.VScrollTableBody.VScrollTableRow> insertRows(UIDL rowData, int firstIndex, int rows)
          Inserts rows as provided in the rowData starting at firstIndex.
protected  void insertRowsDeleteBelow(UIDL rowData, int firstIndex, int rows)
           
 Iterator<com.google.gwt.user.client.ui.Widget> iterator()
           
 void moveCol(int oldIndex, int newIndex)
           
 boolean remove(com.google.gwt.user.client.ui.Widget w)
           
 void renderInitialRows(UIDL rowData, int firstIndex, int rows)
           
 void renderRows(UIDL rowData, int firstIndex, int rows)
           
 void setColWidth(int colIndex, int w)
          Sets the content width of a column.
protected  void unlinkAllRowsStartingAt(int index)
           
protected  void unlinkAndReindexRows(int firstIndex, int count)
           
protected  boolean unlinkRow(boolean fromBeginning)
           
protected  void unlinkRows(int firstIndex, int count)
           
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_ROW_HEIGHT

public static final int DEFAULT_ROW_HEIGHT
See Also:
Constant Field Values
Constructor Detail

VScrollTable.VScrollTableBody

protected VScrollTable.VScrollTableBody()
Method Detail

getRowByRowIndex

public VScrollTable.VScrollTableBody.VScrollTableRow getRowByRowIndex(int indexInTable)

getRequiredHeight

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

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.

insertAndReindexRows

protected List<VScrollTable.VScrollTableBody.VScrollTableRow> insertAndReindexRows(UIDL rowData,
                                                                                   int firstIndex,
                                                                                   int rows)

insertRowsDeleteBelow

protected void insertRowsDeleteBelow(UIDL rowData,
                                     int firstIndex,
                                     int rows)

createRow

protected VScrollTable.VScrollTableBody.VScrollTableRow createRow(UIDL uidl,
                                                                  char[] aligns2)

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 -

getLastRendered

public int getLastRendered()

getFirstRendered

public int getFirstRendered()

moveCol

public void moveCol(int oldIndex,
                    int newIndex)

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.



Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.