public class SwingBuffer extends Buffer
| Modifier and Type | Field and Description |
|---|---|
BufferContent |
content |
javax.swing.text.Caret |
curPosition |
static javax.swing.text.Style |
defaultStyle |
javax.swing.text.DefaultStyledDocument |
doc |
javax.swing.text.Style |
inputStyle |
javax.swing.text.StyledDocument |
modelineDocument |
static javax.swing.text.Style |
redStyle |
static javax.swing.text.StyleContext |
styles |
activeKeymaps, buffers, fileBuffers, markMarker, pointMarkerATTRIBUTE_VALUE, BOOLEAN_VALUE, CDATA_VALUE, CHAR_VALUE, COMMENT_VALUE, DOCUMENT_VALUE, DOUBLE_VALUE, ELEMENT_VALUE, EOF_VALUE, eofValue, FLOAT_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| Constructor and Description |
|---|
SwingBuffer(java.lang.String name) |
SwingBuffer(java.lang.String name,
BufferContent content) |
| Modifier and Type | Method and Description |
|---|---|
int |
createPos(int index,
boolean isAfter)
Generate a position at a given index.
|
Char |
get(int index)
See java.util.List.
|
int |
getDot() |
int |
getLength() |
CharSeq |
getStringContent() |
void |
insert(int index,
java.lang.String string,
java.lang.Object style) |
void |
insert(java.lang.String string,
java.lang.Object style) |
void |
insert(java.lang.String string,
java.lang.Object style,
int ipos)
Insert string with given style at position pair.
|
void |
insertChar(int ch,
int count)
Insert count copies of ch at point.
|
void |
insertFile(java.io.Reader in) |
void |
invoke(java.lang.Runnable doRun)
This is intended for Runnable's that may affect the state of the buffer.
|
int |
lineStartOffset(int offset) |
int |
maxDot() |
int |
nextIndex(int ipos)
Get the offset from the beginning corresponding to a position cookie.
|
gnu.kawa.io.InPort |
openReader(int start,
int count) |
void |
redrawModeline() |
void |
removeChar(int count) |
void |
removePos(int ipos,
int count)
Remove one or more elements.
|
void |
removeRegion(int start,
int end) |
void |
restorePointMark(long pointMark) |
void |
save(java.io.Writer out) |
long |
savePointMark() |
long |
scan(char target,
int start,
int end,
int count,
boolean allowQuit)
Search in BUF for COUNT instances of the character TARGET between START and END.
|
void |
setDot(int i)
Set the current position (point) (0-origin).
|
int |
size()
See java.util.List.
|
backwardChar, charAt, charWidth, checkMark, coerceBuffer, consume, countColumns, currentColumn, currentColumn, display, fill, fill, findFile, forwardChar, forwardLine, forwardLine, generateNewBufferName, getBuffer, getChars, getCurrent, getFileName, getLocalKeymap, getMarkMarker, getName, getPath, getPoint, getPointMarker, getReadOnly, insert, insert, insertAll, insertChar, insertFile, length, lineStartOffset, makeBufferLocal, minDot, moveToColumn, positionToOffset, removeAll, save, setCharacterAt, setCharAt, setCurrent, setFileName, setLocalKeymap, setPath, setPoint, setReadOnly, subSequence, toString, writeTo, writeToadd, add, addAll, addAll, addPos, boundedHash, clear, compare, compare, compare, consume, consumeNext, consumePosRange, contains, containsAll, copyPos, createRelativePos, elements, endPos, equals, equals, fill, fill, fillPosRange, firstAttributePos, firstChildPos, firstChildPos, fromEndIndex, get, getAttribute, getAttributeLength, getContainingSequenceSize, getEffectiveIndex, getIndexDifference, getIterator, getIterator, getIteratorAtPos, getLowBound, getNextKind, getNextTypeName, getNextTypeObject, getPosNext, getPosPrevious, getSize, gotoAttributesStart, gotoChildrenStart, gotoParent, hashCode, hasNext, hasPrevious, indexOf, isAfterPos, isEmpty, iterator, lastIndexOf, listIterator, listIterator, nextIndex, nextMatching, nextPos, parentPos, previousPos, rank, releasePos, remove, remove, removeAll, removePosRange, retainAll, set, set, setAt, setPosNext, setPosPrevious, stableCompare, startPos, subList, subSequence, subSequencePos, toArray, toArray, toString, unsupported, unsupportedExceptionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitadd, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, subList, toArray, toArrayconsumeboundedHashpublic javax.swing.text.DefaultStyledDocument doc
public javax.swing.text.Caret curPosition
public BufferContent content
public javax.swing.text.StyledDocument modelineDocument
public static javax.swing.text.StyleContext styles
public static javax.swing.text.Style defaultStyle
public javax.swing.text.Style inputStyle
public static javax.swing.text.Style redStyle
public SwingBuffer(java.lang.String name)
public SwingBuffer(java.lang.String name,
BufferContent content)
public void removeRegion(int start,
int end)
removeRegion in class Bufferpublic void removeChar(int count)
removeChar in class Bufferpublic void removePos(int ipos,
int count)
AbstractSequenceremovePos in class AbstractSequence<Char>ipos - position where elements should be removedcount - if non-negative, remove that number of elements
following (poses, posNumber); if negative the negative of the number
of elements to remove before (poses, posNumber).public void save(java.io.Writer out)
throws java.lang.Exception
public void insertChar(int ch,
int count)
BufferinsertChar in class Bufferpublic void insert(int index,
java.lang.String string,
java.lang.Object style)
public void insert(java.lang.String string,
java.lang.Object style)
public void insert(java.lang.String string,
java.lang.Object style,
int ipos)
Bufferpublic void insertFile(java.io.Reader in)
throws java.lang.Exception
insertFile in class Bufferjava.lang.Exceptionpublic void redrawModeline()
redrawModeline in class Bufferpublic long scan(char target,
int start,
int end,
int count,
boolean allowQuit)
Bufferpublic int lineStartOffset(int offset)
lineStartOffset in class Bufferpublic void setDot(int i)
Bufferpublic CharSeq getStringContent()
getStringContent in class Bufferpublic int createPos(int index,
boolean isAfter)
AbstractSequencecreatePos in class AbstractSequence<Char>index - offset from beginning of desired positionisAfter - should the position have the isAfter propertypublic Char get(int index)
AbstractSequencepublic int size()
AbstractSequencepublic int nextIndex(int ipos)
AbstractSequencenextIndex in class AbstractSequence<Char>public long savePointMark()
savePointMark in class Bufferpublic void restorePointMark(long pointMark)
restorePointMark in class Bufferpublic gnu.kawa.io.InPort openReader(int start,
int count)
openReader in class Bufferpublic void invoke(java.lang.Runnable doRun)
Bufferinvoke in class BufferBuffer.invoke(java.lang.Runnable)