Package com.vaadin.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.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.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
VScrollTable.VScrollTableBody.VScrollTableGeneratedRow
class
VScrollTable.VScrollTableBody.VScrollTableRow
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_ROW_HEIGHT
-
Constructor Summary
Constructors Modifier Constructor Description protected
VScrollTableBody()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
calculateMaxIndent()
This method exists for the needs ofVTreeTable
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 ofVTreeTable
only.int
getRequiredHeight()
VScrollTable.VScrollTableBody.VScrollTableRow
getRowByRowIndex(int indexInTable)
double
getRowHeight()
double
getRowHeight(boolean forceUpdate)
int
getTableHeight()
int
indexOf(com.google.gwt.user.client.ui.Widget row)
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.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)
protected void
updateStyleNames(String primaryStyleName)
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, add, adopt, clear, 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, unsinkEvents
-
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
-
-
-
-
Field Detail
-
DEFAULT_ROW_HEIGHT
public static final int DEFAULT_ROW_HEIGHT
- See Also:
- Constant Field Values
-
-
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.
-
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.
-
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
-
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 ofVTreeTable
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 ofVTreeTable
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.
-
-