TV-Browser 2.7.5 API

tvbrowser.core.contextmenu
Class ContextMenuManager

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

public class ContextMenuManager
extends Object

A class that handles the program context menu.

Author:
René Mach

Method Summary
 JMenu createContextMenuItems(ContextMenuIf callerIf, Program program, boolean markDefaultIf)
          Creates the context menu items.
 ContextMenuIf[] getAvailableContextMenuIfs(boolean includingDisabledItems, boolean cleanSeparator)
          Returns all available ContextMenuItems
 ContextMenuIf getContextMenuIfForId(String id)
          Returns the ContextMenuIf for the id.
 ContextMenuIf getDefaultContextMenuIf()
          Gets the default context menu interface.
 List<ContextMenuIf> getDisabledContextMenuIfs()
          Returns a List with all disabled ContextMenuIfs
static ContextMenuManager getInstance()
          Returns the instance of this class.
 ContextMenuIf getLeftSingleClickIf()
          Gets the left single click context menu interface.
 ContextMenuIf getMiddleClickIf()
          Gets the middle click context menu interface.
 void setDefaultContextMenuIf(ContextMenuIf value)
          Sets the default context menu interface.
 void setLeftSingleClickIf(ContextMenuIf value)
          Sets the left single click context menu interface.
 void setMiddleClickIf(ContextMenuIf value)
          Sets the middle click context menu interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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.

getContextMenuIfForId

public ContextMenuIf getContextMenuIfForId(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.

getLeftSingleClickIf

public ContextMenuIf getLeftSingleClickIf()
Gets the left single click context menu interface.

This is context menu that should be executed by default when single left clicking a program in the program table. It is shown with a dark green font in the context menu.

Returns:
The default context menu action or null if there is no default context menu interface.

getDefaultContextMenuIf

public ContextMenuIf getDefaultContextMenuIf()
Gets the default context menu interface.

This is context menu that should be executed by default when double-clicking a program in the program table. It is shown with a bold font in the context menu.

Returns:
The default context menu action or null if there is no default context menu interface.

getMiddleClickIf

public ContextMenuIf getMiddleClickIf()
Gets the middle click context menu interface.

This is the context menu that should be executed by default when middle-clicking a program in the program table. It is shown with an italic font in the context menu.

Returns:
The middle click context menu interface or null if there is no middle click context menu interface defined.

setLeftSingleClickIf

public void setLeftSingleClickIf(ContextMenuIf value)
Sets the left single click context menu interface.

Parameters:
value - The ContextMenuIf to set as left single click context menu interface.

setDefaultContextMenuIf

public void setDefaultContextMenuIf(ContextMenuIf value)
Sets the default context menu interface.

Parameters:
value - The ContextMenuIf to set as default context menu interface.

setMiddleClickIf

public void setMiddleClickIf(ContextMenuIf value)
Sets the middle click context menu interface.

Parameters:
value - The ContextMenuIf to set as middle click context menu interface.

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 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 List<ContextMenuIf> getDisabledContextMenuIfs()
Returns a List with all disabled ContextMenuIfs

Returns:
disabled ContextMenuIfs

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)