Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.ide.command
Class Context  view Context download Context.java

java.lang.Object
  extended byjavax.ide.command.Context

public final class Context
extends java.lang.Object

The Context class provides information about the state of the IDE when a command is in the process of being executed. Such information includes:

In addition, to this information, the context allows clients to store arbitrary data to pass on to a command. Such data is stored in the context under a client specified string key. The data can be retrieved using that same key.


Field Summary
private  javax.ide.model.Document _document
           
private  javax.ide.model.Project _project
           
private  java.util.HashMap _properties
           
private  javax.ide.model.Element[] _selection
           
 
Constructor Summary
Context(javax.ide.model.Document document, javax.ide.model.Project project)
          Constructor.
Context(javax.ide.model.Document document, javax.ide.model.Project project, javax.ide.model.Element[] selection)
          Constructor.
 
Method Summary
 javax.ide.model.Document getDocument()
          The current javax.ide.model.Document the user is working on.
 javax.ide.model.Project getProject()
          The current javax.ide.model.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.
 javax.ide.model.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(javax.ide.model.Element[] selection)
          Set the currently selected objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_properties

private java.util.HashMap _properties

_document

private javax.ide.model.Document _document

_project

private javax.ide.model.Project _project

_selection

private javax.ide.model.Element[] _selection
Constructor Detail

Context

public Context(javax.ide.model.Document document,
               javax.ide.model.Project project,
               javax.ide.model.Element[] selection)
Constructor.


Context

public Context(javax.ide.model.Document document,
               javax.ide.model.Project project)
Constructor.

Method Detail

getProject

public javax.ide.model.Project getProject()
The current javax.ide.model.Project the user is working on.


getDocument

public javax.ide.model.Document getDocument()
The current javax.ide.model.Document the user is working on.


getSelection

public javax.ide.model.Element[] getSelection()
Get the currently selected objects. These are javax.ide.model.Elements that users can select inside IDE views.


setSelection

public void setSelection(javax.ide.model.Element[] selection)
Set the currently selected objects. These are javax.ide.model.Elements that users can select inside IDE views.


getProperty

public java.lang.Object getProperty(java.lang.String name,
                                    java.lang.Object defaultValue)
Retrieves the value associated with a property. If no value exists for the requested property, the specified default value is returned. Use context properties to pass along extra data meaningful to an extension.


setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Sets the value for a property. Setting a value to null removes that property. Use context properties to pass along extra data meaningful to an extension.