Extension SDK

oracle.jdeveloper.model
Class JavaSourceNode

java.lang.Object
  extended byoracle.ide.model.DefaultDisplayable
      extended byoracle.ide.model.DefaultElement
          extended byoracle.ide.model.DefaultDocument
              extended byoracle.ide.model.DefaultNode
                  extended byoracle.ide.model.TextNode
                      extended byoracle.ide.model.DeployableTextNode
                          extended byoracle.jdeveloper.model.JavaSourceNode
All Implemented Interfaces:
Category, Data, Dirtyable, Displayable, Document, Element, JavaNode, LazyLoadable, Locatable, Node, PackagedSource, Subject, TextDocument
Direct Known Subclasses:
SqljSourceNode

public class JavaSourceNode
extends DeployableTextNode
implements JavaNode, PackagedSource

The JavaSourceNode interface represents a Java source file in the JDeveloper browser. In addition to providing the services supported by the JavaNode interface, the JavaSourceNode interface provides access to a source view of the file through the JOT subystem.


Field Summary
static java.lang.String defaultName
           
static java.lang.String EXT
           
 
Fields inherited from class oracle.ide.model.DeployableTextNode
EXT2
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Fields inherited from interface oracle.ide.model.Category
UNDEFINED
 
Constructor Summary
JavaSourceNode()
           
 
Method Summary
 void close()
          Closes the Document and unloads any associated data.
 int getCategory()
          Get the bit field identifying the different categories this data node falls under.
 javax.swing.Icon getIcon()
          Returns an Icon that can be shown in association with this Displayable.
 java.lang.String getPackage()
           
 java.lang.String getPackage(JProject project)
          Returns the package for the source file.
 java.lang.String getSourceFile()
          Returns the file name for the source file.
 oracle.javatools.parser.java.symbol.RootSymbol parse()
          Convenience routine.
 oracle.javatools.parser.java.symbol.RootSymbol parse(boolean fullDepth)
          Parses the Java code contained within this JavaSourceNode.
 
Methods inherited from class oracle.ide.model.TextNode
acquireTextBuffer, getInputStream, getLoadEncoding, getReader, getSaveEncoding, getTextBufferDirectly, hasEmptyTextBuffer, isDirty, isReadOnly, markDirty, open, releaseTextBuffer, reopen, save, setTextBufferDirectly, updateReadOnlyFlag
 
Methods inherited from class oracle.ide.model.DefaultNode
equalsImpl, setURL
 
Methods inherited from class oracle.ide.model.DefaultDocument
attach, copyToImpl, createSubject, detach, ensureOpen, equalsImpl, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampDirectly, getToolTipText, getURL, isNew, isOpen, notifyObservers, refreshTimestamp, setOpen, setTimestampDirectly
 
Methods inherited from class oracle.ide.model.DefaultElement
getAttributes, getChildren, getData, mayHaveChildren
 
Methods inherited from class oracle.ide.model.DefaultDisplayable
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ide.model.Document
getInputStream, getTimestamp, isNew, isReadOnly, open, save
 
Methods inherited from interface oracle.ide.model.Locatable
getURL, setURL
 
Methods inherited from interface oracle.ide.model.Element
getAttributes, getChildren, mayHaveChildren
 
Methods inherited from interface oracle.ide.model.Data
getData
 
Methods inherited from interface oracle.ide.model.Displayable
getLongLabel, getShortLabel, getToolTipText, toString
 
Methods inherited from interface oracle.ide.addin.Subject
attach, detach, notifyObservers
 
Methods inherited from interface oracle.ide.model.Dirtyable
isDirty, markDirty
 
Methods inherited from interface oracle.ide.model.LazyLoadable
isOpen
 

Field Detail

EXT

public static final java.lang.String EXT
See Also:
Constant Field Values

defaultName

public static final java.lang.String defaultName
Constructor Detail

JavaSourceNode

public JavaSourceNode()
Method Detail

close

public void close()
Description copied from interface: Document
Closes the Document and unloads any associated data. When this method returns, the state of the Document object should be equivalent to when the Document object has just been instantiated but not yet opened.

Specified by:
close in interface Document
Overrides:
close in class TextNode

getPackage

public java.lang.String getPackage()

getPackage

public java.lang.String getPackage(JProject project)
Description copied from interface: PackagedSource
Returns the package for the source file.

Note that the package returned here may begin with a '*' which means that the exact package is not known.

Specified by:
getPackage in interface PackagedSource
Parameters:
project - the project which contains the source file
Returns:
the package for the source file.

getSourceFile

public java.lang.String getSourceFile()
Description copied from interface: PackagedSource
Returns the file name for the source file.

Only the name of the source file is given by the source file attribute it never represents the name of a directory containing the file or an absolute path name for the file. For instance the source file attribute may contain file name foo.java but not the UNIX path name /home/jdevwork/workspace1/project1/package1/foo.java.

Specified by:
getSourceFile in interface PackagedSource
Returns:
the source file name for the source file.

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: Displayable
Returns an Icon that can be shown in association with this Displayable. Typically the icon will be used in a tree control or list control. Therefore the icon must fit naturally within the space normally given to items within those controls. Such icons are usually 16x16 in size or, if there is a one-pixel transparent padding around the edge, 18x18 in size. It is strongly recommended that icons returned by this method be either 16x16 or 18x18 in size. If null is returned, the control may show a default icon, or it may show no icon, whichever is appropriate.

Specified by:
getIcon in interface Displayable
Overrides:
getIcon in class DefaultDisplayable
Returns:
the Icon for this node instance
See Also:
Displayable.getIcon()

getCategory

public int getCategory()
Get the bit field identifying the different categories this data node falls under.

Specified by:
getCategory in interface Category
Overrides:
getCategory in class DefaultNode
Returns:
the category types.

parse

public oracle.javatools.parser.java.symbol.RootSymbol parse(boolean fullDepth)
Parses the Java code contained within this JavaSourceNode. If a full-depth parse is requested, a full-depth parse tree will be returned. If a only a members-depth parse is requested, but a full-depth parse tree is already available, the full-depth parse tree will be returned.

Parameters:
fullDepth - Request full-depth.
Returns:
the RootSymbol resulting from the parse, or null if a valid RootSymbol could not be constructed.

parse

public oracle.javatools.parser.java.symbol.RootSymbol parse()
Convenience routine. Gets the full-depth parse tree.


Extension SDK

 

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