| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html lang="en"> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js" type="text/javascript"></script> |
| <title>Defining a product status handler</title> |
| </head> |
| <body> |
| |
| <h2>Defining a product status handler</h2> |
| |
| <p> |
| The <a href="../reference/api/org/eclipse/ui/statushandlers/AbstractStatusHandler.html"><b>AbstractStatusHandler</b></a> |
| class and the <b><a href="../reference/extension-points/org_eclipse_ui_statusHandlers.html">org.eclipse.ui.statusHandlers</a></b> |
| extension point make up the generic mechanism that can be used to customize |
| problem handling for the given product. The main purpose of this extension is |
| to define status handlers (which extends <a href="../reference/api/org/eclipse/ui/statushandlers/AbstractStatusHandler.html"><b>AbstractStatusHandler</b></a>) |
| and to specify the binding between a product and a status handler. For example, |
| the following contribution defines a hypothetical status handler to be used |
| by the workbench:</p> |
| |
| <pre> |
| <extension point="org.eclipse.ui.statusHandlers"> |
| <statusHandler |
| class="org.eclipse.ui.statushandlers.SampleStatusHandler" |
| id="sampleStatusHandler"/> |
| <statusHandlerProductBinding |
| handlerId="sampleStatusHandler" |
| productId="productId"> |
| </introProductBinding> |
| </extension> |
| </pre> |
| <p> |
| This contribution first defines the status handler and assigns it the id "sampleStatusHandler". It then binds this |
| handler to a product whose id is "productId". When the status handling facility is accessed first time, |
| the class specified in the <b>class</b> attribute will be instantiated by the workbench and used for handling of |
| status or error occurred in the product. |
| </p> |
| |
| <p> |
| The platform supplies its own <a href="../reference/api/org/eclipse/ui/statushandlers/AbstractStatusHandler.html"><b>AbstractStatusHandler</b></a> |
| implementation called <a href="../reference/api/org/eclipse/ui/statushandlers/WorkbenchErrorHandler.html"><b>WorkbenchErrorHandler</b></a>. |
| </p> |
| |
| </body> |
| </html> |