org.gnu.gtk
Class AccelLabel

java.lang.Object
  |
  +--org.gnu.glib.GObject
        |
        +--org.gnu.gtk.GtkObject
              |
              +--org.gnu.gtk.Widget
                    |
                    +--org.gnu.gtk.Misc
                          |
                          +--org.gnu.gtk.Label
                                |
                                +--org.gnu.gtk.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(int handle)
          Construct a AccelLabel using a handle to a native resource.
AccelLabel(java.lang.String str)
          Create an AccelLabel.
 
Method Summary
 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
getAttributes, getJustification, getLabel, getLineWrap, getMnemonicWidget, getSelectable, getSelected, getSelectionEnd, getSelectionStart, getText, getUseMarkup, getUseMnemonic, select, setAttributes, setJustification, setLabel, setLineWrap, setMarkup, setMarkup, setMnemonicWidget, setSelectable, setText, setUnderlinePattern, setUseMarkup, setUseMnemonic
 
Methods inherited from class org.gnu.gtk.Misc
getXAlign, getXPadding, getYAlign, getYPadding, setAlignment, setPadding
 
Methods inherited from class org.gnu.gtk.Widget
activate, addListener, addListener, addListener, addListener, addListener, addListener, createContext, createLayout, destroy, draw, drawArea, drawArea, getAccessible, getColormap, getContext, getEventListenerClass, getEventType, 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
 

Constructor Detail

AccelLabel

public AccelLabel(java.lang.String str)
Create an AccelLabel.


AccelLabel

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

Method Detail

setAccelWidget

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


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.


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