Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.jdevimpl.audit.model
Class WorkspaceModelAdapter

java.lang.Object
  extended by oracle.jdeveloper.audit.model.ModelAdapter
      extended by oracle.jdeveloper.audit.model.ContainerModelAdapter
          extended by oracle.jdevimpl.audit.model.WorkspaceModelAdapter
All Implemented Interfaces:
java.lang.Comparable, Located

public class WorkspaceModelAdapter
extends ContainerModelAdapter

A ModelAdapter which adapts the Audit framework to the (vestigial) model of a Workspace node. The node is the root construct of the model, its contained constructs are the model adapters for its Project children.

See Also:
ModelAdapter, ContainerModelAdapter, WorkspaceModelType

Field Summary
 
Fields inherited from class oracle.jdeveloper.audit.model.ModelAdapter
index, log
 
Constructor Summary
WorkspaceModelAdapter(ModelFactory factory, ModelType type, Workspace workspace)
           
 
Method Summary
 int compareTo(java.lang.Object object)
          Gets whether this model is less than, equal to, or greater than another using the natural order defined by this class.
 boolean contains(ModelAdapter that)
          Gets whether this model contains a model.
 boolean contains(java.lang.Object construct, Location location)
          Gets whether a construct in this model contains a location.
protected  void createContainedModels(java.lang.Object construct)
          Creates models for each Element contained by the root construct of this model using ContainerModelAdapter.addContainedElement(oracle.ide.model.Element, java.net.URL).
 java.lang.Object getConstruct(Location location)
          Gets the innermost construct containing a location in this model.
 ContainerModelAdapter getContainingAdapter()
          Gets the model adapter containing this model adapter, or null if this is the root node.
 ContentDirectory getDirectory()
          Gets the package directory containing this model, or null if none.
 Location[] getElementLocations(Element element)
          Gets the locations of the constructs in this model corresponding to an IDE element.
 Location getLocation(java.lang.Object construct)
          Gets the location for a construct in this model, or null if the object is not a construct in this model.
 Node getNode()
          Gets the IDE Node corresponding to this model, or null if none (in particular, if this is the root or a directory model).
 Project getProject()
          Gets the project containing this model.
 java.lang.Object getRoot()
          Gets the root construct of this model.
 java.net.URL getUrl()
          Gets the non-null URL corresponding to this model.
 Workspace getWorkspace()
          Gets the workspace containing this model.
 javax.swing.Icon icon(java.lang.Object construct)
          Gets the icon for a construct of this model.
 boolean isModifiable()
          Gets whether this model is modifiable.
 java.lang.Object label(java.lang.Object construct)
          Gets the label for a construct of this model.
 java.lang.Object summary(java.lang.Object construct)
          Gets the summary for a construct of this model.
 
Methods inherited from class oracle.jdeveloper.audit.model.ContainerModelAdapter
addContainedElement, addContainedModel, getContainedConstructs, getContainedUnauditableElements, isFile
 
Methods inherited from class oracle.jdeveloper.audit.model.ModelAdapter
acquireReadLock, beginRead, beginRead, beginReadHook, cancelRead, compareSiblings, contains, contextDescription, edit, endRead, endRead, endReadHook, enter, equals, exit, getAttribute, getCharacter, getColumnOffset, getConstruct, getDependency, getDirectoryAdapter, getElement, getEndLocation, getFactory, getFileAdapter, getFocusLocation, getFocusLocation, getIdeContext, getInitialLength, getLine, getLineOffset, getLocation, getLocation, getLock, getPrimaryCollationKey, getProjectAdapter, getSecondaryCollationKey, getSecondaryCollationString, getShortLabel, getText, getType, getURL, getWorkspaceAdapter, icon, isEditable, isModified, isModified, label, release, releaseReadLock, setAttribute, summary, toString, verifyReadTransaction
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WorkspaceModelAdapter

public WorkspaceModelAdapter(ModelFactory factory,
                             ModelType type,
                             Workspace workspace)
Method Detail

getContainingAdapter

public ContainerModelAdapter getContainingAdapter()
Description copied from class: ModelAdapter
Gets the model adapter containing this model adapter, or null if this is the root node.

Specified by:
getContainingAdapter in class ModelAdapter

getUrl

public java.net.URL getUrl()
Description copied from class: ModelAdapter
Gets the non-null URL corresponding to this model.

Specified by:
getUrl in class ModelAdapter

getWorkspace

public Workspace getWorkspace()
Description copied from class: ModelAdapter
Gets the workspace containing this model.

Overrides:
getWorkspace in class ModelAdapter

getProject

public Project getProject()
Description copied from class: ModelAdapter
Gets the project containing this model.

Overrides:
getProject in class ModelAdapter

getDirectory

public ContentDirectory getDirectory()
Description copied from class: ModelAdapter
Gets the package directory containing this model, or null if none.

Overrides:
getDirectory in class ModelAdapter

getRoot

public java.lang.Object getRoot()
Description copied from class: ModelAdapter
Gets the root construct of this model. A read transaction must be active on this model.

Specified by:
getRoot in class ModelAdapter

getElementLocations

public Location[] getElementLocations(Element element)
Description copied from class: ModelAdapter
Gets the locations of the constructs in this model corresponding to an IDE element. A read transaction must be active on this model.

Implementations need only deal with IDE element types that are returned by the getRootElementTypes and getContainedElementTypes methods of the model type for this model.

Specified by:
getElementLocations in class ModelAdapter
Parameters:
element - an IDE Element of a type supported by this model.
Returns:
the locations corresponding to the element, or null or an empty array if none.

getLocation

public Location getLocation(java.lang.Object construct)
Description copied from class: ModelAdapter
Gets the location for a construct in this model, or null if the object is not a construct in this model. A read transaction must be active on this model.

Implementations must extract offset and length from the construct to create a Location.

Specified by:
getLocation in class ModelAdapter
Parameters:
construct - a construct in this model, created by either ModelAdapter.getRoot() or ModelAdapter.getContainedConstructs(java.lang.Object).

getConstruct

public java.lang.Object getConstruct(Location location)
Description copied from class: ModelAdapter
Gets the innermost construct containing a location in this model. The location must be in this model and a read transaction must be active on this model. The ModelAdapter implementation traverses from the root using ModelAdapter.getContainedConstructs(java.lang.Object) and the Location.contains(oracle.jdeveloper.audit.model.Location) method.

Overrides:
getConstruct in class ModelAdapter
Parameters:
location - A location in this model.
Returns:
The innermost construct containing the location.

createContainedModels

protected void createContainedModels(java.lang.Object construct)
Creates models for each Element contained by the root construct of this model using ContainerModelAdapter.addContainedElement(oracle.ide.model.Element, java.net.URL). This method is invoked by the first invocation of ContainerModelAdapter.getContainedConstructs(java.lang.Object) or #getContainedUnauditableElements, unless {@link #addContainedModel} has already been invoked.

Tbe Audit framework invokes this method with a read transaction active on this model and holding a private monitor lock. The contained constructs of a workspace are its projects.

Specified by:
createContainedModels in class ContainerModelAdapter
Parameters:
construct - A construct of this model.

compareTo

public int compareTo(java.lang.Object object)
Description copied from class: ModelAdapter
Gets whether this model is less than, equal to, or greater than another using the natural order defined by this class. Model adapters created by different ModelFactory instances cannot be compared.

Specified by:
compareTo in interface java.lang.Comparable
Specified by:
compareTo in class ModelAdapter
Parameters:
object - The node with which to compare this node.

contains

public boolean contains(ModelAdapter that)
Description copied from class: ModelAdapter
Gets whether this model contains a model.

Specified by:
contains in class ModelAdapter
Parameters:
that - The ModelAdapter to test.

contains

public boolean contains(java.lang.Object construct,
                        Location location)
Description copied from class: ModelAdapter
Gets whether a construct in this model contains a location.

Overrides:
contains in class ModelAdapter
Parameters:
construct - The construct in this node to test.
location - The Location to test.

getNode

public Node getNode()
Description copied from class: ModelAdapter
Gets the IDE Node corresponding to this model, or null if none (in particular, if this is the root or a directory model).

Overrides:
getNode in class ModelAdapter

isModifiable

public boolean isModifiable()
Description copied from class: ModelAdapter
Gets whether this model is modifiable. The default ModelAdapter implementation returns false.

Overrides:
isModifiable in class ModelAdapter

label

public java.lang.Object label(java.lang.Object construct)
Description copied from class: ModelAdapter
Gets the label for a construct of this model. Note that the return type is Object, and Audit uses String.valueOf(Object) to get a string. Typically, implementations of this method will return a string, but the return type allows an implementation to return an object which defers expensive formatting to its toString() method. If necessary, the label should be localized.

Specified by:
label in class ModelAdapter

summary

public java.lang.Object summary(java.lang.Object construct)
Description copied from class: ModelAdapter
Gets the summary for a construct of this model. The summary will be used, for example, as the tool tip text if the construct appears as a row in an Audit report. Note that the return type is Object, and Audit uses String.valueOf(Object) to get a string. Typically, implementations of this method will return a string, but the return type allows an implementation to return an object which defers expensive formatting to its toString() method. The summary should be localized.

Specified by:
summary in class ModelAdapter

icon

public javax.swing.Icon icon(java.lang.Object construct)
Description copied from class: ModelAdapter
Gets the icon for a construct of this model. If necessary, the icon should be localized.

Specified by:
icon in class ModelAdapter

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.