Package com.illumon.iris.gui.widget
Interface FreezeColumnsManager
- All Known Implementing Classes:
FreezeColumnsManagerImpl
,NullFreezeColumnManager
public interface FreezeColumnsManager
A Freeze Column manager allows the user to freeze columns so that they are always in view.
-
Method Summary
Modifier and Type Method Description default void
close()
Cleans up all resources related to this instancedefault int
convertColumnIndexToModel(int viewColumnIndex)
Converts a view column index to a model column index taking into account both the freeze table and main table.void
freezeColumn(String column)
Freezes a column.void
freezeColumn(TableColumn column)
Freezes a column.boolean
freezeColumnsSupported()
Indicates if freeze columns are supported.default String
getColumnName(int column)
Gets the column name at view column position taking into account both the freeze table and the main table.List<String>
getFreezeColumns()
Gets a list of the columns that are frozen.GuiTable
getFreezeTable()
Gets the freeze table.Set<String>
getFrozenColumnSet()
Gets the freeze columns as a set.default Collection<TableColumn>
getHiddenColumns()
Gets all the hidden columns taking into account both the freeze table and the main table.GuiTable
getMainTable()
Gets the main table.Set<String>
getNormalColumnSet()
Gets the normal (unfrozen) columns as a set.default Set<String>
getOtherColumnSet(GuiTable guiTable)
Gets the subset of columns that are used in the other GuiTable (including hidden columns).default int[]
getSelectedColumns()
Gets the selected columns taking into account both the freeze table and the main table.default int
getTotalColumnCount()
Gets the total column count for both the freeze table and the main table.default Collection<TableColumn>
getVisibleColumns()
Gets all the visible columns taking into account both the freeze table and the main table.default void
hideAllColumns()
Hides all columns in both the freeze table and main table.void
hideFreezeTable()
Hides the freeze table.boolean
isFreezeTable(GuiTable table)
Indicates if a table is the freeze table.boolean
isModified()
Indicates if the freeze columns have been altered since the table was first created (e.g.default boolean
mayHideOrFreezeColumn(TableColumn tableColumn)
Identifies if a specific column is eligible for hiding/freezing.void
repaint()
Requests the freeze table to repaint.void
setFreezeColumns(Collection<String> columns)
Clears any previous freeze columns and sets them to the columns in a list.void
setModified(boolean modified)
Marks if the freeze columns have been modified.default void
showColumn(TableColumn tableColumn)
Shows a column in the correct table (freeze table or main table)void
showFreezeTable()
Shows the freeze table.void
unfreezeColumn(String column)
Unfreezes a column.void
unfreezeColumn(TableColumn column)
Unfreezes a column.
-
Method Details
-
freezeColumnsSupported
boolean freezeColumnsSupported()Indicates if freeze columns are supported.- Returns:
- true if freeze columns are supported, false otherwise
-
getFreezeColumns
Gets a list of the columns that are frozen.- Returns:
- a list of freeze columns
-
getOtherColumnSet
Gets the subset of columns that are used in the other GuiTable (including hidden columns).- Parameters:
guiTable
- the table requesting the columns- Returns:
- the columns for the other table
-
getFrozenColumnSet
Gets the freeze columns as a set.- Returns:
- the freeze columns
-
getNormalColumnSet
Gets the normal (unfrozen) columns as a set.- Returns:
- the normal columns
-
setFreezeColumns
Clears any previous freeze columns and sets them to the columns in a list.- Parameters:
columns
- the list of columns to freeze
-
getMainTable
Gets the main table. This is useful for when we should operate on the main table, but the user clicks on the freeze table.- Returns:
- the main table
-
getFreezeTable
Gets the freeze table.- Returns:
- the freeze table, null if freezing is not supported or no columns have been frozen
-
hideFreezeTable
void hideFreezeTable()Hides the freeze table. -
showFreezeTable
void showFreezeTable()Shows the freeze table. -
isFreezeTable
Indicates if a table is the freeze table.- Parameters:
table
- the table to check- Returns:
- true if it is the freeze table, false otherwise
-
freezeColumn
Freezes a column.- Parameters:
column
- the column to freeze
-
unfreezeColumn
Unfreezes a column.- Parameters:
column
- the column to unfreeze
-
freezeColumn
Freezes a column.- Parameters:
column
- the column to freeze
-
unfreezeColumn
Unfreezes a column.- Parameters:
column
- the column to unfreeze
-
repaint
void repaint()Requests the freeze table to repaint. -
isModified
boolean isModified()Indicates if the freeze columns have been altered since the table was first created (e.g. the freeze columns are different than what was specified in the layout hints)- Returns:
- true if the columns have been modified, false otherwise
-
setModified
void setModified(boolean modified)Marks if the freeze columns have been modified.- Parameters:
modified
- true if they have been modified, false otherwise
-
getTotalColumnCount
default int getTotalColumnCount()Gets the total column count for both the freeze table and the main table.- Returns:
- the total column count
-
getSelectedColumns
default int[] getSelectedColumns()Gets the selected columns taking into account both the freeze table and the main table.- Returns:
- the selected columns
-
convertColumnIndexToModel
default int convertColumnIndexToModel(int viewColumnIndex)Converts a view column index to a model column index taking into account both the freeze table and main table. Specifically, the input index for this method is one that is treating the two tables as one big table.- Parameters:
viewColumnIndex
- the view column index- Returns:
- the model column index
-
getColumnName
Gets the column name at view column position taking into account both the freeze table and the main table.- Parameters:
column
- the view column index- Returns:
- the column name
-
getHiddenColumns
Gets all the hidden columns taking into account both the freeze table and the main table.- Returns:
- a collection of hidden columns
-
getVisibleColumns
Gets all the visible columns taking into account both the freeze table and the main table.- Returns:
- a collection of visible columns
-
hideAllColumns
default void hideAllColumns()Hides all columns in both the freeze table and main table. -
showColumn
Shows a column in the correct table (freeze table or main table)- Parameters:
tableColumn
- the column to show
-
mayHideOrFreezeColumn
Identifies if a specific column is eligible for hiding/freezing. We must not hide/freeze the final column in our mainTable, or we will have scrolling and viewport issues- Parameters:
tableColumn
- a column within our table- Returns:
- true if the column may be hidden or frozen, else false
-
close
default void close()Cleans up all resources related to this instance
-