org.gnu.gtk

Class StatusBar


public class StatusBar
extends HBox

A Statusbar is usually placed along the bottom of an application's main Window. It may provide a regular commentary of the application's status (as is usually the case in a web browser, for example), or may be used to simply output a message when the status changes, (when an upload is complete in an FTP client, for example). It may also have a resize grip (a triangular area in the lower right corner) which can be clicked on to resize the window containing the statusbar.

Status bars in Gtk+ maintain a stack of messages. The message at the top of the each bar's stack is the one that will currently be displayed.

Any messages added to a statusbar's stack must specify a contextID that is used to uniquely identify the source of a message. This contextID can be generated by getContextID(String), given a message. Note that messages are stored in a stack, and when choosing which message to display, the stack structure is adhered to, regardless of the context identifier of a message.

Messages are added to the bar's stack with push(int,String).

The message at the top of the stack can be removed using pop(int). A message can be removed from anywhere in the stack if it's messageID was recorded at the time it was added. This is done using remove(int,int).

Constructor Summary

StatusBar()
Creates a new StatusBar Widget
StatusBar(Handle handle)
Creates a new StatusBar from a handle to native resources.

Method Summary

void
addListener(StatusBarListener listener)
Register an object to handle StatusBar events.
int
getContextID(String description)
Returns a new context identifier, given a description of the actual context.
Class
getEventListenerClass(String signal)
EventType
getEventType(String signal)
boolean
getHasResizeGrip()
Returns whether the statusbar has a resize grip.
static StatusBar
getStatusBar(Handle handle)
Internal static factory method to be used by Java-Gnome only.
static Type
getType()
Retrieve the runtime type used by the GLib library.
void
pop(int contextID)
Removes the message at the top of the statusbar's stack.
int
push(int contextID, String text)
Pushes a new message onto a statusbar's stack.
void
remove(int contextID, int messageID)
Forces the removal of a message from a statusbar's stack.
void
removeListener(StatusBarListener listener)
Removes a listener
void
setHasResizeGrip(boolean setting)
Sets whether the statusbar has a resize grip.

Methods inherited from class org.gnu.gtk.HBox

getHBox, getType

Methods inherited from class org.gnu.gtk.Box

getHomogeneous, getSpacing, getType, packEnd, packEnd, packStart, packStart, reorderChild, setHomogeneous, setSpacing

Methods inherited from class org.gnu.gtk.Container

add, addListener, getBooleanChildProperty, getBorderWidth, getChildProperty, getChildren, getEventListenerClass, getEventType, getIntChildProperty, getResizeMode, getType, remove, removeListener, resizeChildren, setBooleanChildProperty, setBorderWidth, setChildProperty, setIntChildProperty, setResizeMode

Methods inherited from class org.gnu.gtk.Widget

activate, addAccelerator, addEvents, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, addListener, canActivateAccel, createContext, createLayout, draw, drawArea, drawArea, finish, getAccessible, getAllocation, getCanFocus, getColormap, getContext, getData, getDisplay, getDragData, getEventListenerClass, getEventType, getExtensionEvents, getModifierStyle, getName, getParent, getParentWindow, getPointer, getRootWindow, getScreen, getSensitive, getStyle, getToplevel, getType, getWidget, getWindow, grabDefault, grabFocus, hasFocus, hasScreen, hide, hideAll, highlight, highlight, intersect, isAncestor, makeWidget, modifyStyle, popColormap, pushColormap, realize, removeAccelerator, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, removeListener, reparent, setBackgroundColor, setBaseColor, setCanFocus, setColormap, setDoubleBuffered, setDragDestination, setDragIcon, setDragIconPixbuf, setDragIconStock, setDragSource, setEvents, setExtensionEvents, setFont, setForegroundColor, setMinimumSize, setName, setNoDragDestination, setNoDragSource, setSensitive, setTextColor, shapeCombineMask, show, showAll, unHighlight, unHighlight

Methods inherited from class org.gnu.gtk.GtkObject

destroy, getType, sink

Methods inherited from class org.gnu.glib.GObject

addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addEventHandler, addListener, collect, freezeNotify, getBooleanProperty, getData, getDoubleProperty, getEventListenerClass, getEventType, getFloatProperty, getGObjectFromHandle, getIntProperty, getJavaObjectProperty, getLongProperty, getPixbufProperty, getProperty, getStringProperty, hasProperty, notify, removeEventHandler, removeListener, setBooleanProperty, setData, setDoubleProperty, setFloatProperty, setIntProperty, setJavaObjectProperty, setLongProperty, setPixbufProperty, setProperty, setStringProperty, thawNotify

Constructor Details

StatusBar

public StatusBar()
Creates a new StatusBar Widget

StatusBar

public StatusBar(Handle handle)
Creates a new StatusBar from a handle to native resources. This should only be used internally by the Java-Gnome packages.

Method Details

addListener

public void addListener(StatusBarListener listener)
Register an object to handle StatusBar events.

getContextID

public int getContextID(String description)
Returns a new context identifier, given a description of the actual context.
Parameters:
description - textual description of what context the new message is being used in.

getEventListenerClass

public Class getEventListenerClass(String signal)
Overrides:
getEventListenerClass in interface Container

getEventType

public EventType getEventType(String signal)
Overrides:
getEventType in interface Container

getHasResizeGrip

public boolean getHasResizeGrip()
Returns whether the statusbar has a resize grip.
Returns:
TRUE if the statusbar has a resize grip.

getStatusBar

public static StatusBar getStatusBar(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.
Overrides:
getType in interface HBox

pop

public void pop(int contextID)
Removes the message at the top of the statusbar's stack.
Parameters:
contextID - a context identifier.

push

public int push(int contextID,
                String text)
Pushes a new message onto a statusbar's stack.
Returns:
The message's new message id for use with remove(int,int)

remove

public void remove(int contextID,
                   int messageID)
Forces the removal of a message from a statusbar's stack. The exact contextID and messageID must be specified.

removeListener

public void removeListener(StatusBarListener listener)
Removes a listener

setHasResizeGrip

public void setHasResizeGrip(boolean setting)
Sets whether the statusbar has a resize grip. TRUE by default.
Parameters:
setting - TRUE to have a resize grip.