|
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
oracle.ide.model.TextNode
The TextNode class extends Nodeand should
be used for all objects that can be opened as a text file inside a
code editor.
| Constructor Summary | |
TextNode()
|
|
TextNode(java.net.URL url)
|
|
| 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. |
protected void |
closeImpl()
Subclasses should override this method to customize the close() behavior. |
protected java.io.OutputStreamWriter |
createOutputStreamWriter(java.io.OutputStream outStream)
|
protected java.io.Reader |
createReader(java.net.URL url)
Fetch a Reader for reading the contents of this node from the given URL. |
protected void |
dataExpired()
Cleanup any meta data based on the underlying TextBuffer. |
java.io.InputStream |
getInputStream()
Deprecated. |
java.io.InputStream |
getInputStream(boolean warn)
Deprecated. |
java.lang.String |
getLoadEncoding()
Returns a Java supported encoding name to use to create the InputStreamReader for reading data from the URL into the TextBuffer (called from revert()). |
java.io.Reader |
getReader()
Fetch a Reader for accessing the buffer contents of this TextNode. |
java.lang.String |
getSaveEncoding()
Returns a Java supported encoding name to use to create the OutputStreamWriter for writing the TextBuffer to a file (called from save()). |
protected TextBuffer |
getTextBufferDirectly()
Directly gets the TextBuffer. |
boolean |
hasEmptyTextBuffer()
Checks whether the TextBuffer for this TextNode is empty (zero-length). |
boolean |
isDirty()
First checks if the superclass has its dirty flag set; if so, returns true. |
boolean |
isReadOnly()
Part of Node interface. |
void |
markDirty(boolean dirty)
Two things happen: The superclass markDirty(dirty) method is
called.
|
protected void |
openImpl()
Subclasses should override this method to customize the open() behavior. |
void |
releaseTextBuffer()
Informs the document that the previously acquired TextBuffer instance is no longer needed. |
void |
removeTextBufferListener(TextBufferListener listener)
Informs the TextBuffer that the given listener no longer needs to track it. |
protected void |
reportOpenException(java.lang.Exception e)
This routine is given a chance to handle or report an Exception that occurred during open(). |
protected void |
revertImpl()
Subclasses should override this method to customize the revert() behavior. |
protected void |
saveImpl()
Subclasses should override this method to customize the save() behavior. |
protected void |
setDefaultLineTerminator(TextBuffer textBuffer)
Sets up the default line terminator to use for the text buffer. |
void |
setLoadEncoding(java.lang.String loadEncoding)
Sets a Java supported encoding name to use to create the InputStreamReader for reading data from the URL into the TextBuffer (called from revert()). |
boolean |
setReadOnly(boolean readOnly)
Sets the read-only status of URL for this TextNode. |
void |
setSaveEncoding(java.lang.String saveEncoding)
Sets a Java supported encoding name to use to create the OutputStreamWriter for writing the TextBuffer to a file (called from save()). |
protected void |
updateReadOnlyFlag(boolean readOnly)
In general, this method should only be used by the TextNode class itself or any subclasses that need to
override TextNode behavior. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TextNode()
public TextNode(java.net.URL url)
| Method Detail |
public boolean isDirty()
true. Otherwise, the determination of
the dirty state is delegated to the underlying TextBuffer
implementation. If the current TextBuffer is
null, false is returned.
isDirty in interface oracle.javatools.data.DirtyableisDirty in class Nodepublic void markDirty(boolean dirty)
markDirty(dirty) method is
called.
dirty parameter is false,
the modified state of the underlying TextBuffer is
cleared.
markDirty in interface oracle.javatools.data.DirtyablemarkDirty in class Node
protected void openImpl()
throws java.io.IOException
Node
openImpl in class Nodejava.io.IOException - if an I/O error occurred while openingprotected void reportOpenException(java.lang.Exception e)
reportOpenException in class Node
protected void closeImpl()
throws java.io.IOException
Node
closeImpl in class Nodejava.io.IOException - if an I/O error occurred while closing
protected void saveImpl()
throws java.io.IOException
Node
saveImpl in class Nodejava.io.IOException - if an I/O error occurred while saving
protected void revertImpl()
throws java.io.IOException
Node
revertImpl in class Nodejava.io.IOException - if an I/O error occurred while revertingprotected void setDefaultLineTerminator(TextBuffer textBuffer)
textBuffer - the text buffer that backs up the contents
of this node
protected java.io.OutputStreamWriter createOutputStreamWriter(java.io.OutputStream outStream)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic boolean setReadOnly(boolean readOnly)
TextBuffer
instance appropriately. The return value indicates whether or not
the setting of the read-only flag succeeded.
readOnly - true to make the resource indicated by the
URL as read-only
public boolean isReadOnly()
Node interface. This implementation delegates
to the URLFileSystem to determine whether or not this
document is read-only. We override this here in order to force the underlying buffer to be read only.
isReadOnly in class NodeNode.isReadOnly()
public java.io.InputStream getInputStream()
throws java.io.IOException
Returns an InputStream that's backed by the current
TextBuffer.
getInputStream in class NodeInputStream, or null if the
document has no contents.
java.lang.IllegalStateException - if the current
TextBuffer is null.
java.io.IOException - if an I/O error occurs when trying to open
the InputStream.
public java.io.InputStream getInputStream(boolean warn)
throws java.io.IOException
Returns an InputStream that's backed by the current
TextBuffer.
java.lang.IllegalStateException - if the current
TextBuffer is null.
java.io.IOExceptionpublic final TextBuffer acquireTextBuffer()
public final void releaseTextBuffer()
protected TextBuffer getTextBufferDirectly()
TextBuffer. This method is primarily
intended for subclass customization of TextNode.
public void removeTextBufferListener(TextBufferListener listener)
listener - the text buffer listenerpublic void setLoadEncoding(java.lang.String loadEncoding)
getLoadEncoding() with a different encoding
determined from the TextBuffer data
loadEncoding - a Java supported encoding name for readingpublic void setSaveEncoding(java.lang.String saveEncoding)
getSaveEncoding()
with a different encoding determined from the TextBuffer data
saveEncoding - a Java supported encoding name for writingprotected void dataExpired()
public java.io.Reader getReader()
throws java.io.IOException
java.io.IOExceptionpublic boolean hasEmptyTextBuffer()
protected void updateReadOnlyFlag(boolean readOnly)
TextNode class itself or any subclasses that need to
override TextNode behavior.
This method modifies the read-only flag of the underlying TextBuffer.
public java.lang.String getLoadEncoding()
public java.lang.String getSaveEncoding()
protected java.io.Reader createReader(java.net.URL url)
throws java.io.IOException
url - the URL to fetch a Reader for
java.io.IOException
|
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.