public class AnnotationContextMenu extends Object
AnnotationContextMenu
represents the context menu displayed
when a user right-clicks on an AnnotationComponent
or a row in the
CommentPanelNotes
. There is one instance of this class per
PDFNotesBean
, it can be retrieved with
PDFNotesBean.getCommentPanelNotes().getAnnotContextMenu()
.
Different context menus are displayed depending on the selected annotations.
All possible menu items are represented in this class and can be retrieved by
the provided getters. When initially constructed, all menu items in this
class are added to the JPopupMenu
. After the
JPopupMenu
is constructed, only the visibility and enabled state
of its menu items can be modified, the actual contents of the list of items
can not. Therefore, any changes developers make to the
JPopupMenu
's component list will be persistent. This is the
recommended way to either add or remove components to the
AnnotationContextMenu
. The contents of the
AnnotationContextMenu
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(); AnnotationContextMenu contextMenu = notesBean.getCommentPanelNotes().getAnnotContextMenu(); 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 |
---|
AnnotationContextMenu() |
Modifier and Type | Method and Description |
---|---|
JMenu |
getAlignmentMenu()
The Alignment menu.
|
JMenuItem |
getCheckmarkMenuItem()
The CheckmarkMenuItem.
|
JMenuItem |
getConvertToPerimeterMenuItem()
The Convert to Perimeter menu item.
|
JMenuItem |
getCopyMenuItem()
The Copy menu item.
|
JMenuItem |
getCopyTextMenuItem()
The Copy Text menu item.
|
JMenuItem |
getCreatePerimeterMenuItem()
The Create Perimeter menu item.
|
JMenuItem |
getCutMenuItem()
The Cut menu item.
|
JMenuItem |
getDeleteMenuItem()
The Delete menu item.
|
JMenuItem |
getEditMenuItem()
Deprecated.
This menu item is no longer used or supported with the change to our Link Tool to be a link-editing mode.
|
JSeparator |
getFlattenDivider()
The JSeparator that follows the FlattenMenuItem
This Separator is only visible if the FlattenMenuItem or DeleteMenuItem or CopyMenuItem or CutMenuItem are visible |
JMenuItem |
getFlattenMenuItem()
The Flatten menu item.
|
JSeparator |
getGroupDivider()
The JSeparator that follows the GroupMenuItem
This Separator is only visible if the GroupMenuItem is visible |
JMenuItem |
getGroupMenuItem()
The Group menu item.
|
JSeparator |
getMoveAndAlignSeparator()
The JSeparator that follows the Alignment and Move menus.
|
JMenu |
getMoveMenu()
The Move menu.
|
JMenuItem |
getMoveToBackMenuItem()
The Move To Back menu item.
|
JMenuItem |
getMoveToFrontMenuItem()
The Move To Front menu item.
|
JSeparator |
getNoteDivider()
The JSeparator that follows the ShowNoteMenuItem
This Separator is only visible if the ShowNoteMenuItem is visible |
JMenuItem |
getOpenAttachmentMenuItem()
The Open attachment menu item.
|
JPopupMenu |
getPopupMenu()
Returns the actual JPopupMenu.
|
JMenuItem |
getPropertiesMenuItem()
The Properties menu item.
|
JSeparator |
getPropertiesSeparator()
The JSeparator that follows the PropertiesMenuItem.
|
JMenuItem |
getResetMenuItem()
The Reset menu item.
|
JSeparator |
getReviewDivider()
The JSeparator that follows the ReviewMenu
This Separator is only visible if the ReviewMenu or the CheckMarkMenuItem are visible |
JMenu |
getReviewMenu()
The Review status menu.
|
JMenuItem |
getSaveAttachmentMenuItem()
The Save attachment menu item.
|
JMenuItem |
getShowNoteMenuItem()
The ShowNoteMenuItem.
|
JMenuItem |
getSoundMenuItem()
The Play sound menu item.
|
public JPopupMenu getPopupMenu()
public JMenuItem getShowNoteMenuItem()
public JMenuItem getCheckmarkMenuItem()
AnnotationTools#isReviewEnabled()
is false.public JMenu getReviewMenu()
AnnotationTools#isReviewEnabled()
is false.public JMenuItem getGroupMenuItem()
AnnotationTools#isGroupingEnabled()
is false. public JMenuItem getCutMenuItem()
public JMenuItem getCopyMenuItem()
public JMenuItem getDeleteMenuItem()
AnnotationTools#isDeleteEnabled()
is false. public JMenuItem getEditMenuItem()
Link
.public JMenuItem getFlattenMenuItem()
AnnotationTools#isFlatteningEnabled()
is false or an unflattenable annotation is selected. public JMenuItem getResetMenuItem()
public JMenu getAlignmentMenu()
public JMenu getMoveMenu()
public JMenuItem getMoveToFrontMenuItem()
public JMenuItem getMoveToBackMenuItem()
public JMenuItem getPropertiesMenuItem()
public JMenuItem getSoundMenuItem()
Sound
. Sound
.public JMenuItem getOpenAttachmentMenuItem()
FileAttachment
. FileAttachment
.public JMenuItem getSaveAttachmentMenuItem()
FileAttachment
. FileAttachment
.public JMenuItem getCreatePerimeterMenuItem()
public JMenuItem getConvertToPerimeterMenuItem()
public JSeparator getNoteDivider()
public JSeparator getReviewDivider()
public JSeparator getGroupDivider()
public JSeparator getFlattenDivider()
public JSeparator getMoveAndAlignSeparator()
public JSeparator getPropertiesSeparator()
public JMenuItem getCopyTextMenuItem()