|
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.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 Elements 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 |
| 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()
DisplayableString 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 DisplayablegetShortLabel in class DefaultDocumentDisplayable.getShortLabel()public boolean mayHaveChildren()
ElementElement 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 ElementmayHaveChildren in class DefaultElementElement.mayHaveChildren()public java.util.Iterator getChildren()
ElementElement interface to
provide a convenient way of getting an Iterator over any
contained child Elements 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 Elements or
null if there are no children.
getChildren in interface ElementgetChildren in class DefaultElementElement.getChildren()public boolean canAdd(Element element)
FolderElement can be added to the Folder.
canAdd in interface Folderelement - 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)
FolderElement to the end of the
Folder.
add in interface Folderpublic boolean canRemove(Element element)
FolderElement can be removed from this
Folder.
canRemove in interface Folderelement - 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)
FolderElement. If the child object
appears more than once, only the first instance is removed.
remove in interface Folderelement - The child object to remove.public int size()
Folder
size in interface Folderpublic boolean containsChild(Element child)
Foldertrue if the folder contains the
specified child Element; returns false
otherwise.
containsChild in interface Folderpublic void removeAll()
Folder
removeAll in interface Folder
public boolean add(Element element,
boolean notifyObservers)
ContainerFolder.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 Containerelement - 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)
ContainerFolder.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 Containerelement - 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)
ContainerContainer. The
notify flag indicates whether observers should be
notified of the change.
removeAll in interface ContainernotifyObservers - If true, any observers are notified
of the change. If false, no notification is sent.public void save(boolean shallow)
Document
save in interface Documentsave in class PropertiesNodepublic 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 PropertiesNodepublic void reopen()
PropertiesNode.reopen(). This therefore also
affects the behavior of PropertiesNode.open().
reopen in class PropertiesNodeprotected java.lang.String getXMLRootElementName()
getXMLRootElementName in class PropertiesNodepublic boolean hasChild(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.