org.springframework.richclient.application.statusbar.support
Class DefaultStatusBar

java.lang.Object
  extended by org.springframework.richclient.application.support.ApplicationServicesAccessor
      extended by org.springframework.richclient.factory.AbstractControlFactory
          extended by org.springframework.richclient.application.statusbar.support.DefaultStatusBar
All Implemented Interfaces:
StatusBar, ControlFactory

public class DefaultStatusBar
extends AbstractControlFactory
implements StatusBar

A StatusBar control is a component with a horizontal layout which hosts a number of status indication controls. Typically it is situated below the content area of the window.

By default a StatusBar has two predefined status controls: a JLabel and a JProgressBar and it provides API for easy access.

Author:
Peter De Bruycker

Constructor Summary
DefaultStatusBar()
           
 
Method Summary
 void clear()
          Clears the messages of this status bar.
protected  JComponent createControl()
          Subclasses must override this method to create a new instance of the control that this factory produces.
protected  JLabel createMessageLabel()
          Create the JLabel used to render the messages.
protected  StatusBarProgressMonitor createStatusBarProgressMonitor()
          Create the StatusBarProgressMonitor.
 ProgressMonitor getProgressMonitor()
          Returns the status bar's progress monitor
 void setCancelEnabled(boolean enabled)
          Controls whether the ProgressIndication provides UI for canceling a long running operation.
 void setErrorMessage(Message errorMessage)
          Sets the error message text to be displayed on the status bar.
 void setErrorMessage(String errorMessage)
          Sets the error message text to be displayed on the status bar.
 void setMessage(Message message)
          Sets the message text to be displayed on the status bar.
 void setMessage(String message)
          Sets the message text to be displayed on the status bar.
 void setVisible(boolean visible)
          Shows or hides this status bar.
 
Methods inherited from class org.springframework.richclient.factory.AbstractControlFactory
createControlIfNecessary, getControl, isControlCreated, isSingleton, setSingleton
 
Methods inherited from class org.springframework.richclient.application.support.ApplicationServicesAccessor
getActiveWindow, getApplication, getApplicationContext, getApplicationName, getApplicationServices, getCommandConfigurer, getComponentFactory, getConversionService, getIconSource, getImageSource, getMessage, getMessage, getMessage, getMessage, getMessages, getMessageSource, getObjectConfigurer, getService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.richclient.factory.ControlFactory
getControl
 

Constructor Detail

DefaultStatusBar

public DefaultStatusBar()
Method Detail

getProgressMonitor

public ProgressMonitor getProgressMonitor()
Returns the status bar's progress monitor

Specified by:
getProgressMonitor in interface StatusBar
Returns:
the progress monitor

setCancelEnabled

public void setCancelEnabled(boolean enabled)
Controls whether the ProgressIndication provides UI for canceling a long running operation. If the ProgressIndication is currently visible calling this method may have a direct effect on the layout because it will make a cancel button visible.

Specified by:
setCancelEnabled in interface StatusBar
Parameters:
enabled - true or false

setMessage

public void setMessage(Message message)
Sets the message text to be displayed on the status bar.

The icon of the message is ignored

Specified by:
setMessage in interface StatusBar
Parameters:
message - the message to be set, if null, the status line is cleared.

setMessage

public void setMessage(String message)
Sets the message text to be displayed on the status bar.

Specified by:
setMessage in interface StatusBar
Parameters:
message - the message to be set, if null, the status line is cleared.

setErrorMessage

public void setErrorMessage(Message errorMessage)
Sets the error message text to be displayed on the status bar.

Error messages are shown over the standard message, and in a red color.

The icon of the message is ignored

Specified by:
setErrorMessage in interface StatusBar
Parameters:
message - the error message to be set, if null, the error message is cleared, and the standard message is shown again

setErrorMessage

public void setErrorMessage(String errorMessage)
Sets the error message text to be displayed on the status bar.

Error messages are shown over the standard message, and in a red color.

Specified by:
setErrorMessage in interface StatusBar
Parameters:
message - the error message to be set, if null, the error message is cleared, and the standard message is shown again

createMessageLabel

protected JLabel createMessageLabel()
Create the JLabel used to render the messages.

Can safely be overridden to customize the label

Returns:
the JLabel

createControl

protected JComponent createControl()
Description copied from class: AbstractControlFactory
Subclasses must override this method to create a new instance of the control that this factory produces.

Specified by:
createControl in class AbstractControlFactory
Returns:
The newly created control, never null.

createStatusBarProgressMonitor

protected StatusBarProgressMonitor createStatusBarProgressMonitor()
Create the StatusBarProgressMonitor.

Can safely be overridden to customize the progress monitor and its components

Returns:
the StatusBarProgressMonitor

setVisible

public void setVisible(boolean visible)
Shows or hides this status bar.

Specified by:
setVisible in interface StatusBar
Parameters:
visible - true or false
See Also:
Component.setVisible(boolean)

clear

public void clear()
Description copied from interface: StatusBar
Clears the messages of this status bar.

Specified by:
clear in interface StatusBar


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.