TV-Browser 3.3.3 API

tvbrowser.core.contextmenu
Class ContextMenuManager

java.lang.Object
  extended by tvbrowser.core.contextmenu.ContextMenuManager

public class ContextMenuManager
extends java.lang.Object

A class that handles the program context menu.

Author:
René Mach

Field Summary
static int NO_MOUSE_MODIFIER_EX
           
 
Method Summary
 javax.swing.JMenu createContextMenuItems(ContextMenuIf callerIf, Program program, boolean markDefaultIf)
          Creates the context menu items.
 javax.swing.JPopupMenu createRemovedProgramContextMenu(Program program)
           
 ContextMenuIf[] getAvailableContextMenuIfs(boolean includingDisabledItems, boolean cleanSeparator)
          Returns all available ContextMenuItems
 ContextMenuIf getContextMenuArrayForModifierEx(int modifierEx, boolean leftMouseButton, boolean singleClick)
          Gets the ContextMenuIf for a mouse click and modifier.
 ContextMenuIf getContextMenuForDoubleClick(java.awt.event.MouseEvent e)
          Gets the ContextMenuIf for a double mouse click.
 ContextMenuIf getContextMenuForSingleClick(java.awt.event.MouseEvent e)
          Gets the ContextMenuIf for a single mouse click.
 ContextMenuIf getContextMenuIfForId(java.lang.String id)
          Returns the ContextMenuIf for the id.
 java.util.List<ContextMenuIf> getDisabledContextMenuIfs()
          Returns a List with all disabled ContextMenuIfs
static ContextMenuManager getInstance()
          Returns the instance of this class.
 void init()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_MOUSE_MODIFIER_EX

public static final int NO_MOUSE_MODIFIER_EX
See Also:
Constant Field Values
Method Detail

init

public void init()

getInstance

public static ContextMenuManager getInstance()
Returns the instance of this class. If the instance is null a new will be created.

Returns:
The instance of this class.

getContextMenuForSingleClick

public ContextMenuIf getContextMenuForSingleClick(java.awt.event.MouseEvent e)
Gets the ContextMenuIf for a single mouse click.

Parameters:
e - The MouseEvent to get the ContextMenuIf for.
Returns:
The ContextMenuIf for a single mouse click that matches the mouse event or null if there is no single mouse click ContextMenuIf for the mouse event.
Since:
3.3.1

getContextMenuArrayForModifierEx

public ContextMenuIf getContextMenuArrayForModifierEx(int modifierEx,
                                                      boolean leftMouseButton,
                                                      boolean singleClick)
Gets the ContextMenuIf for a mouse click and modifier.

Parameters:
modifierEx - The modifier for the mouse event.
leftMouseButton - If the ContextMenuIf for the left mouse button should be gotten.
singleClick - If the ContextMenuIf for a single mouse click should be gotten.
Returns:
The ContextMenuIf for a mouse click that matches given values or null if there is no single mouse click ContextMenuIf.
Since:
3.3.1

getContextMenuForDoubleClick

public ContextMenuIf getContextMenuForDoubleClick(java.awt.event.MouseEvent e)
Gets the ContextMenuIf for a double mouse click.

Parameters:
e - The MouseEvent to get the ContextMenuIf for.
Returns:
The ContextMenuIf for a double mouse click that matches the mouse event or null if there is no double mouse click ContextMenuIf for the mouse event.

getContextMenuIfForId

public ContextMenuIf getContextMenuIfForId(java.lang.String id)
Returns the ContextMenuIf for the id.

Parameters:
id - The id to get the ContextMenuIf for.
Returns:
The ContextMenuIf for the id or null if id wasn't found.

getAvailableContextMenuIfs

public ContextMenuIf[] getAvailableContextMenuIfs(boolean includingDisabledItems,
                                                  boolean cleanSeparator)
Returns all available ContextMenuItems

Parameters:
includingDisabledItems - If true the List also contains all disabled Items
cleanSeparator - If true, all Separators that follow directly another Separator will be removed
Returns:
The available context menu interfaces.

createContextMenuItems

public javax.swing.JMenu createContextMenuItems(ContextMenuIf callerIf,
                                                Program program,
                                                boolean markDefaultIf)
Creates the context menu items.

Parameters:
callerIf - The caller Context menu interface.
program - The program to show the context menu for.
markDefaultIf - True if the default context menu interfaces should be highlighted.
Returns:
The menu items of the context menu.

getDisabledContextMenuIfs

public java.util.List<ContextMenuIf> getDisabledContextMenuIfs()
Returns a List with all disabled ContextMenuIfs

Returns:
disabled ContextMenuIfs

createRemovedProgramContextMenu

public javax.swing.JPopupMenu createRemovedProgramContextMenu(Program program)

TV-Browser 3.3.3 API

TV-Browser 3.3.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)