org.gnu.gtk

Class CheckMenuItem

public class CheckMenuItem extends MenuItem

The CheckMenuItem is a menu item that maintains the state of a boolean value in addition to the MenuItem's usual role of activating application code.

A check box indicating the state of boolean value is displayed on the left side of the MenuItem. Activating the MenuItem toggles this value.

Constructor Summary
CheckMenuItem()
Create a new CheckMenuItem
CheckMenuItem(Handle handle)
Construct a CheckMenuItem using a handle to a native resource.
CheckMenuItem(String label, boolean hasMnemonic)
Create a new CheckMenuItem with the given label.
Method Summary
voidaddListener(CheckMenuItemListener listener)
Register an object to handle dialog events.
booleangetActive()
Returns whether the CheckMenuItem is active.
static CheckMenuItemgetCheckMenuItem(Handle handle)
Internal static factory method to be used by Java-Gnome only.
booleangetDrawAsRadio()
Gets whether the CheckMenuItem will be drawn as a radio control.
ClassgetEventListenerClass(String signal)
EventTypegetEventType(String signal)
booleangetInconsistent()
Returns whether the CheckMenuItem is in the "inconsistent" state.
static TypegetType()
Retrieve the runtime type used by the GLib library.
voidremoveListener(CheckMenuItemListener listener)
Removes a listener
voidsetActive(boolean isActive)
Sets the active state of the CheckMenuItem's check box.
voidsetDrawAsRadio(boolean drawAsRadio)
Sets whether the CheckMenuItem should be drawn as a radio control
voidsetInconsistent(boolean isInconsistent)
This method will turn on a third state that indicates that the widget is in an inconsistent state.

Constructor Detail

CheckMenuItem

public CheckMenuItem()
Create a new CheckMenuItem

CheckMenuItem

public CheckMenuItem(Handle handle)
Construct a CheckMenuItem using a handle to a native resource.

CheckMenuItem

public CheckMenuItem(String label, boolean hasMnemonic)
Create a new CheckMenuItem with the given label.

Parameters: label The label to display for this CheckMenuItem.

Method Detail

addListener

public void addListener(CheckMenuItemListener listener)
Register an object to handle dialog events.

See Also: CheckMenuItemListener

getActive

public boolean getActive()
Returns whether the CheckMenuItem is active.

Returns: true if the check box is active.

getCheckMenuItem

public static CheckMenuItem getCheckMenuItem(Handle handle)
Internal static factory method to be used by Java-Gnome only.

getDrawAsRadio

public boolean getDrawAsRadio()
Gets whether the CheckMenuItem will be drawn as a radio control.

getEventListenerClass

public Class getEventListenerClass(String signal)

getEventType

public EventType getEventType(String signal)

getInconsistent

public boolean getInconsistent()
Returns whether the CheckMenuItem is in the "inconsistent" state.

Returns: true if the check box is inconsistent.

getType

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

removeListener

public void removeListener(CheckMenuItemListener listener)
Removes a listener

See Also: addListener

setActive

public void setActive(boolean isActive)
Sets the active state of the CheckMenuItem's check box.

Parameters: isActive true if the check box is checked.

setDrawAsRadio

public void setDrawAsRadio(boolean drawAsRadio)
Sets whether the CheckMenuItem should be drawn as a radio control

Parameters: drawAsRadio

setInconsistent

public void setInconsistent(boolean isInconsistent)
This method will turn on a third state that indicates that the widget is in an inconsistent state.

Parameters: isInconsistent true to display an "inconsistent" third state.