public class BookmarkContextMenu extends Object
BookmarkContextMenu
represents the context menu displayed
when a user right-clicks on a bookmark in BookmarkPanelEditor
.
There is one instance of this class per PDFEditorBean
. It can be retrieved with
PDFEditorBean.getBookmarkPanelEditor().getBookmarkContextMenu()
.
The contents of the
BookmarkContextMenu
may be accessed and modified with the
getPopupMenu()
method. For example, to add a new menu item to
the popup menu:
PDFEditorBean editorBean = new PDFEditorBean(); BookmarkContextMenu contextMenu = editorBean.getBookmarkPanelEditor().getBookmarkContextMenu(); JMenuItem menuItem = new JMenuItem("My Menu Item"); contextMenu.getPopupMenu().add(menuItem);The visibility and enabled state of the preset menu items is adjusted each time the
JPopupMenu
is displayed. The behavior of these
adjustments is documented on each individual getter method. If a developer
desires a different behavior for a particular item, they may remove the item
and add their own. Or, they can add a PopupMenuListener
to the
JPopupMenu
. Their Listener
will be notified after
any adjustments have been completed, and they can make adjustments as they
wish.Constructor and Description |
---|
BookmarkContextMenu() |
Modifier and Type | Method and Description |
---|---|
JMenuItem |
getAddAfterMenuItem()
The AddAfterMenuItem.
|
JMenuItem |
getAddBeforeMenuItem()
The AddBeforeMenuItem.
|
JMenuItem |
getAddChildMenuItem()
The AddChildMenuItem.
|
JMenu |
getAddMenu()
The AddMenu.
|
JSeparator |
getAddMenuSeparator()
The AddMenuSeparator.
|
JMenuItem |
getCutMenuItem()
The CutMenuItem.
|
JMenuItem |
getDeleteMenuItem()
The DeleteMenuItem.
|
JMenuItem |
getPasteAfterMenuItem()
The PasteAfterMenuItem.
|
JMenuItem |
getPasteMenuItem()
The PasteMenuItem.
|
JPopupMenu |
getPopupMenu()
Returns the actual JPopupMenu.
|
JMenuItem |
getPrint() |
JMenuItem |
getPrintSection() |
JMenuItem |
getPropertiesMenuItem()
The PropertiesMenuItem.
|
JSeparator |
getPropertiesSeparator()
The Properties Separator.
|
JMenuItem |
getRenameMenuItem()
The RenameMenuItem.
|
JMenuItem |
getSetDestinationMenuItem()
The SetDestinationMenuItem.
|
JSeparator |
getSetDestinationSeparator()
The SetDestinationSeparator.
|
boolean |
isActive()
Returns whether or not the
JPopupMenu for the context menu in
getPopupMenu() is active. |
void |
setActive(boolean active)
Sets whether or not the
JPopupMenu for the context menu in
getPopupMenu() is active. |
public JPopupMenu getPopupMenu()
public JMenuItem getCutMenuItem()
public JMenuItem getPasteMenuItem()
public JMenuItem getPasteAfterMenuItem()
public JMenuItem getDeleteMenuItem()
public JMenuItem getRenameMenuItem()
public JMenuItem getPropertiesMenuItem()
public JMenuItem getSetDestinationMenuItem()
public JMenu getAddMenu()
public JMenuItem getAddBeforeMenuItem()
public JMenuItem getAddAfterMenuItem()
public JMenuItem getAddChildMenuItem()
public JSeparator getAddMenuSeparator()
public JSeparator getSetDestinationSeparator()
public JSeparator getPropertiesSeparator()
public void setActive(boolean active)
JPopupMenu
for the context menu in
getPopupMenu()
is active. A JPopupMenu
that is not
active will not be shown when the JPopupMenu
is triggered.active
- true
to set the JPopupMenu
active,
false
otherwisepublic boolean isActive()
JPopupMenu
for the context menu in
getPopupMenu()
is active. A JPopupMenu
that is not
active will not be shown when the JPopupMenu
is triggered.true
if the JPopupMenu is active,
false
otherwise
public JMenuItem getPrint()
public JMenuItem getPrintSection()