Extension SDK 10.1.2

oracle.ide.model
Interface Document

All Superinterfaces:
Data, Dirtyable, Displayable, Element, LazyLoadable, Locatable, Subject
All Known Subinterfaces:
Container, JavaNode, Layout, Node, TextDocument, WorkEnvironment
All Known Implementing Classes:
BaseLayout, ConnectionNode, DataContainer, DefaultContainer, DefaultDocument, DefaultNode, JavaClassNode, JavaSourceNode, PropertiesContainer, TextNode, XMLDataContainer

public interface Document
extends Locatable, Element, Subject, Dirtyable, LazyLoadable

The Document interface is implemented by objects which have a persistent representation. Note: each Document must properly implement the Locatable interface and return a valid URL


Field Summary
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Method Summary
 void close()
          Closes the Document and unloads any associated data.
 java.io.InputStream getInputStream()
          Gets an InputStream that can be used to read the contents of this object.
 long getTimestamp()
          Returns the timestamp associated with the Document, which indicates the time at which the document was last modified.
 boolean isNew()
          Returns true if the document's data has never been saved.
 boolean isReadOnly()
          Returns true if the document is read-only.
 void open()
          Opens the Document and loads any associated data into the appropriate data structures.
 void save(boolean shallow)
          Saves the contents of the document.
 
Methods inherited from interface oracle.ide.model.Locatable
getURL, setURL
 
Methods inherited from interface oracle.ide.model.Element
getAttributes, getChildren, mayHaveChildren
 
Methods inherited from interface oracle.ide.model.Data
getData
 
Methods inherited from interface oracle.ide.model.Displayable
getIcon, getLongLabel, getShortLabel, 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
 

Method Detail

open

public void open()
          throws java.io.IOException
Opens the Document and loads any associated data into the appropriate data structures. If the implementation of this method completes successfully, the LazyLoadable.isOpen() method should then return true.

Throws:
java.io.IOException - Signals that an I/O exception of some sort occurred.

close

public void close()
           throws java.io.IOException
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.

Throws:
java.io.IOException - Signals that an I/O exception of some sort occurred.

save

public void save(boolean shallow)
          throws java.io.IOException
Saves the contents of the document.

Parameters:
shallow - The value of this parameter only matters if the Document is also a Container. If shallow is true, children should not be saved; if shallow is false, children should also be saved.
Throws:
java.io.IOException - Signals that an I/O exception of some sort occurred.

isNew

public boolean isNew()
Returns true if the document's data has never been saved.

Returns:
true if the document's data has never been saved.

isReadOnly

public boolean isReadOnly()
Returns true if the document is read-only.

Returns:
true if the document is a read-only document.

getTimestamp

public long getTimestamp()
Returns the timestamp associated with the Document, which indicates the time at which the document was last modified. The returned long is expressed in milliseconds since 00:00:00 GMT Jan 1, 1970.

Returns:
the Document's time stamp.

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Gets an InputStream that can be used to read the contents of this object.

Returns:
an InputStream, or null if the document has no contents.
Throws:
java.io.IOException - if a security manager exists and its checkRead method denies read access.

Extension SDK

 

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