Extension SDK 9.0.5

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 jot representation of the users 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 Jot level for the JotClass represented by this CmtComponentSource instance.
static java.lang.String INIT_METHOD_NAME
          GUI initialization method name.
static JotType[] INIT_METHOD_PARAMS
          GUI initialization method argument signatures.
static int STRUCTURE_CHANGING
          Message ID indicating that a Jot level message has been received which will force the recreation of the Cmt model.
 
Fields inherited from interface oracle.jdeveloper.cmt.CmtComponent
PROXY_KEY
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Method Summary
 void addImport(java.lang.String className)
          Add import statement necessitated by the given class name to the class represented by this CmtComponent.
 void addImports(JotExpression jotExpression)
          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.
 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 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 to this CmtComponent.
 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 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 renameSubcomponent(CmtSubcomponent subcomponent, java.lang.String name)
          This method is used for renaming a CmtSubcomponent within 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.addin.Subject
attach, detach, notifyObservers
 

Field Detail

INIT_METHOD_NAME

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

See Also:
Constant Field Values

EXTENSION_PREFIX

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

See Also:
Constant Field Values

INIT_METHOD_PARAMS

public static final JotType[] INIT_METHOD_PARAMS
GUI initialization method argument signatures.


FILE_PARSE_FAILED

public static final int FILE_PARSE_FAILED
Message ID indicating that a parse error was found at the Jot level for the JotClass 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

public static final int STRUCTURE_CHANGING
Message ID indicating that a Jot 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

public 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

public 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)

renameSubcomponent

public void renameSubcomponent(CmtSubcomponent subcomponent,
                               java.lang.String name)
                        throws java.lang.IllegalArgumentException
This method is used for renaming a CmtSubcomponent within this CmtComponent.

Parameters:
subcomponent - The CmtSubcomponent to rename.
name - The new name.
Throws:
java.lang.IllegalArgumentException
See Also:
CmtSubcomponent, addSubcomponent(java.lang.String, java.lang.String, java.lang.String, int)

getStructure

public 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

public CmtSelectionModel getSelectionModel()
Get the selection model.


getCmtModelNode

public 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

public 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

public 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

public 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

public 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

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

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

commit

public void commit()
Deprecated. Use commit(String)

Commit any uncommitted changes made to this CmtComponent.


commit

public void commit(java.lang.String caption)
Commit any uncommited changes made to this CmtComponent.

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

hasDependencies

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public 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

public void addImports(JotExpression jotExpression)
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:
jotExpression - The expression to consider when determining import statements.

addImport

public 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.

Extension SDK

 

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