com.sencha.gxt.widget.core.client.grid
Class ColumnHeader<M>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.grid.ColumnHeader<M>
All Implemented Interfaces:
HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, BeforeHideEvent.HasBeforeHideHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, HasFocusSupport, HasItemId

public class ColumnHeader<M>
extends Component

A column header component.


Nested Class Summary
static interface ColumnHeader.ColumnHeaderAppearance
           
static interface ColumnHeader.ColumnHeaderStyles
           
 class ColumnHeader.GridSplitBar
           
 class ColumnHeader.Group
           
 class ColumnHeader.Head
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
ColumnHeader(Widget container, ColumnModel<M> cm)
          Creates a new column header.
ColumnHeader(Widget container, ColumnModel<M> cm, ColumnHeader.ColumnHeaderAppearance appearance)
          Creates a new column header.
 
Method Summary
 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 getSplitterWidth()
          Returns the splitter width.
 int indexOf(ColumnHeader.Head head)
          Returns the index of the given column head.
 boolean isEnableColumnReorder()
          Returns true if column reordering is enabled.
 void refresh()
          Refreshes the columns.
 void release()
          Do not call.
 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 setMenu(Menu menu)
          Sets the header's context menu.
 void setMinColumnWidth(int minColumnWidth)
          Sets the minimum column width.
 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.
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
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, getStateId, 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, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnHeader

public ColumnHeader(Widget container,
                    ColumnModel<M> cm)
Creates a new column header.

Parameters:
container - the containing widget
cm - the column model

ColumnHeader

public ColumnHeader(Widget container,
                    ColumnModel<M> cm,
                    ColumnHeader.ColumnHeaderAppearance appearance)
Creates a new column header.

Parameters:
container - the containing widget
cm - the column model
appearance - the column header appearance
Method Detail

getContainer

public Widget getContainer()
Returns the header's container widget.

Returns:
the container widget

getHead

public ColumnHeader.Head getHead(int column)
Returns the head at the current index.

Parameters:
column - the column index
Returns:
the column or null if no match

getMinColumnWidth

public int getMinColumnWidth()
Returns the minimum column width.

Returns:
the column width

getSplitterWidth

public int getSplitterWidth()
Returns the splitter width.

Returns:
the splitter width in pixels.

indexOf

public int indexOf(ColumnHeader.Head head)
Returns the index of the given column head.

Parameters:
head - the column head
Returns:
the index

isEnableColumnReorder

public boolean isEnableColumnReorder()
Returns true if column reordering is enabled.

Returns:
the column reorder state

getAppearance

public ColumnHeader.ColumnHeaderAppearance getAppearance()
Returns the column header appearance.

Returns:
the column header appearance

refresh

public void refresh()
Refreshes the columns.


release

public void release()
Do not call.


setEnableColumnReorder

public void setEnableColumnReorder(boolean enable)
True to enable column reordering.

Parameters:
enable - true to enable

setEnableColumnResizing

public void setEnableColumnResizing(boolean enable)
True to enable column resizing.

Parameters:
enable - true to enable, otherwise false

setHeader

public void setHeader(int column,
                      SafeHtml header)
Sets the column's header text.

Parameters:
column - the column index
header - the header text

setMenu

public void setMenu(Menu menu)
Sets the header's context menu.

Parameters:
menu - the context menu

setMinColumnWidth

public void setMinColumnWidth(int minColumnWidth)
Sets the minimum column width.

Parameters:
minColumnWidth - the minimum column width

setSplitterWidth

public void setSplitterWidth(int splitterWidth)
Sets the splitter width.

Parameters:
splitterWidth - the splitter width

showColumnMenu

public void showColumnMenu(int column)
Shows the column's header context menu.

Parameters:
column - the column index

updateColumnHidden

public void updateColumnHidden(int index,
                               boolean hidden)
Updates the visibility of a column.

Parameters:
index - the column index
hidden - true to hide, otherwise false

updateColumnWidth

public void updateColumnWidth(int column,
                              int width)
Updates the column width.

Parameters:
column - the column index
width - the new width

updateSortIcon

public void updateSortIcon(int colIndex,
                           SortDir dir)
Updates the sort icon of a column.

Parameters:
colIndex - the column index
dir - the sort direction

updateTotalWidth

public void updateTotalWidth(int offset,
                             int width)
Updates the total width of the header.

Parameters:
offset - the offset
width - the new width


Copyright © 2012. All Rights Reserved.