StatusBar Class

StatusBar Class

This Package | All Packages

Component
  |
  +--Control
    |
    +--StatusBar
public class StatusBar
extends Control

This class wraps the comctl32 status bar control.

Constructors
Name Description
StatusBar() Creates a status bar.

Methods
Name Description
addOnPanelClick( StatusBarPanelClickEventHandler value) Adds an event listener for the PanelClick event.
addPanel(StatusBarPanel statusBarPanel) Adds a panel to the status bar.
getMode() Retrieves the state of the Mode property.
getPanels() Retrieve an array of StatusBarPanel objects that are in the status bar.
getSimpleText() Retrieves the SimpleText property.
getSizingGrip() Retrieves the SizingGrip property.
getStatusBarPanel(int index) Retrieves the specified panel in the status bar.
getText() Overrides Control.getText().
insertPanel(int index, StatusBarPanel panel) Inserts a panel at the specified location.
onMouseDown(MouseEvent e) Overrides Control.onMouseDown(MouseEvent)

Overrides:

onMouseDown(MouseEvent) in Control.

onPanelClick(StatusBarPanelClickEvent e) Event for when a status bar panel is clicked.
removeAllPanels() Removes all the panels from the status bar.
removeOnPanelClick( StatusBarPanelClickEventHandler value) Removes an event listener for the PanelClick event.
removePanel(int index) Removes a panel from the status bar.
setFont(Font value) Overrides Control.setFont(Font).
setMode(int mode) Sets the state of the Mode property.
setPanel(int index, StatusBarPanel panel) Sets a panel at a particular index.
setPanels(StatusBarPanel[] array) Sets the panels within the status bar.
setSimpleText(String string) Sets the SimpleText property.
setSizingGrip(boolean value) Sets the SizingGrip property.
setText(String text) Overrides Control.setText(String).

Constructors

StatusBar.StatusBar

Syntax
public StatusBar();
Description

Creates a status bar.

Methods

StatusBar.addOnPanelClick

Syntax
public void addOnPanelClick( StatusBarPanelClickEventHandler value );
Parameters
value
The event handler to add.
Description

Adds an event listener for the PanelClick event.

StatusBar.addPanel

Syntax
public int addPanel( StatusBarPanel statusBarPanel );
Parameters
statusBarPanel
The statusBarPanel to add.
Return Value

Returns the index of the added panel.

Description

Adds a panel to the status bar.

StatusBar.getMode

Syntax
public int getMode();
Return Value

Returns the mode of the status bar.

Description

Retrieves the state of the Mode property. The Mode property determines whether the StatusBar is simple or not.

StatusBar.getPanels

Syntax
public StatusBarPanel[] getPanels();
Return Value

Returns the array.

Description

Retrieve an array of StatusBarPanel objects that are in the status bar.

StatusBar.getSimpleText

Syntax
public String getSimpleText();
Return Value

Returns the SimpleText;

Description

Retrieves the SimpleText property. The SimpleText property is displayed when the status bar is in simple mode.

StatusBar.getSizingGrip

Syntax
public boolean getSizingGrip();
Return Value

Returns true if the status bar has a sizing grip; otherwise, returns false.

Description

Retrieves the SizingGrip property.

StatusBar.getStatusBarPanel

Syntax
public StatusBarPanel getStatusBarPanel( int index );
Parameters
index
The index of the panel requested.
Return Value

Returns a StatusBarPanel object.

Description

Retrieves the specified panel in the status bar.

StatusBar.getText

Syntax
public String getText();
Description

Overrides Control.getText().

Overrides

getText() in Control.

StatusBar.insertPanel

Syntax
public int insertPanel( int index, StatusBarPanel panel );
Parameters
index
The location at which to insert the panel.
panel
The StatusBarPanel to insert in the status bar.
Return Value

Returns the index of the added panel.

Description

Inserts a panel at the specified location.

StatusBar.onMouseDown

Syntax
protected void onMouseDown( MouseEvent e );
Description

Overrides Control.onMouseDown(MouseEvent)

Overrides

onMouseDown(MouseEvent) in Control.

StatusBar.onPanelClick

Syntax
protected void onPanelClick( StatusBarPanelClickEvent e );
Parameters
e
The event data, including the StatusBarPanel clicked.
Description

Event for when a status bar panel is clicked.

StatusBar.removeAllPanels

Syntax
public void removeAllPanels();
Description

Removes all the panels from the status bar.

StatusBar.removeOnPanelClick

Syntax
public void removeOnPanelClick( StatusBarPanelClickEventHandler value );
Parameters
value
The event handler to remove.
Description

Removes an event listener for the PanelClick event.

StatusBar.removePanel

Syntax
public void removePanel( int index );
Parameters
index
The index of the panel to remove.
Description

Removes a panel from the status bar.

Exceptions

ArrayIndexOutOfBounds thrown if the index is out of range.

StatusBar.setFont

Syntax
public void setFont( Font value );
Description

Overrides Control.setFont(Font). This method is used to update the width of any panels that have the StatusBarPAnelAutoSize.CONTENTS property set.

Overrides

setFont(Font) in Control.

StatusBar.setMode

Syntax
public void setMode( int mode );
Parameters
mode
The new mode of the status bar.
Description

Sets the state of the Mode property. The Mode property determines whether the status bar is simple or not. A simple status bar displays only one line of text.

StatusBar.setPanel

Syntax
public void setPanel( int index, StatusBarPanel panel );
Parameters
index
The index at which to change the panel.
panel
The new panel.
Description

Sets a panel at a particular index.

StatusBar.setPanels

Syntax
public void setPanels( StatusBarPanel[] array );
Parameters
array
The new panels.
Description

Sets the panels within the status bar. The previous panels will be removed.

StatusBar.setSimpleText

Syntax
public void setSimpleText( String string );
Parameters
string
The text displayed by the status bar.
Description

Sets the SimpleText property. The SimpleText property is displayed when the status bar is in simple mode.

StatusBar.setSizingGrip

Syntax
public void setSizingGrip( boolean value );
Parameters
value
Set to true if a sizing grip is desired; otherwise, set to false.
Description

Sets the SizingGrip property.

StatusBar.setText

Syntax
public void setText( String text );
Description

Overrides Control.setText(String).

Overrides

setText(String) in Control.