|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgnu.lists.AbstractSequence
gnu.jemacs.buffer.Buffer
gnu.jemacs.swing.SwingBuffer
public class SwingBuffer
An Emacs buffer implemented using the Swing toolkits.
| Field Summary | |
|---|---|
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
|
| Fields inherited from class gnu.jemacs.buffer.Buffer |
|---|
activeKeymaps, buffers, fileBuffers, markMarker, pointMarker |
| 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 |
| Constructor Summary | |
|---|---|
SwingBuffer(java.lang.String name)
|
|
SwingBuffer(java.lang.String name,
BufferContent content)
|
|
| Method Summary | |
|---|---|
int |
createPos(int index,
boolean isAfter)
Generate a position at a given index. |
java.lang.Object |
get(int index)
See java.util.List. |
int |
getDot()
|
int |
getLength()
|
CharSeq |
getStringContent()
|
void |
insert(char ch,
int count)
Insert count copies of ch at point. |
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 |
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. |
InPort |
openReader(int start,
int count)
|
void |
redrawModeline()
|
void |
removeAll()
|
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)
|
int |
size()
See java.util.List. |
| Methods inherited from class gnu.jemacs.buffer.Buffer |
|---|
backwardChar, charAt, charWidth, checkMark, coerceBuffer, consume, countColumns, currentColumn, currentColumn, display, fill, fill, findFile, forwardChar, forwardLine, forwardLine, generateNewBufferName, getBuffer, getChars, getCurrent, getFileName, getLocalKeymap, getMarkMarker, getName, getPoint, getPointMarker, insert, insert, insert, insertAll, insertFile, length, lineStartOffset, makeBufferLocal, minDot, moveToColumn, positionToOffset, save, setCharAt, setCurrent, setFileName, setLocalKeymap, setPoint, subSequence, toString, writeTo, writeTo |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface gnu.lists.Sequence |
|---|
elements, fill, isEmpty |
| 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 |
| Methods inherited from interface gnu.lists.Consumable |
|---|
consume |
| Field Detail |
|---|
public 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
| Constructor Detail |
|---|
public SwingBuffer(java.lang.String name)
public SwingBuffer(java.lang.String name,
BufferContent content)
| Method Detail |
|---|
public void removeRegion(int start,
int end)
throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationExceptionpublic void removeAll()
removeAll in class Bufferpublic void removeChar(int count)
removeChar in class Buffer
public void removePos(int ipos,
int count)
AbstractSequence
removePos in class AbstractSequenceipos - 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
save in class Bufferjava.lang.Exception
public void insert(char ch,
int count)
Buffer
insert in class Buffer
public void insert(int index,
java.lang.String string,
java.lang.Object style)
public void insert(java.lang.String string,
java.lang.Object style)
insert in class Buffer
public void insert(java.lang.String string,
java.lang.Object style,
int ipos)
Buffer
insert in class Buffer
public void insertFile(java.io.Reader in)
throws java.lang.Exception
insertFile in class Bufferjava.lang.Exceptionpublic void redrawModeline()
redrawModeline in class Buffer
public long scan(char target,
int start,
int end,
int count,
boolean allowQuit)
Buffer
scan in class Bufferpublic int lineStartOffset(int offset)
lineStartOffset in class Bufferpublic int getDot()
getDot in class Bufferpublic void setDot(int i)
setDot in class Bufferpublic int maxDot()
maxDot in class Bufferpublic int getLength()
getLength in class Bufferpublic CharSeq getStringContent()
getStringContent in class Buffer
public int createPos(int index,
boolean isAfter)
AbstractSequence
createPos in class AbstractSequenceindex - offset from beginning of desired positionisAfter - should the position have the isAfter propertypublic java.lang.Object get(int index)
AbstractSequence
get in interface Sequenceget in interface java.util.Listget in class AbstractSequencepublic int size()
AbstractSequence
size in interface Sequencesize in interface java.util.Collectionsize in interface java.util.Listsize in class AbstractSequencepublic int nextIndex(int ipos)
AbstractSequence
nextIndex in class AbstractSequencepublic long savePointMark()
savePointMark in class Bufferpublic void restorePointMark(long pointMark)
restorePointMark in class Buffer
public InPort openReader(int start,
int count)
openReader in class Bufferpublic void invoke(java.lang.Runnable doRun)
Buffer
invoke in class BufferBuffer.invoke(java.lang.Runnable)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||