Class 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.

    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment

        com.google.gwt.user.client.ui.HasHorizontalAlignment.AutoHorizontalAlignmentConstant, com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant
      • Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment

        com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant
    • Field Summary

      • Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment

        ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_LOCALE_END, ALIGN_LOCALE_START, ALIGN_RIGHT
      • Fields inherited from interface com.google.gwt.user.client.ui.HasVerticalAlignment

        ALIGN_BOTTOM, ALIGN_MIDDLE, ALIGN_TOP
    • 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.
      String getCellClassName()
      Returns the cell's class name(s).
      String getColumnHeaderClassName()
      Returns the column class names(s).
      com.google.gwt.safecss.shared.SafeStyles getColumnStyle()
      Returns the column cells styles.
      String getColumnTextClassName()
      Returns the column text class name(s).
      com.google.gwt.safecss.shared.SafeStyles getColumnTextStyle()
      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.SafeHtml getHeader()
      Returns the column's header html.
      com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
      Returns the column's horizontal alignment.
      com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalHeaderAlignment()
      Returns the column's header horizontal alignment.
      String getPath()
      Returns the value provider path.
      com.google.gwt.safehtml.shared.SafeHtml getToolTip()
      Returns the column's tool tip.
      ValueProvider<? super M,​N> getValueProvider()
      Returns the column's valueProvider.
      com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant getVerticalAlignment()
      Returns the column's vertical alignment.
      com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant getVerticalHeaderAlignment()
      Returns the column's header vertical alignment.
      com.google.gwt.user.client.ui.Widget getWidget()
      Returns the column's widget.
      int getWidth()
      Returns the column's width.
      boolean isCellPadding()  
      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 setCell​(com.google.gwt.cell.client.Cell<N> cell)
      Sets the column's cell renderer (pre-render).
      void setCellClassName​(String cellClassName)
      If provided, this value will be added to all table cells for the column.
      void setCellPadding​(boolean cellPadding)
      Configures whether or not the column's cells should have the default padding around their contents.
      void setColumnHeaderClassName​(String classNames)
      Sets the CSS class name(s) to be applied to the header element (defaults to null).
      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).
      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).
      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).
      void setComparator​(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​(com.google.gwt.safehtml.shared.SafeHtml html)
      Sets the column's header html.
      void setHeader​(String text)
      Sets the column's header text.
      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 setHorizontalAlignment​(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant horizontalAlignment)
      Sets the column's horizontal alignment.
      void setHorizontalHeaderAlignment​(com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant horizontalHeaderAlignment)
      Sets the column's header horizontal alignment.
      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​(com.google.gwt.safehtml.shared.SafeHtml toolTip)
      Sets the column's tool tip as html.
      void setToolTip​(String toolTip)
      Sets the column's tool tip as text, to be displayed as escaped html.
      void setVerticalAlignment​(com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant verticalAlignment)
      Sets the column's vertical alignment.
      void setVerticalHeaderAlignment​(com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant verticalHeaderAlignment)
      Sets the column's header vertical alignment, if there is room to align.
      void setWidget​(com.google.gwt.user.client.ui.Widget widget, com.google.gwt.safehtml.shared.SafeHtml header)
      Sets the column's widget.
      void setWidth​(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 provider
        width - 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 provider
        width - the column width
        header - the column header content
      • ColumnConfig

        public ColumnConfig​(ValueProvider<? super M,​N> valueProvider,
                            int width,
                            String header)
        Creates a new column config.
        Parameters:
        valueProvider - thevalueProvider
        width - the column width
        header - the heading text
    • Method Detail

      • getHorizontalAlignment

        public com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant getHorizontalAlignment()
        Returns the column's horizontal alignment.
        Specified by:
        getHorizontalAlignment in interface com.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:
        getVerticalAlignment in interface com.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. 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 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:
        setHorizontalAlignment in interface com.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. 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​(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:
        setVerticalAlignment in interface com.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 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