Package com.vaadin.v7.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.v7.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.PanelThis 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 classVScrollTable.VScrollTableBody.VScrollTableGeneratedRowclassVScrollTable.VScrollTableBody.VScrollTableRow
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_ROW_HEIGHT
-
Constructor Summary
Constructors Modifier Constructor Description protectedVScrollTableBody()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcalculateMaxIndent()This method exists for the needs ofVTreeTableonly.protected VScrollTable.VScrollTableBody.VScrollTableRowcreateRow(UIDL uidl, char[] aligns2)protected voidensureCacheFilled()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.protected voidensureFocus()Ensure the component has a focus.intgetAvailableWidth()intgetColWidth(int columnIndex)Returns the width available for column content.intgetFirstRendered()intgetLastRendered()protected intgetMaxIndent()This method exists for the needs ofVTreeTableonly.intgetRequiredHeight()VScrollTable.VScrollTableBody.VScrollTableRowgetRowByRowIndex(int indexInTable)doublegetRowHeight()doublegetRowHeight(boolean forceUpdate)intgetTableHeight()intindexOf(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 voidinsertRowsDeleteBelow(UIDL rowData, int firstIndex, int rows)Iterator<com.google.gwt.user.client.ui.Widget>iterator()voidmoveCol(int oldIndex, int newIndex)booleanremove(com.google.gwt.user.client.ui.Widget w)voidrenderInitialRows(UIDL rowData, int firstIndex, int rows)voidrenderRows(UIDL rowData, int firstIndex, int rows)voidsetColWidth(int colIndex, int w)Sets the content width of a column.voidsetLastRendered(int lastRendered)protected voidunlinkAllRowsStartingAt(int index)protected voidunlinkAndReindexRows(int firstIndex, int count)protected booleanunlinkRow(boolean fromBeginning)protected voidunlinkRows(int firstIndex, int count)protected voidupdateStyleNames(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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
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:
removein interfacecom.google.gwt.user.client.ui.HasWidgets- Specified by:
removein 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- The column Indexw- The content width
-
getMaxIndent
protected int getMaxIndent()
This method exists for the needs ofVTreeTableonly. 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 ofVTreeTableonly. 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.
-
-