org.jdesktop.wonderland.client.contextmenu
Class ContextMenuManager

java.lang.Object
  extended by org.jdesktop.wonderland.client.contextmenu.ContextMenuManager

public class ContextMenuManager
extends java.lang.Object

Manages the entries on the context menu. The visual implementation of the context menu is relegated to a module that interacts with this class.

Author:
Jordan Slott

Constructor Summary
ContextMenuManager()
          Constructor
 
Method Summary
 void addContextMenuListener(ContextMenuListener listener)
          Adds a listener for context display events.
 void fireContextMenuEvent(ContextMenuEvent event)
          Dispatches an event to all listeners that a context menu is about to be displayed.
 java.util.List<ContextMenuFactorySPI> getContextMenuFactoryList()
          Returns a list of context menu factories that generate items.
static ContextMenuManager getContextMenuManager()
          Returns a single instance of this class
 void removeContextMenuListener(ContextMenuListener listener)
          Removes the given listener for context menu display events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextMenuManager

public ContextMenuManager()
Constructor

Method Detail

getContextMenuManager

public static final ContextMenuManager getContextMenuManager()
Returns a single instance of this class

Returns:
Single instance of this class.

getContextMenuFactoryList

public java.util.List<ContextMenuFactorySPI> getContextMenuFactoryList()
Returns a list of context menu factories that generate items. This callers of this method should not modify the returned List, but instead create a copy of it first.

Returns:
A list of ContextMenuSPI objects

addContextMenuListener

public void addContextMenuListener(ContextMenuListener listener)
Adds a listener for context display events. If the listener already exists, this method does nothing.

Parameters:
listener - The listener to add

removeContextMenuListener

public void removeContextMenuListener(ContextMenuListener listener)
Removes the given listener for context menu display events. If the listener does not exist, then this method does nothing.

Parameters:
listener - The listener to remove

fireContextMenuEvent

public void fireContextMenuEvent(ContextMenuEvent event)
Dispatches an event to all listeners that a context menu is about to be displayed.

Parameters:
event - The ContextEvent that caused the menu to be displayed


Open Wonderland - http://openwonderland.org