org.gnu.gtk
Class MenuShell

java.lang.Object
  |
  +--org.gnu.glib.GObject
        |
        +--org.gnu.gtk.GtkObject
              |
              +--org.gnu.gtk.Widget
                    |
                    +--org.gnu.gtk.Container
                          |
                          +--org.gnu.gtk.MenuShell
Direct Known Subclasses:
Menu, MenuBar

public abstract class MenuShell
extends Container

The MenuShell class is an abstract base class used to derive the Menu and MenuBar subclasses.

A MenuShell is a container of MenuItem objects arranged in a list which can be navigated, selected, and activated by the user to perform application functions. A MenuItem can have a submenu associated with it, allowing for nested hierarchical menus.


Method Summary
 void activateItem(MenuItem menuItem, boolean forceDeactivate)
          Activates the MenuItem within the MenuShell.
 void append(MenuItem child)
          Append a new MenuItem to the end of the MenuShell's item list.
 void deactivate()
          Deactivates the MenuShell.
 void deselect()
          Deselects the currently selected item from the MenuShell.
static Type getType()
          Retrieve the runtime type used by the GLib library.
 void insert(MenuItem child, int position)
          Adds a new MenuItem to the MenuShell's item list at the requested position.
 void prepend(MenuItem child)
          Adds a new MenuItem to the beginning of the MenuShell's item list.
 void selectItem(MenuItem menuItem)
          Selects the MenuItem from the MenuShell.
 
Methods inherited from class org.gnu.gtk.Container
add, addListener, getBorderWidth, getEventListenerClass, getEventType, getResizeMode, remove, removeListener, resizeChildren, setBorderWidth, setResizeMode
 
Methods inherited from class org.gnu.gtk.Widget
activate, addListener, addListener, addListener, addListener, addListener, addListener, createContext, createLayout, destroy, draw, drawArea, drawArea, getAccessible, getColormap, getContext, getModifierStyle, getName, getParent, getParentWindow, getPointer, getSensitive, getStyle, getToplevel, grabDefault, grabFocus, hasFocus, hide, hideAll, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setColormap, setDoubleBuffered, setDragDestination, setDragSource, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll
 
Methods inherited from class org.gnu.glib.GObject
addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, equals, getData, getHandle, removeEventHandler, setData
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

append

public void append(MenuItem child)
Append a new MenuItem to the end of the MenuShell's item list.

Parameters:
child - The MenuItem to add

prepend

public void prepend(MenuItem child)
Adds a new MenuItem to the beginning of the MenuShell's item list.

Parameters:
child - The MenuItem to add.

insert

public void insert(MenuItem child,
                   int position)
Adds a new MenuItem to the MenuShell's item list at the requested position.

Parameters:
child - The MenuItem to add.
position - The position in the item list where child is added. Positions are zero based.

deactivate

public void deactivate()
Deactivates the MenuShell. Typically this results in the MenuShell being erased from the screen.


selectItem

public void selectItem(MenuItem menuItem)
Selects the MenuItem from the MenuShell.

Parameters:
menuItem - The MenuItem to select.

deselect

public void deselect()
Deselects the currently selected item from the MenuShell.


activateItem

public void activateItem(MenuItem menuItem,
                         boolean forceDeactivate)
Activates the MenuItem within the MenuShell.

Parameters:
menuItem - The MenuItem to activate.
forceDeactivate - If true, force the deactivation of the MenuShell after the MenuItem is activated.

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.


Please send any bug reports, comments, or suggestions for the API or documentation to java-gnome-developer@lists.sf.net