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

E13403-07

oracle.jdeveloper.cmt
Interface CmtComponentSource

All Superinterfaces:
CmtComponent, Subject

public interface CmtComponentSource
extends CmtComponent, Subject

The CmtComponentSource interface extends the CmtComponent interface and is intended to be used by the builder environment to differentiate between .java class files that have been constructed by the user via usage of the Designers as opposed to having been found somewhere on the classpath. The primary usage of this interface is to provide access to the builder model and parser representation of the user's actions.

See Also:
CmtComponent

Field Summary
static java.lang.String EXTENSION_PREFIX
          GUI initialization extension method prefix name.
static int FILE_PARSE_FAILED
          Message ID indicating that a parse error was found at the parser level for the JavaClass represented by this CmtComponentSource instance.
static java.lang.String INIT_METHOD_NAME
          GUI initialization method name.
static JavaType[] INIT_METHOD_PARAMS
          GUI initialization method argument signatures.
static int STRUCTURE_CHANGING
          Message ID indicating that a parser level message has been received which will force the recreation of the Cmt model.
 
Fields inherited from interface oracle.jdeveloper.cmt.CmtComponent
PROXY_KEY
 
Method Summary
 void abort()
          Abort any uncommited changes made within the current transaction.
 void addImport(java.lang.String className)
          Add import statement necessitated by the given class name to the class represented by this CmtComponent.
 void addImports(SourceExpression SourceExpression)
          Deprecated. No longer has any effect. Use auto import support of underlying oracle.javatools.parser.java.v2.model.SourceFile.
 void addModel(CmtModel model, CmtModel aheadOf)
          Add a CmtModel to this CmtComponent.
 CmtPropertySource addProperty(java.lang.String type, java.lang.String name)
          Create and add a new property to the class represented by this CmtComponent.
 CmtSubcomponent addSubcomponent(java.lang.String type, java.lang.String name, java.lang.String init, int scope)
          This method is used for createing and adding a CmtSubcomponent to this CmtComponent.
 void beginTrans()
          Begin a transaction.
 void buildDependencies()
          Recompile, as necessary, any .java source files, other than our own, upon which this CmtComponent is dependant and which have been modified since the last time this CmtComponent was updated.
 void commit()
          Deprecated. Use commit(String)
 void commit(java.lang.String caption)
          Commit any uncommited changes made within the current transaction.
 CmtModelNode getCmtModelNode(java.lang.String name)
          Get the CmtModelNode for the given CmtSubcomponent name.
 CmtMethodSource getInitMethod()
          Get the initialization method from the class represented by this CmtComponent.
 Element[] getLastDesignedNodes(java.lang.Object key)
          Get the nodes which were last actively designed.
 CmtModel getModel(java.lang.String name, CmtSubcomponent subcomponent)
          Get the CmtModel which has the given name and contains the given CmtSubcomponent.
 CmtModel[] getModels()
          Get all CmtModels of this CmtComponent.
 CmtModel[] getModels(java.lang.String name)
          Get all CmtModels which have the given name as their name.
 java.lang.String getName()
          Get the name of the class being modeled by this instance.
 CmtSelectionModel getSelectionModel()
          Get the selection model.
 javax.swing.tree.DefaultTreeModel getStructure()
          Get the TreeModel into which all tokenized structure is to be placed.
 boolean hasDependencies()
          Determine whether there exist any .java source files, other than our own, upon which this CmtComponent is dependant.
 boolean hasTrans()
          Return true if a transaction is in progress.
 boolean isDependency(CmtSubcomponent sub)
          Determine whether given CmtSubcomponent is based upon a .java source file upon which this CmtComponent is dependant.
 void removeModel(CmtModel model)
          Remove a CmtModel from this CmtComponent.
 void removeProperty(CmtProperty property)
          Remove a property from the class represented by this CmtComponent.
 void removeSubcomponent(CmtSubcomponent subcomponent)
          This method is used for removing a CmtSubcomponent from this CmtComponent.
 void setLastDesignedNodes(java.lang.Object key, Element[] nodes)
          Set the nodes which were last actively designed.
 
Methods inherited from interface oracle.jdeveloper.cmt.CmtComponent
getComponents, getContainerDelegate, getDefaultEventIndex, getDefaultPropertyIndex, getEvent, getEvents, getEventSet, getEventSets, getFile, getLiveType, getMessages, getMethod, getMethods, getProperties, getProperty, getSubcomponent, getSubcomponents, getType, isContainer, isReadOnly, logMessage, release
 
Methods inherited from interface oracle.ide.model.Subject
attach, detach, notifyObservers
 

Field Detail

INIT_METHOD_NAME

static final java.lang.String INIT_METHOD_NAME
GUI initialization method name.

See Also:
Constant Field Values

EXTENSION_PREFIX

static final java.lang.String EXTENSION_PREFIX
GUI initialization extension method prefix name.

See Also:
Constant Field Values

INIT_METHOD_PARAMS

static final JavaType[] INIT_METHOD_PARAMS
GUI initialization method argument signatures.


FILE_PARSE_FAILED

static final int FILE_PARSE_FAILED
Message ID indicating that a parse error was found at the parser level for the JavaClass represented by this CmtComponentSource instance. Upon receit of this message ID, listeners should present some visual cue that the data is no longer accurate and should prevent the user from further manipulating the Cmt model.


STRUCTURE_CHANGING

static final int STRUCTURE_CHANGING
Message ID indicating that a parser level message has been received which will force the recreation of the Cmt model. Upon receipt of this message ID, listeners should perform any preparatory work necessary in anticipation of the succeeding STRUCTURED_CHANGED message.

Method Detail

addSubcomponent

CmtSubcomponent addSubcomponent(java.lang.String type,
                                java.lang.String name,
                                java.lang.String init,
                                int scope)
This method is used for createing and adding a CmtSubcomponent to this CmtComponent. This implies that the CmtSubcomponent created is to server as a data member for the class being defined by this CmtComponent.

Parameters:
type - The the class type of the named CmtSubcomponent.
name - The instance name of the CmtSubcomponent to be created.
init - The initialization source or null.
scope - The scope of the CmtSubcomponent to be created.
Returns:
The newly created CmtSubcomponent.
See Also:
CmtSubcomponent, removeSubcomponent(oracle.jdeveloper.cmt.CmtSubcomponent)

removeSubcomponent

void removeSubcomponent(CmtSubcomponent subcomponent)
This method is used for removing a CmtSubcomponent from this CmtComponent. This implies that the CmtSubcomponent being removed will no longer serve as a data member for the class being defined by this CmtComponent.

Parameters:
subcomponent - The CmtSubcomponent to remove.
See Also:
CmtSubcomponent, addSubcomponent(java.lang.String, java.lang.String, java.lang.String, int)

getStructure

javax.swing.tree.DefaultTreeModel getStructure()
Get the TreeModel into which all tokenized structure is to be placed.

Returns:
the TreeModel into which all tokenized structure is placed.

getSelectionModel

CmtSelectionModel getSelectionModel()
Get the selection model.


getCmtModelNode

CmtModelNode getCmtModelNode(java.lang.String name)
Get the CmtModelNode for the given CmtSubcomponent name. This will cause any necessary tokenizing to take place in order to cause the construction of the CmtModelNode instances.

Returns:
the CmtModelNode for the given CmtSubcomponent name or null.

addModel

void addModel(CmtModel model,
              CmtModel aheadOf)
Add a CmtModel to this CmtComponent. Adds a model describing the makeup of this CmtComponent.

Parameters:
model - A CmtModel describing a part or all of this CmtComponent.
aheadOf - A CmtModel ahead of which the new model should be ordered.
See Also:
CmtModel, removeModel(oracle.jdeveloper.cmt.CmtModel)

removeModel

void removeModel(CmtModel model)
Remove a CmtModel from this CmtComponent.

Parameters:
model - The CmtModel to remove from this CmtComponent.
See Also:
CmtModel, addModel(oracle.jdeveloper.cmt.CmtModel, oracle.jdeveloper.cmt.CmtModel)

getModel

CmtModel getModel(java.lang.String name,
                  CmtSubcomponent subcomponent)
Get the CmtModel which has the given name and contains the given CmtSubcomponent. Multiple models may all have the same name, however, a given CmtSubcomponent should only appear in one of those commonly named models.

Parameters:
name - The CmtModel name as returned by CmtModel.getName().
subcomponent - The CmtSubcomponent whose CmtModel is to be returned.
Returns:
The CmtModel named name which contains subcomponent.
See Also:
CmtModel, CmtSubcomponent

getModels

CmtModel[] getModels(java.lang.String name)
Get all CmtModels which have the given name as their name. Multiple models may all have the same name.

Parameters:
name - The CmtModel name as returned by CmtModel.getName().
Returns:
The collection of CmtModels named name.
See Also:
CmtModel

getModels

CmtModel[] getModels()
Get all CmtModels of this CmtComponent.

Returns:
The CmtModels held by this CmtComponent.
See Also:
CmtModel

hasTrans

boolean hasTrans()
Return true if a transaction is in progress.


beginTrans

void beginTrans()
Begin a transaction.


commit

void commit()
Deprecated. Use commit(String)

Commit any uncommitted changes made within the current transaction.


commit

void commit(java.lang.String caption)
Commit any uncommited changes made within the current transaction.

Parameters:
caption - brief description of the change made suitable for appearance in an Undo or Redo menu item.

abort

void abort()
Abort any uncommited changes made within the current transaction.


hasDependencies

boolean hasDependencies()
Determine whether there exist any .java source files, other than our own, upon which this CmtComponent is dependant. This situation typically would arise when a class in one source file makes reference to a class in a separate file in the same Project. (i.e. this CmtComponent holds a CmtSubcomponent of a type defined in another file of the common Project).


isDependency

boolean isDependency(CmtSubcomponent sub)
Determine whether given CmtSubcomponent is based upon a .java source file upon which this CmtComponent is dependant. This situation typically would arise when a class in one source file makes reference to a class in a separate file in the same Project. (i.e. this CmtComponent holds a CmtSubcomponent of a type defined in another file of the common Project).


buildDependencies

void buildDependencies()
Recompile, as necessary, any .java source files, other than our own, upon which this CmtComponent is dependant and which have been modified since the last time this CmtComponent was updated. This situation typically would arise when a modification is made to a separate file in the same Project which defines a JavaBean class which in turn is referenced from within the file of this CmtComponent (i.e. this CmtComponent holds a CmtSubcomponent of the type defined in the other file of the common Project).


getName

java.lang.String getName()
Get the name of the class being modeled by this instance. For example, if this is a java source file it would be the name of the public class, whereas if this is modeler related it could be any name so long as it identified the meta data being produced as a result of modeling.

Returns:
The name of the class being modeled.

setLastDesignedNodes

void setLastDesignedNodes(java.lang.Object key,
                          Element[] nodes)
Set the nodes which were last actively designed. The purpose of this method is to provide a means by which the last nodes manipulated by a given View may be retained such that they may again be reselected after a parse operation etc. This information becomes particulary usefull whenever a Designer must re-annotate.

Parameters:
nodes - The CmtModelNodes which were last manipulated by the View.

getLastDesignedNodes

Element[] getLastDesignedNodes(java.lang.Object key)
Get the nodes which were last actively designed. The purpose of this method is to provide a means by which the last nodes manipulated by the View may be fetched such that they may again be reselected after a parse operation etc. This information becomes particulary usefull whenever a Designer must re-annotate.

Returns:
The CmtModelNodes which were last manipulated by the View.

addProperty

CmtPropertySource addProperty(java.lang.String type,
                              java.lang.String name)
Create and add a new property to the class represented by this CmtComponent.

Parameters:
type - The type name for the new property.
name - The name for the the new property.
Returns:
A CmtPropertySource representing the newly created property.
See Also:
CmtPropertySource, removeProperty(oracle.jdeveloper.cmt.CmtProperty)

removeProperty

void removeProperty(CmtProperty property)
Remove a property from the class represented by this CmtComponent.

Parameters:
property - The property to remove.
See Also:
CmtProperty, addProperty(java.lang.String, java.lang.String)

getInitMethod

CmtMethodSource getInitMethod()
Get the initialization method from the class represented by this CmtComponent.

Returns:
The initialization method for the class represented by this CmtSubcomponent.
See Also:
CmtMethodSource

addImports

void addImports(SourceExpression SourceExpression)
Deprecated. No longer has any effect. Use auto import support of underlying oracle.javatools.parser.java.v2.model.SourceFile.

Add any import statements necessitated by the given expression to the class represented by this CmtComponent, and reduce to the minimum reference within the expression.

Parameters:
SourceExpression - The expression to consider when determining import statements.

addImport

void addImport(java.lang.String className)
Add import statement necessitated by the given class name to the class represented by this CmtComponent.

Parameters:
className - The class name to consider when determining import statements.

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

E13403-07

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