org.gnu.gtk

Class CheckMenuItem

Known Direct Subclasses:
RadioMenuItem

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

void
addListener(CheckMenuItemListener listener)
Register an object to handle dialog events.
boolean
getActive()
Returns whether the CheckMenuItem is active.
static CheckMenuItem
getCheckMenuItem(Handle handle)
Internal static factory method to be used by Java-Gnome only.
boolean
getDrawAsRadio()
Gets whether the CheckMenuItem will be drawn as a radio control.
Class
getEventListenerClass(String signal)
EventType
getEventType(String signal)
boolean
getInconsistent()
Returns whether the CheckMenuItem is in the "inconsistent" state.
static Type
getType()
Retrieve the runtime type used by the GLib library.
void
removeListener(CheckMenuItemListener listener)
Removes a listener
void
setActive(boolean isActive)
Sets the active state of the CheckMenuItem's check box.
void
setDrawAsRadio(boolean drawAsRadio)
Sets whether the CheckMenuItem should be drawn as a radio control
void
setInconsistent(boolean isInconsistent)
This method will turn on a third state that indicates that the widget is in an inconsistent state.

Methods inherited from class org.gnu.gtk.MenuItem

addListener, emitActivate, emitDeselect, getEventListenerClass, getEventType, getMenuItem, getType, removeListener, removeSubmenu, setLeftJustified, setRightJustified, setSubmenu

Methods inherited from class org.gnu.gtk.Item

addListener, deselect, getEventListenerClass, getEventType, getType, removeListener, select, toggle

Methods inherited from class org.gnu.gtk.Bin

getChild, getType

Methods inherited from class org.gnu.gtk.Container

add, addListener, getBooleanChildProperty, getBorderWidth, getChildProperty, getChildren, getEventListenerClass, getEventType, getIntChildProperty, getResizeMode, getType, remove, removeListener, resizeChildren, setBooleanChildProperty, setBorderWidth, setChildProperty, setIntChildProperty, setResizeMode

Methods inherited from class org.gnu.gtk.Widget

activate, addAccelerator, addEvents, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, draw, drawArea, drawArea, finish, getAccessible, getAllocation, getCanFocus, getColormap, getContext, getData, getDisplay, getDragData, getEventListenerClass, getEventType, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getType, getWidget, getWindow, grabDefault, grabFocus, hasFocus, hasScreen, hide, hideAll, highlight, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeAccelerator, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setCanFocus, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setEvents, setExtensionEvents, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight, unHighlight

Methods inherited from class org.gnu.gtk.GtkObject

destroy, getType, sink

Constructor Details

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 Details

addListener

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

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)
Overrides:
getEventListenerClass in interface MenuItem

getEventType

public EventType getEventType(String signal)
Overrides:
getEventType in interface MenuItem

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.
Overrides:
getType in interface MenuItem

removeListener

public void removeListener(CheckMenuItemListener listener)
Removes a listener

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.