|
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.TableHeaderPopupMenuInstaller
public class TableHeaderPopupMenuInstaller
TableHeaderPopupMenuInstaller
allows you to add a popup menu to table header and customize it. To use
it, you just need to call
TableHeaderPopupMenuInstaller installer = new TableHeaderPopupMenuInstaller(table);
Or if you want to uninstall it, call
TableHeaderPopupMenuInstaller.getTableHeaderPopupMenuInstaller(table).uninstallListeners();
However TableHeaderPopupMenuInstaller
has no menu items. You can use one of the existing
TableHeaderPopupMenuCustomizer
s to add more menu items or create your own
TableHeaderPopupMenuCustomizer
to do it.
Field Summary | |
---|---|
static String |
CLIENT_PROPERTY_POPUP_MENU_INSTALLER
Client property used by JTable to provide its own TableColumnPopupMenuCustomizer. |
Constructor Summary | |
---|---|
TableHeaderPopupMenuInstaller(JTable table)
Creates a TableColumnPopupMenuCustomizer. |
Method Summary | |
---|---|
static void |
addSeparatorIfNecessary(JPopupMenu popup)
Adds a separator to the popup menu if there are menu items on it already. |
void |
addTableHeaderPopupMenuCustomizer(TableHeaderPopupMenuCustomizer customizer)
|
protected JPopupMenu |
createPopupMenu()
|
protected void |
customizeMenuItems(JTableHeader header,
JPopupMenu popup,
int clickingColumn)
Customizes the menu items for the popup menu. |
TableHeaderPopupMenuCustomizer[] |
getTableHeaderPopupMenuCustomizers()
|
static TableHeaderPopupMenuInstaller |
getTableHeaderPopupMenuInstaller(JTable table)
Gets the Searchable installed on the component. |
void |
installListeners()
Installs the listeners needed in order to show the popup menu for the table header. |
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
propertyChange(PropertyChangeEvent evt)
|
void |
removeTableHeaderPopupMenuCustomizer(TableHeaderPopupMenuCustomizer customizer)
|
void |
uninstallListeners()
Uninstalls the listeners needed in order to show the popup menu for the table header. |
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 |
---|
public static final String CLIENT_PROPERTY_POPUP_MENU_INSTALLER
Constructor Detail |
---|
public TableHeaderPopupMenuInstaller(JTable table)
table
- the table.Method Detail |
---|
public void addTableHeaderPopupMenuCustomizer(TableHeaderPopupMenuCustomizer customizer)
public void removeTableHeaderPopupMenuCustomizer(TableHeaderPopupMenuCustomizer customizer)
public TableHeaderPopupMenuCustomizer[] getTableHeaderPopupMenuCustomizers()
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
protected JPopupMenu createPopupMenu()
protected void customizeMenuItems(JTableHeader header, JPopupMenu popup, int clickingColumn)
header
- the table header.popup
- the popup menu.clickingColumn
- the column that user right clicks. -1 means invalid clicking column. However, it might be -2 or less in GroupTableHeader.public static void addSeparatorIfNecessary(JPopupMenu popup)
popup
- the popup menu.public void installListeners()
public void uninstallListeners()
public static TableHeaderPopupMenuInstaller getTableHeaderPopupMenuInstaller(JTable table)
table
- the table
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |