Eclipse Platform
Release 3.3

org.eclipse.ui.statushandlers
Class StatusManager

java.lang.Object
  extended byorg.eclipse.ui.statushandlers.StatusManager

public class StatusManager
extends Object

StatusManager is the entry point for all statuses to be reported in the user interface.

Handlers shoudn't be used directly but through the StatusManager singleton which keeps the status handling policy and chooses handlers. StatusManager.getManager().handle(IStatus) and handle(IStatus status, int style) are the methods are the primary access points to the StatusManager.

Acceptable styles (can be combined with logical OR)

Handlers are intended to be accessed via the status manager. The StatusManager chooses which handler should be used for a particular error. There are two ways for adding handlers to the handling flow. First using extension point org.eclipse.ui.statusHandlers, second by the workbench advisor and its method WorkbenchAdvisor.getWorkbenchErrorHandler(). If a handler is associated with a product, it is used instead of this defined in advisor.

Since:
3.3
See Also:
AbstractStatusHandler

Field Summary
static int BLOCK
          A style indicating that the handling should block the calling method until the user has responded.
static int LOG
          A style indicating that the status should be logged only.
static int NONE
          A style indicating that the status should not be acted on.
static int SHOW
          A style indicating that handlers should show a problem to an user without blocking the calling method while awaiting user response.
 
Method Summary
 void addLoggedStatus(IStatus status)
          This method informs the StatusManager that this IStatus is being handled by the handler and to ignore it when it shows up in our ILogListener.
static StatusManager getManager()
          Returns StatusManager singleton instance.
 void handle(IStatus status)
          Handles the given status.
 void handle(IStatus status, int style)
          Handles the given status due to the style.
 void handle(StatusAdapter statusAdapter)
          Handles the given status adapter.
 void handle(StatusAdapter statusAdapter, int style)
          Handles the given status adapter due to the style.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
A style indicating that the status should not be acted on. This is used by objects such as log listeners that do not want to report a status twice.

See Also:
Constant Field Values

LOG

public static final int LOG
A style indicating that the status should be logged only.

See Also:
Constant Field Values

SHOW

public static final int SHOW
A style indicating that handlers should show a problem to an user without blocking the calling method while awaiting user response. This is generally done using a non modal Dialog.

See Also:
Constant Field Values

BLOCK

public static final int BLOCK
A style indicating that the handling should block the calling method until the user has responded. This is generally done using a modal window such as a Dialog.

See Also:
Constant Field Values
Method Detail

getManager

public static StatusManager getManager()
Returns StatusManager singleton instance.

Returns:
the manager instance

handle

public void handle(StatusAdapter statusAdapter,
                   int style)
Handles the given status adapter due to the style. Because the facility depends on Workbench, this method will log the status, if Workbench isn't initialized and the style isn't NONE. If Workbench isn't initialized and the style is NONE, the manager will do nothing.

Parameters:
statusAdapter - the status adapter. Both the status adapter and the wrapped status may not be null.
style - the style.Value can be combined with logical OR. One of NONE, LOG, SHOW and BLOCK.

handle

public void handle(StatusAdapter statusAdapter)
Handles the given status adapter. The log style is used when this method is called.

Parameters:
statusAdapter - the status adapter. Both the status adapter and the wrapped status may not be null.

handle

public void handle(IStatus status,
                   int style)
Handles the given status due to the style. Because the facility depends on Workbench, this method will log the status, if Workbench isn't initialized and the style isn't NONE. If Workbench isn't initialized and the style is NONE, the manager will do nothing.

Parameters:
status - the status to handle. May not be null.
style - the style. Acceptable values are defined in StatusManager and can be combined with logical OR.

handle

public void handle(IStatus status)
Handles the given status. The log style is used when this method is called.

Parameters:
status - the status to handle. May not be null.

addLoggedStatus

public void addLoggedStatus(IStatus status)
This method informs the StatusManager that this IStatus is being handled by the handler and to ignore it when it shows up in our ILogListener.

Parameters:
status - already handled and logged status

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.