Extension SDK 10.1.2

oracle.ide.model
Interface TextDocument

All Superinterfaces:
Data, Dirtyable, Displayable, Document, Element, LazyLoadable, Locatable, Subject
All Known Implementing Classes:
JavaClassNode, TextNode

public interface TextDocument
extends Document

The TextDocument extends the Document interface by providing the way for a (code) editor to access the data in this text document using a Content interface.

Since storing the document in text format (i.e., as a character array) can be twice as expensive as storing it in a byte stream format, the use of the acquired Content is reference counted. Editors which no longer need the Content object should call releaseContent() to inform the TextDocument that it no longer needs to maintain the Content object (or data in character form.)


Field Summary
 
Fields inherited from interface oracle.ide.addin.Subject
OBJECT_MODIFIED
 
Method Summary
 TextBuffer acquireTextBuffer()
          Requests the data from the Document in the format of a TextBuffer instance so that it can be used by the code editor.
 void releaseTextBuffer()
          Informs the document that the previously acquired TextBuffer instance is no longer needed.
 
Methods inherited from interface oracle.ide.model.Document
close, getInputStream, getTimestamp, isNew, isReadOnly, open, save
 
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

acquireTextBuffer

public TextBuffer acquireTextBuffer()
Requests the data from the Document in the format of a TextBuffer instance so that it can be used by the code editor. Note that the acquisition and release of TextBuffer instances are reference counted - this is to allow TextDocument implementations the freedom to drop the use of the TextBuffer instance when it is no longer needed and revert to a more "compressed" form of storage.

Returns:
the TextBuffer instance for accessing this Document in text form

releaseTextBuffer

public void releaseTextBuffer()
Informs the document that the previously acquired TextBuffer instance is no longer needed. This frees up the need for the Document to maintain the TextBuffer instance.


Extension SDK

 

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