Class ColumnsState

    • Method Detail

      • getEntry

        public ColumnsState.Entry getEntry​(String id)
        Returns the ColumnsState.Entry instance for column with give id, or null if the entry doesn't exist.
        Parameters:
        id - column id
        Returns:
        entry or null
      • setColumnWidth

        public void setColumnWidth​(String id,
                                   int newWidth)
        Sets the width of column with specified id.
        Parameters:
        id - column id
        newWidth - new width or -1 if initial column width should be used
      • getColumnWidth

        public int getColumnWidth​(String id)
        Returns the width of column with specified id.
        Parameters:
        id - column id
        Returns:
        column width or -1 if initial width should be used
      • setColumnVisibility

        public void setColumnVisibility​(String id,
                                        boolean newValue)
        Sets the visibility of column with given id.
        Parameters:
        id - column id
        newValue -
      • getColumnVisibility

        public boolean getColumnVisibility​(String id)
        Returns the visibility of given column.
        Parameters:
        id - column id
        Returns:
        true if the column is visible, false otherwise
      • setColumnIndex

        public void setColumnIndex​(String id,
                                   int newIndex)
        Moves the column with specified to specified position. If the position is out of range throws IndexOutOfBoundsException. If the column with given id is not found, throws an IllegalStateException. The other columns are shifted accordingly.
        Parameters:
        id - column id
        newIndex - new column index
      • getVisibleColumns

        public <M,​I,​S> Collection<IGridColumn<M,​I,​S>> getVisibleColumns​(Collection<IGridColumn<M,​I,​S>> allColumns)
        Filters the given IGridColumn collection leaving only the columns with visibility set to true.
        Parameters:
        allColumns - Collection to be filtered.
        Returns:
        Collection of columns with visibility set to true.