org.eclipse.ocl.examples.modelregistry.ui.ripoffs
Class StatusInfo

java.lang.Object
  extended by org.eclipse.ocl.examples.modelregistry.ui.ripoffs.StatusInfo
All Implemented Interfaces:
org.eclipse.core.runtime.IStatus

public class StatusInfo
extends java.lang.Object
implements org.eclipse.core.runtime.IStatus

A settable IStatus. Can be an error, warning, info or ok. For error, info and warning states, a message describes the problem.


Field Summary
static org.eclipse.core.runtime.IStatus OK_STATUS
           
 
Fields inherited from interface org.eclipse.core.runtime.IStatus
CANCEL, ERROR, INFO, OK, WARNING
 
Constructor Summary
StatusInfo()
          Creates a status set to OK (no message)
StatusInfo(java.lang.Exception e)
           
StatusInfo(int severity, java.lang.String message)
          Creates a status .
 
Method Summary
 org.eclipse.core.runtime.IStatus[] getChildren()
          Returns always an empty array.
 int getCode()
          Returns always the error severity.
 java.lang.Throwable getException()
          Returns always null.
 java.lang.String getMessage()
           
 java.lang.String getPlugin()
           
 int getSeverity()
           
 boolean isError()
          Returns if the status' severity is ERROR.
 boolean isInfo()
          Returns if the status' severity is INFO.
 boolean isMultiStatus()
          Returns always false.
 boolean isOK()
          Returns if the status' severity is OK.
 boolean isWarning()
          Returns if the status' severity is WARNING.
 boolean matches(int severityMask)
           
 void setError(java.lang.String errorMessage)
          Sets the status to ERROR.
 void setInfo(java.lang.String infoMessage)
          Sets the status to INFO.
 void setOK()
          Sets the status to OK.
 void setWarning(java.lang.String warningMessage)
          Sets the status to WARNING.
 java.lang.String toString()
          Returns a string representation of the status, suitable for debugging purposes only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OK_STATUS

public static final org.eclipse.core.runtime.IStatus OK_STATUS
Constructor Detail

StatusInfo

public StatusInfo()
Creates a status set to OK (no message)


StatusInfo

public StatusInfo(int severity,
                  java.lang.String message)
Creates a status .

Parameters:
severity - The status severity: ERROR, WARNING, INFO and OK.
message - The message of the status. Applies only for ERROR, WARNING and INFO.

StatusInfo

public StatusInfo(java.lang.Exception e)
Method Detail

isOK

public boolean isOK()
Returns if the status' severity is OK.

Specified by:
isOK in interface org.eclipse.core.runtime.IStatus

isWarning

public boolean isWarning()
Returns if the status' severity is WARNING.


isInfo

public boolean isInfo()
Returns if the status' severity is INFO.


isError

public boolean isError()
Returns if the status' severity is ERROR.


getMessage

public java.lang.String getMessage()
Specified by:
getMessage in interface org.eclipse.core.runtime.IStatus
See Also:
IStatus.getMessage()

setError

public void setError(java.lang.String errorMessage)
Sets the status to ERROR.

Parameters:
errorMessage - The error message (can be empty, but not null)

setWarning

public void setWarning(java.lang.String warningMessage)
Sets the status to WARNING.

Parameters:
warningMessage - The warning message (can be empty, but not null)

setInfo

public void setInfo(java.lang.String infoMessage)
Sets the status to INFO.

Parameters:
infoMessage - The info message (can be empty, but not null)

setOK

public void setOK()
Sets the status to OK.


matches

public boolean matches(int severityMask)
Specified by:
matches in interface org.eclipse.core.runtime.IStatus

isMultiStatus

public boolean isMultiStatus()
Returns always false.

Specified by:
isMultiStatus in interface org.eclipse.core.runtime.IStatus
See Also:
IStatus.isMultiStatus()

getSeverity

public int getSeverity()
Specified by:
getSeverity in interface org.eclipse.core.runtime.IStatus

getPlugin

public java.lang.String getPlugin()
Specified by:
getPlugin in interface org.eclipse.core.runtime.IStatus

getException

public java.lang.Throwable getException()
Returns always null.

Specified by:
getException in interface org.eclipse.core.runtime.IStatus
See Also:
IStatus.getException()

getCode

public int getCode()
Returns always the error severity.

Specified by:
getCode in interface org.eclipse.core.runtime.IStatus
See Also:
IStatus.getCode()

getChildren

public org.eclipse.core.runtime.IStatus[] getChildren()
Returns always an empty array.

Specified by:
getChildren in interface org.eclipse.core.runtime.IStatus
See Also:
IStatus.getChildren()

toString

public java.lang.String toString()
Returns a string representation of the status, suitable for debugging purposes only.

Overrides:
toString in class java.lang.Object