KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > part > components > services > IStatusFactory


1 /*******************************************************************************
2  * Copyright (c) 2005 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.internal.part.components.services;
12
13 import org.eclipse.core.runtime.IStatus;
14
15 /**
16  * Service for constructing IStatus objects. IStatus objects represent
17  * individual messages which will be logged or displayed to the user. Implementations
18  * of <code>IStatusFactory</code> will attach context to the
19  * IStatus, such as the plugin that generated the message.
20  *
21  * <p>
22  * Not intended to be implemented by clients.
23  * </p>
24  *
25  * <p>EXPERIMENTAL: The components framework is currently under active development. All
26  * aspects of this class including its existence, name, and public interface are likely
27  * to change during the development of Eclipse 3.1</p>
28  *
29  * @since 3.1
30  */

31 public interface IStatusFactory {
32     /**
33      * Constructs an error status for the given throwable. If the given throwable
34      * contains a localized message, it will be used as the message in the status.
35      * Otherwise, a generic "an exception was thrown" message will be used.
36      *
37      * @param t throwable associated with the error
38      * @return a newly constructed Status message
39      */

40     public IStatus newError(Throwable JavaDoc t);
41     
42     /**
43      * Constructs an error message from the given user-readable string
44      * and the given throwable.
45      *
46      * @param message user-readable string describing the error
47      * @param t exception that caused the error
48      * @return a newly constructed Status message
49      */

50     public IStatus newError(String JavaDoc message, Throwable JavaDoc t);
51     
52     /**
53      * Constructs a status message with the given severity and the given
54      * user-readable string
55      *
56      * @param severity one of Status.* severity constants
57      * @param message user-readable string
58      * @return a newly constructed Status message
59      */

60     public IStatus newStatus(int severity, String JavaDoc message);
61
62     /**
63      * Constructs an info message with the given localized message
64      *
65      * @param message localized message string
66      * @return an info message with the given localized message
67      */

68     public IStatus newMessage(String JavaDoc message);
69 }
70
Popular Tags