org.eclipse.ui.statushandlers
Class StatusAdapter
java.lang.Object
org.eclipse.ui.statushandlers.StatusAdapter
-
All Implemented Interfaces:
-
IAdaptable
-
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.
-
Since:
- 3.3
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
TITLE_PROPERTY
public static final
QualifiedName TITLE_PROPERTY
-
Deprecated. use
IStatusAdapterConstants.TITLE_PROPERTY
instead
- This property is used to add title to the adapter. If the adapter is
shown in a dialog, this property is used to create title of the dialog.
TIMESTAMP_PROPERTY
public static final
QualifiedName TIMESTAMP_PROPERTY
-
Deprecated. use
IStatusAdapterConstants.TIMESTAMP_PROPERTY
instead
- This property is used to add a timestamp to the adapter. If the adapter
is shown in the UI, this property can be used for sorting and showing
information about the status creation time.
The property must be of type Long
.
StatusAdapter
public StatusAdapter(
IStatus status)
- Creates an instance of this class.
-
Parameters:
-
status
- the status to wrap. May not be null
.
addAdapter
public 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.
-
-
-
Parameters:
-
adapter
- the adapter class -
object
- the adapter instance
getAdapter
public
Object getAdapter(
Class adapter)
-
Description copied from interface:
IAdaptable
- Returns an object which is an instance of the given class
associated with this object. Returns
null
if
no such object can be found.
-
-
Specified by:
-
getAdapter
in interface
IAdaptable
-
-
Parameters:
-
adapter
- the adapter class to look up
-
Returns:
- a object castable to the given class,
or
null
if this object does not
have an adapter for the given class
getStatus
public
IStatus getStatus()
- Returns the wrapped status.
-
-
-
Returns:
- the wrapped status set in the constructor or in
setStatus(IStatus)
. Will not be null
.
setStatus
public void setStatus(
IStatus status)
- Sets a new status for this adapter.
-
-
-
Parameters:
-
status
- the status to set. May not be null
.
getProperty
public
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.
-
-
-
Parameters:
-
key
- the qualified name of the property
-
Returns:
- the value of the property, or
null
if this adapter
has no such property
setProperty
public void setProperty(
QualifiedName key,
Object value)
- Sets the value of the receiver's property identified by the given key.
-
-
-
Parameters:
-
key
- the qualified name of the property -
value
- the value of the property
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.