|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.model.DefaultDisplayable oracle.ide.model.DefaultElement oracle.ide.model.DefaultDocument oracle.ide.model.DefaultNode oracle.ide.model.PropertiesNode oracle.ide.model.PropertiesContainer
This is a complete implementation of the Container
interface
that uses a single HashMap
to hold all of its data and an
ArrayList
to hold its children. PropertiesContainer
takes care of marshalling the data and the children to XML and
unmarshalling them from XML back into their respective HashMap
and ArrayList
. Unmarshalling (loading) and marshalling
(saving) are done only on-demand. Access to the properties occurs
through the PropertyAccess
interface. Access
to the children occurs through the Container
interface.
This class serves primarily as an example of how a Container
implementation can interact with Object2Dom
to produce
marshalling behavior that differs from the approach taken by
XMLDataContainer
. The XMLDataContainer
class is the
main Container
class that is responsible for XML marshalling
in the Oracle IDE framework and in JDeveloper.
Field Summary |
Fields inherited from interface oracle.ide.addin.Subject |
OBJECT_MODIFIED |
Fields inherited from interface oracle.ide.model.Category |
UNDEFINED |
Constructor Summary | |
protected |
PropertiesContainer()
|
protected |
PropertiesContainer(java.net.URL url)
|
Method Summary | |
boolean |
add(Element element)
Appends a child Element to the end of the
Folder . |
boolean |
add(Element element,
boolean notifyObservers)
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. |
boolean |
canAdd(Element element)
Other classes can call this method to determine whether the given Element can be added to the Folder . |
boolean |
canRemove(Element element)
Other classes can call this method to determine whether the specified Element can be removed from this
Folder . |
void |
close()
Closes the Document and unloads any associated data. |
boolean |
containsChild(Element child)
Returns true if the folder contains the
specified child Element ; returns false
otherwise. |
java.util.Iterator |
getChildren()
This method is part of the Element interface to
provide a convenient way of getting an Iterator over any
contained child Element s without having to test the
object's type with the instanceof operator or having
to downcast to a more specific type. |
java.lang.String |
getShortLabel()
Returns a short label that can be displayed to the user. |
protected java.lang.String |
getXMLRootElementName()
|
boolean |
hasChild(Element element)
|
boolean |
mayHaveChildren()
This method is part of the Element interface to
provide a convenient way of determining whether an object may
have children without having to test the object's type with the
instanceof operator or having to downcast to a
more specific type. |
boolean |
remove(Element element)
Removes the specified child Element . |
boolean |
remove(Element element,
boolean notifyObservers)
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. |
void |
removeAll()
Removes all children from the folder. |
void |
removeAll(boolean notifyObservers)
Removes all elements in the Container . |
void |
reopen()
Overrides PropertiesNode.reopen() . |
void |
save(boolean shallow)
Saves the contents of the document. |
int |
size()
Returns the current number of children in the folder. |
Methods inherited from class oracle.ide.model.PropertiesNode |
getProperties, getProperty, open, removeProperty, setProperties, setProperty |
Methods inherited from class oracle.ide.model.DefaultNode |
equalsImpl, getCategory, setURL |
Methods inherited from class oracle.ide.model.DefaultDocument |
attach, copyToImpl, createSubject, detach, ensureOpen, equalsImpl, getInputStream, getLongLabel, getSubject, getTimestamp, getTimestampDirectly, getToolTipText, getURL, isDirty, isNew, isOpen, isReadOnly, markDirty, notifyObservers, refreshTimestamp, setOpen, setTimestampDirectly, setURLDirectly |
Methods inherited from class oracle.ide.model.DefaultElement |
getAttributes, getData |
Methods inherited from class oracle.ide.model.DefaultDisplayable |
getIcon, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.ide.model.Document |
getInputStream, getTimestamp, isNew, isReadOnly, open |
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 |
getIcon, getLongLabel, getToolTipText, toString |
Methods inherited from interface oracle.ide.addin.Subject |
attach, detach, notifyObservers |
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 |
protected PropertiesContainer(java.net.URL url)
protected PropertiesContainer()
Method Detail |
public java.lang.String getShortLabel()
Displayable
String
is considered
translatable and should therefore be placed in an appropriate
resource file. When possible, the returned label should be
reasonably short enough to show in the navigator or explorer
windows but long enough to clearly identify and distinguish the
Displayable
.
getShortLabel
in interface Displayable
getShortLabel
in class DefaultDocument
Displayable.getShortLabel()
public boolean mayHaveChildren()
Element
Element
interface to
provide a convenient way of determining whether an object may
have children without having to test the object's type with the
instanceof
operator or having to downcast to a
more specific type.
An implementation of Element
that represents a leaf
in a tree structure should return false
from this
method. An implementation of Element
that could
represent a non-leaf in a tree structure should return
true
from this method, even if it does not currently
contain any children.
mayHaveChildren
in interface Element
mayHaveChildren
in class DefaultElement
Element.mayHaveChildren()
public java.util.Iterator getChildren()
Element
Element
interface to
provide a convenient way of getting an Iterator
over any
contained child Element
s without having to test the
object's type with the instanceof
operator or having
to downcast to a more specific type.
An implementation of Element
that represents a leaf
in a tree structure should return null
from this
method. An implementation of Element
that could
represent a non-leaf in a tree structure should return either an
Iterator
over the child Element
s or
null
if there are no children.
getChildren
in interface Element
getChildren
in class DefaultElement
Element.getChildren()
public boolean canAdd(Element element)
Folder
Element
can be added to the Folder
.
canAdd
in interface Folder
element
- the Element
that is about to be added
to this Folder
.
true
if the specified Element
can be
added to this Folder
; false
if the
Element
cannot be added.public boolean add(Element element)
Folder
Element
to the end of the
Folder
.
add
in interface Folder
public boolean canRemove(Element element)
Folder
Element
can be removed from this
Folder
.
canRemove
in interface Folder
element
- the Element
that is about to be removed
from this Folder
.
true
if the specified Element
can be
removed from this Folder
; false
if the
Element
cannot be removed.public boolean remove(Element element)
Folder
Element
. If the child object
appears more than once, only the first instance is removed.
remove
in interface Folder
element
- The child object to remove.public int size()
Folder
size
in interface Folder
public boolean containsChild(Element child)
Folder
true
if the folder contains the
specified child Element
; returns false
otherwise.
containsChild
in interface Folder
public void removeAll()
Folder
removeAll
in interface Folder
public boolean add(Element element, boolean notifyObservers)
Container
Folder.add(Element)
method
that accepts an additional flag that indicates whether or not
notifications of the change should be sent to registered observers.
add
in interface Container
element
- The Element
to be added to this
Container
.notifyObservers
- If true
, any observers are notified
of the change. If false
, no notification is sent.public boolean remove(Element element, boolean notifyObservers)
Container
Folder.remove(Element)
method
that accepts an additional flag that indiciates whether or not
notifications of the change should be sent to registered observers.
remove
in interface Container
element
- The Element
to be removed from this
Container
.notifyObservers
- If true
, any observers are notified
of the change. If false
, no notification is sent.public void removeAll(boolean notifyObservers)
Container
Container
. The
notify
flag indicates whether observers should be
notified of the change.
removeAll
in interface Container
notifyObservers
- If true
, any observers are notified
of the change. If false
, no notification is sent.public void save(boolean shallow)
Document
save
in interface Document
save
in class PropertiesNode
public void close()
Document
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.
close
in interface Document
close
in class PropertiesNode
public void reopen()
PropertiesNode.reopen()
. This therefore also
affects the behavior of PropertiesNode.open()
.
reopen
in class PropertiesNode
protected java.lang.String getXMLRootElementName()
getXMLRootElementName
in class PropertiesNode
public boolean hasChild(Element element)
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.