java-gnome version 4.0.19

org.gnome.gtk
Class Toolbar

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.Toolbar

public class Toolbar
extends Container

A Toolbar is a broad horizontal bar with several controls (usually largish graphical buttons) intended to provide a fast and convenient access to operations commonly used in an application.

In most cases, you will want to add some ToolButtons to the Toolbar, but you can also add other elements as well by creating a ToolItem and adding your own customized elements to it.

You can also group related items together by using a SeparatorToolItem to the Toolbar to create a separation between them. Don't overdo that, however - too many separators result in a cluttered appearance.

Note that the actual on screen appearance of the Toolbar is governed by the user's theme and how they have configured Toolbars to appear. The choices of "Text below Icons" (the usual default), "Text beside Icons", "Icons only", and "Text only" are available from the GNOME panel menu at System > Menus & Toolbars which runs the gnome-ui-properties program.

Since:
4.0.4
Author:
Vreixo Formoso, Andrew Cowie

Nested Class Summary
 
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
Toolbar()
          Create a new, empty, Toolbar.
 
Method Summary
 void add(Widget w)
          Add a child Widget to this Container.
 void insert(ToolItem item, int pos)
          Insert a ToolItem in the Toolbar at a given position.
 void setStyle(ToolbarStyle style)
          Set the appearance of a Toolbar.
 
Methods inherited from class org.gnome.gtk.Container
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

Toolbar

public Toolbar()
Create a new, empty, Toolbar.

Method Detail

add

public void add(Widget w)
Description copied from class: Container
Add a child Widget to this Container. This works for all the various Container types, of course, but most offer more specialized packing methods that allow you to control the positioning of the Widget being added with greater finesse.

Overrides:
add in class Container

insert

public void insert(ToolItem item,
                   int pos)
Insert a ToolItem in the Toolbar at a given position.

Parameters:
item - The new item to add to the Toolbar.
pos - The position where the new item will be inserted. You can use 0 to prepend the item at the beginning of the Toolbar, or a negative value to append the item at the end.

setStyle

public void setStyle(ToolbarStyle style)
Set the appearance of a Toolbar.

Toolbars buttons can be customized to display either an icon, a text label, or both. As explained above, in the documentation for this class, the appearance of Toolbars is configured by the user as a desktop setting. This method will override those settings, so in most cases you should not use this method, and just let the user choose the appearance (s)he prefers.

However, some really complex applications might need several Toolbars and many buttons on each one, so configuring a compact Toolbar style can help to save screen space. In such cases this method may be useful, but the general advice is to use this with care, and avoid overriding of user settings unless you have a strong reason.

Finally, note that if you choose for example an ICONS only appearance, and a given ToolButton has no icon, its Label will be shown instead, so GTK engine will do its best to keep Toolbar usable.

Since:
4.0.12


java-gnome