KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > TeamStatus


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.team.core;
12
13 import org.eclipse.core.resources.IResource;
14 import org.eclipse.core.resources.ResourcesPlugin;
15 import org.eclipse.core.runtime.Status;
16
17 /**
18  * Status that is returned from some Team operations or is the payload of
19  * some TeamExceptions.
20  *
21  * @since 3.0
22  */

23 public class TeamStatus extends Status implements ITeamStatus {
24
25     private IResource resource;
26
27     /**
28      * Create a new status object.
29      * @param severity the severity; one of <code>OK</code>,
30      * <code>ERROR</code>, <code>INFO</code>, or <code>WARNING</code>
31      * @param pluginId the unique identifier of the relevant plug-in
32      * @param code the plug-in-specific status code, or <code>OK</code>
33      * @param message a human-readable message, localized to the
34      * current locale
35      * @param exception a low-level exception, or <code>null</code> if not
36      * applicable
37      * @param resource the resource associated with the exception
38      */

39     public TeamStatus(int severity, String JavaDoc pluginId, int code, String JavaDoc message, Throwable JavaDoc exception, IResource resource) {
40         super(severity, pluginId, code, message, exception);
41         if (resource == null) {
42             this.resource = ResourcesPlugin.getWorkspace().getRoot();
43         } else {
44             this.resource = resource;
45         }
46     }
47     
48     /**
49      * Return the resource associated with this status.
50      * @return Returns the resource.
51      */

52     public IResource getResource() {
53         return resource;
54     }
55 }
56
Popular Tags