org.eclipse.xtext.ui.codetemplates.ui.contentassist
Class DummyDocument

java.lang.Object
  extended by org.eclipse.xtext.ui.codetemplates.ui.contentassist.DummyDocument
All Implemented Interfaces:
org.eclipse.jface.text.IDocument

public class DummyDocument
extends java.lang.Object
implements org.eclipse.jface.text.IDocument

Author:
Sebastian Zarnekow - Initial contribution and API

Field Summary
 
Fields inherited from interface org.eclipse.jface.text.IDocument
DEFAULT_CATEGORY, DEFAULT_CONTENT_TYPE
 
Constructor Summary
DummyDocument(java.lang.String content)
           
 
Method Summary
 void addDocumentListener(org.eclipse.jface.text.IDocumentListener listener)
           
 void addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener listener)
           
 void addPosition(org.eclipse.jface.text.Position position)
           
 void addPosition(java.lang.String category, org.eclipse.jface.text.Position position)
           
 void addPositionCategory(java.lang.String category)
           
 void addPositionUpdater(org.eclipse.jface.text.IPositionUpdater updater)
           
 void addPrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener documentAdapter)
           
 int computeIndexInCategory(java.lang.String category, int offset)
           
 int computeNumberOfLines(java.lang.String text)
           
 org.eclipse.jface.text.ITypedRegion[] computePartitioning(int offset, int length)
           
 boolean containsPosition(java.lang.String category, int offset, int length)
           
 boolean containsPositionCategory(java.lang.String category)
           
 java.lang.String get()
           
 java.lang.String get(int offset, int length)
           
 char getChar(int offset)
           
 java.lang.String getContentType(int offset)
           
 org.eclipse.jface.text.IDocumentPartitioner getDocumentPartitioner()
           
 java.lang.String[] getLegalContentTypes()
           
 java.lang.String[] getLegalLineDelimiters()
           
 int getLength()
           
 java.lang.String getLineDelimiter(int line)
           
 org.eclipse.jface.text.IRegion getLineInformation(int line)
           
 org.eclipse.jface.text.IRegion getLineInformationOfOffset(int offset)
           
 int getLineLength(int line)
           
 int getLineOffset(int line)
           
 int getLineOfOffset(int offset)
           
 int getNumberOfLines()
           
 int getNumberOfLines(int offset, int length)
           
 org.eclipse.jface.text.ITypedRegion getPartition(int offset)
           
 java.lang.String[] getPositionCategories()
           
 org.eclipse.jface.text.Position[] getPositions(java.lang.String category)
           
 org.eclipse.jface.text.IPositionUpdater[] getPositionUpdaters()
           
 void insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater updater, int index)
           
 void removeDocumentListener(org.eclipse.jface.text.IDocumentListener listener)
           
 void removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener listener)
           
 void removePosition(org.eclipse.jface.text.Position position)
           
 void removePosition(java.lang.String category, org.eclipse.jface.text.Position position)
           
 void removePositionCategory(java.lang.String category)
           
 void removePositionUpdater(org.eclipse.jface.text.IPositionUpdater updater)
           
 void removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener documentAdapter)
           
 void replace(int offset, int length, java.lang.String text)
           
 int search(int startOffset, java.lang.String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord)
          Deprecated. 
 void set(java.lang.String text)
           
 void setDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner partitioner)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyDocument

public DummyDocument(java.lang.String content)
Method Detail

getChar

public char getChar(int offset)
             throws org.eclipse.jface.text.BadLocationException
Specified by:
getChar in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

getLength

public int getLength()
Specified by:
getLength in interface org.eclipse.jface.text.IDocument

get

public java.lang.String get()
Specified by:
get in interface org.eclipse.jface.text.IDocument

get

public java.lang.String get(int offset,
                            int length)
                     throws org.eclipse.jface.text.BadLocationException
Specified by:
get in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

set

public void set(java.lang.String text)
Specified by:
set in interface org.eclipse.jface.text.IDocument

replace

public void replace(int offset,
                    int length,
                    java.lang.String text)
             throws org.eclipse.jface.text.BadLocationException
Specified by:
replace in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

addDocumentListener

public void addDocumentListener(org.eclipse.jface.text.IDocumentListener listener)
Specified by:
addDocumentListener in interface org.eclipse.jface.text.IDocument

removeDocumentListener

public void removeDocumentListener(org.eclipse.jface.text.IDocumentListener listener)
Specified by:
removeDocumentListener in interface org.eclipse.jface.text.IDocument

addPrenotifiedDocumentListener

public void addPrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener documentAdapter)
Specified by:
addPrenotifiedDocumentListener in interface org.eclipse.jface.text.IDocument

removePrenotifiedDocumentListener

public void removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener documentAdapter)
Specified by:
removePrenotifiedDocumentListener in interface org.eclipse.jface.text.IDocument

addPositionCategory

public void addPositionCategory(java.lang.String category)
Specified by:
addPositionCategory in interface org.eclipse.jface.text.IDocument

removePositionCategory

public void removePositionCategory(java.lang.String category)
                            throws org.eclipse.jface.text.BadPositionCategoryException
Specified by:
removePositionCategory in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadPositionCategoryException

getPositionCategories

public java.lang.String[] getPositionCategories()
Specified by:
getPositionCategories in interface org.eclipse.jface.text.IDocument

containsPositionCategory

public boolean containsPositionCategory(java.lang.String category)
Specified by:
containsPositionCategory in interface org.eclipse.jface.text.IDocument

addPosition

public void addPosition(org.eclipse.jface.text.Position position)
                 throws org.eclipse.jface.text.BadLocationException
Specified by:
addPosition in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

removePosition

public void removePosition(org.eclipse.jface.text.Position position)
Specified by:
removePosition in interface org.eclipse.jface.text.IDocument

addPosition

public void addPosition(java.lang.String category,
                        org.eclipse.jface.text.Position position)
                 throws org.eclipse.jface.text.BadLocationException,
                        org.eclipse.jface.text.BadPositionCategoryException
Specified by:
addPosition in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException
org.eclipse.jface.text.BadPositionCategoryException

removePosition

public void removePosition(java.lang.String category,
                           org.eclipse.jface.text.Position position)
                    throws org.eclipse.jface.text.BadPositionCategoryException
Specified by:
removePosition in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadPositionCategoryException

getPositions

public org.eclipse.jface.text.Position[] getPositions(java.lang.String category)
                                               throws org.eclipse.jface.text.BadPositionCategoryException
Specified by:
getPositions in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadPositionCategoryException

containsPosition

public boolean containsPosition(java.lang.String category,
                                int offset,
                                int length)
Specified by:
containsPosition in interface org.eclipse.jface.text.IDocument

computeIndexInCategory

public int computeIndexInCategory(java.lang.String category,
                                  int offset)
                           throws org.eclipse.jface.text.BadLocationException,
                                  org.eclipse.jface.text.BadPositionCategoryException
Specified by:
computeIndexInCategory in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException
org.eclipse.jface.text.BadPositionCategoryException

addPositionUpdater

public void addPositionUpdater(org.eclipse.jface.text.IPositionUpdater updater)
Specified by:
addPositionUpdater in interface org.eclipse.jface.text.IDocument

removePositionUpdater

public void removePositionUpdater(org.eclipse.jface.text.IPositionUpdater updater)
Specified by:
removePositionUpdater in interface org.eclipse.jface.text.IDocument

insertPositionUpdater

public void insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater updater,
                                  int index)
Specified by:
insertPositionUpdater in interface org.eclipse.jface.text.IDocument

getPositionUpdaters

public org.eclipse.jface.text.IPositionUpdater[] getPositionUpdaters()
Specified by:
getPositionUpdaters in interface org.eclipse.jface.text.IDocument

getLegalContentTypes

public java.lang.String[] getLegalContentTypes()
Specified by:
getLegalContentTypes in interface org.eclipse.jface.text.IDocument

getContentType

public java.lang.String getContentType(int offset)
                                throws org.eclipse.jface.text.BadLocationException
Specified by:
getContentType in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

getPartition

public org.eclipse.jface.text.ITypedRegion getPartition(int offset)
                                                 throws org.eclipse.jface.text.BadLocationException
Specified by:
getPartition in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

computePartitioning

public org.eclipse.jface.text.ITypedRegion[] computePartitioning(int offset,
                                                                 int length)
                                                          throws org.eclipse.jface.text.BadLocationException
Specified by:
computePartitioning in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

addDocumentPartitioningListener

public void addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener listener)
Specified by:
addDocumentPartitioningListener in interface org.eclipse.jface.text.IDocument

removeDocumentPartitioningListener

public void removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener listener)
Specified by:
removeDocumentPartitioningListener in interface org.eclipse.jface.text.IDocument

setDocumentPartitioner

public void setDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner partitioner)
Specified by:
setDocumentPartitioner in interface org.eclipse.jface.text.IDocument

getDocumentPartitioner

public org.eclipse.jface.text.IDocumentPartitioner getDocumentPartitioner()
Specified by:
getDocumentPartitioner in interface org.eclipse.jface.text.IDocument

getLineLength

public int getLineLength(int line)
                  throws org.eclipse.jface.text.BadLocationException
Specified by:
getLineLength in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

getLineOfOffset

public int getLineOfOffset(int offset)
                    throws org.eclipse.jface.text.BadLocationException
Specified by:
getLineOfOffset in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

getLineOffset

public int getLineOffset(int line)
                  throws org.eclipse.jface.text.BadLocationException
Specified by:
getLineOffset in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

getLineInformation

public org.eclipse.jface.text.IRegion getLineInformation(int line)
                                                  throws org.eclipse.jface.text.BadLocationException
Specified by:
getLineInformation in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

getLineInformationOfOffset

public org.eclipse.jface.text.IRegion getLineInformationOfOffset(int offset)
                                                          throws org.eclipse.jface.text.BadLocationException
Specified by:
getLineInformationOfOffset in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

getNumberOfLines

public int getNumberOfLines()
Specified by:
getNumberOfLines in interface org.eclipse.jface.text.IDocument

getNumberOfLines

public int getNumberOfLines(int offset,
                            int length)
                     throws org.eclipse.jface.text.BadLocationException
Specified by:
getNumberOfLines in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

computeNumberOfLines

public int computeNumberOfLines(java.lang.String text)
Specified by:
computeNumberOfLines in interface org.eclipse.jface.text.IDocument

getLegalLineDelimiters

public java.lang.String[] getLegalLineDelimiters()
Specified by:
getLegalLineDelimiters in interface org.eclipse.jface.text.IDocument

getLineDelimiter

public java.lang.String getLineDelimiter(int line)
                                  throws org.eclipse.jface.text.BadLocationException
Specified by:
getLineDelimiter in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException

search

@Deprecated
public int search(int startOffset,
                             java.lang.String findString,
                             boolean forwardSearch,
                             boolean caseSensitive,
                             boolean wholeWord)
           throws org.eclipse.jface.text.BadLocationException
Deprecated. 

Specified by:
search in interface org.eclipse.jface.text.IDocument
Throws:
org.eclipse.jface.text.BadLocationException