org.gnu.gtk

Class MenuItem

public class MenuItem extends Item

Deprecated: This class is part of the java-gnome 2.x family of libraries, which, due to their inefficiency and complexity, are no longer being maintained and have been abandoned by the java-gnome project. This class may in the future have an equivalent in java-gnome 4.0, try looking for org.gnome.gtk.MenuItem. You should be aware that there is a considerably different API in the new library: the architecture is completely different and most notably internals are no longer exposed to public view.

The MenuItem widget and derived widgets are the only valid children for Menus. Their function is to correctly handle highlighting, alignment, events, and submenus.
Constructor Summary
MenuItem()
Construct a new menu item.
MenuItem(Handle handle)
Create a new MenuItem with a handle to a native resource returned from a call to the native libraries.
MenuItem(String label, boolean hasMnemonic)
Construct a new menu item with the provided label.
Method Summary
voidaddListener(MenuItemListener listener)
Register an object to receive event notification.
voidemitActivate()
Emits the "activate" signal on this MenuItem.
voidemitDeselect()
Emits the "deselect" signal on this MenuItem.
ClassgetEventListenerClass(String signal)
EventTypegetEventType(String signal)
static MenuItemgetMenuItem(Handle handle)
Create a new MenuItem with a handle to a native resource returned from a call to the native libraries.
static TypegetType()
Retrieve the runtime type used by the GLib library.
voidremoveListener(MenuItemListener listener)
Unregister an object that was receiving menuitem event notification.
voidremoveSubmenu()
Removes the widget's submenu.
voidsetLeftJustified()
MenuItem's are left justified by default.
voidsetRightJustified()
Sets whether the menu item appears to the right side of the menu bar.
voidsetSubmenu(Menu submenu)
Sets the submenu, or changes it.

Constructor Detail

MenuItem

public MenuItem()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Construct a new menu item.

MenuItem

public MenuItem(Handle handle)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Create a new MenuItem with a handle to a native resource returned from a call to the native libraries. Should only be used internally by Java-Gnome.

Parameters: handle The handle that represents a pointer to a native resource.

MenuItem

public MenuItem(String label, boolean hasMnemonic)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Construct a new menu item with the provided label.

Parameters: label The label to display in the menu item. hasMnemonic Indicates if the provided string contains mnemonics

Method Detail

addListener

public void addListener(MenuItemListener listener)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Register an object to receive event notification.

Parameters: listener The object that has implemented the MenuItemListener interface that is to receive the menu item events.

emitActivate

public void emitActivate()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Emits the "activate" signal on this MenuItem.

emitDeselect

public void emitDeselect()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Emits the "deselect" signal on this MenuItem.

getEventListenerClass

public Class getEventListenerClass(String signal)

getEventType

public EventType getEventType(String signal)

getMenuItem

public static MenuItem getMenuItem(Handle handle)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Create a new MenuItem with a handle to a native resource returned from a call to the native libraries. Should only be used internally by Java-Gnome.

Parameters: handle The handle that represents a pointer to a native resource.

getType

public static Type getType()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Retrieve the runtime type used by the GLib library.

removeListener

public void removeListener(MenuItemListener listener)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Unregister an object that was receiving menuitem event notification.

Parameters: listener The object that is to no longer receive menuitem events.

removeSubmenu

public void removeSubmenu()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Removes the widget's submenu.

setLeftJustified

public void setLeftJustified()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

MenuItem's are left justified by default. Use this method to change a MenuItem from right justified back to left justified.

setRightJustified

public void setRightJustified()

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Sets whether the menu item appears to the right side of the menu bar. This was traditionally done for the Help menu, but is now considered a bad idea. (If the widget layout is reversed for a right to left language like Hebrew or Arabic, right-justified menu items appear at the left).

setSubmenu

public void setSubmenu(Menu submenu)

Deprecated: Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries.

Sets the submenu, or changes it.

Parameters: submenu The submenu.