oracle.jdeveloper.model
Class JProject
java.lang.Object
oracle.ide.model.DefaultDisplayable
oracle.ide.model.DefaultElement
oracle.ide.model.DefaultDocument
oracle.ide.model.DefaultNode
oracle.ide.model.DataNode
oracle.ide.model.DataContainer
oracle.ide.model.Project
oracle.jdeveloper.model.JProject
- All Implemented Interfaces:
- Category, Container, Copyable, Data, Dirtyable, Displayable, Document, DynamicPropertySet, Element, Folder, LazyLoadable, Locatable, Node, Observer, Subject, SupportsInspection, VetoableSubject
- public class JProject
- extends Project
- implements SupportsInspection
JProject
is the data class that represents the project in JDeveloper.
Methods inherited from class oracle.ide.model.Project |
add, add, add, addDependency, addElements, canRemove, containsOwnedChild, copyToImpl, createSubject, equalsImpl, findOwner, firePropertyChanged, getAllDependencies, getAllDependenciesList, getContainerOwner, getContainerOwner, getDefaultName, getDependencies, getDependencyList, getIcon, getOwnedChildren, getOwnedChildrenList, getOwnerMap, getProperties, getProperty, getProperty, getTechnologyScope, notifyObservers, removeDependency, removeOwnedChildren, setDependencyList, setOwnerMap, setProperties, setProperty, setTechnologyScope, size, update, updateTechnologyScope |
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.DefaultDocument |
attach, copyToImpl, detach, ensureOpen, equalsImpl, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampDirectly, getToolTipText, isDirty, isNew, isOpen, isReadOnly, markDirty, notifyObservers, refreshTimestamp, setOpen, setTimestampDirectly, setURLDirectly |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.ide.model.Data |
getData |
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
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
CONTENT_PROVIDERSPATH_PROPERTY
public static final java.lang.String CONTENT_PROVIDERSPATH_PROPERTY
-
- See Also:
- Constant Field Values
JProject
public JProject()
- Default constructor. Required for JavaBean status.
JProject
public JProject(JProject project)
- Copy constructor.
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.
registerProjectTechnologyListener
public static void registerProjectTechnologyListener(java.lang.String technologyKey,
JProjectTechnologyListener listener)
- Registers a technology listener for the specified technology. The listener is called whenever the technology is added or removed from any project.
-
- Parameters:
technologyKey
- The key for a registered technology.
listener
- The listener to register.
- See Also:
TechnologyRegistry
unregisterProjectTechnologyListener
public static void unregisterProjectTechnologyListener(java.lang.String technologyKey,
JProjectTechnologyListener listener)
- Unregisters a technology listener for the specified technology.
-
- Parameters:
technologyKey
- The key for a registered technology.
listener
- The listener to register.
- Throws:
java.lang.IllegalArgumentException
- if no such listener has been registered.
- See Also:
TechnologyRegistry
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()
-
- Returns:
- An unsynchronized List that should be synchronized upon when used.
setDefaultPackages
public void setDefaultPackages(java.util.List defaultPackages)
getProjectSourcePath
public URLPath getProjectSourcePath()
-
- Overrides:
getProjectSourcePath
in class Project
-
- 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)
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 Workspace
s 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
getContentProvidersPath
public URLPath getContentProvidersPath()
-
- Overrides:
getContentProvidersPath
in class Project
-
- Returns:
- additional source paths provided by extensions. For example, the modelers path is a content provider path.
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[] nodes)
addToProjectSourcePath
public void addToProjectSourcePath(JavaSourceNode node)
addToActiveConfigurationAdditionalClassPath
protected int addToActiveConfigurationAdditionalClassPath(java.net.URL url,
boolean[] ask)
- Add the the specified
url
to the active configuration extra class path. 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.
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()
validateJarURL
protected java.net.URL validateJarURL(java.net.URL url)
- We need to make sure that urls pointing to jar/zip files have the correct protocol.
Copyright © 1997, 2004, Oracle. All rights reserved.