Class ColumnConfig<M,N>
- java.lang.Object
-
- com.sencha.gxt.widget.core.client.grid.ColumnConfig<M,N>
-
- All Implemented Interfaces:
com.google.gwt.user.client.ui.HasHorizontalAlignment,com.google.gwt.user.client.ui.HasVerticalAlignment
- Direct Known Subclasses:
RowExpander,RowNumberer,SummaryColumnConfig
public class ColumnConfig<M,N> extends Object implements com.google.gwt.user.client.ui.HasHorizontalAlignment, com.google.gwt.user.client.ui.HasVerticalAlignment
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
Constructors Constructor Description 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, com.google.gwt.safehtml.shared.SafeHtml header)Creates a new column config.ColumnConfig(ValueProvider<? super M,N> valueProvider, int width, String header)Creates a new column config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.cell.client.Cell<N>getCell()Returns the column's cell renderer.StringgetCellClassName()Returns the cell's class name(s).StringgetColumnHeaderClassName()Returns the column class names(s).com.google.gwt.safecss.shared.SafeStylesgetColumnStyle()Returns the column cells styles.StringgetColumnTextClassName()Returns the column text class name(s).com.google.gwt.safecss.shared.SafeStylesgetColumnTextStyle()Returns the column text styles.Comparator<N>getComparator()Returns the comparator used to compare the items in this column when grouping or sorting.com.google.gwt.safehtml.shared.SafeHtmlgetHeader()Returns the column's header html.com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstantgetHorizontalAlignment()Returns the column's horizontal alignment.com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstantgetHorizontalHeaderAlignment()Returns the column's header horizontal alignment.StringgetPath()Returns the value provider path.com.google.gwt.safehtml.shared.SafeHtmlgetToolTip()Returns the column's tool tip.ValueProvider<? super M,N>getValueProvider()Returns the column's valueProvider.com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstantgetVerticalAlignment()Returns the column's vertical alignment.com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstantgetVerticalHeaderAlignment()Returns the column's header vertical alignment.com.google.gwt.user.client.ui.WidgetgetWidget()Returns the column's widget.intgetWidth()Returns the column's width.booleanisCellPadding()booleanisFixed()Returns true if the column width cannot be changed.booleanisGroupable()Returns true if the column can be grouped.booleanisHidden()Returns true if the column is hidden.booleanisHideable()Returns true if the column can be hidden.booleanisMenuDisabled()Returns true if the column's menu is disabled.booleanisResizable()Returns true if the column is resizable.booleanisRowHeader()Returns true if the column is marked as the row header.booleanisSortable()Returns true if the column is sortable (pre-render).voidsetCell(com.google.gwt.cell.client.Cell<N> cell)Sets the column's cell renderer (pre-render).voidsetCellClassName(String cellClassName)If provided, this value will be added to all table cells for the column.voidsetCellPadding(boolean cellPadding)Configures whether or not the column's cells should have the default padding around their contents.voidsetColumnHeaderClassName(String classNames)Sets the CSS class name(s) to be applied to the header element (defaults to null).voidsetColumnStyle(com.google.gwt.safecss.shared.SafeStyles columnStyles)Sets the CSS class name(s) to be applied to the cell in the column (defaults to null).voidsetColumnTextClassName(String columnTextClassName)Sets the CSS class name(s) to be applied to the text element of each cell in the column (defaults to null).voidsetColumnTextStyle(com.google.gwt.safecss.shared.SafeStyles textStyles)Sets one to many CSS styles to be applied to the text element of each cell in the column (defaults to null).voidsetComparator(Comparator<N> comparator)Sets the comparator used to compare the items in this column when grouping or sorting.voidsetFixed(boolean fixed)True if the column width cannot be changed either by column model or user resizing (defaults to false, pre-render).voidsetGroupable(boolean groupable)Sets if the column is groupable (defaults to true).voidsetHeader(com.google.gwt.safehtml.shared.SafeHtml html)Sets the column's header html.voidsetHeader(String text)Sets the column's header text.voidsetHidden(boolean hidden)Sets whether the column is hidden.voidsetHideable(boolean hideable)True to allow the column to be hidden via the context menu (defaults to true).voidsetHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant horizontalAlignment)Sets the column's horizontal alignment.voidsetHorizontalHeaderAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant horizontalHeaderAlignment)Sets the column's header horizontal alignment.voidsetMenuDisabled(boolean menuDisabled)Sets whether the column's menu is disabled (pre-render).voidsetResizable(boolean resizable)Specifies if the column may be resized (defaults to true, pre-render).voidsetRowHeader(boolean rowHeader)True to mark this column as the row header.voidsetSortable(boolean sortable)Sets if the column can be sorted (defaults to true, pre-render).voidsetToolTip(com.google.gwt.safehtml.shared.SafeHtml toolTip)Sets the column's tool tip as html.voidsetToolTip(String toolTip)Sets the column's tool tip as text, to be displayed as escaped html.voidsetVerticalAlignment(com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant verticalAlignment)Sets the column's vertical alignment.voidsetVerticalHeaderAlignment(com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant verticalHeaderAlignment)Sets the column's header vertical alignment, if there is room to align.voidsetWidget(com.google.gwt.user.client.ui.Widget widget, com.google.gwt.safehtml.shared.SafeHtml header)Sets the column's widget.voidsetWidth(int width)Sets the column's width in pixels.
-
-
-
Constructor Detail
-
ColumnConfig
public ColumnConfig(ValueProvider<? super M,N> valueProvider)
Creates a new column config.- Parameters:
valueProvider- the value provider
-
ColumnConfig
public ColumnConfig(ValueProvider<? super M,N> valueProvider, int width)
Creates a new column config.- Parameters:
valueProvider- the value providerwidth- the column width
-
ColumnConfig
public ColumnConfig(ValueProvider<? super M,N> valueProvider, int width, com.google.gwt.safehtml.shared.SafeHtml header)
Creates a new column config.- Parameters:
valueProvider- the value providerwidth- the column widthheader- the column header content
-
ColumnConfig
public ColumnConfig(ValueProvider<? super M,N> valueProvider, int width, String header)
Creates a new column config.- Parameters:
valueProvider- thevalueProviderwidth- the column widthheader- the heading text
-
-
Method Detail
-
getHorizontalAlignment
public com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
Returns the column's horizontal alignment.- Specified by:
getHorizontalAlignmentin interfacecom.google.gwt.user.client.ui.HasHorizontalAlignment- Returns:
- the horizontalAlignment
-
getVerticalAlignment
public com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant getVerticalAlignment()
Returns the column's vertical alignment.- Specified by:
getVerticalAlignmentin interfacecom.google.gwt.user.client.ui.HasVerticalAlignment- Returns:
- the verticalAlignment
-
getHorizontalHeaderAlignment
public com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalHeaderAlignment()
Returns the column's header horizontal alignment.- Returns:
- the horizontalAlignment
-
getVerticalHeaderAlignment
public com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant getVerticalHeaderAlignment()
Returns the column's header vertical alignment. Default is middle.- Returns:
- the verticalAlignment
- Since:
- 4.0.3
-
getCell
public com.google.gwt.cell.client.Cell<N> getCell()
Returns the column's cell renderer.- Returns:
- the renderer
-
getCellClassName
public String getCellClassName()
Returns the cell's class name(s).- Returns:
- the cell's class name(s)
-
getColumnHeaderClassName
public String getColumnHeaderClassName()
Returns the column class names(s).- Returns:
- the column class names(s)
-
getColumnStyle
public com.google.gwt.safecss.shared.SafeStyles getColumnStyle()
Returns the column cells styles.- Returns:
- the styles
-
getColumnTextClassName
public String getColumnTextClassName()
Returns the column text class name(s).- Returns:
- the class names(s)
-
getColumnTextStyle
public com.google.gwt.safecss.shared.SafeStyles getColumnTextStyle()
Returns the column text styles.- Returns:
- the styles
-
getComparator
public Comparator<N> getComparator()
Returns the comparator used to compare the items in this column when grouping or sorting. IfNimplementsComparable, this is not required to sort or group.- Returns:
- the current comparator used or null if none has been set.
-
getHeader
public com.google.gwt.safehtml.shared.SafeHtml getHeader()
Returns the column's header html.- Returns:
- the header html
-
getPath
public String getPath()
Returns the value provider path.- Returns:
- the path
-
getToolTip
public com.google.gwt.safehtml.shared.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 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
-
isCellPadding
public boolean isCellPadding()
-
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
-
setHorizontalAlignment
public void setHorizontalAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant horizontalAlignment)
Sets the column's horizontal alignment. This will affect cells with a rendering width less than 100%.- Specified by:
setHorizontalAlignmentin interfacecom.google.gwt.user.client.ui.HasHorizontalAlignment- Parameters:
horizontalAlignment- the horizontal alignment
-
setHorizontalHeaderAlignment
public void setHorizontalHeaderAlignment(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant horizontalHeaderAlignment)
Sets the column's header horizontal alignment. This will affect cells with a rendering width less than 100%.- Parameters:
horizontalHeaderAlignment- the horizontal header alignment
-
setVerticalHeaderAlignment
public void setVerticalHeaderAlignment(com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant verticalHeaderAlignment)
Sets the column's header vertical alignment, if there is room to align.HasVerticalAlignment- Parameters:
verticalHeaderAlignment- the vertical header alignment- Since:
- 4.0.3
-
setCell
public void setCell(com.google.gwt.cell.client.Cell<N> cell)
Sets the column's cell renderer (pre-render).- Parameters:
cell- the cell renderer
-
setCellPadding
public void setCellPadding(boolean cellPadding)
Configures whether or not the column's cells should have the default padding around their contents. Defaults to true- Parameters:
cellPadding- false to disable padding around the contents of a cell
-
setCellClassName
public void setCellClassName(String cellClassName)
If provided, this value will be added to all table cells for the column.- Parameters:
cellClassName- the cell class name(s)
-
setColumnHeaderClassName
public void setColumnHeaderClassName(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(com.google.gwt.safecss.shared.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(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(com.google.gwt.safecss.shared.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(Comparator<N> comparator)
Sets the comparator used to compare the items in this column when grouping or sorting. IfNimplementsComparable, 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(com.google.gwt.safehtml.shared.SafeHtml html)
Sets the column's header html.- Parameters:
html- the column's header html- See Also:
setHeader(String)
-
setHeader
public void setHeader(String text)
Sets the column's header text. Text that contains reserved html characters will be escaped.- Parameters:
text- the column's header text- 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(com.google.gwt.safehtml.shared.SafeHtml toolTip)
Sets the column's tool tip as html.- Parameters:
toolTip- the tool tip
-
setToolTip
public void setToolTip(String toolTip)
Sets the column's tool tip as text, to be displayed as escaped html.- Parameters:
toolTip- the tool tip
-
setVerticalAlignment
public void setVerticalAlignment(com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant verticalAlignment)
Sets the column's vertical alignment. This will affect cells with a rendering height less than 100%.- Specified by:
setVerticalAlignmentin interfacecom.google.gwt.user.client.ui.HasVerticalAlignment- Parameters:
verticalAlignment- the verticalAlignment
-
setWidget
public void setWidget(com.google.gwt.user.client.ui.Widget widget, com.google.gwt.safehtml.shared.SafeHtml header)Sets the column's widget.- Parameters:
widget- the widgetheader- 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
-
-