org.gnome.gtk

## Class ToolItem

- Object
- - org.freedesktop.bindings.Pointer
  - - org.freedesktop.bindings.Proxy
    - - org.gnome.glib.Object
      - - org.gnome.gtk.Widget
        - - org.gnome.gtk.Container
          - - org.gnome.gtk.Bin
            - - org.gnome.gtk.ToolItem

- All Implemented Interfaces:
    Activatable
  Direct Known Subclasses:
    SeparatorToolItem, ToolButton

      public class ToolItem
      extends Bin
      implements Activatable

  ToolItems are the items that can be added to a `Toolbar`.

  Usually you will prefer to use a subtype of this class, such as `ToolButton`, in your Toolbars. However, if you want to add another kind of Widget, you have to create a new ToolItem and `add()` the desired Widget to it.

  Since:
    4.0.4
  Author:
    Vreixo Formoso
  See Also:
    `Toolbar`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.gnome.gtk.Widget

      `Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.Destroy, Widget.Draw, Widget.EnterNotifyEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.SizeAllocate, Widget.UnmapEvent, Widget.VisibilityNotifyEvent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ToolItem()` Create a new ToolItem.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `getExpand()` Get if this ToolItem will be [is] expanded in the presence of extra available space on the Toolbar.
    `Action` | `getRelatedAction()` Get the Action that is triggered when this Activatable is activated, if any.
    `void` | `setExpand(boolean expand)` Set whether this ToolItem will be expanded when there is available space on the Toolbar.
    `void` | `setIsImportant(boolean setting)` Indicate that this ToolItem is to be considered to have "priority text".
    `void` | `setRelatedAction(Action action)` Set the Action that is triggered when this Activatable is activated.

    - ### 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, connect, connect, destroy, getAllocatedHeight, getAllocatedWidth, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getPreferredHeightForWidthMinimum, getPreferredHeightForWidthNatural, getPreferredHeightMinimum, getPreferredHeightNatural, getPreferredWidthForHeightMinimum, getPreferredWidthForHeightNatural, getPreferredWidthMinimum, getPreferredWidthNatural, getRequestMode, getRequisition, getSensitive, getStyleContext, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, overrideBackground, overrideColor, overrideFont, queueDraw, queueDrawArea, realize, setAlignHorizontal, setAlignVertical, setCanDefault, setCanFocus, setEvents, setExpandHorizontal, setExpandVertical, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll`

    - ### Methods inherited from class org.freedesktop.bindings.Pointer

      `toString`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ToolItem

          public ToolItem()

      Create a new ToolItem.

  - ### Method Detail

    - #### getExpand

          public boolean getExpand()

      Get if this ToolItem will be [is] expanded in the presence of extra available space on the Toolbar.

    - #### getRelatedAction

          public Action getRelatedAction()

      Description copied from interface: `Activatable`
      Get the Action that is triggered when this Activatable is activated, if any.
      Specified by:
        `getRelatedAction` in interface `Activatable`

    - #### setExpand

          public void setExpand(boolean expand)

      Set whether this ToolItem will be expanded when there is available space on the Toolbar.

    - #### setIsImportant

          public void setIsImportant(boolean setting)

      Indicate that this ToolItem is to be considered to have "priority text". When the ToolbarStyle is `BOTH_HORIZ` (which is the default in GNOME these days) only ToolItems with this property set will have their labels showing. For example, browsers often have the label "Back" but not "Forward" or "Up" marked important and thus showing.
      Since:
        4.0.19

    - #### setRelatedAction

          public void setRelatedAction(Action action)

      Description copied from interface: `Activatable`
      Set the Action that is triggered when this Activatable is activated.

      This replaced Action's connectProxy().

      Specified by:
        `setRelatedAction` in interface `Activatable`