|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectoracle.ide.model.Node
The Node class is the base class for all document types
that need to interact with the IDE framework.
| Constructor Summary | |
Node()
Default constructor. |
|
Node(java.net.URL url)
Constructor that takes an URL pointing to the persistent
location of the Node's contents. |
|
| Method Summary | |
protected ReadWriteLock |
_getReadWriteLockInternal()
Fetch the lock instance used for Node state and data synchronization. |
void |
addNodeListener(NodeListener listener)
Adds the specified NodeListener to this Node instance. |
static void |
addNodeListenerForType(java.lang.Class type,
NodeListener listener)
Statically registers the specified NodeListener to be
called back for node events for the specified node type. |
static void |
addNodeListenerForTypeHierarchy(java.lang.Class type,
NodeListener listener)
Statically registeres the specified NodeListener to be called
back for node events for the specified node type and its subtypes.
|
void |
attach(Observer observer)
Registers an observer interested in being notified when the internal state of the class implementing the Subject interface
changes.
|
void |
close()
Closes the Node and unloads any associated data.
|
protected void |
closeImpl()
Subclasses should override this method to customize the close() behavior. |
protected Subject |
createSubject()
Creates an instance of a Subject implementation. |
void |
delete()
This method closes the current node (if open), deletes the Node from disk, and removes this Node from the NodeFactory's cache. |
protected void |
deleteImpl()
Subclasses should override this method to customize the delte() behavior. |
void |
detach(Observer observer)
Unregisters an observer that is not interested anymore in being notified when the internal state of the class implementing the Subject
interface changes.
|
boolean |
ensureOpen()
Call this method to make sure that the Node is properly opened before accessing its data. |
protected boolean |
equalsImpl(Node node)
This is a helper method for )that can
also be used by subclasses that implement).
|
Attributes |
getAttributes()
This method returns an Attributes object that encodes the
attributes of the Element. |
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.Object |
getData()
Returns the data object associated with this Element.
|
javax.swing.Icon |
getIcon()
Displayable interface method. |
java.io.InputStream |
getInputStream()
Gets an InputStream that can be used to read the contents
of the Node. |
java.lang.String |
getLongLabel()
Displayable interface method. |
java.lang.String |
getShortLabel()
Displayable interface method. |
protected Subject |
getSubject()
Gets the implementation of the Subject interface. |
long |
getTimestamp()
Returns the timestamp associated with the Node,
which indicates the time at which the Node was last modified.
|
java.lang.String |
getToolTipText()
Displayable interface method. |
java.net.URL |
getURL()
Returns the URL that identifies this
Locatable. |
boolean |
isDirty()
|
boolean |
isNew()
Returns true if the Node's data has never been saved. |
boolean |
isOpen()
Returns true if the object's data has already been
loaded. |
boolean |
isReadOnly()
Returns true if the Node is read-only. |
protected boolean |
isTrackedInNodeCache()
The return value of this method indicates whether this Node should be tracked by the NodeFactory cache. |
void |
markDirty(boolean dirty)
|
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. |
void |
notifyObservers(java.lang.Object observed,
UpdateMessage change)
Notifies all observers that the state of the subject has changed. |
void |
open()
Opens the Node and loads any associated data
into the appropriate data structures. |
protected void |
openImpl()
Subclasses should override this method to customize the open() behavior. |
protected void |
postCloseImpl()
This method is called after nodeClosed(..) has been called on all registered NodeListeners. |
protected long |
refreshTimestamp()
Protected method that can be used to refresh the timestamp of the Node based on the timestamp that can be obtained
through the URL. |
void |
removeNodeListener(NodeListener listener)
Removes the specified NodeListener from this Node instance. |
static void |
removeNodeListenerForType(java.lang.Class type,
NodeListener listener)
Unregisters a listener that had been registered via addNodeListenerForType(Class,NodeListener). |
static void |
removeNodeListenerForTypeHierarchy(java.lang.Class type,
NodeListener listener)
Unregisters a listener that had been registered via addNodeListenerForTypeHierarchy(Class,NodeListener). |
Node |
rename(java.net.URL newURL)
This method renames the current node and recaches this Node under its new URL in the NodeFactory. |
protected void |
renameImpl(java.net.URL oldURL,
java.net.URL newURL)
Subclasses should override this method to customize the rename() behavior. |
protected void |
reportOpenException(java.lang.Exception e)
This routine is given a chance to handle or report an Exception that occurred during open(). |
void |
revert()
|
protected void |
revertImpl()
Subclasses should override this method to customize the revert() behavior. |
protected void |
runWhileSynchronized(java.lang.Runnable runnable)
Executes the specified runnable implementation while under the Node's exclusive locking protection. |
void |
save()
Saves the contents of the Node. |
protected void |
saveImpl()
Subclasses should override this method to customize the save() behavior. |
protected void |
setOpen(boolean isOpen)
Protected accessor for the #_isOpenflag. |
protected void |
setTimestampDirectly(long timestamp)
Accessor for allowing subclasses to set the timestamp directly. |
void |
setURL(java.net.URL newURL)
Sets the URL associated with this Node and
recaches the Node in the NodeFactory with
the new URL so that subsequent queries for the
Node will return successfully. |
java.lang.String |
toString()
Returns the Short Label displayed to a user. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Node()
public Node(java.net.URL url)
URL pointing to the persistent
location of the Node's contents.
url - URL identifying the persistent location of
the Node.| Method Detail |
public static final void addNodeListenerForType(java.lang.Class type,
NodeListener listener)
NodeListener to be
called back for node events for the specified node type. Only
events for the exact type will be delivered. To receive
events for all types and subtypes, use
addNodeListenerForTypeHierarchy(Class,NodeListener)
type - the exact Node type whose events should be delivered
to the listenerlistener - the NodeListener to register
public static final void removeNodeListenerForType(java.lang.Class type,
NodeListener listener)
addNodeListenerForType(Class,NodeListener).
type - the Node type for which the listener had been registeredlistener - the NodeListener to unregister
public static final void addNodeListenerForTypeHierarchy(java.lang.Class type,
NodeListener listener)
NodeListener to be called
back for node events for the specified node type and its subtypes.
To receive events instead for a specific node type and not its
subtypes, use addNodeListenerForType(Class,NodeListener).
type - the Node type (and its subtypes) whose events should be
delivered to the listenerlistener - the NodeListener to register
public static final void removeNodeListenerForTypeHierarchy(java.lang.Class type,
NodeListener listener)
addNodeListenerForTypeHierarchy(Class,NodeListener).
type - the Node type for which the listener had been registeredlistener - the NodeListener to unregisterpublic final void addNodeListener(NodeListener listener)
listener - the listener to addpublic final void removeNodeListener(NodeListener listener)
listener - the listener to removepublic java.net.URL getURL()
LocatableURL that identifies this
Locatable. Parts of the IDE will use the value of
this URL as a hash key for caching UI components for this
Locatable. Therefore, URL uniqueness is
important.
getURL in interface LocatableURL identifying this Locatable.public void setURL(java.net.URL newURL)
URL associated with this Node and
recaches the Node in the NodeFactory with
the new URL so that subsequent queries for the
Node will return successfully.
setURL in interface LocatablenewURL - The URL to set.Locatable.setURL(URL)protected boolean isTrackedInNodeCache()
true. Node types that should not
be tracked by the NodeFactory cache should override this method
to return false.
true if this Node should be tracked by the
IDE's NodeFactory cache; false otherwise.public boolean isDirty()
isDirty in interface oracle.javatools.data.Dirtyablepublic void markDirty(boolean dirty)
markDirty in interface oracle.javatools.data.Dirtyablepublic java.lang.String getShortLabel()
Displayable interface method. The Node class returns
the file name part of the currently set URL. If the
currently set URL is null, then this method
returns "<null>".
getShortLabel in interface DisplayableDisplayable
that can be shown to the user.public java.lang.String getLongLabel()
Displayable interface method. The Node class returns
the path name part of the currently set URL. If the
currently set URL is null, then this method
returns "<null>".
getLongLabel in interface DisplayableDisplayable that
can be shown to the user.public javax.swing.Icon getIcon()
Displayable interface method. The Node class returns
a generic icon.
getIcon in interface DisplayableIcon to be displayed for the
Displayable.public java.lang.String getToolTipText()
Displayable interface method. The Node class returns
returns the String form of the currently set URL.
getToolTipText in interface DisplayableDisplayable.public final void attach(Observer observer)
SubjectSubject interface
changes.
Implementors should do nothing when the same observer is added more
than once.
attach in interface Subjectobserver - the Observer interested in change notification
messages.public final void detach(Observer observer)
SubjectSubject
interface changes.
Implementors should do nothing when the same observer is removed more
than once.
detach in interface Subjectobserver - the Observer disinterested in change
notification messages.
public void notifyObservers(java.lang.Object observed,
UpdateMessage change)
Subject
notifyObservers in interface Subjectobserved - the subject whose state has changed.change - what changed.protected final Subject getSubject()
Subject interface. This
implementation returns an IdeSubject but subclasses should
override the createSubject method in order to provide
a different implementation of a Subject.
protected Subject createSubject()
Subject implementation. This method
is called from getSubject() the first time the subject
is created. Subclasses should override this method to provide their
own Subject implementation.
public java.lang.Object getData()
ElementElement.
Implementations will often simply return this, since
the Element is often its own data object.
getData in interface ElementElement
instance.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 Elementtrue if this Element may contain
child Elements.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 ElementIterator over any child Elements
contained by this Element. If there are no children,
null is returned.public Attributes getAttributes()
ElementAttributes object that encodes the
attributes of the Element. Changing the attribute
settings on the return object changes the element attributes.
Subclasses should use their super class attributes object to
define their own attributes. This allows subclasses to
inherit their super class attributes. If a subclass does not
wish to inherit attributes, they should first call
getAttributes().clear() and define new attributes.
getAttributes in interface Element
public final void open()
throws java.io.IOException
Node and loads any associated data
into the appropriate data structures. If the implementation
of this method completes successfully, the isOpen()
method should then return true.
In addition, this method should fire an
oracle.ide.addin.UpdateMessage#OBJECT_OPENED update
message when the node is opened.
java.io.IOException - Signals that an I/O exception occurred
while trying to open this Node.
public final void close()
throws java.io.IOException
Node and unloads any associated data.
When this method returns, the state of the Node
object should be equivalent to when the Node
object has just been instantiated but not yet opened.
Implementations of the close method should not fire object closing update messages. The IDE takes care of firing those events when Nodes are closed.
java.io.IOException - Signals that an I/O exception occurred
while trying to close this Node.
public final void save()
throws java.io.IOException
java.io.IOException - Signals that an I/O exception of some sort
occurred.
public final void revert()
throws java.io.IOException
java.io.IOException
public final void delete()
throws java.io.IOException
java.io.IOException
public final Node rename(java.net.URL newURL)
throws java.io.IOException
java.io.IOExceptionpublic boolean isOpen()
LazyLoadabletrue if the object's data has already been
loaded.
isOpen in interface LazyLoadablepublic boolean isReadOnly()
true if the Node is read-only.
public long getTimestamp()
Node,
which indicates the time at which the Node was last modified.
The returned long is expressed in milliseconds since
00:00:00 GMT Jan 1, 1970.
Node's time stamp.
public java.io.InputStream getInputStream()
throws java.io.IOException
InputStream that can be used to read the contents
of the Node.
InputStream, or null if the
document has no contents.
java.net.UnknownServiceException - if the
URL's protocol does not support input.
java.io.IOException - if an I/O error occurs when trying to open
the InputStream.
java.lang.SecurityException - if a security manager exists and its
checkRead method denies read access.public final boolean isNew()
true if the Node's data has never been saved.
public java.lang.String toString()
DisplayabletoString method in java.lang.Object.
Implementors of the Displayable interface should
override this as appropriate. The default implementation is
the same as getShortLabel
toString in interface Displayableprotected final void runWhileSynchronized(java.lang.Runnable runnable)
runnable - the runnable to execute while locked with the
Node's lockingprotected final ReadWriteLock _getReadWriteLockInternal()
protected void openImpl()
throws java.io.IOException
java.io.IOException - if an I/O error occurred while opening
protected void closeImpl()
throws java.io.IOException
java.io.IOException - if an I/O error occurred while closingprotected void postCloseImpl()
protected void saveImpl()
throws java.io.IOException
java.io.IOException - if an I/O error occurred while saving
protected void revertImpl()
throws java.io.IOException
java.io.IOException - if an I/O error occurred while reverting
protected void deleteImpl()
throws java.io.IOException
java.io.IOException - if an I/O error occurred while deleting
protected void renameImpl(java.net.URL oldURL,
java.net.URL newURL)
throws java.io.IOException
java.io.IOException - if an I/O error occurred while renamingprotected final boolean equalsImpl(Node node)
)that can
also be used by subclasses that implement).
It assumes that the argument is not null.
node -
protected final void setOpen(boolean isOpen)
#_isOpenflag. This method
must remain protected in order to avoid being picked
up by theIntrospectoras a
read/writeable JavaBean property.
isOpen - protected final long refreshTimestamp()
Node based on the timestamp that can be obtained
through the URL.
protected final void setTimestampDirectly(long timestamp)
public final boolean ensureOpen()
open().protected void reportOpenException(java.lang.Exception e)
|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Copyright © 1997, 2005, Oracle.All rights reserved.