public class StatusAdapter extends Object implements IAdaptable
The StatusAdapter wraps an instance of IStatus subclass and can hold additional information either by using properties or by adding a new adapter. Used during status handling process.
Modifier and Type | Field and Description |
---|---|
static QualifiedName |
TIMESTAMP_PROPERTY
Deprecated.
use
IStatusAdapterConstants.TIMESTAMP_PROPERTY
instead |
static QualifiedName |
TITLE_PROPERTY
Deprecated.
use
IStatusAdapterConstants.TITLE_PROPERTY instead |
Constructor and Description |
---|
StatusAdapter(IStatus status)
Creates an instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdapter(Class adapter,
Object object)
Associates new object which is an instance of the given class with this
adapter. object will be returned when
IAdaptable.getAdapter(Class)
is called on the receiver with Class adapter as a parameter. |
Object |
getAdapter(Class adapter)
Returns an object which is an instance of the given class
associated with this object.
|
Object |
getProperty(QualifiedName key)
Returns the value of the adapter's property identified by the given key,
or
null if this adapter has no such property. |
IStatus |
getStatus()
Returns the wrapped status.
|
void |
setProperty(QualifiedName key,
Object value)
Sets the value of the receiver's property identified by the given key.
|
void |
setStatus(IStatus status)
Sets a new status for this adapter.
|
@Deprecated public static final QualifiedName TITLE_PROPERTY
IStatusAdapterConstants.TITLE_PROPERTY
instead@Deprecated public static final QualifiedName TIMESTAMP_PROPERTY
IStatusAdapterConstants.TIMESTAMP_PROPERTY
instead
The property must be of type Long
.
public StatusAdapter(IStatus status)
status
- the status to wrap. May not be null
.public void addAdapter(Class adapter, Object object)
IAdaptable.getAdapter(Class)
is called on the receiver with Class
adapter as a parameter.adapter
- the adapter classobject
- the adapter instancepublic Object getAdapter(Class adapter)
IAdaptable
null
if
no such object can be found.getAdapter
in interface IAdaptable
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given classpublic IStatus getStatus()
setStatus(IStatus)
. Will not be null
.public void setStatus(IStatus status)
status
- the status to set. May not be null
.public Object getProperty(QualifiedName key)
null
if this adapter has no such property.key
- the qualified name of the propertynull
if this adapter
has no such propertypublic void setProperty(QualifiedName key, Object value)
key
- the qualified name of the propertyvalue
- the value of the property
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.