|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoracle.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
This is the base class for all data classes that represent a user
project. A project may contain children owned by other containers
which are also part of the same project. When owned children are
added to the project, clients should use the method:
add( Node child, Container containerOwner )
The child owner relationship is maintained by the project and persited
in the project file. The child must be a Node and the owner must
be a Container. This is necessary because the NodeFactory
is used to create the nodes from the persisted data.
The method getChildren gets called, it returns all
children of the project including the children owned by other containers.
Note: Container owners must be direct children of the project.
| Field Summary |
| 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 | |
Project()
Default constructor. |
|
Project(Project project)
Copy constructor. |
|
| Method Summary | |
void |
add(java.util.Collection elements)
Adds the collection of elements to the project. |
void |
add(java.util.Collection elements,
Container ownerContainer)
Adds the collection of Nodes to the project. |
boolean |
add(Node node,
Container ownerContainer)
Add the Node to the project. |
void |
addDependency(Dependable dependable)
Adds a dependency to the project. |
protected void |
addElements(java.util.Collection elements,
Container containerOwner)
Adds the collection of elements to the project. |
void |
addToProject(java.util.Collection elements)
Adds the collection of elements to the project. |
boolean |
canAdd(Element element)
Call this method to determine if an Element can be added to
this project. |
boolean |
canRemove(Element element)
Call this method to determine if the element can be removed from this project. |
void |
close()
Closes the Document and unloads any associated data. |
boolean |
containsChild(Element child)
Returns true if the child is contained by the project even if the owner is another folder contained in the project. |
boolean |
containsOwnedChild(Element child)
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(Project copy)
Design pattern for supporting strongly typed copying. |
protected Subject |
createSubject()
Creates an instance of a Subject implementation. |
boolean |
equals(java.lang.Object o)
|
protected boolean |
equalsImpl(Project project)
This is a helper method for equals(Object) that can
also be used by subclasses that implement equals(Object). |
Folder |
findOwner(Element element)
|
java.util.Iterator |
getAllDependencies()
Returns all dependables this project depends on. |
java.util.Iterator |
getChildren()
Returns all children of the project including children owned by other folders contained in the project. |
protected Container |
getContainerOwner(Element element)
Get the container that owns the specified node. |
protected Container |
getContainerOwner(java.net.URL url)
Get the container that owns the node associated with the specfied url. |
static java.lang.String |
getDefaultName()
Returns the default name (prefix only) for project files in general. |
java.util.Iterator |
getDependencies()
Returns dependables this project depends on. |
java.util.List |
getDependencyList()
Get a list of Elements this project depends on. |
javax.swing.Icon |
getIcon()
Returns an Icon that can be shown in association with this
Displayable. |
java.util.Iterator |
getMyChildren()
Returns the children owned by this project. |
java.util.Iterator |
getOwnedChildren()
Get a collection of children that are owned by other folders included in this project. |
protected java.util.List |
getOwnedChildrenList()
Initialize the list of children owned by other folders included in this project. |
java.util.Map |
getOwnerMap()
Get the map that associates an element with its owner. |
java.util.Map |
getProperties()
Retrieves a map holding the property-value pairs. |
java.lang.Object |
getProperty(java.lang.String name)
Retrieves the value associated with a property. |
java.lang.Object |
getProperty(java.lang.String name,
java.lang.Object defaultValue)
Accessor to user data saved in the project file |
void |
notifyObservers(java.lang.Object subject,
VetoableMessage change)
Notifies all observers that the state of the subject has changed. |
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 |
removeDependency(Dependable dependable)
Removes the specified element from the dependencies list. |
void |
removeOwnedChildren(Folder owner)
Removes the children of the project that are owned by the specified owner. |
void |
setDependencyList(java.util.List dependencies)
|
void |
setOwnerMap(java.util.Map ownerMap)
|
void |
setProperties(java.util.Map properties)
Sets the map holding the property-value pairs. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Accessor to user data saved in the project file |
int |
size()
Returns the total number of children in the project. |
void |
update(java.lang.Object observed,
UpdateMessage change)
Projects are interested in receiving notification of when an owned child is renamed in order to update owner map. |
| 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 |
currentObjectStore, getURL, open, 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, open, 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 |
| Constructor Detail |
public Project()
public Project(Project project)
| Method Detail |
public java.lang.Object copyTo(java.lang.Object object)
Copyablethis 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.
copyTo in interface Copyableobject - The target object to which the state of
this object should be copied. If target
is null, then the copyTo method will
return a new instance of this class.
this
object was copied. If the target was
non-null, then the return value is the same as the
target object that was passed in; otherwise, the
return value is a new instance of this class.protected final void copyToImpl(Project copy)
This method is intended to be helper method that subclasses can use,
if they implement the Copyable interface.
public boolean equals(java.lang.Object o)
protected final boolean equalsImpl(Project project)
equals(Object) that can
also be used by subclasses that implement equals(Object).
It assumes that the argument is not null.
public javax.swing.Icon getIcon()
DisplayableIcon 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.
getIcon in interface DisplayablegetIcon in class DefaultDisplayableDisplayable.getIcon()public boolean canRemove(Element element)
Node, this
method returns true. If it is a node and it has an owner,
it delegates the call to the Folder owner. It the node does
not have an owner, implying that the project owns the node,
this method returns true.
canRemove in interface FoldercanRemove in class DataContainertrue if and only if the specified
Element is not null.Folder.canRemove(Element)public boolean canAdd(Element element)
Element can be added to
this project.
This method does not allow the addition of Workspaces and other
projects.
canAdd in interface FoldercanAdd in class DataContainertrue if and only if the specified
Element is not null.Folder.canAdd(Element)public boolean containsChild(Element child)
containsChild in interface FoldercontainsChild in class DataContainerpublic boolean containsOwnedChild(Element child)
public int size()
size in interface Foldersize in class DataContainer
public boolean remove(Element element,
boolean notify)
notify
is set to true.
If the specified element is an owned element, this method will also
remove the element.
remove in interface Containerremove in class DataContainerpublic void removeAll(boolean notify)
removeAll in interface ContainerremoveAll in class DataContainerpublic java.util.Map getOwnerMap()
Folder that has veto
over operations such as removing the owned element from the project.
This method will create an owner map if none exist. Call this method
when the owner map is actually needed.
public void setOwnerMap(java.util.Map ownerMap)
public java.util.List getDependencyList()
Elements this project depends on.
Returns a copy of the internal list or null if there are no dependencies.
public void setDependencyList(java.util.List dependencies)
public Folder findOwner(Element element)
public void addToProject(java.util.Collection elements)
elements collection specified should
not be null. Subclasses should override this method to
make sure that other properties of a project, such as source
path, are updated from the url of the specified elements.
public void add(java.util.Collection elements,
Container ownerContainer)
Nodes to the project. The nodes
that could not be added to the project are removed from the
collection. Call this method when adding nodes to the project
that are owned by another folder. That is they are children
of a folder contained also in the project.
The items in the specified in the collection must be nodes.
The ownerContainer must point to a Container
The container owner is returned when the findOwner
method is called.
public boolean add(Node node,
Container ownerContainer)
Node to the project. Call this method when adding
a node to the project that is owned by another folder. If the
node is already contained by this project, this method returns
without doing anything.
The ownerContainer must point to a Container
The container owner is returned when the findOwner
method is called.
public void add(java.util.Collection elements)
elements collection specified should
not be null. This method adds the elements in the collection
to the project without updating any other project property.
public java.util.Iterator getChildren()
getChildren in interface ElementgetChildren in class DataContainerElement.getChildren()public java.util.Iterator getMyChildren()
getChildren.
public java.util.Iterator getOwnedChildren()
public void removeOwnedChildren(Folder owner)
owner. The owner need not be a direct
child of this project. The method recursively removes children
owned by other containers that may be children of the given
owner. This method also notifies observers of the
project that children were removed.
public void addDependency(Dependable dependable)
public void removeDependency(Dependable dependable)
element from the dependencies list.
public java.util.Iterator getDependencies()
public java.util.Iterator getAllDependencies()
public java.util.Map getProperties()
DynamicPropertySet
getProperties in interface DynamicPropertySetpublic void setProperties(java.util.Map properties)
DynamicPropertySet
setProperties in interface DynamicPropertySetpublic java.lang.Object getProperty(java.lang.String name)
DynamicPropertySet
getProperty in interface DynamicPropertySetname - the property key for which a value is desired.
exists.
null value
if the property does not exist or is not set.
public java.lang.Object getProperty(java.lang.String name,
java.lang.Object defaultValue)
getProperty in interface DynamicPropertySetname - the property key for which a value is desired.defaultValue - the value to return if no value currently
exists.
public void setProperty(java.lang.String name,
java.lang.Object value)
setProperty in interface DynamicPropertySetname - the property key to setvalue - the value to set
public void update(java.lang.Object observed,
UpdateMessage change)
update in interface Observerobserved - the subject whose state has changed.change - what has changed.
public void notifyObservers(java.lang.Object subject,
VetoableMessage change)
throws ChangeVetoException
VetoableSubject
notifyObservers in interface VetoableSubjectsubject - the subject whose state has changed.change - what changed.
ChangeVetoExceptionpublic static java.lang.String getDefaultName()
public void close()
DocumentDocument 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.
close in interface Documentclose in class DataContainerprotected Subject createSubject()
Subject implementation. This method
is called from DefaultDocument.getSubject() the first time the subject
is created. This implementation creates an IdeVetoableSubject.
createSubject in class DefaultDocument
protected void addElements(java.util.Collection elements,
Container containerOwner)
elements collection specified should
not be null.
If owner is specified it indicates that the
elements in the collection are nodes and are owned by another container
in the project.
protected java.util.List getOwnedChildrenList()
protected Container getContainerOwner(java.net.URL url)
url.
protected Container getContainerOwner(Element element)
|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©1997, 2003, Oracle. All rights reserved.