org.greenstone.gs3client
Class Displays.PopupListener

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by org.greenstone.gs3client.Displays.PopupListener
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.MouseListener, java.util.EventListener
Enclosing class:
Displays

static class Displays.PopupListener
extends java.awt.event.MouseAdapter
implements java.awt.event.ActionListener

Handles rightclicks on a treeview of documentNodeData objects by showing the popupMenu with associated files that, when selected, can be displayed in the htmlPane. Listens to rightclick events, but also handles clicks on popup menu items.

See Also:
Java tutorial on menus

Nested Class Summary
(package private)  class Displays.PopupListener.AssocFilePopupItem
          Package access inner class.
 
Field Summary
(package private)  GS3JavaClient client
          Handle to the running GS3JavaClient object to have access to its methods
(package private)  javax.swing.JEditorPane htmlArea
          The htmlPane wherein associated files are to be displayed
(package private)  javax.swing.JPopupMenu popupMenu
          A popup component
(package private)  javax.swing.JTree tree
          The treeView component on which the rightclicks occurred
 
Constructor Summary
Displays.PopupListener(javax.swing.JPopupMenu popupMenu, javax.swing.JTree tree, GS3JavaClient client, javax.swing.JEditorPane htmlArea)
          Constructor for the PopupListener.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Called when one of the popup's menuItems was clicked.
protected  void maybeShowPopup(java.awt.event.MouseEvent e)
          If the mouseEvent was a trigger (rightclick), displays the popup context menu.
 void mousePressed(java.awt.event.MouseEvent e)
          Possibly a popupEvent
 void mouseReleased(java.awt.event.MouseEvent e)
          Possibly a popupEvent
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

client

final GS3JavaClient client
Handle to the running GS3JavaClient object to have access to its methods


popupMenu

final javax.swing.JPopupMenu popupMenu
A popup component


tree

final javax.swing.JTree tree
The treeView component on which the rightclicks occurred


htmlArea

final javax.swing.JEditorPane htmlArea
The htmlPane wherein associated files are to be displayed

Constructor Detail

Displays.PopupListener

public Displays.PopupListener(javax.swing.JPopupMenu popupMenu,
                              javax.swing.JTree tree,
                              GS3JavaClient client,
                              javax.swing.JEditorPane htmlArea)
Constructor for the PopupListener.

Parameters:
popupMenu - - the JPopupMenu object this PopupListener will handle mouseEvents for
tree - - the JTree object whose documentNodeData was clicked
client - - handle to the running GS3JavaClient instance
htmlArea - - the html editor pane in which to display the associated file chosen from the popupMenu.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Called when one of the popup's menuItems was clicked. The associated file represented by the menuItem is displayed in the html editor pane.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Possibly a popupEvent

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class java.awt.event.MouseAdapter

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Possibly a popupEvent

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class java.awt.event.MouseAdapter

maybeShowPopup

protected void maybeShowPopup(java.awt.event.MouseEvent e)
If the mouseEvent was a trigger (rightclick), displays the popup context menu.