com.vaadin.terminal.gwt.client.ui.
Class VScrollTable.VScrollTableBody
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.vaadin.terminal.gwt.client.ui.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.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:
- extends com.google.gwt.user.client.ui.Panel
public class VScrollTable.VScrollTableBody
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 void |
calculateMaxIndent()
This method exists for the needs of VTreeTable only. |
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()
|
protected int |
getMaxIndent()
This method exists for the needs of VTreeTable only. |
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)
|
protected void |
onAttach()
|
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. |
void |
setLastRendered(int lastRendered)
|
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, 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, 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:
Constructor Detail |
---|
VScrollTable.VScrollTableBody
protected VScrollTable.VScrollTableBody()
Method Detail |
---|
setLastRendered
public void setLastRendered(int lastRendered)
getLastRendered
public int getLastRendered()
getFirstRendered
public int getFirstRendered()
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)
- Parameters:
rowData
-firstIndex
-rows
- the number of rows- Returns:
- a list of the rows added.
Inserts rows as provided in the rowData starting at firstIndex.
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 interfacecom.google.gwt.user.client.ui.HasWidgets
- Specified by:
remove
in classcom.google.gwt.user.client.ui.Panel
onAttach
protected void onAttach()
- Overrides:
onAttach
in classcom.google.gwt.user.client.ui.Widget
getRowHeight
public double getRowHeight()
getRowHeight
public double getRowHeight(boolean forceUpdate)
getTableHeight
public int getTableHeight()
getColWidth
public int getColWidth(int columnIndex)
- Parameters:
columnIndex
-- Returns:
Returns the width available for column content.
setColWidth
public void setColWidth(int colIndex,
int w)
- Parameters:
colIndex
-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.
getMaxIndent
protected int getMaxIndent()
- Returns:
- maximum indent in pixels
- See Also:
VScrollTable#getHierarchyColumnIndex()}
This method exists for the needs of VTreeTable
only. Returns
the maximum indent of the hierarcyColumn, if applicable.
calculateMaxIndent
protected void calculateMaxIndent()
This method exists for the needs of VTreeTable
only.
Calculates the maximum indent of the hierarcyColumn, if applicable.
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.