|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.event.MouseAdapter com.jidesoft.grid.TableColumnChooser
public class TableColumnChooser
TableColumnChooser
's show/hide column popup menu feature is replaced by TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please refer to the JavaDoc of
TableHeaderPopupMenuInstaller
for more information. In short, here is the new code to produce the same
result as the TabelColumnChooser.
TableHeaderPopupMenuInstaller installer = new TableHeaderPopupMenuInstaller(_table);
installer.addTableHeaderPopupMenuCustomizer(new AutoResizePopupMenuCustomizer());
installer.addTableHeaderPopupMenuCustomizer(new TableColumnChooserPopupMenuCustomizer());
Field Summary | |
---|---|
static String |
CLICK_COLUMN_INDEX
Deprecated. This client property is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static String |
CLIENT_PROPERTY_COLUMN_CHOOSER_DIALOG_STYLE
Since 2.10.1, we use DualList in TableColumnChooserDialog . |
static String |
CLIENT_PROPERTY_COLUMN_SORT_ORDER
You can set this client property for your table to SortableListModel.SORT_ASCENDING, SortableListModel.SORT_DESCENDING or SortableListModel.UNSORTED. |
static String |
CLIENT_PROPERTY_HIDDEN_IDENTIFIER_LIST
When hideColumn(javax.swing.JTable, int) or showColumn(javax.swing.JTable, String, int, int) is
invoked, we will update the hidden identifier list so that you could locate the list of the hidden identifiers. |
static String |
CLIENT_PROPERTY_TABLE_CHANGED
When grouping or ungrouping, JideTable.tableChanged(TableModelEvent) is called, we will call the code below to save the information that the table is changed. |
static String |
CLIENT_PROPERTY_TABLE_COLUMN_IDENTIFIER
When hideColumn(javax.swing.JTable, int) is called, we will call the code below to save the original
column. |
static String |
CLIENT_PROPERTY_TABLE_COLUMN_INDEX
Deprecated. |
static String |
CLIENT_PROPERTY_TABLE_COLUMN_NAME
Deprecated. |
static String |
CLIENT_PROPERTY_TABLE_COLUMN_WIDTH_RESET
By default, column width will not be reset when choosing "reset to default". |
static String |
COLUMN_INDEX
Deprecated. This client property is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static String |
DISPLAY_COLUMN_NAMES
Deprecated. This client property is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static String |
FIXED_COLUMNS
Deprecated. This client property is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static String |
HIDDEN_COLUMNS
Deprecated. This client property is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static String |
SHOW_AUTO_RESIZE
Deprecated. This client property is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static String |
SHOW_SELECTION
Deprecated. This client property is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static String |
TABLE
Deprecated. This client property is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static String |
TABLE_COLUMN_CHOOSER
Deprecated. This client property is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
Constructor Summary | |
---|---|
TableColumnChooser()
Deprecated. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please refer to the JavaDoc
of TableHeaderPopupMenuInstaller for more information. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
protected void |
createColumnChooserMenuItems(JPopupMenu popup,
JTableHeader header,
int[] fixedColumns,
int clickingColumn)
Deprecated. This method is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please refer to the
JavaDoc of TableHeaderPopupMenuInstaller for more information. |
protected void |
createColumnChooserMenuItems(JPopupMenu popup,
JTableHeader header,
int[] fixedColumns,
int[] hiddenColumns,
int clickingColumn)
Deprecated. This method is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please refer to the
JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static int |
getActualIndex(JTable table,
int columnIndex)
Get actual index from the model index in table scroll pane scenario. |
static JTable |
getActualTable(JTable table,
int modelIndex)
Get actual table instance from the model index in table scroll pane scenario. |
static int[] |
getAllHiddenColumns(JTable table)
Gets all the hidden columns. |
static JTable[] |
getAllTables(JTable table)
Get all table instances from any one table in table scroll pane scenario. |
static int |
getColumnIndex(TableColumnModel model,
int modelCol)
Gets the index of the column in the specified TableColumnModel. |
static int |
getColumnIndex(TableColumnModel model,
TableColumn col)
Gets the view index of the column in the specified TableColumnModel. |
protected String |
getDisplayColumnName(JTable table,
int columnIndex)
Gets the display column name to be displayed on the popup menu. |
static AbstractButton |
getTableColumnChooserButton(JTable table)
Gets the table column chooser button so that you can add it to the JScrollPane.UPPER_RIGHT_CORNER of a JScrollPane. |
static AbstractButton |
getTableColumnChooserButton(JTable table,
boolean[] hidableColumns)
Gets a button which will invoke a TableColumnChooserDialog to allow user show or hide columns. |
static AbstractButton |
getTableColumnChooserButton(JTable table,
boolean[] hidableColumns,
String[] descriptions)
Gets a button which will invoke a TableColumnChooserDialog to allow user show or hide columns. |
static AbstractButton |
getTableColumnChooserButton(JTable table,
int[] fixedColumns,
int[] hiddenColumns,
String[] descriptions)
Gets a button which will invoke a TableColumnChooserDialog to allow user show or hide columns. |
static AbstractButton |
getTableColumnChooserButton(JTable table,
int[] fixedColumns,
String[] descriptions)
Gets a button which will invoke a TableColumnChooserDialog to allow user show or hide columns. |
static AbstractButton |
getTableColumnChooserButton(JTable table,
String[] descriptions)
Gets a button which will invoke a TableColumnChooserDialog to allow user show or hide columns. |
static TableColumnChooserDialog |
getTableColumnChooserDialog(Dialog parent,
JTable table,
boolean[] hidableColumns,
String[] descriptions)
Gets the TableColumnChooserDialog for the table. |
static TableColumnChooserDialog |
getTableColumnChooserDialog(Dialog parent,
JTable table,
int[] fixedColumns,
int[] hiddenColumns,
String[] descriptions)
Gets the TableColumnChooserDialog for the table. |
static TableColumnChooserDialog |
getTableColumnChooserDialog(Dialog parent,
JTable table,
int[] fixedColumns,
String[] descriptions)
Gets the TableColumnChooserDialog for the table. |
static TableColumnChooserDialog |
getTableColumnChooserDialog(Frame parent,
JTable table,
boolean[] hidableColumns,
String[] descriptions)
Gets the TableColumnChooserDialog for the table. |
static TableColumnChooserDialog |
getTableColumnChooserDialog(Frame parent,
JTable table,
int[] fixedColumns,
int[] hiddenColumns,
String[] descriptions)
Gets the TableColumnChooserDialog for the table. |
static TableColumnChooserDialog |
getTableColumnChooserDialog(Frame parent,
JTable table,
int[] fixedColumns,
String[] descriptions)
Gets the TableColumnChooserDialog for the table. |
static Set<Integer> |
getVisibleColumns(JTable table)
Gets a Set of column indices that are visible. |
static Set<Integer> |
getVisibleColumns(JTable table,
boolean considerTableScrollPane)
Gets a Set of column indices that are visible. |
static boolean |
hasHiddenColumns(JTable table)
Checks if the table has hidden columns. |
static void |
hideColumn(JTable table,
int modelIndex)
Hides the table column at the specified index. |
static void |
hideColumns(JTable table,
int[] modelColumnIndexes)
Hides the columns at specified indices. |
static TableColumnChooser |
install(JTable table)
Deprecated. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
boolean |
isKeepColumnOrder()
Deprecated. This method is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please refer to the
JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static boolean |
isVisibleColumn(JTable table,
int modelIndex)
Checks if a column is visible. |
static boolean |
isVisibleColumn(TableColumnModel model,
int modelCol)
Checks if a column is visible. |
static boolean |
isVisibleColumn(TableColumnModel model,
TableColumn col)
Checks if a column is visible. |
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
propertyChange(PropertyChangeEvent evt)
|
static void |
reorderColumns(JTable table,
int[] visibleModelIndices)
Reorder the columns according the visible column index array. |
static void |
resetColumnsToDefault(JTable table)
Reset the visible columns to all the columns in table model and clear all previous hiding actions. |
void |
setKeepColumnOrder(boolean keepColumnOrder)
Deprecated. This method is not used anymore. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please refer to the
JavaDoc of TableHeaderPopupMenuInstaller for more information. |
static void |
showAllColumns(JTable table)
Shows all columns that were hidden. |
static void |
showColumn(JTable table,
int modelIndex,
int viewIndex)
Shows the TableColumn at the specified column index. |
static void |
showColumn(JTable table,
String columnIdentifier,
int modelIndex,
int newColumnIndex)
Shows the TableColumn with the specified name. |
static void |
showColumns(JTable table,
int[] modelColumnIndexes)
Shows the columns at specified indices. |
static void |
uninstall(JTable table)
Deprecated. Using TableColumnChooser to add header popup menu is replaced with TableHeaderPopupMenuInstaller class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller for more information. |
Methods inherited from class java.awt.event.MouseAdapter |
---|
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Deprecated public static final String FIXED_COLUMNS
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.@Deprecated public static final String HIDDEN_COLUMNS
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.@Deprecated public static final String SHOW_AUTO_RESIZE
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.@Deprecated public static final String SHOW_SELECTION
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.@Deprecated public static final String DISPLAY_COLUMN_NAMES
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.@Deprecated public static final String COLUMN_INDEX
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.@Deprecated public static final String CLICK_COLUMN_INDEX
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.@Deprecated public static final String TABLE
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.@Deprecated public static final String TABLE_COLUMN_CHOOSER
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.@Deprecated public static final String CLIENT_PROPERTY_TABLE_COLUMN_NAME
hideColumn(javax.swing.JTable, int)
is called, we will call the code below to save the original
column. You can get it from the client property if you need the information.
table.putClientProperty(CLIENT_PROPERTY_TABLE_COLUMN_NAME + col.getHeaderValue(), col);
@Deprecated public static final String CLIENT_PROPERTY_TABLE_COLUMN_INDEX
hideColumn(javax.swing.JTable, int)
is called, we will call the code below to save the original
column. You can get it from the client property if you need the information.
table.putClientProperty(CLIENT_PROPERTY_TABLE_COLUMN_INDEX + col.getModelIndex(), col);
public static final String CLIENT_PROPERTY_TABLE_COLUMN_IDENTIFIER
hideColumn(javax.swing.JTable, int)
is called, we will call the code below to save the original
column. You can get it from the client property if you need the information.
table.putClientProperty(CLIENT_PROPERTY_TABLE_COLUMN_IDENTIFIER + col.getIdentifier(), col);
public static final String CLIENT_PROPERTY_HIDDEN_IDENTIFIER_LIST
hideColumn(javax.swing.JTable, int)
or showColumn(javax.swing.JTable, String, int, int)
is
invoked, we will update the hidden identifier list so that you could locate the list of the hidden identifiers.
public static final String CLIENT_PROPERTY_COLUMN_CHOOSER_DIALOG_STYLE
TableColumnChooserDialog
. To change the behavior back,
please set this client property for your table with Boolean.TRUE.
public static final String CLIENT_PROPERTY_COLUMN_SORT_ORDER
public static final String CLIENT_PROPERTY_TABLE_CHANGED
showColumn(javax.swing.JTable, String, int, int)
is
called, we will reset the modelIndex in columnModel based on the identifiers.
table.putClientProperty(CLIENT_PROPERTY_TABLE_CHANGED, true);
public static final String CLIENT_PROPERTY_TABLE_COLUMN_WIDTH_RESET
Constructor Detail |
---|
@Deprecated public TableColumnChooser()
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please refer to the JavaDoc
of TableHeaderPopupMenuInstaller
for more information.
Method Detail |
---|
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class MouseAdapter
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class MouseAdapter
@Deprecated public boolean isKeepColumnOrder()
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please refer to the
JavaDoc of TableHeaderPopupMenuInstaller
for more information.
@Deprecated public void setKeepColumnOrder(boolean keepColumnOrder)
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please refer to the
JavaDoc of TableHeaderPopupMenuInstaller
for more information.
keepColumnOrder
- the flagpublic static void reorderColumns(JTable table, int[] visibleModelIndices)
table
- the table to be reorderedvisibleModelIndices
- the model indices array@Deprecated protected void createColumnChooserMenuItems(JPopupMenu popup, JTableHeader header, int[] fixedColumns, int clickingColumn)
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please refer to the
JavaDoc of TableHeaderPopupMenuInstaller
for more information.
popup
- the popup menuheader
- the table headerfixedColumns
- the fixed columnsclickingColumn
- the clicking column@Deprecated protected void createColumnChooserMenuItems(JPopupMenu popup, JTableHeader header, int[] fixedColumns, int[] hiddenColumns, int clickingColumn)
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please refer to the
JavaDoc of TableHeaderPopupMenuInstaller
for more information.
popup
- the popup menuheader
- the table headerfixedColumns
- the fixed columnshiddenColumns
- the hidden columnsclickingColumn
- the clicking columnprotected String getDisplayColumnName(JTable table, int columnIndex)
table
- the tablecolumnIndex
- the column index as in table model.
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
@Deprecated public static TableColumnChooser install(JTable table)
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.
table
- the table
@Deprecated public static void uninstall(JTable table)
TableHeaderPopupMenuInstaller
class which is more powerful and flexible. Please
refer to the JavaDoc of TableHeaderPopupMenuInstaller
for more information.
table
- the tablepublic void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public static int getColumnIndex(TableColumnModel model, int modelCol)
model
- table column modelmodelCol
- the column index in table model
public static boolean isVisibleColumn(JTable table, int modelIndex)
table
- the tablemodelIndex
- the column index in table model
public static Set<Integer> getVisibleColumns(JTable table)
getVisibleColumns(javax.swing.JTable, boolean)
with the second parameter as true by
default.
table
- the table
getVisibleColumns(javax.swing.JTable, boolean)
public static Set<Integer> getVisibleColumns(JTable table, boolean considerTableScrollPane)
table
- the tableconsiderTableScrollPane
- the flag indicating if we should consider the other tables in the same
TableScrollPane.
public static JTable getActualTable(JTable table, int modelIndex)
table
- whichever table existing in the table scroll panemodelIndex
- the model index
public static JTable[] getAllTables(JTable table)
table
- whichever table existing in the table scroll pane
public static int getActualIndex(JTable table, int columnIndex)
table
- whichever table existing in the table scroll panecolumnIndex
- the column index
public static boolean isVisibleColumn(TableColumnModel model, int modelCol)
model
- table column modelmodelCol
- the column index in table model
public static int getColumnIndex(TableColumnModel model, TableColumn col)
model
- table column modelcol
- the TableColumn instance
public static boolean isVisibleColumn(TableColumnModel model, TableColumn col)
model
- table column modelcol
- the TableColumn
public static void showColumn(JTable table, int modelIndex, int viewIndex)
hideColumn(javax.swing.JTable, int)
to hide the column.
table
- the tablemodelIndex
- the column index in TableModel. This is the column that will be shown.viewIndex
- new column view index. This is optional. You can use -1. Otherwise the new column will be put
at this view index.public static void showColumn(JTable table, String columnIdentifier, int modelIndex, int newColumnIndex)
hideColumn(javax.swing.JTable, int)
to hide the column.
table
- the tablecolumnIdentifier
- if you use this parameter, we will try to locate the column based on this name. If not
found, we will try to find the column based on modelIndex.modelIndex
- the column index in TableModel. This is the column that will be shown.newColumnIndex
- new column view index. This is optional. You can use -1. Otherwise the new column will be
put at this view index.public static void hideColumn(JTable table, int modelIndex)
table
- the tablemodelIndex
- the column index as in table model.public static boolean hasHiddenColumns(JTable table)
table
- the table.
public static int[] getAllHiddenColumns(JTable table)
table
- the table.
public static void showAllColumns(JTable table)
table
- the table.public static void hideColumns(JTable table, int[] modelColumnIndexes)
table
- the tablemodelColumnIndexes
- the columns to be hidden and the rest will be shown.public static void showColumns(JTable table, int[] modelColumnIndexes)
table
- the tablemodelColumnIndexes
- the columns to be shown and the rest will be hiddenpublic static void resetColumnsToDefault(JTable table)
table
- the table to be resetpublic static AbstractButton getTableColumnChooserButton(JTable table)
table
- the table
public static AbstractButton getTableColumnChooserButton(JTable table, boolean[] hidableColumns)
JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, TableColumnChooser.getTableColumnChooserButton(table,
...);
Please make sure you have VERTICAL_SCROLLBAR_ALWAYS. Otherwise, the vertical scroll bar could be hidden then the
button will be hidden too.
table
- the tablehidableColumns
- the array of boolean to indicate which column can be hidden.
public static AbstractButton getTableColumnChooserButton(JTable table, String[] descriptions)
JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, TableColumnChooser.getTableColumnChooserButton(table,
...);
Please make sure you have VERTICAL_SCROLLBAR_ALWAYS. Otherwise, the vertical scroll bar could be hidden then the
button will be hidden too.
table
- the tabledescriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the column
chooser dialog instead of the column name.
public static AbstractButton getTableColumnChooserButton(JTable table, boolean[] hidableColumns, String[] descriptions)
JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, TableColumnChooser.getTableColumnChooserButton(table,
...);
Please make sure you have VERTICAL_SCROLLBAR_ALWAYS. Otherwise, the vertical scroll bar could be hidden then the
button will be hidden too.
table
- the tablehidableColumns
- the array of boolean to indicate which column can be hidden.descriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the
column chooser dialog instead of the colum name.
TableColumnChooserDialog
public static AbstractButton getTableColumnChooserButton(JTable table, int[] fixedColumns, String[] descriptions)
JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, TableColumnChooser.getTableColumnChooserButton(table,
...);
Please make sure you have VERTICAL_SCROLLBAR_ALWAYS. Otherwise, the vertical scroll bar could be hidden then the
button will be hidden too.
table
- the tablefixedColumns
- the column indices that can not be hidden.descriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the column
chooser dialog instead of the column name.
TableColumnChooserDialog
public static AbstractButton getTableColumnChooserButton(JTable table, int[] fixedColumns, int[] hiddenColumns, String[] descriptions)
JScrollPane scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setCorner(JScrollPane.UPPER_RIGHT_CORNER, TableColumnChooser.getTableColumnChooserButton(table,
...);
Please make sure you have VERTICAL_SCROLLBAR_ALWAYS. Otherwise, the vertical scroll bar could be hidden then the
button will be hidden too.
table
- the tablefixedColumns
- the column indices that can not be hidden.hiddenColumns
- the column indices that should not be visible in the list.descriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the
column chooser dialog instead of the column name.
TableColumnChooserDialog
public static TableColumnChooserDialog getTableColumnChooserDialog(Frame parent, JTable table, boolean[] hidableColumns, String[] descriptions)
parent
- the parent for the dialog.table
- the tablehidableColumns
- the array of boolean to indicate which column can be hidden.descriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the
column chooser dialog instead of the column name.
public static TableColumnChooserDialog getTableColumnChooserDialog(Frame parent, JTable table, int[] fixedColumns, String[] descriptions)
parent
- the parent for the dialogtable
- the tablefixedColumns
- the column indices that can not be hidden.descriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the column
chooser dialog instead of the column name.
public static TableColumnChooserDialog getTableColumnChooserDialog(Frame parent, JTable table, int[] fixedColumns, int[] hiddenColumns, String[] descriptions)
parent
- the parent for the dialogtable
- the tablefixedColumns
- the column indices that can not be hidden.hiddenColumns
- the column indices that should not be visible in the list.descriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the
column chooser dialog instead of the column name.
public static TableColumnChooserDialog getTableColumnChooserDialog(Dialog parent, JTable table, boolean[] hidableColumns, String[] descriptions)
parent
- the parent for the dialogtable
- the tablehidableColumns
- the columns that shouldn't be hidden if the corresponding boolean in the array is false.descriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the
column chooser dialog instead of the column name.
public static TableColumnChooserDialog getTableColumnChooserDialog(Dialog parent, JTable table, int[] fixedColumns, String[] descriptions)
parent
- the parent for the dialogtable
- the tablefixedColumns
- the column indices that can not be hidden.descriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the column
chooser dialog instead of the column name.
public static TableColumnChooserDialog getTableColumnChooserDialog(Dialog parent, JTable table, int[] fixedColumns, int[] hiddenColumns, String[] descriptions)
parent
- the parent for the dialogtable
- the tablefixedColumns
- the column indices that can not be hidden.hiddenColumns
- the column indices that should not be visible in the list.descriptions
- the descriptions for all columns as the order in the TableModel. It will appear in the
column chooser dialog instead of the column name.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |