1) Moved net.sourceforge.phpeclipse.ui\src\net\sourceforge\phpdt back to net.sourcefo...
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / IJavaModelStatus.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.core;
12
13 import org.eclipse.core.runtime.IPath;
14 import org.eclipse.core.runtime.IStatus;
15
16 /**
17  * Represents the outcome of an Java model operation. Status objects are used
18  * inside <code>JavaModelException</code> objects to indicate what went wrong.
19  * <p>
20  * Java model status object are distinguished by their plug-in id:
21  * <code>getPlugin</code> returns <code>"net.sourceforge.phpdt.core"</code>.
22  * <code>getCode</code> returns one of the status codes declared in
23  * <code>IJavaModelStatusConstants</code>.
24  * </p>
25  * <p>
26  * A Java model status may also carry additional information (that is, in
27  * addition to the information defined in <code>IStatus</code>):
28  * <ul>
29  * <li>elements - optional handles to Java elements associated with the failure</li>
30  * <li>string - optional string associated with the failure</li>
31  * </ul>
32  * <p>
33  * This interface is not intended to be implemented by clients.
34  * </p>
35  * 
36  * @see org.eclipse.core.runtime.IStatus
37  * @see IJavaModelStatusConstants
38  */
39 public interface IJavaModelStatus extends IStatus {
40         /**
41          * Returns any Java elements associated with the failure (see specification
42          * of the status code), or an empty array if no elements are related to this
43          * particular status code.
44          * 
45          * @return the list of Java element culprits
46          * @see IJavaModelStatusConstants
47          */
48         public IJavaElement[] getElements();
49
50         /**
51          * Returns the path associated with the failure (see specification of the
52          * status code), or <code>null</code> if the failure is not one of
53          * <code>DEVICE_PATH</code>, <code>INVALID_PATH</code>,
54          * <code>PATH_OUTSIDE_PROJECT</code>, or <code>RELATIVE_PATH</code>.
55          * 
56          * @return the path that caused the failure, or <code>null</code> if none
57          * @see IJavaModelStatusConstants#DEVICE_PATH
58          * @see IJavaModelStatusConstants#INVALID_PATH
59          * @see IJavaModelStatusConstants#PATH_OUTSIDE_PROJECT
60          * @see IJavaModelStatusConstants#RELATIVE_PATH
61          */
62         IPath getPath();
63
64         /**
65          * Returns the string associated with the failure (see specification of the
66          * status code), or <code>null</code> if no string is related to this
67          * particular status code.
68          * 
69          * @return the string culprit, or <code>null</code> if none
70          * @see IJavaModelStatusConstants
71          * @deprecated Use IStatus#getMessage instead
72          */
73         String getString();
74
75         /**
76          * Returns whether this status indicates that a Java model element does not
77          * exist. This convenience method is equivalent to
78          * <code>getCode() == IJavaModelStatusConstants.ELEMENT_DOES_NOT_EXIST</code>.
79          * 
80          * @return <code>true</code> if the status code indicates that a Java
81          *         model element does not exist
82          * @see IJavaModelStatusConstants#ELEMENT_DOES_NOT_EXIST
83          */
84         boolean isDoesNotExist();
85 }