public class TextSelectionContextMenu extends Object
TextSelectionContextMenu represents the popup menu that is
displayed when the user right clicks on the
PageViewPanel and the Text Selection Tool
is active. A reference to the TextSelectionContextMenu of the
PDFViewerBean can be obtained with
PDFViewerBean.getPageViewPanel().getTextSelectionContextMenu().
By default, this menu is composed of: CopyMenuItem, a JMenu divider,
OpenLinkMenuItem, a JMenu divider HandToolMenuItem, TextSelectionMenuItem,
and ZoomToolMenuItem. These items may be modified by retrieving them with
their individual getter methods. The contents of the
TextSelectionContextMenu may be accessed and modified with the
getPopupMenu() method. For example, to add a new menu item to the
popup menu:
PDFViewerBean viewerBean = new PDFViewerBean();
TextSelectionContextMenu contextMenu = viewerBean.getPageViewPanel().getTextSelectionContextMenu();
JMenuItem menuItem = new JMenuItem("My Menu Item");
contextMenu.getPopupMenu().add(menuItem);
| Constructor and Description |
|---|
TextSelectionContextMenu() |
| Modifier and Type | Method and Description |
|---|---|
JMenuItem |
getCopyMenuItem()
Returns the CopyToClipboard menu item for the text selection context menu.
|
JSeparator |
getCopySeparator() |
JCheckBoxMenuItem |
getHandToolMenuItem()
The Hand Tool menu item for the page view context menu.
|
JSeparator |
getLinkSeparator() |
JMenuItem |
getOpenLinkMenuItem() |
JPopupMenu |
getPopupMenu() |
JCheckBoxMenuItem |
getTextSelMenuItem()
The Text Select menu item for the page view context menu.
|
JCheckBoxMenuItem |
getZoomToolMenuItem()
The Zoom Tool menu item for the page view context menu.
|
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 JSeparator getCopySeparator()
public JSeparator getLinkSeparator()
public JMenuItem getCopyMenuItem()
public JMenuItem getOpenLinkMenuItem()
public JCheckBoxMenuItem getHandToolMenuItem()
public JCheckBoxMenuItem getTextSelMenuItem()
public JCheckBoxMenuItem getZoomToolMenuItem()
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