Extension SDK

oracle.jdeveloper.model
Class JProject

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.DataNode
                      extended byoracle.ide.model.DataContainer
                          extended byoracle.ide.model.Project
                              extended byoracle.jdeveloper.model.JProject
All Implemented Interfaces:
Category, Container, Copyable, Data, Dirtyable, Displayable, Document, DynamicPropertySet, Element, Folder, LazyLoadable, Locatable, Node, Observer, Subject, VetoableSubject

public class JProject
extends Project

JProject is the data class that represents the project in JDeveloper.


Field Summary
static java.lang.String ACTIVE_CONFIGURATION_PROPERTY
           
static java.lang.String CLASSPATH_PROPERTY
           
static java.lang.String COMMON_DATA_PROPERTY
           
static java.lang.String DATA_KEY
          The data key by which a JProject instance can be located within a TraversableContext.
static java.lang.String DEFAULT_PACKAGE_PROPERTY
           
static java.lang.String DOCPATH_PROPERTY
           
static java.lang.String EXT
           
static java.lang.String HTML_ROOT_DIRECTORY_PROPERTY
           
static java.lang.String HTML_SOURCE_DIRECTORY_PROPERTY
          Deprecated. -- We are no longer using the notion of an HTML source directory.
static java.lang.String OUTPUT_DIRECTORY_PROPERTY
           
static java.lang.String PROJECT_SOURCEPATH_PROPERTY
           
static java.lang.String RUN_CLASSPATH_PROPERTY
           
static java.lang.String SOURCEPATH_PROPERTY
           
static java.lang.String USE_DEFAULT_PACKAGE_PROPERTY
           
static java.lang.String USE_DYNAMIC_PATHS_PROPERTY
           
static java.lang.String USER_COMPANY_PROPERTY
           
static java.lang.String USER_COPYRIGHT_PROPERTY
           
static java.lang.String USER_DESCRIPTION_PROPERTY
           
static java.lang.String USER_TITLE_PROPERTY
           
static java.lang.String USER_VERSION_PROPERTY
           
 
Fields inherited from class oracle.ide.model.DataContainer
_children
 
Fields inherited from class oracle.ide.model.DataNode
_objectStore
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Fields inherited from interface oracle.ide.model.Category
UNDEFINED
 
Constructor Summary
JProject()
          Default constructor.
JProject(JProject project)
          Copy constructor.
 
Method Summary
 void addDynamicPathFilter(URLFilter filter)
          Adds the specified URLFilter to the list of filters used to exclude resources from appearing under a dynamic project.
 boolean addLibrary(java.lang.String library)
          Adds the specified library to the project's library list, if not already present.
 void addToProject(java.util.Collection elements)
          Adds the collection of elements to the project.
 void addToProject(java.util.Collection elements, boolean askToAdd)
          Adds the collection of elements to the project.
 void addToProjectSourcePath(JavaSourceNode node)
           
protected  int addToProjectSourcePath(JavaSourceNode node, boolean[] ask)
          The the source path of the specified node to the project source path list.
 boolean canAdd(Element element)
          Call this method to determine if an Element can be added to this project.
protected  java.util.Collection clearBuiltChildren()
           
 void close()
          Closes the Document and unloads any associated data.
 boolean containsChild(Element element)
          Returns true if the child is contained by the project even if the owner is another folder contained in the project.
 java.lang.Object copyTo(java.lang.Object object)
          Copies the internal state of this object to the specified copy.
protected  void copyToImpl(JProject copy)
          Design pattern for supporting strongly typed copying.
 URLPath currentClassPath()
          Deprecated. -- Call getClassPath() instead.
protected  ObjectStore currentObjectStore()
           
 java.net.URL currentOutputDirectory()
          Deprecated. -- Call getOutputDirectory() instead.
 URLPath currentRunClassPath()
          Deprecated. -- Call getRunClassPath() instead.
 URLPath currentSourcePath()
          Deprecated. -- Call getSourcePath() instead.
 boolean equals(java.lang.Object o)
           
protected  boolean equalsImpl(JProject jProject)
          This is a helper method for equals(Object) that can also be used by subclasses that implement equals(Object).
 java.lang.Object getActiveConfigDataByName(java.lang.String dataKey)
           
 JProjectConfiguration getActiveConfiguration()
           
 java.lang.String getActiveConfigurationName()
           
 java.util.Iterator getChildren()
          Returns all children of the project including children owned by other folders contained in the project.
 URLPath getClassPath()
           
 java.lang.String getCompilerEncoding()
           
 JProjectConfiguration getConfigurationByName(java.lang.String configName)
           
 java.util.List getConfigurationNames()
           
 java.util.Iterator getConfigurations()
           
 java.lang.String getDefaultPackage()
           
 java.util.List getDefaultPackages()
           
 URLPath getDocPath()
           
 java.lang.String getEncoding()
          Deprecated. Use getCompilerEncoding() instead.
 java.net.URL getHtmlRootDirectory()
           
 java.net.URL getHtmlSourceDirectory()
          Deprecated. -- We are no longer using the notion of an HTML source directory. Call getHtmlRootDirectory() instead.
 java.lang.String getIanaEncoding()
          Deprecated. Use IdeUtil.getIdeIanaEncoding() instead.
 java.lang.String getJ2eeWebAppName()
           
 java.lang.String getJ2eeWebContextRoot()
           
 java.lang.String getJ2eeWebContextRoot(boolean forceSlash)
           
 java.util.Iterator getMyChildren()
          Returns the children owned by this project.
 java.net.URL getOutputDirectory()
           
 URLPath getProjectDocPath()
           
 LibraryList getProjectLibraryList()
           
 JProjectSettings getProjectSettings()
           
 URLPath getProjectSourcePath()
           
 URLPath getRunClassPath()
           
 URLPath getSourcePath()
           
 java.lang.String getUserAuthor()
           
 java.lang.String getUserCompany()
           
 java.lang.String getUserCopyright()
           
 java.lang.String getUserDescription()
           
 java.lang.String getUserTitle()
           
 java.lang.String getUserVersion()
           
 void open()
          Document interface method.
protected  void rebuildChildren()
           
 boolean remove(Element element, boolean notify)
          Remove the especified element.
 void removeAll(boolean notify)
          Removes all children of the project including those owned by other folders.
 void removeDynamicPathFilter(URLFilter filter)
          Removes the specified URLFilter from the list of filters used to exclude resources from appearing under a dynamic project.
 boolean removeLibrary(java.lang.String library)
          Removes the library from the project's library list, if it is present.
 void setDefaultPackage(java.lang.String defaultPackage)
           
 void setDefaultPackages(java.util.List defaultPackages)
           
 void setHtmlRootDirectory(java.net.URL htmlRootDirectory)
           
 void setHtmlSourceDirectory(java.net.URL htmlSourceDirectory)
          Deprecated. -- We are no longer using the notion of an HTML source directory.
 void setJ2eeWebAppName(java.lang.String j2eeWebAppName)
           
 void setJ2eeWebContextRoot(java.lang.String j2eeWebContextRoot)
          If the specified context root does not begin with a '/' then one is added automatically.
 void setOutputDirectory(java.net.URL outputDirectory)
           
 void setProjectDocPath(URLPath projectDocPath)
           
 void setProjectLibraryList(LibraryList libList)
           
 void setProjectSettings(JProjectSettings projectSettings)
           
 void setProjectSourcePath(URLPath projectSourcePath)
           
 void setUserAuthor(java.lang.String userAuthor)
           
 void setUserCompany(java.lang.String userCompany)
           
 void setUserCopyright(java.lang.String userCopyright)
           
 void setUserDescription(java.lang.String userDescription)
           
 void setUserTitle(java.lang.String userTitle)
           
 void setUserVersion(java.lang.String userVersion)
           
 void setUsesDynamicPaths(boolean dynamicPaths)
           
 boolean usesDynamicPaths()
           
 
Methods inherited from class oracle.ide.model.Project
add, add, add, addDependency, addElements, canRemove, containsOwnedChild, copyToImpl, createSubject, equalsImpl, findOwner, getAllDependencies, getContainerOwner, getContainerOwner, getDefaultName, getDependencies, getDependencyList, getIcon, getOwnedChildren, getOwnedChildrenList, getOwnerMap, getProperties, getProperty, getProperty, notifyObservers, removeDependency, removeOwnedChildren, setDependencyList, setOwnerMap, setProperties, setProperty, size, update
 
Methods inherited from class oracle.ide.model.DataContainer
add, add, add, copyToImpl, getBaseDirectory, getListOfChildren, mayHaveChildren, remove, removeAll, resetSubDirtyableOwners, setListOfChildren, setSubDirtyableOwner
 
Methods inherited from class oracle.ide.model.DataNode
getURL, reopen, save, setObjectStore
 
Methods inherited from class oracle.ide.model.DefaultNode
equalsImpl, getCategory, setURL
 
Methods inherited from class oracle.ide.model.DefaultDocument
attach, copyToImpl, detach, ensureOpen, equalsImpl, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampDirectly, getToolTipText, isDirty, isNew, isOpen, isReadOnly, markDirty, notifyObservers, refreshTimestamp, setOpen, setTimestampDirectly
 
Methods inherited from class oracle.ide.model.DefaultElement
getAttributes, getData
 
Methods inherited from class oracle.ide.model.DefaultDisplayable
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ide.addin.Subject
attach, detach, notifyObservers
 
Methods inherited from interface oracle.ide.model.Document
getInputStream, getTimestamp, isNew, isReadOnly, save
 
Methods inherited from interface oracle.ide.model.Locatable
getURL, setURL
 
Methods inherited from interface oracle.ide.model.Element
getAttributes
 
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.model.Dirtyable
isDirty, markDirty
 
Methods inherited from interface oracle.ide.model.LazyLoadable
isOpen
 
Methods inherited from interface oracle.ide.model.Category
getCategory
 

Field Detail

DATA_KEY

public static final java.lang.String DATA_KEY
The data key by which a JProject instance can be located within a TraversableContext.

See Also:
Constant Field Values

EXT

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

ACTIVE_CONFIGURATION_PROPERTY

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

SOURCEPATH_PROPERTY

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

HTML_ROOT_DIRECTORY_PROPERTY

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

DEFAULT_PACKAGE_PROPERTY

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

CLASSPATH_PROPERTY

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

RUN_CLASSPATH_PROPERTY

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

OUTPUT_DIRECTORY_PROPERTY

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

USER_TITLE_PROPERTY

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

USER_VERSION_PROPERTY

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

USER_COMPANY_PROPERTY

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

USER_COPYRIGHT_PROPERTY

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

USER_DESCRIPTION_PROPERTY

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

PROJECT_SOURCEPATH_PROPERTY

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

COMMON_DATA_PROPERTY

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

DOCPATH_PROPERTY

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

USE_DEFAULT_PACKAGE_PROPERTY

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

USE_DYNAMIC_PATHS_PROPERTY

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

HTML_SOURCE_DIRECTORY_PROPERTY

public static final java.lang.String HTML_SOURCE_DIRECTORY_PROPERTY
Deprecated. -- We are no longer using the notion of an HTML source directory.

See Also:
Constant Field Values
Constructor Detail

JProject

public JProject()
Default constructor. Required for JavaBean status.


JProject

public JProject(JProject project)
Copy constructor.

Method Detail

open

public void open()
          throws java.io.IOException
Document interface method. If this object is not open, Delegate to the superclass to open this Object then use the ensureData method on JProjectSettings to ensure that all of the data classes registered on each JProjectConfiguration exists in the configuration data.

Specified by:
open in interface Document
Overrides:
open in class DataNode
Throws:
java.io.IOException - if errors occur while opening the data from storage (file system, network, or other location accessible with an URL)
See Also:
DefaultNode#open(), NavigableRegistry#ensureData(Map)

copyTo

public java.lang.Object copyTo(java.lang.Object object)
Description copied from interface: Copyable
Copies the internal state of this object to the specified copy. If copy is null, then this method should create a new instance of this class and proceed to copy the internal state to the newly created object. Generally, only the persistent state of the object should be copied, but whether or not it is appropriate to copy transient properties is at the discretion of the individual implementor.

Regardless of whether the copy occurs to an existing object or to a newly created object, the return value is object to which this object's state was copied.

There is a standard implementation pattern for the copyTo method that helps avoid problems that arise when a Copyable object is subclassed. The pattern is:

public Object copyTo( Object target )
{
final <this_class> copy =
target != null ? (<this_class>) target : new <this_class>();
copyToImpl( copy );
return copy;
} protected final void copyToImpl( <this_class> copy ) { super.copyToImpl( copy ); // if necessary // put code here for copying the properties of <this_class> }
The parameter passed into the copyToImpl method is the same type of this class. The responsibility of copyToImpl is to copy the state of this class through direct access of the fields. The copyToImpl method should not use getters and setters since these may be overridden, causing the state of this class to be incompletely copied.

Specified by:
copyTo in interface Copyable
Overrides:
copyTo in class Project

copyToImpl

protected final void copyToImpl(JProject copy)
Design pattern for supporting strongly typed copying.


getProjectSettings

public JProjectSettings getProjectSettings()

setProjectSettings

public void setProjectSettings(JProjectSettings projectSettings)

getDefaultPackage

public java.lang.String getDefaultPackage()

setDefaultPackage

public void setDefaultPackage(java.lang.String defaultPackage)

getDefaultPackages

public java.util.List getDefaultPackages()

setDefaultPackages

public void setDefaultPackages(java.util.List defaultPackages)

getProjectSourcePath

public URLPath getProjectSourcePath()
Returns:
The user defined project source path. This path does not include the dependencies, libraries, nor jdk source path.

setProjectSourcePath

public void setProjectSourcePath(URLPath projectSourcePath)

getProjectDocPath

public URLPath getProjectDocPath()

setProjectDocPath

public void setProjectDocPath(URLPath projectDocPath)

getHtmlRootDirectory

public java.net.URL getHtmlRootDirectory()

setHtmlRootDirectory

public void setHtmlRootDirectory(java.net.URL htmlRootDirectory)

getUserTitle

public java.lang.String getUserTitle()

setUserTitle

public void setUserTitle(java.lang.String userTitle)

getUserVersion

public java.lang.String getUserVersion()

setUserVersion

public void setUserVersion(java.lang.String userVersion)

getUserAuthor

public java.lang.String getUserAuthor()

setUserAuthor

public void setUserAuthor(java.lang.String userAuthor)

getUserCompany

public java.lang.String getUserCompany()

setUserCompany

public void setUserCompany(java.lang.String userCompany)

getUserCopyright

public java.lang.String getUserCopyright()

setUserCopyright

public void setUserCopyright(java.lang.String userCopyright)

getUserDescription

public java.lang.String getUserDescription()

setUserDescription

public void setUserDescription(java.lang.String userDescription)

getJ2eeWebAppName

public java.lang.String getJ2eeWebAppName()

setJ2eeWebAppName

public void setJ2eeWebAppName(java.lang.String j2eeWebAppName)

getJ2eeWebContextRoot

public java.lang.String getJ2eeWebContextRoot()

getJ2eeWebContextRoot

public java.lang.String getJ2eeWebContextRoot(boolean forceSlash)

setJ2eeWebContextRoot

public void setJ2eeWebContextRoot(java.lang.String j2eeWebContextRoot)
If the specified context root does not begin with a '/' then one is added automatically.


getProjectLibraryList

public LibraryList getProjectLibraryList()

setProjectLibraryList

public void setProjectLibraryList(LibraryList libList)

usesDynamicPaths

public boolean usesDynamicPaths()

setUsesDynamicPaths

public void setUsesDynamicPaths(boolean dynamicPaths)

getChildren

public java.util.Iterator getChildren()
Description copied from class: Project
Returns all children of the project including children owned by other folders contained in the project.

Specified by:
getChildren in interface Element
Overrides:
getChildren in class Project

getMyChildren

public java.util.Iterator getMyChildren()
Description copied from class: Project
Returns the children owned by this project. This method excludes children that are owned by other folders contained in the project. To get all children of the project, including those owned by sub-folders, call the method getChildren.

Overrides:
getMyChildren in class Project

containsChild

public boolean containsChild(Element element)
Description copied from class: Project
Returns true if the child is contained by the project even if the owner is another folder contained in the project.

Specified by:
containsChild in interface Folder
Overrides:
containsChild in class Project

remove

public boolean remove(Element element,
                      boolean notify)
Description copied from class: Project
Remove the especified element. Notify observers when notify is set to true. If the specified element is an owned element, this method will also remove the element.

Specified by:
remove in interface Container
Overrides:
remove in class Project

removeAll

public void removeAll(boolean notify)
Description copied from class: Project
Removes all children of the project including those owned by other folders.

Specified by:
removeAll in interface Container
Overrides:
removeAll in class Project

canAdd

public boolean canAdd(Element element)
Description copied from class: Project
Call this method to determine if an Element can be added to this project. This method does not allow the addition of Workspaces and other projects.

Specified by:
canAdd in interface Folder
Overrides:
canAdd in class Project

currentObjectStore

protected ObjectStore currentObjectStore()
Overrides:
currentObjectStore in class DataNode

getSourcePath

public URLPath getSourcePath()
                      throws TransientMarker
Returns:
The full project source path. This path includes the user defined source path, the source path of the projects this project depends on, the libraries source path, and the jdk source path.
Throws:
TransientMarker

getClassPath

public URLPath getClassPath()
                     throws TransientMarker
Throws:
TransientMarker

getRunClassPath

public URLPath getRunClassPath()
                        throws TransientMarker
Throws:
TransientMarker

getDocPath

public URLPath getDocPath()
                   throws TransientMarker
Throws:
TransientMarker

getCompilerEncoding

public java.lang.String getCompilerEncoding()
                                     throws TransientMarker
Throws:
TransientMarker

getEncoding

public java.lang.String getEncoding()
                             throws TransientMarker
Deprecated. Use getCompilerEncoding() instead.

Throws:
TransientMarker

getIanaEncoding

public java.lang.String getIanaEncoding()
                                 throws TransientMarker
Deprecated. Use IdeUtil.getIdeIanaEncoding() instead.

Throws:
TransientMarker

getOutputDirectory

public java.net.URL getOutputDirectory()
                                throws TransientMarker
Throws:
TransientMarker

setOutputDirectory

public void setOutputDirectory(java.net.URL outputDirectory)

addLibrary

public boolean addLibrary(java.lang.String library)
Adds the specified library to the project's library list, if not already present. This method adds the library to all currently available project configurations.

Returns:
true if the library was not already present in one or more configurations and was therefore added; false otherwise.

removeLibrary

public boolean removeLibrary(java.lang.String library)
Removes the library from the project's library list, if it is present.

Returns:
true if the library was present in one or more configurations and was therefore removed; false otherwise.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class Project

equalsImpl

protected final boolean equalsImpl(JProject jProject)
This is a helper method for equals(Object) that can also be used by subclasses that implement equals(Object). It assumes that the argument is not null.


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 Project

getConfigurationNames

public java.util.List getConfigurationNames()

getConfigurationByName

public JProjectConfiguration getConfigurationByName(java.lang.String configName)

getConfigurations

public java.util.Iterator getConfigurations()

getActiveConfiguration

public JProjectConfiguration getActiveConfiguration()

getActiveConfigurationName

public java.lang.String getActiveConfigurationName()

getActiveConfigDataByName

public java.lang.Object getActiveConfigDataByName(java.lang.String dataKey)

addToProjectSourcePath

public void addToProjectSourcePath(JavaSourceNode node)

addToProjectSourcePath

protected int addToProjectSourcePath(JavaSourceNode node,
                                     boolean[] ask)
The the source path of the specified node to the project source path list. This method asks for confirmation from the user only if the ask[0] flag indicates to do so. Once the user is asked for confirmation the ask[0] flag is reset so that in subsequent calls the user is not asked again.


addToProject

public void addToProject(java.util.Collection elements)
Adds the collection of elements to the project. The elements that could not be added to the project are removed from the collection

Overrides:
addToProject in class Project

addToProject

public void addToProject(java.util.Collection elements,
                         boolean askToAdd)
Adds the collection of elements to the project. The elements that could not be added to the project are removed from the collection. The ask parameter determines if the user is ever asked whether or not to modify the java source path of the project.


addDynamicPathFilter

public void addDynamicPathFilter(URLFilter filter)
Adds the specified URLFilter to the list of filters used to exclude resources from appearing under a dynamic project. Extensions may use this method to limit which files appear in a dynamic project. If the filter is null, this method has no effect.

Parameters:
filter - the URLFilter instance to add

removeDynamicPathFilter

public void removeDynamicPathFilter(URLFilter filter)
Removes the specified URLFilter from the list of filters used to exclude resources from appearing under a dynamic project. If the filter is either null or not an active filter, this method has no effect.

Parameters:
filter - the URLFilter instance to remove

rebuildChildren

protected void rebuildChildren()

clearBuiltChildren

protected java.util.Collection clearBuiltChildren()

currentSourcePath

public URLPath currentSourcePath()
Deprecated. -- Call getSourcePath() instead.


currentClassPath

public URLPath currentClassPath()
Deprecated. -- Call getClassPath() instead.


currentRunClassPath

public URLPath currentRunClassPath()
Deprecated. -- Call getRunClassPath() instead.


currentOutputDirectory

public java.net.URL currentOutputDirectory()
Deprecated. -- Call getOutputDirectory() instead.


getHtmlSourceDirectory

public java.net.URL getHtmlSourceDirectory()
                                    throws TransientMarker
Deprecated. -- We are no longer using the notion of an HTML source directory. Call getHtmlRootDirectory() instead.

Throws:
TransientMarker

setHtmlSourceDirectory

public void setHtmlSourceDirectory(java.net.URL htmlSourceDirectory)
Deprecated. -- We are no longer using the notion of an HTML source directory.


Extension SDK

 

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