Extension SDK 10.1.3.36.73

oracle.ide.model
Class DataContainer

java.lang.Object
  extended byoracle.ide.model.Node
      extended byoracle.ide.model.DataNode
          extended byoracle.ide.model.DataContainer
All Implemented Interfaces:
oracle.javatools.data.Dirtyable, Dirtyable, Displayable, Element, Folder, LazyLoadable, Locatable, Observer, oracle.javatools.data.PropertyStorage, Subject
Direct Known Subclasses:
IdeSystem, MiscellaneousFolder, Project, Workspace

public class DataContainer
extends DataNode
implements oracle.javatools.data.PropertyStorage, Folder, Observer


Constructor Summary
DataContainer()
          Default constructor.
DataContainer(java.net.URL url)
           
 
Method Summary
 boolean add(java.util.Collection childElements, boolean notify)
          Adds a Collection of Element objects to the child list for the container.
 boolean add(Element element)
          Part of the Folder interface.
 boolean add(Element element, boolean notify)
           
 boolean canAdd(Element element)
          Part of the Folder interface.
 boolean canRemove(Element element)
          Part of the Folder interface.
protected  void closeImpl()
          Subclasses should override this method to customize the close() behavior.
 boolean containsChild(Element child)
          Returns true if the folder contains the specified child Element; returns false otherwise.
 boolean equals(java.lang.Object obj)
           
protected  boolean equalsImpl(DataContainer other)
           
 java.lang.String getBaseDirectory()
           
 java.util.Iterator getChildren()
          Part of the Element interface.
 java.util.List getListOfChildren()
          Fulfills the public accessor part of the Folder contract.
 oracle.javatools.data.HashStructure getProperties()
          Returns the root HashStructure object that holds properties for this Project.
 java.lang.String getProperty(java.lang.String name)
          Convenience method equivalent to calling project.getProperties().getString(name).
 java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
          Convenience method equivalent to calling project.getProperties().getString(name, defaultValue).
 oracle.javatools.data.HashStructure getSharedPropertiesOnly()
          This method returns the persistent HashStructure that is not user-private.
 java.util.Map getTransientProperties()
          This method returns a Map that the caller can use to store 'transient' properties in the Project.
 oracle.javatools.data.HashStructure getUserPropertiesOnly()
          For DataContainer subtypes that distinguish between user-private properties and shared properties, this method returns only the user-private HashStructure.
 boolean mayHaveChildren()
          Part of the Element interface.
protected  void openImpl()
          This method uses ObjectStore to unmarshal the file into a JavaBean instance.
protected  void postCloseImpl()
          This method is called after nodeClosed(..) has been called on all registered NodeListeners.
 boolean remove(Element element)
          Part of the Folder interface.
 boolean remove(Element element, boolean notify)
           
 void removeAll()
          Removes all children from the folder.
 void removeAll(boolean notify)
           
protected  void resetSubDirtyableOwners(java.util.List children)
          Resets the owner of each element listed.
 void setListOfChildren(java.util.List list)
          Fulfills the public accessor part of the Folder contract.
 void setProperty(java.lang.String name, java.lang.String value)
          Convenience method equivalent to calling project.getProperties().putString(name, value).
protected  void setSubDirtyableOwner(Element element, Dirtyable owner)
          Sets the owner of this element to the specified element.
 int size()
          Returns the current number of children in the folder.
 void update(java.lang.Object observed, UpdateMessage change)
          Notification message.
 
Methods inherited from class oracle.ide.model.DataNode
getObjectStoreTarget, getURL, newObjectStore, saveImpl
 
Methods inherited from class oracle.ide.model.Node
_getReadWriteLockInternal, addNodeListener, addNodeListenerForType, addNodeListenerForTypeHierarchy, attach, close, createSubject, delete, deleteImpl, detach, ensureOpen, equalsImpl, getAttributes, getData, getIcon, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getToolTipText, isDirty, isNew, isOpen, isReadOnly, isTrackedInNodeCache, markDirty, notifyObservers, open, refreshTimestamp, removeNodeListener, removeNodeListenerForType, removeNodeListenerForTypeHierarchy, rename, renameImpl, reportOpenException, revert, revertImpl, runWhileSynchronized, save, setOpen, setTimestampDirectly, setURL, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ide.model.Element
getAttributes, getData
 
Methods inherited from interface oracle.ide.model.Displayable
getIcon, getLongLabel, getShortLabel, getToolTipText, toString
 

Constructor Detail

DataContainer

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


DataContainer

public DataContainer(java.net.URL url)
Method Detail

getProperties

public oracle.javatools.data.HashStructure getProperties()
Returns the root HashStructure object that holds properties for this Project. This method is guaranteed to return non-null.

Subclasses that support user-private properties must override this method to return the proper chained HashStructure.

Specified by:
getProperties in interface oracle.javatools.data.PropertyStorage

getUserPropertiesOnly

public oracle.javatools.data.HashStructure getUserPropertiesOnly()
For DataContainer subtypes that distinguish between user-private properties and shared properties, this method returns only the user-private HashStructure. If user-private properties are not supported, this method returns the same value as getSharedPropertiesOnly().

Subclasses that support user-private properties must override this method to return the right HashStructure.


getSharedPropertiesOnly

public final oracle.javatools.data.HashStructure getSharedPropertiesOnly()
This method returns the persistent HashStructure that is not user-private. Usually such a file is "shared" on a development team through source control.


getProperty

public final java.lang.String getProperty(java.lang.String name)
Convenience method equivalent to calling project.getProperties().getString(name).


getProperty

public final java.lang.String getProperty(java.lang.String name,
                                          java.lang.String defaultValue)
Convenience method equivalent to calling project.getProperties().getString(name, defaultValue).


setProperty

public final void setProperty(java.lang.String name,
                              java.lang.String value)
Convenience method equivalent to calling project.getProperties().putString(name, value).


getTransientProperties

public final java.util.Map getTransientProperties()
This method returns a Map that the caller can use to store 'transient' properties in the Project. Transient properties are not persistent, so they do not affect the dirty flag. They also have no effect on the result of calling equals(Object) and they are not copied by #copyTo(Object).

Transient properties are automatically discarded whenever the Project is closed. There are many ways to close a Project -- for example, exiting the IDE, removing the enclosing workspace, closing the project explicitly, etc. Therefore any such actions will cause the Project's transient properties to be discarded.

Clients can listen for 'project closing' and 'project closed' events by registering an Observer with the Project that filters for the UpdateMessage.OBJECT_CLOSING or UpdateMessage.OBJECT_CLOSED IDs returned by UpdateMessage.getMessageID().


getListOfChildren

public java.util.List getListOfChildren()
                                 throws TransientMarker
Fulfills the public accessor part of the Folder contract.

Returns:
a List view of the child @{link Element}s contained by this DataFolder.
Throws:
TransientMarker

setListOfChildren

public void setListOfChildren(java.util.List list)
Fulfills the public accessor part of the Folder contract. Sets the child list of the DataFolder instance to match the specified List. Only objects in the List that can be cast to Element are added. The implementation uses the DefaultFolder.add(Element) method to add the child to the list, so that subclass implementations can override DefaultFolder.add(Element) without having to also override this method.


mayHaveChildren

public boolean mayHaveChildren()
Part of the Element interface. This implementation always returns true.

Specified by:
mayHaveChildren in interface Element
Overrides:
mayHaveChildren in class Node
See Also:
Element.mayHaveChildren()

getChildren

public java.util.Iterator getChildren()
Part of the Element interface. This implementation returns an Iterator over the current list of children.

Specified by:
getChildren in interface Element
Overrides:
getChildren in class Node
See Also:
Element.getChildren()

canAdd

public boolean canAdd(Element element)
Part of the Folder interface. The default implementation returns true if and only if the specified Element is not null.

Specified by:
canAdd in interface Folder
Parameters:
element - the Element that is about to be added to this Folder.
Returns:
true if and only if the specified Element is not null.
See Also:
Folder.canAdd(Element)

add

public boolean add(Element element)
Part of the Folder interface. The specified Element is added to the end of the child list. However, if the Element is null, this method does nothing.

No notification is fired by this method.

Specified by:
add in interface Folder
See Also:
Folder.add(oracle.ide.model.Element)

canRemove

public boolean canRemove(Element element)
Part of the Folder interface. The default implementation returns true if and only if the specified Element is not null.

Specified by:
canRemove in interface Folder
Parameters:
element - the Element that is about to be removed from this Folder.
Returns:
true if and only if the specified Element is not null.
See Also:
Folder.canRemove(Element)

remove

public boolean remove(Element element)
Part of the Folder interface. The specified Element is removed from the child list. However, if the Element is null, this method does nothing. If the Element occurs more than once in the child list, then only the first instance is removed.

No notification is fired by this method.

Specified by:
remove in interface Folder
Parameters:
element - The child object to remove.
See Also:
Folder.remove(Element)

containsChild

public boolean containsChild(Element child)
Description copied from interface: Folder
Returns true if the folder contains the specified child Element; returns false otherwise.

Specified by:
containsChild in interface Folder

size

public int size()
Description copied from interface: Folder
Returns the current number of children in the folder.

Specified by:
size in interface Folder

removeAll

public void removeAll()
Description copied from interface: Folder
Removes all children from the folder.

Specified by:
removeAll in interface Folder

add

public boolean add(Element element,
                   boolean notify)

remove

public boolean remove(Element element,
                      boolean notify)

removeAll

public void removeAll(boolean notify)

getBaseDirectory

public final java.lang.String getBaseDirectory()

openImpl

protected void openImpl()
                 throws java.io.IOException
Description copied from class: DataNode
This method uses ObjectStore to unmarshal the file into a JavaBean instance. In addition, subclasses can call this method and indicate that the method should not send OBJECT_OPENED notification to observers. This method sends OBJECT_OPENED notification in an invoke later event.

Overrides:
openImpl in class DataNode
Throws:
java.io.IOException
See Also:
ObjectStore

closeImpl

protected void closeImpl()
                  throws java.io.IOException
Description copied from class: Node
Subclasses should override this method to customize the close() behavior.

Overrides:
closeImpl in class Node
Throws:
java.io.IOException - if an I/O error occurred while closing

postCloseImpl

protected void postCloseImpl()
Description copied from class: Node
This method is called after nodeClosed(..) has been called on all registered NodeListeners. It allows a Node subtype to cleanup state that needs to remain available while NodeListener are being called but should get cleaned up before close() returns.

Overrides:
postCloseImpl in class Node

update

public void update(java.lang.Object observed,
                   UpdateMessage change)
Description copied from interface: Observer
Notification message. Subjects call this method when they notify their observers that the subjects state has changed.

Specified by:
update in interface Observer
Parameters:
observed - the subject whose state has changed.
change - what has changed.

equals

public boolean equals(java.lang.Object obj)

equalsImpl

protected final boolean equalsImpl(DataContainer other)

add

public boolean add(java.util.Collection childElements,
                   boolean notify)
Adds a Collection of Element objects to the child list for the container. Each Element is added with the add(Element, boolean) method. If an Object in the Collection is not an Element or if an Element cannot be added to the container, then it is skipped and false is returned; the other Element objects in the Collection will still be added, however.


resetSubDirtyableOwners

protected void resetSubDirtyableOwners(java.util.List children)
Resets the owner of each element listed. Ownership here refers to the element that owns a SubDirtyable element. When a sub-dirtyable element is made dirty it actually makes its owner dirty.


setSubDirtyableOwner

protected void setSubDirtyableOwner(Element element,
                                    Dirtyable owner)
Sets the owner of this element to the specified element. When a sub-dirtyable object is made dirty it actually makes its owner dirty.


Extension SDK 10.1.3.36.73

 

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