com.extjs.gxt.ui.client.widget.grid
Class ColumnConfig

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.widget.grid.ColumnConfig
All Implemented Interfaces:
Observable
Direct Known Subclasses:
CheckColumnConfig, RowExpander, RowNumberer, SummaryColumnConfig

public class ColumnConfig
extends BaseObservable

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.


Field Summary
protected  boolean ariaIgnore
          True to disable keyboard column navigation of this column.
 
Constructor Summary
ColumnConfig()
          Creates a new column config.
ColumnConfig(java.lang.String id, int width)
          Creates a new column config.
ColumnConfig(java.lang.String id, java.lang.String name, int width)
          Creates a new column config.
 
Method Summary
 Style.HorizontalAlignment getAlignment()
          Returns the column's horizontal alignment.
 java.lang.String getColumnStyleName()
          Returns the column style name.
 java.lang.String getDataIndex()
          Returns the column's data index.
 com.google.gwt.i18n.client.DateTimeFormat getDateTimeFormat()
          Returns the column's data time format.
 CellEditor getEditor()
          Returns the column's cell editor.
 java.lang.String getHeader()
          Returns the column's header text.
 java.lang.String getId()
          Returns the column's id.
 com.google.gwt.i18n.client.NumberFormat getNumberFormat()
          Returns the column's number format.
 GridCellRenderer<ModelData> getRenderer()
          Returns the column's cell renderer.
 java.lang.String getStyle()
          Returns the column style.
 java.lang.String getToolTip()
          Returns the column's tool tip.
 com.google.gwt.user.client.ui.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 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(Style.HorizontalAlignment alignment)
          Sets the column's horizontal alignment.
 void setColumnStyleName(java.lang.String columnStyleName)
          Sets the style name to be applied to the header element (defaults to null).
 void setDataIndex(java.lang.String dataIndex)
          Sets the column's data index.
 void setDateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat dateTimeFormat)
          Sets the column's date time format.
 void setEditor(CellEditor editor)
          Sets the column's cell editor.
 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(java.lang.String header)
          Sets the column's header text.
 void setHidden(boolean hidden)
          Sets whether the column is hidden.
 void setId(java.lang.String id)
          Sets the column's id.
 void setMenuDisabled(boolean menuDisabled)
          Sets whether the column's menu is disabled (pre-render).
 void setNumberFormat(com.google.gwt.i18n.client.NumberFormat format)
          Sets the column's number format.
 void setRenderer(GridCellRenderer renderer)
          Sets the column's cell renderer (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 setStyle(java.lang.String style)
          Sets one to many styles.
 void setToolTip(java.lang.String toolTip)
          Sets the column's tool tip.
 void setWidget(com.google.gwt.user.client.ui.Widget widget, java.lang.String header)
          Sets the column's widget.
 void setWidth(int width)
          Sets the column's width in pixels.
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ariaIgnore

protected boolean ariaIgnore
True to disable keyboard column navigation of this column.

Constructor Detail

ColumnConfig

public ColumnConfig()
Creates a new column config.


ColumnConfig

public ColumnConfig(java.lang.String id,
                    int width)
Creates a new column config.

Parameters:
id - the column id
width - the column width

ColumnConfig

public ColumnConfig(java.lang.String id,
                    java.lang.String name,
                    int width)
Creates a new column config.

Parameters:
id - the column id
name - the column name
width - the column width
Method Detail

getAlignment

public Style.HorizontalAlignment getAlignment()
Returns the column's horizontal alignment.

Returns:
the horizontal alignment

getColumnStyleName

public java.lang.String getColumnStyleName()
Returns the column style name.

Returns:
the column style name

getDataIndex

public java.lang.String getDataIndex()
Returns the column's data index.

Returns:
the data index

getDateTimeFormat

public com.google.gwt.i18n.client.DateTimeFormat getDateTimeFormat()
Returns the column's data time format.

Returns:
the date time format

getEditor

public CellEditor getEditor()
Returns the column's cell editor.

Returns:
the editor

getHeader

public java.lang.String getHeader()
Returns the column's header text.

Returns:
the header text

getId

public java.lang.String getId()
Returns the column's id.

Returns:
the id

getNumberFormat

public com.google.gwt.i18n.client.NumberFormat getNumberFormat()
Returns the column's number format.

Returns:
the number format

getRenderer

public GridCellRenderer<ModelData> getRenderer()
Returns the column's cell renderer.

Returns:
the renderer

getStyle

public java.lang.String getStyle()
Returns the column style.

Returns:
the style

getToolTip

public java.lang.String getToolTip()
Returns the column's tool tip.

Returns:
the tool tip

getWidget

public com.google.gwt.user.client.ui.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

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(Style.HorizontalAlignment alignment)
Sets the column's horizontal alignment.

Parameters:
alignment - the alignment

setColumnStyleName

public void setColumnStyleName(java.lang.String columnStyleName)
Sets the style name to be applied to the header element (defaults to null). The style is only applied to the header cell, not the data rows.

Parameters:
columnStyleName - the CSS style name

setDataIndex

public void setDataIndex(java.lang.String dataIndex)
Sets the column's data index.

Parameters:
dataIndex - the data index

setDateTimeFormat

public void setDateTimeFormat(com.google.gwt.i18n.client.DateTimeFormat dateTimeFormat)
Sets the column's date time format.

Parameters:
dateTimeFormat - the date time format

setEditor

public void setEditor(CellEditor editor)
Sets the column's cell editor.

Parameters:
editor - the cell editor

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(java.lang.String header)
Sets the column's header text.

Parameters:
header - the header text

setHidden

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

Parameters:
hidden - true to hide

setId

public void setId(java.lang.String id)
Sets the column's id.

Parameters:
id - the column id

setMenuDisabled

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

Parameters:
menuDisabled - true to disable the menu

setNumberFormat

public void setNumberFormat(com.google.gwt.i18n.client.NumberFormat format)
Sets the column's number format.

Parameters:
format - the number format

setRenderer

public void setRenderer(GridCellRenderer renderer)
Sets the column's cell renderer (pre-render).

Parameters:
renderer - the cell renderer

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

setStyle

public void setStyle(java.lang.String style)
Sets one to many styles.
 <code>
        setStyle("color:red;font-weight: bold");
 </code>
 

Parameters:
style - the style

setToolTip

public void setToolTip(java.lang.String toolTip)
Sets the column's tool tip.

Parameters:
toolTip - the tool tip

setWidget

public void setWidget(com.google.gwt.user.client.ui.Widget widget,
                      java.lang.String 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