public abstract class TextFileModelAdapter extends FileModelAdapter
ModelAdapter adapter which adapts a text file node.
 When the node is open, this adapter tracks changes to the text buffer associated with the node and maps offsets across edits to the node. When the node is opened, this adapter attaches an observer to the text buffer.
ModelAdapter| Constructor and Description | 
|---|
| TextFileModelAdapter(ModelFactory factory,
                    ModelType type,
                    ContainerModelAdapter workspace,
                    ContainerModelAdapter project,
                    ContainerModelAdapter directory,
                    Node node,
                    java.net.URL url) | 
| TextFileModelAdapter(ModelFactory factory,
                    ModelType type,
                    ContainerModelAdapter workspace,
                    ContainerModelAdapter project,
                    ContainerModelAdapter directory,
                    Node node,
                    java.net.URL url,
                    java.lang.String primaryCollationString) | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | acquireReadLock(WriteLockRequestListener listener)Acquires a read lock for this model. | 
| protected void | beginReadHook()A subclass hook invoked by  ModelAdapter.beginRead()after it invokesModelAdapter.acquireReadLock(oracle.jdeveloper.audit.model.LockPolicy). | 
| java.lang.String | contextDescription(Location location)Gets a description of a location of this model. | 
| protected void | endReadHook()A subclass hook invoked by  ModelAdapter.endRead()before it invokesModelAdapter.releaseReadLock(oracle.jdeveloper.audit.model.LockPolicy). | 
| char | getCharacter(int offset)Gets a character from this model, or  0if no text is
 available. | 
| int | getColumnOffset(int offset)Gets the zero-based column offset of a character offset in this model,
 or the character offset if this model does not have lines and columns. | 
| protected int | getDeltaLength(int offset,
              int length,
              int version) | 
| protected int | getDeltaOffset(int offset,
              int version) | 
| Location | getFocusLocation(Location location)Gets the focus location for a location in this model. | 
| int | getInitialLength()Gets the initial length of this model. | 
| java.lang.String | getLine(int offset)Gets a line of text from this model, or null if no text is available. | 
| int | getLineOffset(int offset)Gets the zero-based line offset of a character offset in this model,
 or  0if this model does not have lines and columns. | 
| Location | getLocation(int offset,
           int length)Gets a location in this model. | 
| oracle.ide.navigation.NavigationPoint | getNavigationPoint(Location location)Gets a  NavigationPointto navigate to a location in this model, or
 null if the location is not navigable. | 
| java.lang.Object | getRootHook()A subclass hook invoked by  ModelAdapter.getRoot()to get the root construct of
 this model. | 
| java.lang.Object | getRootImplementation()Deprecated. 
 Override  getRootHook()instead. | 
| java.lang.String | getText(int offset,
       int length)Gets text from this model, or null if the model is not a text model. | 
| TextBuffer | getTextBuffer()Gets the text buffer for this model. | 
| TextNode | getTextNode()Gets the IDE {@link TextNode) containing this model. | 
| boolean | isModifiable()Gets whether this model is modifiable. | 
| boolean | isModified()Gets whether the model has been modified since this representation of it
 was created. | 
| boolean | isModified(Location location)Gets whether a region of this model has been modified since this 
 model adapter was created. | 
| boolean | isNavigable(Location location)Gets whether a location in this model is navigable. | 
| void | release()Releases resources used by this model. | 
| protected void | releaseReadLock(WriteLockRequestListener listener)Releases a read lock for this model. | 
| void | verifyReadTransaction()Verifies that a read transaction is in progress for this model. | 
compareTo, contains, getContainingAdapter, getDependency, getFileAdapter, getUrl, isFileacquireReadLock, acquireReadLock, beginRead, beginRead, cancelRead, compareSiblings, contains, contains, contains, createModelAccessError, createModelAccessError, createModelAccessError, edit, endRead, endRead, enter, equals, exit, getAttribute, getConstruct, getConstruct, getContainedConstructs, getDirectory, getDirectoryAdapter, getElement, getElementLocations, getEndLocation, getFactory, getFocusLocation, getIcon, getIcon, getIdeContext, getLabel, getLabel, getLocation, getLocation, getLock, getNode, getPrimaryCollationKey, getProject, getProjectAdapter, getRoot, getSecondaryCollationKey, getSecondaryCollationString, getShortLabel, getSummary, getSummary, getType, getURL, getWorkspace, getWorkspaceAdapter, hashCode, isAccessible, isReadLockHeld, isWriteLockHeld, releaseReadLock, setAttribute, toString, verifyModelAccesspublic TextFileModelAdapter(ModelFactory factory, ModelType type, ContainerModelAdapter workspace, ContainerModelAdapter project, ContainerModelAdapter directory, Node node, java.net.URL url)
public TextFileModelAdapter(ModelFactory factory, ModelType type, ContainerModelAdapter workspace, ContainerModelAdapter project, ContainerModelAdapter directory, Node node, java.net.URL url, java.lang.String primaryCollationString)
public TextNode getTextNode()
public boolean isModifiable()
ModelAdapterModelAdapter
 implementation returns false.isModifiable in class ModelAdapterpublic boolean isModified()
ModelAdapterModelAdapter implementation returns false.isModified in class ModelAdapterpublic boolean isModified(Location location)
ModelAdapterisModified in class ModelAdapterpublic int getInitialLength()
ModelAdapterInteger.MAX_VALUE
 if this node has not been opened. The default ModelAdapter 
 implementation returns Integer.MAX_VALUE.getInitialLength in class ModelAdapterpublic Location getLocation(int offset, int length)
ModelAdaptergetLocation in class ModelAdapterprotected int getDeltaLength(int offset,
                             int length,
                             int version)
protected int getDeltaOffset(int offset,
                             int version)
protected void acquireReadLock(WriteLockRequestListener listener) throws java.lang.InterruptedException
ModelAdapter.beginRead() with
 no read transaction for this model active on the current thread. The
 default ModelAdapter implementation does nothing.
 
 The default TextFileModelAdapter implementation is the following:
     ReadWriteLock lock = getLock();
     lock.readLock();
     if (listener != null && lock.addWriteLockRequestListener(listener))
     {
       lock.removeWriteLockRequestListener(listener);
       lock.readUnlock();
       throw new InterruptedException("self-cancellation: write lock request pending");
     }
 
acquireReadLock in class ModelAdapterlistener - The listener to notify if a thread requests the write lock,
                 or null.java.lang.InterruptedException - if the current thread is in or gets put in the
 interrupted state, or if listener is not null and other threads are
 already waiting for a write lock. The interrupted state is cleared when
 this exception is thrown.public void verifyReadTransaction()
ModelAdapterModelAdapter implementation does nothing.verifyReadTransaction in class ModelAdapterprotected void releaseReadLock(WriteLockRequestListener listener)
ModelAdapter.endRead() with
 a read transaction for this model active on the current thread. The
 default TextFileModelAdapter implementation is the following:
     ReadWriteLock lock = getLock();
     if (listener != null) lock.removeWriteLockRequestListener(listener);
     lock.readUnlock();
 releaseReadLock in class ModelAdapterlistener - The value given to the matching acquireReadLock(oracle.javatools.buffer.WriteLockRequestListener).protected void beginReadHook()
                      throws java.lang.InterruptedException
ModelAdapter.beginRead() after it invokes
 ModelAdapter.acquireReadLock(oracle.jdeveloper.audit.model.LockPolicy). The default ModelAdapter implementation
 does nothing.
 
 The TextFileModelAdapter implementation pins the text buffer for
 use during the read transaction. Subclasses should not invoke
 this method from inside a synchronized block, on peril of deadlock!
beginReadHook in class ModelAdapterjava.lang.InterruptedExceptionModelAdapter.beginRead(), 
endReadHook()protected void endReadHook()
ModelAdapter.endRead() before it invokes
 ModelAdapter.releaseReadLock(oracle.jdeveloper.audit.model.LockPolicy). The default ModelAdapter implementation
 does nothing.
 
 The TextFileModelAdapter implementation unpins the text buffer.endReadHook in class ModelAdapterModelAdapter.endRead(), 
beginReadHook()public char getCharacter(int offset)
ModelAdapter0 if no text is
 available. A read transaction must be active on this node. The
 ModelAdapter implementation returns 0.getCharacter in class ModelAdapteroffset - The index of the character to return.public int getColumnOffset(int offset)
ModelAdapterModelAdapter
 implementation returns the character offset.getColumnOffset in class ModelAdapterpublic Location getFocusLocation(Location location)
ModelAdapterModelAdapter.getFocusLocation(java.lang.Object, oracle.jdeveloper.audit.model.Location) implementation gets the whole location. A read
 transaction must be active on this node.getFocusLocation in class ModelAdapterlocation - a location in this model.public java.lang.String getLine(int offset)
ModelAdapterModelAdapter
 implementation returns null.getLine in class ModelAdapteroffset - The index of a character in the line to return.public int getLineOffset(int offset)
ModelAdapter0 if this model does not have lines and columns. A read
 transaction must be active on this node. The ModelAdapter
 implementation returns 0.getLineOffset in class ModelAdapterpublic java.lang.Object getRootHook()
ModelAdapterModelAdapter.getRoot() to get the root construct of
 this model. A read transaction must be active on this model.
 
 If an implementation cannot access its content and can provide a useful
 description of the cause, it should throw ModelAccessError with
 that localized description. Otherwise, it should return null, and ModelAdapter.getRoot() will probe the file and construct and throw the exception based 
 on its findings.getRootHook in class ModelAdapterpublic java.lang.Object getRootImplementation()
getRootHook() instead.public java.lang.String getText(int offset,
                                int length)
ModelAdapterModelAdapter implementation returns null.getText in class ModelAdapteroffset - The index of the first character to return.length - The number of characters to return.public TextBuffer getTextBuffer()
public boolean isNavigable(Location location)
ModelAdapter implementation returns true if ModelAdapter.getNavigationPoint(Location) returns a non-null value.
 
 The default TextFileModelAdapter implementation returns true.isNavigable in class ModelAdapterpublic oracle.ide.navigation.NavigationPoint getNavigationPoint(Location location)
NavigationPoint to navigate to a location in this model, or
 null if the location is not navigable.  The default ModelAdapter
 implementation returns null.
 
 The default TextFileModelAdapter implementation creates an
 OffsetNavigationPoint which will navigate to the code editor.getNavigationPoint in class ModelAdapterpublic void release()
ModelAdapterrelease in class ModelAdapterpublic java.lang.String contextDescription(Location location)
 The ModelAdapter implementation includes the file name and offsets 
 of the location.
 
 The TextFileModelAdapter implementation adds the line and column
 numbers and the text of the location.
contextDescription in class ModelAdapter