public final class Context
extends java.lang.Object
Constructor and Description |
---|
Context(Document document, Project project)
Constructor.
|
Context(Document document, Project project, Element[] selection)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Document |
getDocument()
The current
Document the user is working on. |
Project |
getProject()
The current
Project the user is working on. |
java.lang.Object |
getProperty(java.lang.String name, java.lang.Object defaultValue)
Retrieves the value associated with a property.
|
Element[] |
getSelection()
Get the currently selected objects.
|
void |
setProperty(java.lang.String name, java.lang.Object value)
Sets the value for a property.
|
void |
setSelection(Element[] selection)
Set the currently selected objects.
|
public Context(Document document, Project project, Element[] selection)
document
- The document the user is working on when a command is executed.project
- The project the document is in.selection
- The selected objects.public Element[] getSelection()
Element
s that users can select inside IDE views.public void setSelection(Element[] selection)
Element
s that users can select inside IDE views.selection
- An array of Element
s.public java.lang.Object getProperty(java.lang.String name, java.lang.Object defaultValue)
name
- the property key for which a value is desired.defaultValue
- the value to return if no value currently exists.public void setProperty(java.lang.String name, java.lang.Object value)
null
removes that property. Use context properties to pass along extra data meaningful to an extension.name
- the property key to setvalue
- the value to set