Extension SDK 10.1.2

oracle.jdeveloper.audit.model
Class DocumentTypeAdapter

java.lang.Object
  extended byoracle.jdeveloper.audit.model.DocumentTypeAdapter

public abstract class DocumentTypeAdapter
extends java.lang.Object

An adapter between a document type of the IDE and the Audit framework. A type adapter identifies the IDE Element classes, including the actual Document class(es), which correspond to its document type. It knows its corresponding DocumentAdapter subclass, and manufactures a document adapter for each document of the document type.

To reduce special case code in the Audit framework, Workspaces, Workspace, and Project "documents" each have a corresponding DocumentTypeAdapter.

IDE extensions which provide type adapters register an AuditProvider with the AuditManager at startup. When Audit initializes, it loads and instantiates the adapter classes from the registered providers.

See Also:
DocumentAdapter

Constructor Summary
DocumentTypeAdapter()
           
 
Method Summary
abstract  DocumentAdapter createDocument(DocumentAdapterFactory factory, DocumentAdapter workspace, DocumentAdapter project, java.net.URL url)
          Creates a document adapter for a workspace, project, and URL.
abstract  java.lang.Class[] getDefaultViewTypes(AuditType type)
          Gets the view types for this document type included by default in an Audit or Metrics report.
abstract  java.lang.Class[] getElementTypes()
          Gets the IDE Element types for which this adapter supplies constructs.
 java.lang.Object getKey(java.net.URL url, Project project, Workspace workspace)
          Creates a key for a workspace, project, and URL.
 java.net.URL[] getURLs(Element element, Project project, Workspace workspace)
          Gets the URLs of an element, or null if none.
abstract  java.lang.Class[] getViewTypes()
          Gets the view types for this document type.
abstract  javax.swing.Icon icon(java.lang.Class type)
          Gets the icon for a view type of this document type.
abstract  javax.swing.Icon icon(java.lang.Object construct)
          Gets the icon for a construct of this document type.
 boolean isPackaged()
          Gets whether this document type has a package.
abstract  java.lang.String label(java.lang.Class type)
          Gets the label for a view type of this document type.
 java.lang.String label(Element element)
          Gets the label for an element associated with this document type.
abstract  java.lang.Object label(java.lang.Object construct)
          Gets the label for a construct of this document type.
abstract  java.lang.String summary(java.lang.Class type)
          Gets the summary for a view type of this document type.
abstract  java.lang.Object summary(java.lang.Object construct)
          Gets the summary for a construct of this document type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentTypeAdapter

public DocumentTypeAdapter()
Method Detail

getElementTypes

public abstract java.lang.Class[] getElementTypes()
Gets the IDE Element types for which this adapter supplies constructs. These are used to map from objects selected in the IDE into the Audit object model. At least one of these Element types must be a Node; and the Element types which are not nodes must be children of the Node types.


isPackaged

public boolean isPackaged()
Gets whether this document type has a package. The DocumentTypeAdapter implementation returns false. Document types that are located at run-time by their package location should override this to return true. This method will probably be removed, but for now is required by the Audit framework.


getURLs

public java.net.URL[] getURLs(Element element,
                              Project project,
                              Workspace workspace)
Gets the URLs of an element, or null if none. Typically, Nodes will have one URL and other Elements will have none. Exceptions include Workspaces, Applications, DirectoryFolders, and PackageFolders.


getKey

public java.lang.Object getKey(java.net.URL url,
                               Project project,
                               Workspace workspace)
Creates a key for a workspace, project, and URL.


getViewTypes

public abstract java.lang.Class[] getViewTypes()
Gets the view types for this document type. These are the construct types from this document type which may be included in Audit and Metrics reports. For example, the Java implementation returns JotFile, JotClass, and JotMethod, but not, for example, JotField.


getDefaultViewTypes

public abstract java.lang.Class[] getDefaultViewTypes(AuditType type)
Gets the view types for this document type included by default in an Audit or Metrics report. The types returned here must be included in the types returned by getViewTypes().


createDocument

public abstract DocumentAdapter createDocument(DocumentAdapterFactory factory,
                                               DocumentAdapter workspace,
                                               DocumentAdapter project,
                                               java.net.URL url)
Creates a document adapter for a workspace, project, and URL.


label

public java.lang.String label(Element element)
Gets the label for an element associated with this document type. If necessary, the label should be localized. The DocumentTypeAdapter implementation returns element.getShortLabel().


label

public abstract java.lang.String label(java.lang.Class type)
Gets the label for a view type of this document type. The label should be localized.


summary

public abstract java.lang.String summary(java.lang.Class type)
Gets the summary for a view type of this document type. The summary should be localized.


icon

public abstract javax.swing.Icon icon(java.lang.Class type)
Gets the icon for a view type of this document type. If necessary, the icon should be localized.


label

public abstract java.lang.Object label(java.lang.Object construct)
Gets the label for a construct of this document type. 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.


summary

public abstract java.lang.Object summary(java.lang.Object construct)
Gets the summary for a construct of this document type. 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.


icon

public abstract javax.swing.Icon icon(java.lang.Object construct)
Gets the icon for a construct of this document type. If necessary, the icon should be localized.


Extension SDK

 

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