Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.statushandlers
Class WorkbenchStatusDialogManager

java.lang.Object
  extended by 
org.eclipse.ui.statushandlers.WorkbenchStatusDialogManager

public class WorkbenchStatusDialogManager
extends Object

The WorkbenchStatusDialogManager is a utility class for displaying one or more messages (errors, warnings or infos) to the user. The dialog supplied has a Details button that opens/closes the details area. The default AbstractStatusAreaProvider displays a tree of StatusAdapters related to the selected item on the messages list. The dialog also hasa Support button that opens/closes the support area which contains the provided AbstractStatusAreaProvider. The Support button is disabled and not visible unless enableDefaultSupportArea(boolean) is invoked.

The default details area can be replaced using setDetailsAreaProvider(AbstractStatusAreaProvider)

The default support area can be replaced using setSupportAreaProvider(AbstractStatusAreaProvider) or Policy.setErrorSupportProvider(ErrorSupportProvider).

The manager can switch from a non-modal dialog to a modal dialog. See addStatusAdapter(StatusAdapter, boolean)

Since:
3.4
See Also:
Policy.setErrorSupportProvider(ErrorSupportProvider), ErrorSupportProvider, AbstractStatusAreaProvider
Restriction:
This class is not intended to be subclassed by clients.

Constructor Summary
WorkbenchStatusDialogManager (int displayMask, String dialogTitle)
          Creates workbench status dialog.
WorkbenchStatusDialogManager ( Shell parentShell, int displayMask, String dialogTitle)
          Deprecated. As of 3.4 the parentShell is ignored
WorkbenchStatusDialogManager ( Shell parentShell, String dialogTitle)
          Deprecated. As of 3.4 the parentShell is ignored
WorkbenchStatusDialogManager ( String dialogTitle)
          Creates workbench status dialog.
 
Method Summary
 void addStatusAdapter ( StatusAdapter statusAdapter, boolean modal)
           Adds a new StatusAdapter to the status adapters list in the dialog.
 void enableDefaultSupportArea (boolean enable)
          Enables the default support area that shows stack trace of the exception contained in the selected status.
 void enableErrorDialogCompatibility ()
          This method makes the dialog to be similar to the JFace ErrorDialog.
  Object getProperty ( Object key)
          This method gets various dialog properties.
  Collection getStatusAdapters ()
          Gets a collection of status adapters that were passed to the dialog.
 void setDetailsAreaProvider ( AbstractStatusAreaProvider provider)
          Sets the details area provider.
 void setMessageDecorator ( ILabelDecorator decorator)
           This methods sets up the decorator, which is used to modify displayed strings extracted from StatusAdapter.
 void setProperty ( Object key, Object value)
          This method sets various properties on the manager.
 void setStatusListLabelProvider ( ITableLabelProvider labelProvider)
          Deprecated. As of 3.5 setMessageDecorator(org.eclipse.jface.viewers.ILabelDecorator) is recommended.
 void setSupportAreaProvider ( AbstractStatusAreaProvider provider)
          Sets the support provider.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkbenchStatusDialogManager

public WorkbenchStatusDialogManager(int displayMask,
                                    
String dialogTitle)
Creates workbench status dialog.

Parameters:
displayMask - the mask used to filter the handled StatusAdapter objects, the mask is a logical sum of status severities
dialogTitle - the title of the dialog. If null, than default will be used.

WorkbenchStatusDialogManager

public WorkbenchStatusDialogManager(
Shell parentShell,
                                    int displayMask,
                                    
String dialogTitle)
Deprecated. As of 3.4 the parentShell is ignored

Creates workbench status dialog.

Parameters:
parentShell - the parent shell for the dialog. It may be null.
displayMask - the mask used to filter the handled StatusAdapter objects, the mask is a logical sum of status severities
dialogTitle - the title of the dialog. If null, than default will be used.
See Also:
WorkbenchStatusDialogManager(int, String)

WorkbenchStatusDialogManager

public WorkbenchStatusDialogManager(
String dialogTitle)
Creates workbench status dialog.

Parameters:
dialogTitle - the title of the dialog. If null, than default will be used.

WorkbenchStatusDialogManager

public WorkbenchStatusDialogManager(
Shell parentShell,
                                    
String dialogTitle)
Deprecated. As of 3.4 the parentShell is ignored

Creates workbench status dialog.

Parameters:
parentShell - the parent shell for the dialog. It may be null.
dialogTitle - the title of the dialog. If null, than default will be used.
See Also:
WorkbenchStatusDialogManager(String)
Method Detail

addStatusAdapter

public void addStatusAdapter(
StatusAdapter statusAdapter,
                             boolean modal)

Adds a new StatusAdapter to the status adapters list in the dialog.

If the dialog is already visible, the status adapter will be shown immediately. Otherwise, the dialog with the added status adapter will show up, if all conditions below are false.

All not shown status adapters will be displayed as soon as the dialog shows up.

Parameters:
modal - true if the dialog should be modal, false otherwise
statusAdapter - the status adapter

enableDefaultSupportArea

public void enableDefaultSupportArea(boolean enable)
Enables the default support area that shows stack trace of the exception contained in the selected status.

Parameters:
enable - true enables, false disables default support

getStatusAdapters

public 
Collection getStatusAdapters()
Gets a collection of status adapters that were passed to the dialog.

Returns:
collection of StatusAdapter objects

setDetailsAreaProvider

public void setDetailsAreaProvider(
AbstractStatusAreaProvider provider)
Sets the details area provider. If null is set, the default area provider will be used.

Parameters:
provider - A details area provider to be set.

setStatusListLabelProvider

public void setStatusListLabelProvider(
ITableLabelProvider labelProvider)
Deprecated. As of 3.5 setMessageDecorator(org.eclipse.jface.viewers.ILabelDecorator) is recommended.

Sets new label provider for the status list. This label provider is used also to display the second message on the dialog if only one status is available.

This method is no longer recommended to use as it is impossible to achieve consistent behavior after changing only one label provider.

Parameters:
labelProvider - a label provider to be used when displaying status adapters.

setSupportAreaProvider

public void setSupportAreaProvider(
AbstractStatusAreaProvider provider)
Sets the support provider. The policy for choosing support provider is:
  1. use the support provider set by this method, if set
  2. use the support provider set in JFace Policy, if set
  3. use the default support area, if enabled

Parameters:
provider - Support provider to be set.

setMessageDecorator

public void setMessageDecorator(
ILabelDecorator decorator)

This methods sets up the decorator, which is used to modify displayed strings extracted from StatusAdapter. The decorator should be used to remove technical codes from the dialog, f.e. following message "ERR2008 Invalid password" can be translated into "Invalid password".

The decorator will be applied only to messages extracted from StatusAdapter (predefined messages like "This status has children statuses. See 'Details' for more information." are not affected.

This method should not be used together with setStatusListLabelProvider(ITableLabelProvider).

Parameters:
decorator - - the decorator to be set. Only ILabelDecorator.decorateText(String, Object) method will be used. This method should return null if and only if the first argument is null. StatusAdapter is passed as second parameter. Other methods should have default behavior as they may be used in future versions of the dialog.
Since:
3.5

setProperty

public void setProperty(
Object key,
                        
Object value)
This method sets various properties on the manager.

Parameters:
key - a key of the property to be set.
value - a value of the property to be set. The value must be of type specified by the property key. null should never be passed unless the property key javadoc allows for that.
Since:
3.5

getProperty

public 
Object getProperty(
Object key)
This method gets various dialog properties.

Parameters:
key - a key of the property to be get.
Returns:
a value of the property. The value will be of type specified by the property key. null can be returned.
Since:
3.5

enableErrorDialogCompatibility

public void enableErrorDialogCompatibility()
This method makes the dialog to be similar to the JFace ErrorDialog. The dialog handles StatusAdapters wrapping IStatus with severity IStatus.OK, does not display the link to the error log, does not display the link to the support area but always opens it.

Since:
3.5
See Also:
ErrorDialog

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire