com.limegroup.gnutella.gui.menu
Class MenuMediator

java.lang.Object
  extended bycom.limegroup.gnutella.gui.menu.MenuMediator

public final class MenuMediator
extends java.lang.Object

This class acts as a mediator among all of the various items of the application's menus.


Method Summary
 javax.swing.JMenuBar getMenuBar()
          Returns the JMenuBar for the application.
 int getMenuBarHeight()
          Returns the height of the main menu bar.
 void handleLibrarySelection()
          Rearranges the file menu in response to a selection of the library tab.
 void handleStandardSelection()
          Rearranges the file menu in response to the selection of a tab requiring no specialized menu.
static MenuMediator instance()
          Singleton accessor method for obtaining the MenuMediator instance.
 void setConnected(boolean connected)
          Sets whether or not we are currently connected or disconnected from the network, enabling or disabling the correct connect/disconnect menu items in the file menu.
 void setNavMenuItemEnabled(int TAB_INDEX, boolean ENABLED)
          Sets the enabled/disabled state of the navigation menu item at the specified index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static final MenuMediator instance()
Singleton accessor method for obtaining the MenuMediator instance.

Returns:
the MenuMediator instance

getMenuBar

public javax.swing.JMenuBar getMenuBar()
Returns the JMenuBar for the application.

Returns:
the application's JMenuBar instance

handleLibrarySelection

public void handleLibrarySelection()
Rearranges the file menu in response to a selection of the library tab.


handleStandardSelection

public void handleStandardSelection()
Rearranges the file menu in response to the selection of a tab requiring no specialized menu.


setConnected

public void setConnected(boolean connected)
Sets whether or not we are currently connected or disconnected from the network, enabling or disabling the correct connect/disconnect menu items in the file menu.

Parameters:
connected - specifies our connection status

setNavMenuItemEnabled

public void setNavMenuItemEnabled(int TAB_INDEX,
                                  boolean ENABLED)
Sets the enabled/disabled state of the navigation menu item at the specified index.

Parameters:
TAB_INDEX - the index of the item to set
ENABLED - the enabled or disabled state of the item

getMenuBarHeight

public int getMenuBarHeight()
Returns the height of the main menu bar.

Returns:
the height of the main menu bar