oracle.ide.model
Class DataContainer
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
- All Implemented Interfaces:
- Category, Container, Data, Dirtyable, Displayable, Document, Element, Folder, LazyLoadable, Locatable, Node, Subject
- Direct Known Subclasses:
- IdeSystem, MiscellaneousFolder, Project, Workspace
- public class DataContainer
- extends DataNode
- implements Container
Field Summary |
protected java.util.List |
_children
The "final " modifier makes it possible to synchronize
on the _children object, since its value can never
change. |
Methods inherited from class oracle.ide.model.DefaultDocument |
attach, copyToImpl, createSubject, detach, ensureOpen, equalsImpl, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampDirectly, getToolTipText, isDirty, isNew, isOpen, isReadOnly, markDirty, notifyObservers, refreshTimestamp, setOpen, setTimestampDirectly |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.ide.model.Data |
getData |
_children
protected final java.util.List _children
- The "
final
" modifier makes it possible to synchronize
on the _children
object, since its value can never
change.
DataContainer
public DataContainer()
- Default constructor. Required for JavaBean status.
DataContainer
public DataContainer(java.net.URL url)
getListOfChildren
public java.util.List getListOfChildren()
- Fulfills the public accessor part of the
Folder
contract.
- Returns:
- a
List
view of the child @{link Element}s contained
by this DataFolder
.
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 DefaultElement
- 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 DefaultElement
- 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
- 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
- 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
- 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)
- Description copied from interface:
Container
- This is a variant of the
Folder.add(Element)
method
that accepts an additional flag that indicates whether or not
notifications of the change should be sent to registered observers.
- Specified by:
add
in interface Container
- Following copied from interface:
oracle.ide.model.Container
- Parameters:
element
- The Element
to be added to this
Container
.notify
- If true
, any observers are notified
of the change. If false
, no notification is sent.
remove
public boolean remove(Element element,
boolean notify)
- Description copied from interface:
Container
- This is a variant of the
Folder.remove(Element)
method
that accepts an additional flag that indiciates whether or not
notifications of the change should be sent to registered observers.
- Specified by:
remove
in interface Container
- Following copied from interface:
oracle.ide.model.Container
- Parameters:
element
- The Element
to be removed from this
Container
.notify
- If true
, any observers are notified
of the change. If false
, no notification is sent.
removeAll
public void removeAll(boolean notify)
- Description copied from interface:
Container
- Removes all elements in the
Container
. The
notify
flag indicates whether observers should be
notified of the change.
- Specified by:
removeAll
in interface Container
- Following copied from interface:
oracle.ide.model.Container
- Parameters:
notify
- If true
, any observers are notified
of the change. If false
, no notification is sent.
getBaseDirectory
public final java.lang.String getBaseDirectory()
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 DataNode
- Following copied from class:
oracle.ide.model.DefaultDocument
- See Also:
Document.close()
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.
copyToImpl
protected final void copyToImpl(DataContainer copy)
- Design pattern for supporting strongly typed copying.
This method is intended to be helper method that subclasses can use,
if they implement the Copyable
interface.
The copy of the children list is a shallow copy. That is, the
children themselves are not copied, but the list is copied.
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.