Extension SDK

oracle.ide.addin
Class DefaultContext

java.lang.Object
  |
  +--oracle.ide.addin.DefaultContext
All Implemented Interfaces:
Context
Direct Known Subclasses:
IdeContext

public class DefaultContext
extends java.lang.Object
implements Context


Field Summary
protected  java.lang.Object _data
           
protected  Document _doc
           
protected  Element _elem
           
protected  java.util.EventObject _event
           
protected  Project _project
           
protected  Element[] _sel
           
protected  View _view
           
protected  Workspace _workspace
           
 
Constructor Summary
DefaultContext()
           
DefaultContext(Document doc)
           
DefaultContext(View view, Workspace workspace, Project project, Element[] selection, Document doc, Element elem)
           
 
Method Summary
protected  boolean areMultipleDocumentsSelected()
           
 Folder findOwner(Element element)
           
 Document getDocument()
          Gets the document that owns the selection.
 Element getElement()
          Provides a reference to the Element of interest.
 java.util.EventObject getEvent()
          Provides a reference to the EventObject associated with this Context.
 java.lang.Object getExtraData()
          Provides a reference to the user data associated with this Context.
 Project getProject()
          Provides a reference to the Project data associated with this Context.
 Element[] getSelection()
          Gets the list of selected Elements.
 View getView()
          Provides a reference to the View associated with this Context.
 Workspace getWorkspace()
          Provides a reference to the Workspace associated with this Context.
 void setDocument(Document document)
           
 void setElement(Element element)
           
 void setEvent(java.util.EventObject event)
          Set the EventObject to be associated with this Context.
 void setExtraData(java.lang.Object data)
          Set the user data to be associated with this Context.
 void setProject(Project project)
           
 void setSelection(Element[] selection)
          Set the list of selected Elements.
 void setView(View view)
          Set the View to be associated with this Context.
 void setWorkspace(Workspace workspace)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_view

protected View _view

_workspace

protected Workspace _workspace

_project

protected Project _project

_sel

protected Element[] _sel

_doc

protected Document _doc

_elem

protected Element _elem

_event

protected java.util.EventObject _event

_data

protected java.lang.Object _data
Constructor Detail

DefaultContext

public DefaultContext()

DefaultContext

public DefaultContext(Document doc)

DefaultContext

public DefaultContext(View view,
                      Workspace workspace,
                      Project project,
                      Element[] selection,
                      Document doc,
                      Element elem)
Method Detail

getView

public View getView()
Description copied from interface: Context
Provides a reference to the View associated with this Context.
Specified by:
getView in interface Context
Following copied from interface: oracle.ide.addin.Context
Returns:
the associated View object.

setView

public void setView(View view)
Set the View to be associated with this Context.
Parameters:
view - the View to associate with this Context.
See Also:
getView()

getWorkspace

public Workspace getWorkspace()
Description copied from interface: Context
Provides a reference to the Workspace associated with this Context.
Specified by:
getWorkspace in interface Context

setWorkspace

public void setWorkspace(Workspace workspace)

getProject

public Project getProject()
Description copied from interface: Context
Provides a reference to the Project data associated with this Context.
Specified by:
getProject in interface Context

setProject

public void setProject(Project project)

getEvent

public java.util.EventObject getEvent()
Description copied from interface: Context
Provides a reference to the EventObject associated with this Context.
Specified by:
getEvent in interface Context
Following copied from interface: oracle.ide.addin.Context
Returns:
the EventObject associated with this Context.
See Also:
Context.setEvent(java.util.EventObject)

setEvent

public void setEvent(java.util.EventObject event)
Description copied from interface: Context
Set the EventObject to be associated with this Context.
Specified by:
setEvent in interface Context
Following copied from interface: oracle.ide.addin.Context
Parameters:
event - the EventObject to associate with this Context.
See Also:
Context.getEvent()

getSelection

public Element[] getSelection()
Description copied from interface: Context
Gets the list of selected Elements. The selection must either be all Subjecs, else all not Subjects. That is to say, all the Elements in the selection will also be Subjects, else none of them will. In the case where none of the selected Elements are Subjects, the getDefaultSubject method will return the Subject to which the selected Elements apply. The primary purpose of this restrciction is to allow the Inspector to know what object(s) to use when sending update notification messages.
Specified by:
getSelection in interface Context
Following copied from interface: oracle.ide.addin.Context
Returns:
array of selected Elements.
See Also:
#getDefaultSubject

setSelection

public void setSelection(Element[] selection)
Set the list of selected Elements.
Parameters:
selection - the list of selected Elements.
See Also:
getSelection

getDocument

public Document getDocument()
Gets the document that owns the selection. If the selection contains multiple documents, this methods must return null. The CommandProcessor uses this method to determine what undo stack to activate. Since operations on multiple documents cannot be undone, the return value should be null. This method also allows the Inspector to know what object to use when sending update notification messages in the event that none of the selected Elements were Subjects and the document is a subject.
Specified by:
getDocument in interface Context
Returns:
the document that owns the selection.

setDocument

public void setDocument(Document document)

getElement

public Element getElement()
Description copied from interface: Context
Provides a reference to the Element of interest. In cases where selection is no different than the Element of interest, will also be the first item in the selection. Objects needing to manipulate the complete selection list should use the getSelection method.
Specified by:
getElement in interface Context
Following copied from interface: oracle.ide.addin.Context
Returns:
the first Element of interest.
See Also:
Context.getSelection()

setElement

public void setElement(Element element)

getExtraData

public java.lang.Object getExtraData()
Description copied from interface: Context
Provides a reference to the user data associated with this Context.
Specified by:
getExtraData in interface Context
Following copied from interface: oracle.ide.addin.Context
Returns:
the associated user data.
See Also:
Context.setExtraData(java.lang.Object)

setExtraData

public void setExtraData(java.lang.Object data)
Description copied from interface: Context
Set the user data to be associated with this Context.
Specified by:
setExtraData in interface Context
Following copied from interface: oracle.ide.addin.Context
Parameters:
extraData - the user data to associate with this Context.
See Also:
Context.getExtraData()

findOwner

public Folder findOwner(Element element)
Specified by:
findOwner in interface Context
Following copied from interface: oracle.ide.addin.Context
Parameters:
element - the Element being checked for removal from this folder
Returns:
the Folder that owns the specified element. In general a folder owns an element when that folder has veto power to remove a child element. This method will be called when the IDE needs to determine the container on whom to call the remove, canRemove, add, and canAdd methods.

areMultipleDocumentsSelected

protected boolean areMultipleDocumentsSelected()

Extension SDK