java-gnome version 4.0.19

org.gnome.gtk
Class ToggleToolButton

Object
  extended by org.freedesktop.bindings.Pointer
      extended by org.freedesktop.bindings.Proxy
          extended by org.gnome.glib.Object
              extended by org.gnome.gtk.Object
                  extended by org.gnome.gtk.Widget
                      extended by org.gnome.gtk.Container
                          extended by org.gnome.gtk.Bin
                              extended by org.gnome.gtk.ToolItem
                                  extended by org.gnome.gtk.ToolButton
                                      extended by org.gnome.gtk.ToggleToolButton
All Implemented Interfaces:
Activatable
Direct Known Subclasses:
RadioToolButton

public class ToggleToolButton
extends ToolButton

A ToggleToolButton is a ToolButton that retains its state.

The usual usage of such kind of ToolButtons is to let users enable or disable an application feature.

You can check the current state of the ToggleToolButton using the getActive() method. Additionally you can connect to the TOGGLED signal to respond to changes in the active state.

Beware that ToogleToolButtons have sometimes fared poorly in usability tests. The problem is that they are an exception: most ToolItems are ToolButtons, and most of them you just press and something immediately happens. Since there is no visual distinction between a ToolButton and an inactive ToggleToolButton, users don't expect that this particular ToolItem is going to behave differently and maintain its state. It's not a huge problem (ie, if the user is paying attention they'll soon find out that the button is a toggle), but it's something that usually takes a few iterations before the user learns. Something to keep in mind.

Since:
4.0.4
Author:
Vreixo Formoso, Andrew Cowie

Nested Class Summary
static interface ToggleToolButton.Toggled
          Signal indicating the ToggleToolButton state has changed.
 
Nested classes/interfaces inherited from class org.gnome.gtk.ToolButton
ToolButton.Clicked
 
Nested classes/interfaces inherited from class org.gnome.gtk.Widget
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.EnterNotifyEvent, Widget.ExposeEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.UnmapEvent, Widget.VisibilityNotifyEvent
 
Nested classes/interfaces inherited from class org.gnome.gtk.Object
Object.Destroy
 
Constructor Summary
ToggleToolButton()
          Create a new ToggleToolButton.
ToggleToolButton(Stock stock)
          Create a new ToggleToolButton based on one of the stock items.
 
Method Summary
 void connect(ToggleToolButton.Toggled handler)
          Connect a handler to the ToggleToolButton.Toggled signal.
 boolean getActive()
          Is the ToggleToolButton currently activated on?
 void setActive(boolean isActive)
          Set whether this ToggleToolButton is active, that is, whether it appears pressed or not.
 
Methods inherited from class org.gnome.gtk.ToolButton
connect, getLabel, getLabelWidget, setLabel, setLabelWidget
 
Methods inherited from class org.gnome.gtk.ToolItem
getExpand, getRelatedAction, setExpand, setIsImportant, setRelatedAction
 
Methods inherited from class org.gnome.gtk.Bin
getChild
 
Methods inherited from class org.gnome.gtk.Container
add, getChildren, remove, setBorderWidth
 
Methods inherited from class org.gnome.gtk.Widget
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getRequisition, getSensitive, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, modifyBackground, modifyBase, modifyFont, modifyText, queueDraw, queueDrawArea, realize, setCanDefault, setCanFocus, setColormap, setEvents, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
 
Methods inherited from class org.gnome.gtk.Object
connect, destroy
 
Methods inherited from class org.freedesktop.bindings.Pointer
toString
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ToggleToolButton

public ToggleToolButton()
Create a new ToggleToolButton.

Since:
4.0.4

ToggleToolButton

public ToggleToolButton(Stock stock)
Create a new ToggleToolButton based on one of the stock items.

Since:
4.0.4
Method Detail

connect

public void connect(ToggleToolButton.Toggled handler)
Connect a handler to the ToggleToolButton.Toggled signal.

Since:
4.0.4

getActive

public boolean getActive()
Is the ToggleToolButton currently activated on?

Since:
4.0.4

setActive

public void setActive(boolean isActive)
Set whether this ToggleToolButton is active, that is, whether it appears pressed or not. Calling this will emit a TOGGLED signal.

Since:
4.0.4


java-gnome