JIDE 3.5.15

com.jidesoft.pivot
Class AggregateTableColumnChooserPopupMenuCustomizer

java.lang.Object
  extended by com.jidesoft.grid.TableColumnChooserPopupMenuCustomizer
      extended by com.jidesoft.pivot.AggregateTableColumnChooserPopupMenuCustomizer
All Implemented Interfaces:
TableHeaderPopupMenuCustomizer

public class AggregateTableColumnChooserPopupMenuCustomizer
extends TableColumnChooserPopupMenuCustomizer

A AggregateTableColumnChooserPopupMenuCustomizer to add menu items related to show or hide the columns to a popup menu just for AggregateTable and AggregateTablePane. To use it, you can use the code like this.

 TableHeaderPopupMenuInstaller installer = new TableHeaderPopupMenuInstaller(aggregateTable)
 installer.addTableHeaderPopupMenuCustomizer(new AggregateTableColumnChooserPopupMenuCustomizer());
 


Field Summary
 
Fields inherited from class com.jidesoft.grid.TableColumnChooserPopupMenuCustomizer
_locale, CLIENT_PROPERTY_CLICK_COLUMN_INDEX, CONTEXT_MENU_HIDE, CONTEXT_MENU_MORE, CONTEXT_MENU_OTHER_COLUMNS, CONTEXT_MENU_RESET_COLUMNS, CONTEXT_MENU_SHOW_ALL
 
Constructor Summary
AggregateTableColumnChooserPopupMenuCustomizer()
           
 
Method Summary
 void customizePopupMenu(JTableHeader header, JPopupMenu popup, int clickingColumn)
          The method generates the context menu items by clickingColumn.
protected  String getDisplayColumnName(JTable table, int columnIndex)
          Gets the display column name to be displayed on the popup menu.
protected  String getResourceString(String key)
          Gets the localized string from resource bundle.
protected  void hideColumn(JTable table, int columnIndex, Object columnIdentifier)
          Calls to AggregateTableUtils.hideColumn to hide the column.
protected  void showAllColumns(JTable table, AggregateTablePane pane)
           
protected  void showColumn(JTable table, int columnIndex, Object columnIdentifier)
          Calls to AggregateTableUtils.showColumn to show the column.
 
Methods inherited from class com.jidesoft.grid.TableColumnChooserPopupMenuCustomizer
createTableColumnChooserDialog, getColumnCount, getDisplayColumnNames, getFavoriteColumns, getFixedColumns, getHiddenColumns, getIdentifier, hideColumn, setDisplayColumnNames, setFavoriteColumns, setFixedColumns, setHiddenColumns, showAllColumns, showColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregateTableColumnChooserPopupMenuCustomizer

public AggregateTableColumnChooserPopupMenuCustomizer()
Method Detail

getDisplayColumnName

protected String getDisplayColumnName(JTable table,
                                      int columnIndex)
Gets the display column name to be displayed on the popup menu.

Overrides:
getDisplayColumnName in class TableColumnChooserPopupMenuCustomizer
Parameters:
table - the table
columnIndex - the inner column index indicating the order in PivotField
Returns:
the display name for the column at the specified column index.

customizePopupMenu

public void customizePopupMenu(JTableHeader header,
                               JPopupMenu popup,
                               int clickingColumn)
The method generates the context menu items by clickingColumn. After the process, the popup will contain all the generated menu items. You can override the method to add some new menu items or delete some existing menu items as you wish. You can use CONTEXT_MENU_... as the name to find the existing menu items.
      for (int i = 0; i < popup.getComponentCount(); i++) {
          if (CONTEXT_MENU_HIDE.equals(popup.getComponent(i).getName())) {
              popup.remove(popup.getComponent(i));
          }
      }
 

Specified by:
customizePopupMenu in interface TableHeaderPopupMenuCustomizer
Overrides:
customizePopupMenu in class TableColumnChooserPopupMenuCustomizer
Parameters:
header - the table header
popup - the popup menu to be displayed
clickingColumn - the column index clicked

showColumn

protected void showColumn(JTable table,
                          int columnIndex,
                          Object columnIdentifier)
Calls to AggregateTableUtils.showColumn to show the column.

Overrides:
showColumn in class TableColumnChooserPopupMenuCustomizer
Parameters:
table - the table
columnIndex - the model column index.
columnIdentifier - the column identifier
Since:
3.2.2

hideColumn

protected void hideColumn(JTable table,
                          int columnIndex,
                          Object columnIdentifier)
Calls to AggregateTableUtils.hideColumn to hide the column.

Parameters:
table - the table
columnIndex - the model column index.
columnIdentifier - the column identifier
Since:
3.2.2

getResourceString

protected String getResourceString(String key)
Gets the localized string from resource bundle. Subclass can override it to provide its own string. Available keys are defined in grid.properties that begin with "TableColumnChooser.".

Overrides:
getResourceString in class TableColumnChooserPopupMenuCustomizer
Parameters:
key - the resource string key
Returns:
the localized string.

showAllColumns

protected void showAllColumns(JTable table,
                              AggregateTablePane pane)

JIDE 3.5.15