|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.operations.UndoContext
org.eclipse.core.commands.operations.ObjectUndoContext
An undo context that can be used to represent any given object. Clients can add matching contexts to this context. This class may be instantiated by clients.
Constructor Summary | |
---|---|
ObjectUndoContext(Object object)
Construct an operation context that represents the given object. |
|
ObjectUndoContext(Object object,
String label)
Construct an operation context that represents the given object and has a specialized label. |
Method Summary | |
---|---|
void |
addMatch(IUndoContext context)
Add the specified context as a match of this context. |
String |
getLabel()
Get the label that describes the undo context. |
Object |
getObject()
Return the object that is represented by this context. |
boolean |
matches(IUndoContext context)
Return whether the specified context is considered a match for the receiving context. |
void |
removeMatch(IUndoContext context)
Remove the specified context as a match of this context. |
String |
toString()
The string representation of this operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ObjectUndoContext(Object object)
object
- the object to be represented.public ObjectUndoContext(Object object, String label)
object
- the object to be represented.label
- the label for the contextMethod Detail |
public String getLabel()
UndoContext
Get the label that describes the undo context. The default implementation returns the empty String. Subclasses may override.
getLabel
in interface IUndoContext
getLabel
in class UndoContext
public Object getObject()
public void addMatch(IUndoContext context)
context
- the context to be added as a match of this contextpublic void removeMatch(IUndoContext context)
context
- the context to be removed from the list of matches for this
contextpublic boolean matches(IUndoContext context)
UndoContext
Return whether the specified context is considered a match for the receiving context. When a context matches another context, operations that have the context are considered to also have the matching context. The default implementation checks whether the supplied context is identical to this context. Subclasses may override.
matches
in interface IUndoContext
matches
in class UndoContext
context
- the context to be checked against the receiving context.
true
if the receiving context can be considered a
match for the specified context, and false
if it
cannot.public String toString()
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.