com.qoppa.pdfNotes.contextmenus
Class ThumbnailContextMenu

java.lang.Object
  extended by com.qoppa.pdfNotes.contextmenus.ThumbnailContextMenu

public class ThumbnailContextMenu
extends Object

The 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 Summary
ThumbnailContextMenu(PDFViewerBean bean)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThumbnailContextMenu

public ThumbnailContextMenu(PDFViewerBean bean)
Method Detail

getPopupMenu

public JPopupMenu getPopupMenu()
Returns the actual JPopupMenu. The list of components for this menu is constructed when JPopupMenu is instantiated, and is not modified afterwards. Therefore, any modifications that developers make to this list, will be persistent.

Returns:
the PopupMenu

getInsertPageMenuItem

public JMenuItem getInsertPageMenuItem()
The InsertPageMenuItem. When pressed, this a new blank page will be inserted above the selected page thumbnail.

Returns:
the InsertPageMenuItem

getDeletePageMenuItem

public JMenuItem getDeletePageMenuItem()
The DeletePageMenuItem. When pressed, the pages for all selected page thumbnails will be deleted.

Returns:
the DeletePageMenuItem

getCutPageMenuItem

public JMenuItem getCutPageMenuItem()
The CutPageMenuItem. When pressed, the pages for all selected page thumbnails will be cut. These pages will not actually be removed unitl they are pasted.

Returns:
the CutPageMenuItem

getCopyPageMenuItem

public JMenuItem getCopyPageMenuItem()
The CopyPageMenuItem. When pressed, the pages for all selected page thumbnails will be copied.

Returns:
the CopyPageMenuItem

getPastePageMenuItem

public JMenuItem getPastePageMenuItem()
The PastePageMenuItem. When pressed, any cut/copied pages which have not been pasted, will be inserted above the selected page thumbnail.

This MenuItem is disabled if no pages are available to be pasted.

Returns:
the CutPageMenuItem

getRotatePageMenu

public JMenu getRotatePageMenu()
The RotatePageMenu. A JMenu containing: RotateCw90MenuItem, Rotate180MenuItem, RotateCcw90MenuItem.

Returns:
the RotatePageMenu

getRotateCw90MenuItem

public JMenuItem getRotateCw90MenuItem()
The RotateCw90MenuItem. When pressed, all selected pages are rotated 90 degrees clockwise.

Returns:
the RotateCw90MenuItem

getRotate180MenuItem

public JMenuItem getRotate180MenuItem()
The Rotate180MenuItem. When pressed, all selected pages are rotated 180 degrees.

Returns:
the Rotate180MenuItem

getRotateCcw90MenuItem

public JMenuItem getRotateCcw90MenuItem()
The Rotate90CcwMenuItem. When pressed, all selected pages are rotated 90 degrees counter clockwise.

Returns:
the Rotate90CcwMenuItem

getFlattenCommentsMenuItem

public JMenuItem getFlattenCommentsMenuItem()
The FlattenCommentsMenuItem. When pressed, all comments on all selected pages are flattened.

This item is Invisible if AnnotationTools.isFlatteningEnabled() evaluates to false

Returns:
the FlattenCommentsMenuItem

getDeleteCommentsMenuItem

public JMenuItem getDeleteCommentsMenuItem()
The DeleteCommentsMenuItem. When pressed, all comments on all selected pages are deleted.

This item is Invisible if AnnotationTools.isDeleteEnabled() is false

Returns:
the DeleteCommentsMenuItem

getFlattenSeparator

public JSeparator getFlattenSeparator()
The FlattenSeparator. A JSeparator that appears above the FlattenMenuItem.

This item is Invisible if both the FlattenMenuItem and DeleteMenuItem are invisible.

Returns:
the FlattenSeparator