KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > WorkbenchException


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IStatus;
15 import org.eclipse.core.runtime.Status;
16
17 /**
18  * A checked exception indicating a recoverable error occured internal to the
19  * workbench. The status provides a further description of the problem.
20  * <p>
21  * This exception class is not intended to be subclassed by clients.
22  * </p>
23  */

24 public class WorkbenchException extends CoreException {
25
26     /**
27      * Generated serial version UID for this class.
28      * @since 3.1
29      */

30     private static final long serialVersionUID = 3258125864872129078L;
31
32     /**
33      * Creates a new exception with the given message.
34      *
35      * @param message the message
36      */

37     public WorkbenchException(String JavaDoc message) {
38         this(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, message, null));
39     }
40
41     /**
42      * Creates a new exception with the given message.
43      *
44      * @param message the message
45      * @param nestedException an exception to be wrapped by this WorkbenchException
46      */

47     public WorkbenchException(String JavaDoc message, Throwable JavaDoc nestedException) {
48         this(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, message,
49                 nestedException));
50     }
51
52     /**
53      * Creates a new exception with the given status object. The message
54      * of the given status is used as the exception message.
55      *
56      * @param status the status object to be associated with this exception
57      */

58     public WorkbenchException(IStatus status) {
59         super(status);
60     }
61 }
62
Popular Tags