com.sencha.gxt.widget.core.client.grid
Class ColumnConfig<M,N>

java.lang.Object
  extended by com.sencha.gxt.widget.core.client.grid.ColumnConfig<M,N>
Direct Known Subclasses:
RowExpander, RowNumberer, SummaryColumnConfig

public class ColumnConfig<M,N>
extends java.lang.Object

A column config for a column in a column model.

The column config is a configuration object that should only be used when creating a column model. After the column model is created, any changes should be made to the column model, not the column config.


Constructor Summary
ColumnConfig(ValueProvider<? super M,N> valueProvider)
          Creates a new column config.
ColumnConfig(ValueProvider<? super M,N> valueProvider, int width)
          Creates a new column config.
ColumnConfig(ValueProvider<? super M,N> valueProvider, int width, SafeHtml header)
          Creates a new column config.
ColumnConfig(ValueProvider<? super M,N> valueProvider, int width, java.lang.String header)
          Creates a new column config.
 
Method Summary
 HasHorizontalAlignment.HorizontalAlignmentConstant getAlignment()
          Returns the column's horizontal alignment.
 Cell<N> getCell()
          Returns the column's cell renderer.
 java.lang.String getColumnClassSuffix()
          Returns the columns class name.
 java.lang.String getColumnHeaderClassName()
          Returns the column class names(s).
 SafeStyles getColumnStyle()
          Returns the column cells styles.
 java.lang.String getColumnTextClassName()
          Returns the column text class name(s).
 SafeStyles getColumnTextStyle()
          Returns the column text styles.
 java.util.Comparator<N> getComparator()
          Returns the comparator used to compare the items in this column when grouping or sorting.
 SafeHtml getHeader()
          Returns the column's header text.
 java.lang.String getPath()
          Returns the value provider path.
 SafeHtml getToolTip()
          Returns the column's tool tip.
 ValueProvider<? super M,N> getValueProvider()
          Returns the column's valueProvider.
 Widget getWidget()
          Returns the column's widget.
 int getWidth()
          Returns the column's width.
 boolean isFixed()
          Returns true if the column width cannot be changed.
 boolean isGroupable()
          Returns true if the column can be grouped.
 boolean isHidden()
          Returns true if the column is hidden.
 boolean isHideable()
          Returns true if the column can be hidden.
 boolean isMenuDisabled()
          Returns true if the column's menu is disabled.
 boolean isResizable()
          Returns true if the column is resizable.
 boolean isRowHeader()
          Returns true if the column is marked as the row header.
 boolean isSortable()
          Returns true if the column is sortable (pre-render).
 void setAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant alignment)
          Sets the column's horizontal alignment.
 void setCell(Cell<N> cell)
          Sets the column's cell renderer (pre-render).
 void setColumnClassSuffix(java.lang.String columnClassSuffix)
          If provided, this value will be appended to 'x-grid3-td-' and be added to all table cells for the column.
 void setColumnHeaderClassName(java.lang.String classNames)
          Sets the CSS class name(s) to be applied to the header element (defaults to null).
 void setColumnStyle(SafeStyles columnStyles)
          Sets the CSS class name(s) to be applied to the cell in the column (defaults to null).
 void setColumnTextClassName(java.lang.String columnTextClassName)
          Sets the CSS class name(s) to be applied to the text element of each cell in the column (defaults to null).
 void setColumnTextStyle(SafeStyles textStyles)
          Sets one to many CSS styles to be applied to the text element of each cell in the column (defaults to null).
 void setComparator(java.util.Comparator<N> comparator)
          Sets the comparator used to compare the items in this column when grouping or sorting.
 void setFixed(boolean fixed)
          True if the column width cannot be changed either by column model or user resizing (defaults to false, pre-render).
 void setGroupable(boolean groupable)
          Sets if the column is groupable (defaults to true).
 void setHeader(SafeHtml header)
          Sets the column's header text.
 void setHeader(java.lang.String header)
          Sets the column's header text, to be displayed as escaped html.
 void setHidden(boolean hidden)
          Sets whether the column is hidden.
 void setHideable(boolean hideable)
          True to allow the column to be hidden via the context menu (defaults to true).
 void setMenuDisabled(boolean menuDisabled)
          Sets whether the column's menu is disabled (pre-render).
 void setResizable(boolean resizable)
          Specifies if the column may be resized (defaults to true, pre-render).
 void setRowHeader(boolean rowHeader)
          True to mark this column as the row header.
 void setSortable(boolean sortable)
          Sets if the column can be sorted (defaults to true, pre-render).
 void setToolTip(SafeHtml toolTip)
          Sets the column's tool tip.
 void setWidget(Widget widget, SafeHtml header)
          Sets the column's widget.
 void setWidth(int width)
          Sets the column's width in pixels.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnConfig

public ColumnConfig(ValueProvider<? super M,N> valueProvider)
Creates a new column config.


ColumnConfig

public ColumnConfig(ValueProvider<? super M,N> valueProvider,
                    int width)
Creates a new column config.

Parameters:
valueProvider - the value provider
width - the column width

ColumnConfig

public ColumnConfig(ValueProvider<? super M,N> valueProvider,
                    int width,
                    SafeHtml header)
Creates a new column config.

Parameters:
valueProvider - the value provider
width - the column width
header - the column header content

ColumnConfig

public ColumnConfig(ValueProvider<? super M,N> valueProvider,
                    int width,
                    java.lang.String header)
Creates a new column config.

Parameters:
valueProvider - thevalueProvider
width - the column width
header - the heading text
Method Detail

getAlignment

public HasHorizontalAlignment.HorizontalAlignmentConstant getAlignment()
Returns the column's horizontal alignment.

Returns:
the horizontal alignment

getCell

public Cell<N> getCell()
Returns the column's cell renderer.

Returns:
the renderer

getColumnClassSuffix

public java.lang.String getColumnClassSuffix()
Returns the columns class name.

Returns:
the column class name

getColumnHeaderClassName

public java.lang.String getColumnHeaderClassName()
Returns the column class names(s).

Returns:
the column class names(s)

getColumnStyle

public SafeStyles getColumnStyle()
Returns the column cells styles.

Returns:
the styles

getColumnTextClassName

public java.lang.String getColumnTextClassName()
Returns the column text class name(s).

Returns:
the class names(s)

getColumnTextStyle

public SafeStyles getColumnTextStyle()
Returns the column text styles.

Returns:
the styles

getComparator

public java.util.Comparator<N> getComparator()
Returns the comparator used to compare the items in this column when grouping or sorting. If N implements Comparable, this is not required to sort or group.

Returns:
the current comparator used or null if none has been set.

getHeader

public SafeHtml getHeader()
Returns the column's header text.

Returns:
the header text

getPath

public java.lang.String getPath()
Returns the value provider path.

Returns:
the path

getToolTip

public SafeHtml getToolTip()
Returns the column's tool tip.

Returns:
the tool tip

getValueProvider

public ValueProvider<? super M,N> getValueProvider()
Returns the column's valueProvider.

Returns:
the valueProvider

getWidget

public Widget getWidget()
Returns the column's widget.

Returns:
the widget

getWidth

public int getWidth()
Returns the column's width.

Returns:
the column width

isFixed

public boolean isFixed()
Returns true if the column width cannot be changed. Applies to both column width calculations (auto fill, force fit, auto expand column) and user resizing.

Returns:
the fixed state

isGroupable

public boolean isGroupable()
Returns true if the column can be grouped.

Returns:
true if groupable

isHidden

public boolean isHidden()
Returns true if the column is hidden.

Returns:
the hidden state

isHideable

public boolean isHideable()
Returns true if the column can be hidden.

Returns:
true if column can be hidden

isMenuDisabled

public boolean isMenuDisabled()
Returns true if the column's menu is disabled.

Returns:
the menu disabled state

isResizable

public boolean isResizable()
Returns true if the column is resizable.

Returns:
the resizable state

isRowHeader

public boolean isRowHeader()
Returns true if the column is marked as the row header.

Returns:
true if row header

isSortable

public boolean isSortable()
Returns true if the column is sortable (pre-render).

Returns:
the sortable state

setAlignment

public void setAlignment(HasHorizontalAlignment.HorizontalAlignmentConstant alignment)
Sets the column's horizontal alignment.

Parameters:
alignment - the alignment

setCell

public void setCell(Cell<N> cell)
Sets the column's cell renderer (pre-render).

Parameters:
cell - the cell renderer

setColumnClassSuffix

public void setColumnClassSuffix(java.lang.String columnClassSuffix)
If provided, this value will be appended to 'x-grid3-td-' and be added to all table cells for the column.

Parameters:
columnClassSuffix - the column class name

setColumnHeaderClassName

public void setColumnHeaderClassName(java.lang.String classNames)
Sets the CSS class name(s) to be applied to the header element (defaults to null). The class name(s) is only applied to the header cell, not the data rows.

Parameters:
classNames - the space separated list of class names

setColumnStyle

public void setColumnStyle(SafeStyles columnStyles)
Sets the CSS class name(s) to be applied to the cell in the column (defaults to null).

Parameters:
columnStyles - the column styles

setColumnTextClassName

public void setColumnTextClassName(java.lang.String columnTextClassName)
Sets the CSS class name(s) to be applied to the text element of each cell in the column (defaults to null).

Parameters:
columnTextClassName - the space separated list of class names

setColumnTextStyle

public void setColumnTextStyle(SafeStyles textStyles)
Sets one to many CSS styles to be applied to the text element of each cell in the column (defaults to null).

Parameters:
textStyles - the styles

setComparator

public void setComparator(java.util.Comparator<N> comparator)
Sets the comparator used to compare the items in this column when grouping or sorting. If N implements Comparable, this is not required to sort or group.

Parameters:
comparator - the Comparator to use when locally sorting or grouping

setFixed

public void setFixed(boolean fixed)
True if the column width cannot be changed either by column model or user resizing (defaults to false, pre-render).

Parameters:
fixed - true for fixed column width

setGroupable

public void setGroupable(boolean groupable)
Sets if the column is groupable (defaults to true). Only applies when using a GroupingView.

Parameters:
groupable - true to allow grouping

setHeader

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

Parameters:
header - the header text
See Also:
setHeader(String)

setHeader

public void setHeader(java.lang.String header)
Sets the column's header text, to be displayed as escaped html.

Parameters:
header - the header text to be displayed as escaped html
See Also:
setHeader(SafeHtml)

setHidden

public void setHidden(boolean hidden)
Sets whether the column is hidden.

Parameters:
hidden - true to hide

setHideable

public void setHideable(boolean hideable)
True to allow the column to be hidden via the context menu (defaults to true).

The setting only controls whether the check menu item is enabled / disabled in the grid context menu, controlling whether the user can hide / show a column. All programmatic calls to hide / show are unaffected by this setting.

Parameters:
hideable - true to allow hiding

setMenuDisabled

public void setMenuDisabled(boolean menuDisabled)
Sets whether the column's menu is disabled (pre-render).

Parameters:
menuDisabled - true to disable the menu

setResizable

public void setResizable(boolean resizable)
Specifies if the column may be resized (defaults to true, pre-render).

Parameters:
resizable - the resizable state

setRowHeader

public void setRowHeader(boolean rowHeader)
True to mark this column as the row header. Only applicable when ARIA is enabled for accessibility. Screen reader will annouce the columns value when using a cell selection model.

Parameters:
rowHeader - true to mark the column as the row header

setSortable

public void setSortable(boolean sortable)
Sets if the column can be sorted (defaults to true, pre-render).

Parameters:
sortable - the sortable state

setToolTip

public void setToolTip(SafeHtml toolTip)
Sets the column's tool tip.

Parameters:
toolTip - the tool tip

setWidget

public void setWidget(Widget widget,
                      SafeHtml header)
Sets the column's widget.

Parameters:
widget - the widget
header - the text used for the column context menu

setWidth

public void setWidth(int width)
Sets the column's width in pixels.

Parameters:
width - the width


Copyright © 2012. All Rights Reserved.