|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
com.google.gwt.widgetideas.table.client.ScrollTable
public class ScrollTable
ScrollTable consists of a fixed header and footer (optional) that remain visible and a scrollable body that contains the data.
In order for the columns in the header table and data table to line up, the two table must have the same margin, padding, and border widths. You can use CSS style sheets to manipulate the colors and styles of the cell's, but you must keep the actual sizes consistent (especially with respect to the left and right side of the cells).
Nested Class Summary | |
---|---|
static class |
ScrollTable.ResizePolicy
The resize policies of table cells. |
static class |
ScrollTable.ScrollPolicy
The scroll policy of the table. |
static interface |
ScrollTable.ScrollTableImages
An ImageBundle that provides images for ScrollTable . |
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 |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_STYLE_NAME
The default style name. |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
ScrollTable(FixedWidthGrid dataTable,
FixedWidthFlexTable headerTable)
Constructor. |
|
ScrollTable(FixedWidthGrid dataTable,
FixedWidthFlexTable headerTable,
ScrollTable.ScrollTableImages images)
Constructor. |
Method Summary | |
---|---|
void |
autoFitColumnWidth(int column)
Stretches or shrinks the column to automatically fit its data content. |
void |
fillWidth()
Adjust all column widths so they take up the maximum amount of space without needing a horizontal scroll bar. |
int |
getCellPadding()
|
int |
getCellSpacing()
|
int |
getColumnWidth(int column)
Return the column width for a given column index. |
FixedWidthGrid |
getDataTable()
|
protected com.google.gwt.user.client.Element |
getDataWrapper()
|
FixedWidthFlexTable |
getFooterTable()
|
FixedWidthFlexTable |
getHeaderTable()
|
int |
getMinWidth()
|
ScrollTable.ResizePolicy |
getResizePolicy()
|
ScrollTable.ScrollPolicy |
getScrollPolicy()
|
boolean |
isAutoFitEnabled()
|
boolean |
isColumnSortable(int column)
|
boolean |
isSortingEnabled()
|
protected void |
onAttach()
Resize the widget and redistribute space as needed. |
void |
onBrowserEvent(com.google.gwt.user.client.Event event)
|
void |
onResize(int width,
int height)
This method is called when the dimensions of the parent element change. |
void |
redraw()
Redraw the table. |
boolean |
remove(com.google.gwt.user.client.ui.Widget child)
Unsupported. |
protected void |
resizeTablesVertically()
Fixes the table heights so the header is visible and the data takes up the remaining vertical space. |
protected void |
resizeTablesVerticallyNow()
Helper method that actually performs the vertical resizing. |
protected void |
scrollTables(boolean baseHeader)
Sets the scroll property of the header and data wrappers when scrolling. |
void |
setAutoFitEnabled(boolean autoFitEnabled)
Enable or disable automatic column fitting via mouse clicks to the header cells. |
void |
setCellPadding(int padding)
Sets the amount of padding to be added around all cells. |
void |
setCellSpacing(int spacing)
Sets the amount of spacing to be added around all cells. |
void |
setColumnSortable(int column,
boolean sortable)
Enable or disable sorting on a specific column. |
int |
setColumnWidth(int column,
int width)
Set the width of a column. |
protected int |
setColumnWidth(int column,
int width,
int sacrificeColumn,
boolean guarenteed)
Set the width of a column. |
void |
setFooterTable(FixedWidthFlexTable footerTable)
Set the footer table that appears under the data table. |
void |
setHeight(java.lang.String height)
|
void |
setMinWidth(int minWidth)
Set the minimum allowable width of the data table. |
void |
setResizePolicy(ScrollTable.ResizePolicy resizePolicy)
Set the resize policy of the table. |
void |
setScrollPolicy(ScrollTable.ScrollPolicy scrollPolicy)
Set the scroll policy of the table. |
void |
setSortingEnabled(boolean sortingEnabled)
Enable or disable column sorting via mouse clicks to the header cells. |
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel |
---|
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, insert, insert, iterator, remove |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
---|
add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
getParent, isAttached, onDetach, removeFromParent, setElement |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.widgetideas.client.ResizableWidget |
---|
getElement, isAttached |
Field Detail |
---|
public static final java.lang.String DEFAULT_STYLE_NAME
Constructor Detail |
---|
public ScrollTable(FixedWidthGrid dataTable, FixedWidthFlexTable headerTable)
dataTable
- the data tableheaderTable
- the header tablepublic ScrollTable(FixedWidthGrid dataTable, FixedWidthFlexTable headerTable, ScrollTable.ScrollTableImages images)
dataTable
- the data tableheaderTable
- the header tableimages
- the images to use in the tableMethod Detail |
---|
public void autoFitColumnWidth(int column)
column
- the column to fit
java.lang.IndexOutOfBoundsException
public void fillWidth()
ScrollTable
must be visible on the page for this method to
work.
public int getCellPadding()
public int getCellSpacing()
public int getColumnWidth(int column)
column
- the column index
public FixedWidthGrid getDataTable()
public FixedWidthFlexTable getFooterTable()
public FixedWidthFlexTable getHeaderTable()
public int getMinWidth()
public ScrollTable.ResizePolicy getResizePolicy()
public ScrollTable.ScrollPolicy getScrollPolicy()
public boolean isAutoFitEnabled()
public boolean isColumnSortable(int column)
column
- the column index
public boolean isSortingEnabled()
public void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent
in interface com.google.gwt.user.client.EventListener
onBrowserEvent
in class com.google.gwt.user.client.ui.Widget
Widget
public void onResize(int width, int height)
onResize
in interface ResizableWidget
width
- the new client width of the elementheight
- the new client height of the elementpublic void redraw()
public boolean remove(com.google.gwt.user.client.ui.Widget child)
remove
in interface com.google.gwt.user.client.ui.HasWidgets
remove
in class com.google.gwt.user.client.ui.ComplexPanel
child
- the widget to be removed
java.lang.UnsupportedOperationException
public void setAutoFitEnabled(boolean autoFitEnabled)
autoFitEnabled
- true to enable column sorting via mouse eventspublic void setCellPadding(int padding)
padding
- the cell padding, in pixelspublic void setCellSpacing(int spacing)
spacing
- the cell spacing, in pixelspublic void setColumnSortable(int column, boolean sortable)
setSortingEnabled(boolean)
to disable sorting on all
columns.
column
- the index of the columnsortable
- true to enable sorting for this column, false to disablepublic int setColumnWidth(int column, int width)
#setGuarenteedColumnWidth(int, int)
method, the column will no
longer have a guarenteed column width.
column
- the index of the columnwidth
- the width in pixels
public void setFooterTable(FixedWidthFlexTable footerTable)
footerTable
- the table to use in the footerpublic void setHeight(java.lang.String height)
setHeight
in class com.google.gwt.user.client.ui.UIObject
UIObject
public void setMinWidth(int minWidth)
ScrollTable.ResizePolicy.FILL_WIDTH
and
ScrollTable.ResizePolicy.FILL_WIDTH_DISABLED
.
minWidth
- the minimum width, or -1 to disablepublic void setResizePolicy(ScrollTable.ResizePolicy resizePolicy)
resizePolicy
- the resize policypublic void setScrollPolicy(ScrollTable.ScrollPolicy scrollPolicy)
scrollPolicy
- the new scroll policypublic void setSortingEnabled(boolean sortingEnabled)
sortingEnabled
- true to enable column sorting via mouse eventsprotected com.google.gwt.user.client.Element getDataWrapper()
protected void onAttach()
onAttach
in class com.google.gwt.user.client.ui.Widget
protected void resizeTablesVertically()
protected void resizeTablesVerticallyNow()
protected void scrollTables(boolean baseHeader)
baseHeader
- If true, use the header as the alignment sourceprotected int setColumnWidth(int column, int width, int sacrificeColumn, boolean guarenteed)
column
- the index of the columnwidth
- the width in pixelssacrificeColumn
- the column that will be shrunk to maintain the widthguarenteed
- if true, the column width cannot be changed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |