public class DockableActionCustomizer
extends java.lang.Object
It can be used, for example, to add a set of menu items to the contextual menu associated with any dockable.
Example :
DockableActionCustomizer customizer = new DockableActionCustomizer(){ public void visitSingleDockableTitleBarPopUp(JPopupMenu popUpMenu, Dockable dockable){ popUpMenu.add(new JMenuItem("test")); // a menu for SingleDockableContainers } public void visitTabSelectorPopUp(JPopupMenu popUpMenu, Dockable dockable){ popUpMenu.add(new JMenuItem(closeAllInTab)); // two menus when contained in a tabbed container popUpMenu.add(new JMenuItem(closeAllOtherInTab)); } }; customizer.setSingleDockableTitleBarPopUpCustomizer(true); // enable single customizer.setTabSelectorPopUpCustomizer(true); // enable tabbed DockKey key = ... key.setActioncustomizer(customizer); // assoiate it with one or more DockKeys
Implementation Note : the customizer is invoked every time a pop-up is triggered from the associated dockable container. It is a good practice to keep object creation and listener attachments outside the visit..() methods.
Constructor and Description |
---|
DockableActionCustomizer()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
isSingleDockableTitleBarPopUpCustomizer()
Returns wether this customizer is used in the context of a SingleDockableContainer
|
boolean |
isTabSelectorPopUpCustomizer()
Returns wether this customizer is used in the context of a TabbedDockableContainer
|
void |
setSingleDockableTitleBarPopUpCustomizer(boolean isCustomizer)
Updates the singleDockableTitleBar property.
|
void |
setTabSelectorPopUpCustomizer(boolean isCustomizer)
Updates the tabSelectorDockableTitleBar property
|
void |
visitSingleDockableTitleBarPopUp(javax.swing.JPopupMenu popUpMenu,
Dockable dockable)
Override this method to add contextual items at the end of the pop-up menu
which can be triggered on the title bar of a single dockable.
|
void |
visitTabSelectorPopUp(javax.swing.JPopupMenu popUpMenu,
Dockable tabbedDockable)
Override this method to add contextual items at the end of the pop-up menu
which can be triggered on a tab selector.
|
public void visitTabSelectorPopUp(javax.swing.JPopupMenu popUpMenu, Dockable tabbedDockable)
It is recommended to add menu items at the end to the pop-up menu as other items may have been installed by other visitors (DockGroup for example)
implementation note : This method can be called multiple times as pop-up menus are built during the contextual event dispatch (not stored for the life of the dockable).
public void visitSingleDockableTitleBarPopUp(javax.swing.JPopupMenu popUpMenu, Dockable dockable)
It is recommended to add menu items at the end to the pop-up menu as other items may have been installed by other visitors (DockGroup for example)
implementation note : This method can be called multiple times as pop-up menus are built during the contextual event dispatch (not stored for the life of the dockable).
public boolean isSingleDockableTitleBarPopUpCustomizer()
public void setSingleDockableTitleBarPopUpCustomizer(boolean isCustomizer)
public boolean isTabSelectorPopUpCustomizer()
public void setTabSelectorPopUpCustomizer(boolean isCustomizer)
isTabSelectorPopUpCustomizer()
Copyright © 2010-2014 Pacific Biosciences. All Rights Reserved.