edu.wpi.ebob.internal
Class TypeStatus

java.lang.Object
  extended by org.eclipse.core.runtime.Status
      extended by edu.wpi.ebob.internal.TypeStatus
All Implemented Interfaces:
org.eclipse.core.runtime.IStatus

public class TypeStatus
extends org.eclipse.core.runtime.Status

Represents the status of an eligible object for the Object Bench.

Author:
Liam Morley
See Also:
edu.wpi.ebob.internal.EBOBUtils

Field Summary
static TypeStatus ABSTRACT
          user has attempted to create an abstract class
static int CODE_ABSTRACT
          user has attempted to create an abstract class
static int CODE_HAS_MODEL_PROBLEM
          there was an exception thrown while getting the information
static int CODE_MULTIPLE_SELECTIONS
          user has attempted to create multiple objects
static int CODE_NOT_CLASS
          user has attempted to create an object that is not a class
static int CODE_NOT_PUBLIC
          user has attempted to create a class that is not public
static int CODE_NOT_TYPE
          user has attempted to create an object that is not a type
static TypeStatus MULTIPLE_SELECTIONS
          user has attempted to create multiple objects
static TypeStatus NOT_CLASS
          user has attempted to create an object that is not a class
static TypeStatus NOT_PUBLIC
          user has attempted to create a class that is not public
 
Fields inherited from class org.eclipse.core.runtime.Status
CANCEL_STATUS, OK_STATUS
 
Fields inherited from interface org.eclipse.core.runtime.IStatus
CANCEL, ERROR, INFO, OK, WARNING
 
Constructor Summary
TypeStatus(int severity, int code, java.lang.String message)
          Uses the same parameters as Status.
TypeStatus(int severity, int code, java.lang.Throwable exception)
          Uses the same parameters as Status.
 
Method Summary
static TypeStatus getStatus(org.eclipse.jdt.core.ICompilationUnit unit)
           
static TypeStatus getStatus(org.eclipse.jface.viewers.IStructuredSelection sel)
           
static TypeStatus getStatus(org.eclipse.jdt.core.IType type)
           
 
Methods inherited from class org.eclipse.core.runtime.Status
getChildren, getCode, getException, getMessage, getPlugin, getSeverity, isMultiStatus, isOK, matches, setCode, setException, setMessage, setPlugin, setSeverity, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MULTIPLE_SELECTIONS

public static final TypeStatus MULTIPLE_SELECTIONS
user has attempted to create multiple objects


NOT_CLASS

public static final TypeStatus NOT_CLASS
user has attempted to create an object that is not a class


NOT_PUBLIC

public static final TypeStatus NOT_PUBLIC
user has attempted to create a class that is not public


ABSTRACT

public static final TypeStatus ABSTRACT
user has attempted to create an abstract class


CODE_MULTIPLE_SELECTIONS

public static final int CODE_MULTIPLE_SELECTIONS
user has attempted to create multiple objects

See Also:
Constant Field Values

CODE_NOT_TYPE

public static final int CODE_NOT_TYPE
user has attempted to create an object that is not a type

See Also:
Constant Field Values

CODE_NOT_CLASS

public static final int CODE_NOT_CLASS
user has attempted to create an object that is not a class

See Also:
Constant Field Values

CODE_NOT_PUBLIC

public static final int CODE_NOT_PUBLIC
user has attempted to create a class that is not public

See Also:
Constant Field Values

CODE_ABSTRACT

public static final int CODE_ABSTRACT
user has attempted to create an abstract class

See Also:
Constant Field Values

CODE_HAS_MODEL_PROBLEM

public static final int CODE_HAS_MODEL_PROBLEM
there was an exception thrown while getting the information

See Also:
Constant Field Values
Constructor Detail

TypeStatus

public TypeStatus(int severity,
                  int code,
                  java.lang.String message)
Uses the same parameters as Status. The Object Bench plug-in ID is used, and exception is null.


TypeStatus

public TypeStatus(int severity,
                  int code,
                  java.lang.Throwable exception)
Uses the same parameters as Status. The Object Bench plug-in ID is used, and message is set to the exception 's localized message.

Method Detail

getStatus

public static TypeStatus getStatus(org.eclipse.jface.viewers.IStructuredSelection sel)
Parameters:
sel - the selection
Returns:
the acceptability status of the given selection

getStatus

public static TypeStatus getStatus(org.eclipse.jdt.core.ICompilationUnit unit)
Parameters:
unit - the compilation unit
Returns:
the acceptability status of the compilation unit's primary type

getStatus

public static TypeStatus getStatus(org.eclipse.jdt.core.IType type)
Parameters:
type - the type
Returns:
the acceptability status of the given type