|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
javax.ide.model.Element
javax.ide.model.Document
public class Document
The Document
interface is implemented by objects that can be saved and restored. These objects are generally persisted on some file system and are address using an unique URI
.
Documents are generally created using the DocumentFactory
. This ensures that there is always one instance of a document pointed to by the same URI
.
The specification defines following types of documents:
Project
s: containing user work,TextDocument
s: encapsulating text based files,JavaSource
s: encapsulating java files, andXMLDocument
s: encapsulating xml files.Extension writers that need to introduce custom document classes, should extend this class.
When a new document class is introduced, the DocumentFactory
must be told how to recognize the new document. Extension writers tell the document factory how to recognize newly introduced document classes in the extension deployment descriptor.
Constructor Summary | |
---|---|
Document() |
Method Summary | |
---|---|
void |
addDocumentListener(DocumentListener listener) Add a DocumentListener to the listener list. |
void |
close() Closes the Document and unloads any associated data. |
boolean |
equals(java.lang.Object other) |
ElementDisplayInfo |
getDisplayInfo() |
protected javax.ide.model.spi.ElementImpl |
getElementImpl() |
java.io.Reader |
getReader() Gets an Reader 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. |
java.net.URI |
getURI() Returns the URI that identifies this Document . |
int |
hashCode() |
boolean |
isDirty() True if the data in the object has been modified. |
boolean |
isNew() Returns true if the document'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 document's data has never been saved. |
void |
markDirty(boolean dirty) Marks the data with the specified dirty state. |
void |
open() Opens the Document and loads any associated data into the appropriate data structures. |
void |
removeDocumentListener(DocumentListener listener) Removes a DocumentListener from the listener list. |
void |
save() Saves the contents of the document. |
protected void |
setDisplayInfo(ElementDisplayInfo displayInfo) Set the display info for this element. |
void |
setURI(java.net.URI uri) Sets the URI associated with this Document . |
Methods inherited from class javax.ide.model.Element |
---|
getIcon, getLabel, getLongLabel, getToolTip |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Document()
Method Detail |
---|
protected final javax.ide.model.spi.ElementImpl getElementImpl()
getElementImpl
in class Element
protected final void setDisplayInfo(ElementDisplayInfo displayInfo)
displayInfo
- the display info for this document. If null, the IDE will display this element in whatever the default way is standard for elements of this type.public ElementDisplayInfo getDisplayInfo()
public final java.net.URI getURI()
URI
that identifies this Document
. Parts of the IDE will use the value of this URI
as a hash key for caching UI components for this Document
. Therefore, URI
uniqueness is important.URI
identifying this Document
.public final void setURI(java.net.URI uri)
URI
associated with this Document
. It is important that the URI
only be changed when the Document
has just been created or when all caches keyed on the previous URI
can also be updated.uri
- The URI
to set.public final boolean isOpen()
true
if the object's data has already been loaded.public final boolean isNew()
true
if the document's data has never been saved.public final void open() throws java.io.IOException
Document
and loads any associated data into the appropriate data structures. This method notifies listeners if the document is successfully opened.java.io.IOException
- if the document cannot be opened.public final void close() throws java.io.IOException
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.java.io.IOException
- if the document cannot be closed.public final void save() throws java.io.IOException
java.io.IOException
public final boolean isReadOnly()
true
if the document's data has never been saved.true
if the document's data has never been saved.public final boolean isDirty()
true
if the data in the object has been modified.public final void markDirty(boolean dirty)
dirty
- If true
, sets the object as being dirty; if false
, sets the object as being up-to-date.public final long getTimestamp()
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.Document
's time stamp.public final java.io.Reader getReader() throws java.io.IOException
Reader
that can be used to read the contents of this object.Reader
, or null
if the document has no contents.java.io.IOException
- if a security manager exists and its checkRead
method denies read access.public final void addDocumentListener(DocumentListener listener)
DocumentListener
to the listener list. A DocumentEvent
will be fired in response modifying the contents of this document.public final void removeDocumentListener(DocumentListener listener)
DocumentListener
from the listener list.public final int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |