org.gnu.gtk

Class AccelLabel


public class AccelLabel
extends Label

The AccelLabel widget is a subclass of Label that also displays an accelerator key on the right side of the label text, e.g. 'Ctrl+S'. It is commonly used in menus to show the keyboard shortcut for the command.

The accelerator key to display is not set explicitly. Instead, the AccelLabel displays the accelerator which have been added to a particular widget. This widget is set by calling setAccelWidget().

Constructor Summary

AccelLabel(Handle handle)
Construct a AccelLabel using a handle to a native resource.
AccelLabel(String str)
Create an AccelLabel.

Method Summary

static AccelLabel
getAccelLabel(Handle handle)
Internal static factory method to be used by Java-Gnome only.
Widget
getAccelWidget()
Retrieve the widget for this AccelLabel
int
getAccelWidth()
Returns the width needed to display the accelerator key(s).
static Type
getType()
Retrieve the runtime type used by the GLib library.
void
setAccelWidget(Widget accelWidget)
Set the widget for this AccelLabel

Methods inherited from class org.gnu.gtk.Label

getAngle, getAttributes, getEllipsize, getJustification, getLabel, getLabel, getLineWrap, getMaxWidthChars, getMnemonicWidget, getSelectable, getSelected, getSelectionEnd, getSelectionStart, getSingleLineMode, getText, getType, getUseMarkup, getUseMnemonic, getWidthChars, select, setAngle, setAttributes, setEllipsize, setJustification, setLabel, setLineWrap, setMarkup, setMarkup, setMaxWidthChars, setMnemonicWidget, setSelectable, setSingleLineMode, setText, setUnderlinePattern, setUseMarkup, setUseMnemonic, setWidthChars

Methods inherited from class org.gnu.gtk.Misc

getType, getXAlign, getXPadding, getYAlign, getYPadding, setAlignment, setPadding

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, 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, 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

Methods inherited from class org.gnu.glib.GObject

addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify

Constructor Details

AccelLabel

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

AccelLabel

public AccelLabel(String str)
Create an AccelLabel.

Method Details

getAccelLabel

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

getAccelWidget

public Widget getAccelWidget()
Retrieve the widget for this AccelLabel

getAccelWidth

public int getAccelWidth()
Returns the width needed to display the accelerator key(s). This is used by menus to align all of the MenuItem widgets and shouldn't be needed by applications.
Returns:
The width needed to display the accelerator keys.

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.
Overrides:
getType in interface Label

setAccelWidget

public void setAccelWidget(Widget accelWidget)
Set the widget for this AccelLabel