gnu.jemacs.swt
Class BufferContent
java.lang.Object
gnu.lists.AbstractSequence
gnu.lists.GapVector
gnu.jemacs.swt.SwtCharBuffer
gnu.jemacs.swt.BufferContent
- All Implemented Interfaces:
- CharSeq, Consumable, Sequence, java.lang.CharSequence, java.lang.Iterable, java.util.Collection, java.util.List, org.eclipse.swt.custom.StyledTextContent
public class BufferContent
- extends SwtCharBuffer
- implements org.eclipse.swt.custom.StyledTextContent, CharSeq
Fields inherited from interface gnu.lists.Sequence |
ATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, EOF_VALUE, eofValue, FLOAT_VALUE, GROUP_VALUE, INT_S16_VALUE, INT_S32_VALUE, INT_S64_VALUE, INT_S8_VALUE, INT_U16_VALUE, INT_U32_VALUE, INT_U64_VALUE, INT_U8_VALUE, OBJECT_VALUE, PRIM_VALUE, PROCESSING_INSTRUCTION_VALUE, TEXT_BYTE_VALUE |
Method Summary |
void |
addTextChangeListener(org.eclipse.swt.custom.TextChangeListener textChangeListener)
|
void |
consume(int start,
int count,
Consumer out)
|
void |
fill(char value)
Set all the elements to a given character. |
void |
fill(int fromIndex,
int toIndex,
char value)
|
int |
getCharCount()
|
java.lang.String |
getLine(int lineIndex)
|
int |
getLineAtOffset(int pos)
|
int |
getLineCount()
|
java.lang.String |
getLineDelimiter()
|
int |
getOffsetAtLine(int lineIndex)
|
java.lang.String |
getTextRange(int start,
int length)
|
void |
insertFile(java.io.Reader in,
int pos)
|
int |
lineStartPos(int pos)
|
static void |
main(java.lang.String[] args)
For testing purposes |
void |
removeTextChangeListener(org.eclipse.swt.custom.TextChangeListener textChangeListener)
|
void |
replaceTextRange(int start,
int length,
java.lang.String newText)
|
void |
save(java.io.Writer out)
|
void |
setCharAt(int index,
char value)
|
void |
setText(java.lang.String newText)
|
java.lang.CharSequence |
subSequence(int start,
int end)
|
void |
writeTo(java.lang.Appendable dest)
|
void |
writeTo(int start,
int count,
java.lang.Appendable dest)
Append a specified subsequence to an Appendable . |
Methods inherited from class gnu.jemacs.swt.SwtCharBuffer |
charAt, delete, gapReserve, getChars, insert, length, offset2pos, pos2offset, printable, shiftGap, show, toString |
Methods inherited from class gnu.lists.GapVector |
add, addPos, consumePosRange, createPos, fill, fillPosRange, gapReserve, get, getNextKind, hasNext, isAfterPos, nextIndex, removePosRange, set, size |
Methods inherited from class gnu.lists.AbstractSequence |
add, addAll, addAll, append, append, append, baseUriOfPos, clear, compare, compare, compare, consume, consumeNext, contains, containsAll, copyPos, createRelativePos, elements, endPos, equals, equals, fill, firstAttributePos, firstChildPos, fromEndIndex, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasPrevious, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePos, retainAll, set, setPosNext, setPosPrevious, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, unsupported |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray |
BufferContent
public BufferContent()
BufferContent
public BufferContent(int initialSize)
- Parameters:
initialSize
-
addTextChangeListener
public void addTextChangeListener(org.eclipse.swt.custom.TextChangeListener textChangeListener)
- Specified by:
addTextChangeListener
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.addTextChangeListener(org.eclipse.swt.custom.TextChangeListener)
removeTextChangeListener
public void removeTextChangeListener(org.eclipse.swt.custom.TextChangeListener textChangeListener)
- Specified by:
removeTextChangeListener
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.removeTextChangeListener(org.eclipse.swt.custom.TextChangeListener)
getCharCount
public int getCharCount()
- Specified by:
getCharCount
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.getCharCount()
getLine
public java.lang.String getLine(int lineIndex)
- Specified by:
getLine
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.getLine(int)
getLineAtOffset
public int getLineAtOffset(int pos)
- Specified by:
getLineAtOffset
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.getLineAtOffset(int)
getLineCount
public int getLineCount()
- Specified by:
getLineCount
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.getLineCount()
getLineDelimiter
public java.lang.String getLineDelimiter()
- Specified by:
getLineDelimiter
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.getLineDelimiter()
getOffsetAtLine
public int getOffsetAtLine(int lineIndex)
- Specified by:
getOffsetAtLine
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.getOffsetAtLine(int)
getTextRange
public java.lang.String getTextRange(int start,
int length)
- Specified by:
getTextRange
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.getTextRange(int, int)
replaceTextRange
public void replaceTextRange(int start,
int length,
java.lang.String newText)
- Specified by:
replaceTextRange
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.replaceTextRange(int, int, java.lang.String)
setText
public void setText(java.lang.String newText)
- Specified by:
setText
in interface org.eclipse.swt.custom.StyledTextContent
- See Also:
StyledTextContent.setText(java.lang.String)
main
public static void main(java.lang.String[] args)
- For testing purposes
- Parameters:
args
-
lineStartPos
public int lineStartPos(int pos)
consume
public void consume(int start,
int count,
Consumer out)
- Specified by:
consume
in interface CharSeq
- Parameters:
start
- count
- out
-
insertFile
public void insertFile(java.io.Reader in,
int pos)
throws java.io.IOException
- Parameters:
in
-
- Throws:
java.io.IOException
setCharAt
public void setCharAt(int index,
char value)
- Specified by:
setCharAt
in interface CharSeq
fill
public void fill(char value)
- Description copied from interface:
CharSeq
- Set all the elements to a given character.
- Specified by:
fill
in interface CharSeq
fill
public void fill(int fromIndex,
int toIndex,
char value)
- Specified by:
fill
in interface CharSeq
subSequence
public java.lang.CharSequence subSequence(int start,
int end)
- Specified by:
subSequence
in interface CharSeq
- Specified by:
subSequence
in interface java.lang.CharSequence
- Overrides:
subSequence
in class SwtCharBuffer
writeTo
public void writeTo(int start,
int count,
java.lang.Appendable dest)
throws java.io.IOException
- Description copied from interface:
CharSeq
- Append a specified subsequence to an
Appendable
.
An allowable implementation is:
dest.append(this, start, start+count)
.
Hence implementors of Appendable
should avoid calling
writeTo
- though they can call getChars
.
- Specified by:
writeTo
in interface CharSeq
- Throws:
java.io.IOException
writeTo
public void writeTo(java.lang.Appendable dest)
throws java.io.IOException
- Specified by:
writeTo
in interface CharSeq
- Throws:
java.io.IOException
save
public void save(java.io.Writer out)
throws java.io.IOException
- Parameters:
out
-
- Throws:
java.io.IOException