public class ColumnHeader<M> extends Component
Modifier and Type | Class and Description |
---|---|
static interface |
ColumnHeader.ColumnHeaderAppearance |
static interface |
ColumnHeader.ColumnHeaderStyles |
class |
ColumnHeader.GridSplitBar |
class |
ColumnHeader.Group |
class |
ColumnHeader.Head |
static interface |
ColumnHeader.HeaderContextMenuFactory
Delegate for external code to define what menu any given column should use
|
class |
ColumnHeader.HiddenHeaderGroupConfig |
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
DEBUG_ID_PREFIX
Constructor and Description |
---|
ColumnHeader(Grid<M> container,
ColumnModel<M> cm)
Creates a new column header.
|
ColumnHeader(Grid<M> container,
ColumnModel<M> cm,
ColumnHeader.ColumnHeaderAppearance appearance)
Creates a new column header.
|
Modifier and Type | Method and Description |
---|---|
ColumnHeader.ColumnHeaderAppearance |
getAppearance()
Returns the column header appearance.
|
Widget |
getContainer()
Returns the header's container widget.
|
ColumnHeader.Head |
getHead(int column)
Returns the head at the current index.
|
int |
getMinColumnWidth()
Returns the minimum column width.
|
int |
getRightAlignOffset()
Returns the amount of padding in pixels for right aligned columns (defaults to 16).
|
int |
getSplitterWidth()
Returns the splitter width.
|
int |
indexOf(ColumnHeader.Head head)
Returns the index of the given column head.
|
boolean |
isDisableSortIcon()
Returns the state of the sort icon.
|
boolean |
isEnableColumnReorder()
Returns true if column reordering is enabled.
|
void |
refresh()
Refreshes the columns.
|
void |
release()
Do not call.
|
void |
setColumnModel(ColumnModel<M> columnModel)
Assigns a new set of columns to the header, but does not yet rebuild the headers.
|
void |
setDisableSortIcon(boolean disableSortIcon)
True to disable the column sort icon (defaults to false).
|
void |
setEnableColumnReorder(boolean enable)
True to enable column reordering.
|
void |
setEnableColumnResizing(boolean enable)
True to enable column resizing.
|
void |
setHeader(int column,
SafeHtml header)
Sets the column's header text.
|
void |
setMenuFactory(ColumnHeader.HeaderContextMenuFactory menuFactory)
Specifies which menu to use for any given column
|
void |
setMinColumnWidth(int minColumnWidth)
Sets the minimum column width (defaults to 25px).
|
void |
setRightAlignOffset(int rightAlignOffset)
Sets the amount of padding in pixels for right aligned columns (defaults to 16).
|
void |
setSplitterWidth(int splitterWidth)
Sets the splitter width.
|
void |
showColumnMenu(int column)
Shows the column's header context menu.
|
void |
updateColumnHidden(int index,
boolean hidden)
Updates the visibility of a column.
|
void |
updateColumnWidth(int column,
int width)
Updates the column width.
|
void |
updateSortIcon(int colIndex,
SortDir dir)
Updates the sort icon of a column.
|
void |
updateTotalWidth(int offset,
int width)
Updates the total width of the header.
|
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
public ColumnHeader(Grid<M> container, ColumnModel<M> cm)
container
- the containing widgetcm
- the column modelpublic ColumnHeader(Grid<M> container, ColumnModel<M> cm, ColumnHeader.ColumnHeaderAppearance appearance)
container
- the containing widgetcm
- the column modelappearance
- the column header appearancepublic ColumnHeader.ColumnHeaderAppearance getAppearance()
public Widget getContainer()
public ColumnHeader.Head getHead(int column)
column
- the column indexpublic int getMinColumnWidth()
public int getRightAlignOffset()
public int getSplitterWidth()
public int indexOf(ColumnHeader.Head head)
head
- the column headpublic boolean isDisableSortIcon()
public boolean isEnableColumnReorder()
public void refresh()
public void release()
public void setColumnModel(ColumnModel<M> columnModel)
refresh()
method
must be called to achieve that.columnModel
- the new set of columns to usepublic void setDisableSortIcon(boolean disableSortIcon)
public void setEnableColumnReorder(boolean enable)
enable
- true to enablepublic void setEnableColumnResizing(boolean enable)
enable
- true to enable, otherwise falsepublic void setHeader(int column, SafeHtml header)
column
- the column indexheader
- the header textpublic void setMenuFactory(ColumnHeader.HeaderContextMenuFactory menuFactory)
menuFactory
- the instance to use when requesting a menupublic void setMinColumnWidth(int minColumnWidth)
minColumnWidth
- the minimum column width in pixelspublic void setRightAlignOffset(int rightAlignOffset)
rightAlignOffset
- the right align offsetpublic void setSplitterWidth(int splitterWidth)
splitterWidth
- the splitter widthpublic void showColumnMenu(int column)
column
- the column indexpublic void updateColumnHidden(int index, boolean hidden)
index
- the column indexhidden
- true to hide, otherwise falsepublic void updateColumnWidth(int column, int width)
column
- the column indexwidth
- the new widthpublic void updateSortIcon(int colIndex, SortDir dir)
colIndex
- the column indexdir
- the sort directionpublic void updateTotalWidth(int offset, int width)
offset
- the offsetwidth
- the new widthCopyright © 2015. All rights reserved.