org.gnu.gtk

Class ToolBar

public class ToolBar extends Container

The ToolBar is used to construct a toolbar. It is the container that controls the position of a set of icons that are mouse sensitive.
Constructor Summary
ToolBar()
Create a new ToolBar
ToolBar(Handle hndl)
Method Summary
voidaddListener(ToolBarListener listener)
Register an object to handle dialog events.
voidappendSpace()
Add a space to the end of the ToolBar.
voidappendWidget(Widget widget, String tooltip, String helpText)
Add a widget to the end of the toolbar.
intgetDropIndex(int x, int y)
Returns the position corresponding to the indicated point on ToolBar.
ClassgetEventListenerClass(String signal)
EventTypegetEventType(String signal)
ToolItemgetItem(int position)
Return the ToolItem on the ToolBar from the position specified.
intgetItemIndex(ToolItem item)
Return the position of an item on the ToolBar starting from 0.
intgetNumItems()
Return the number of items on the ToolBar.
ReliefStylegetReliefStyle()
Returns the ReliefStyle of Buttons on the ToolBar.
booleangetShowArrow()
Returns whether the ToolBar has an overflow menu.
static ToolBargetToolBar(Handle handle)
Internal static factory method to be used by Java-Gnome only.
static TypegetType()
Retrieve the runtime type used by the GLib library.
voidinsert(ToolItem item, int position)
Insert a ToolItem into the ToolBar at a specified position.
voidinsertSpace(int position)
Insert a space in the ToolBar at the specified location.
voidinsertWidget(Widget widget, String tooltip, String helpText, int index)
Insert a Widget in the ToolBar at the given position
booleanisToolTips()
voidprependSpace()
Add a space to the beginning of the ToolBar.
voidprependWidget(Widget widget, String tooltip, String helpText)
Add a widget to the beginning of the toolbar.
voidremoveListener(ToolBarListener listener)
Removes a listener
voidremoveSpace(int position)
Remove a space from the ToolBar.
voidsetDropHighlightItem(ToolItem item, int index)
Highlights ToolBar to give an idea of what it would look like if a ToolItem was added to the ToolBar and the provided index.
voidsetIconSize(IconSize iconSize)
Sets the size of the stock icons in the ToolBar.
voidsetOrientation(Orientation orientation)
Set whether the ToolBar should appear horizontally or vertically.
voidsetShowArrow(boolean showArrow)
Sets whether to show an overflow menu when ToolBar doesn't have room for all of its' items.
voidsetStyle(ToolBarStyle style)
Alter the view of the ToolBar to display either icons only, text only, or both.
voidsetToolTips(boolean enable)
Sets if the tooltips of the ToolBar should be active or not.

Constructor Detail

ToolBar

public ToolBar()
Create a new ToolBar

ToolBar

public ToolBar(Handle hndl)

Method Detail

addListener

public void addListener(ToolBarListener listener)
Register an object to handle dialog events.

See Also: ToolBarListener

appendSpace

public void appendSpace()

Deprecated:

Add a space to the end of the ToolBar.

appendWidget

public void appendWidget(Widget widget, String tooltip, String helpText)

Deprecated:

Add a widget to the end of the toolbar.

Parameters: widget The widget to add to the end of the ToolBar. tooltip The text for the tooltip for this item. helpText Context sensitive help about this item.

getDropIndex

public int getDropIndex(int x, int y)
Returns the position corresponding to the indicated point on ToolBar. This is useful when dragging items to the ToolBar: this functions returns the position a new item would be inserted.

Parameters: x y

getEventListenerClass

public Class getEventListenerClass(String signal)

getEventType

public EventType getEventType(String signal)

getItem

public ToolItem getItem(int position)
Return the ToolItem on the ToolBar from the position specified.

Parameters: position

getItemIndex

public int getItemIndex(ToolItem item)
Return the position of an item on the ToolBar starting from 0.

Parameters: item

getNumItems

public int getNumItems()
Return the number of items on the ToolBar.

getReliefStyle

public ReliefStyle getReliefStyle()
Returns the ReliefStyle of Buttons on the ToolBar.

getShowArrow

public boolean getShowArrow()
Returns whether the ToolBar has an overflow menu.

getToolBar

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

getType

public static Type getType()
Retrieve the runtime type used by the GLib library.

insert

public void insert(ToolItem item, int position)
Insert a ToolItem into the ToolBar at a specified position. If position is 0 then the item is prepended to the start of the ToolBar. If position is negative then it is appended to the end of the ToolBar.

Parameters: item position

insertSpace

public void insertSpace(int position)

Deprecated:

Insert a space in the ToolBar at the specified location.

Parameters: position The location to insert the space.

insertWidget

public void insertWidget(Widget widget, String tooltip, String helpText, int index)

Deprecated:

Insert a Widget in the ToolBar at the given position

Parameters: widget The widget to add to the ToolBar. tooltip The text for the tooltip for this item. helpText Context sensitive help about this item. index The location in the ToolBar to insert this Widget.

isToolTips

public boolean isToolTips()

prependSpace

public void prependSpace()

Deprecated:

Add a space to the beginning of the ToolBar.

prependWidget

public void prependWidget(Widget widget, String tooltip, String helpText)

Deprecated:

Add a widget to the beginning of the toolbar.

Parameters: widget The widget to add to the beginning of the ToolBar. tooltip The text for the tooltip for this item. helpText Context sensitive help about this item.

removeListener

public void removeListener(ToolBarListener listener)
Removes a listener

See Also: addListener

removeSpace

public void removeSpace(int position)

Deprecated:

Remove a space from the ToolBar.

Parameters: position The position of the space to remove.

setDropHighlightItem

public void setDropHighlightItem(ToolItem item, int index)
Highlights ToolBar to give an idea of what it would look like if a ToolItem was added to the ToolBar and the provided index.

Parameters: item index

setIconSize

public void setIconSize(IconSize iconSize)

Deprecated:

Sets the size of the stock icons in the ToolBar.

Parameters: iconSize The size of the icons.

setOrientation

public void setOrientation(Orientation orientation)
Set whether the ToolBar should appear horizontally or vertically.

Parameters: orientation Specifies the direction of the ToolBar.

setShowArrow

public void setShowArrow(boolean showArrow)
Sets whether to show an overflow menu when ToolBar doesn't have room for all of its' items.

Parameters: showArrow

setStyle

public void setStyle(ToolBarStyle style)
Alter the view of the ToolBar to display either icons only, text only, or both.

Parameters: style Determines how to display the items.

setToolTips

public void setToolTips(boolean enable)
Sets if the tooltips of the ToolBar should be active or not.

Parameters: enable Should the tooltips be enabled.