public class ThumbnailContextMenu extends Object
ThumbnailContextMenu
represents the context menu displayed
when a user right-clicks on page thumbnail in ThumbnailPanelNotes
.
There is one instance of this class per PDFNotesBean
, it can be retrieved with
PDFNotesBean.getThumbnialPanelNotes().getThumbnailContextMenu()
.
The contents of the
ThumbnailContextMenu
may be accessed and modified with the
getPopupMenu()
method. For example, to add a new menu item to
the popup menu:
PDFNotesBean notesBean = new PDFNotesBean(); ThumbnailContextMenu contextMenu = notesBean.getThumbnailPanelNotes().getThumbnailContextMenu(); 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 |
---|
ThumbnailContextMenu(PDFViewerBean bean) |
Modifier and Type | Method and Description |
---|---|
JMenuItem |
getCopyPageMenuItem()
The CopyPageMenuItem.
|
JMenuItem |
getCutPageMenuItem()
The CutPageMenuItem.
|
JMenuItem |
getDeleteCommentsMenuItem()
The DeleteCommentsMenuItem.
|
JMenuItem |
getDeletePageMenuItem()
The DeletePageMenuItem.
|
JMenuItem |
getFlattenCommentsMenuItem()
The FlattenCommentsMenuItem.
|
JSeparator |
getFlattenSeparator()
The FlattenSeparator.
|
JMenuItem |
getInsertPageMenuItem()
The InsertPageMenuItem.
|
JMenuItem |
getPastePageMenuItem()
The PastePageMenuItem.
|
JPopupMenu |
getPopupMenu()
Returns the actual JPopupMenu.
|
JMenuItem |
getRotate180MenuItem()
The Rotate180MenuItem.
|
JMenuItem |
getRotateCcw90MenuItem()
The Rotate90CcwMenuItem.
|
JMenuItem |
getRotateCw90MenuItem()
The RotateCw90MenuItem.
|
JMenu |
getRotatePageMenu()
The RotatePageMenu.
|
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 ThumbnailContextMenu(PDFViewerBean bean)
public JPopupMenu getPopupMenu()
public JMenuItem getInsertPageMenuItem()
public JMenuItem getDeletePageMenuItem()
public JMenuItem getCutPageMenuItem()
public JMenuItem getCopyPageMenuItem()
public JMenuItem getPastePageMenuItem()
public JMenu getRotatePageMenu()
public JMenuItem getRotateCw90MenuItem()
public JMenuItem getRotate180MenuItem()
public JMenuItem getRotateCcw90MenuItem()
public JMenuItem getFlattenCommentsMenuItem()
AnnotationTools.isFlatteningEnabled()
evaluates to false
public JMenuItem getDeleteCommentsMenuItem()
AnnotationTools.isDeleteEnabled()
is false
public JSeparator getFlattenSeparator()
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