com.qoppa.pdfViewer
Interface IContextMenu

All Known Implementing Classes:
ViewerContextMenu

public interface IContextMenu

This interface allows the host application to customize the context menus in the viewer. The different context menus in the viewer (on the content pane or when selecting text) implement this interface to allow the host application to modify the menus.

Author:
Qoppa Software

Method Summary
 JMenuItem add(JMenuItem menuItem)
          Appends the specified menu item to the end of this menu.
 void addPopupMenuListener(PopupMenuListener listener)
          Adds a PopupMenuListener to the context menu.
 void addSeparator()
          Appends a new separator at the end of the menu.
 Component getComponent(int index)
          Returns the component at the specified index.
 int getComponentCount()
          Returns the number of components in the context menu.
 int getComponentIndex(Component component)
          Returns the index of the component.
 void insert(Component component, int index)
          Insert a new item into the popup menu.
 void remove(int index)
          Removes the component at the specified index.
 void removePopupMenuListener(PopupMenuListener listener)
          Removes the PopupMenuListener from the context menu.
 

Method Detail

add

public JMenuItem add(JMenuItem menuItem)
Appends the specified menu item to the end of this menu.

Parameters:
menuItem - the JMenuItem to add

addSeparator

public void addSeparator()
Appends a new separator at the end of the menu.


insert

public void insert(Component component,
                   int index)
Insert a new item into the popup menu.

Parameters:
component - the Component to insert
index - specifies the position at which to insert the component

remove

public void remove(int index)
Removes the component at the specified index.

Parameters:
index - the index of the component to remove

getComponentIndex

public int getComponentIndex(Component component)
Returns the index of the component.

Parameters:
component -
Returns:
the index of the component, where 0 is the first.
-1 if the component is not found.

getComponentCount

public int getComponentCount()
Returns the number of components in the context menu.

Returns:
the number of components in the context menu

getComponent

public Component getComponent(int index)
Returns the component at the specified index.

Parameters:
index -
Returns:
the component at the specified index

addPopupMenuListener

public void addPopupMenuListener(PopupMenuListener listener)
Adds a PopupMenuListener to the context menu.

Parameters:
listener -

removePopupMenuListener

public void removePopupMenuListener(PopupMenuListener listener)
Removes the PopupMenuListener from the context menu.

Parameters:
listener -