|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gnu.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.BadLocationException
public void removeAll()
removeAll
in class Buffer
public void removeChar(int count)
removeChar
in class Buffer
public void removePos(int ipos, int count)
AbstractSequence
removePos
in class AbstractSequence
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
save
in class Buffer
java.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 Buffer
java.lang.Exception
public void redrawModeline()
redrawModeline
in class Buffer
public long scan(char target, int start, int end, int count, boolean allowQuit)
Buffer
scan
in class Buffer
public int lineStartOffset(int offset)
lineStartOffset
in class Buffer
public int getDot()
getDot
in class Buffer
public void setDot(int i)
setDot
in class Buffer
public int maxDot()
maxDot
in class Buffer
public int getLength()
getLength
in class Buffer
public CharSeq getStringContent()
getStringContent
in class Buffer
public int createPos(int index, boolean isAfter)
AbstractSequence
createPos
in class AbstractSequence
index
- offset from beginning of desired positionisAfter
- should the position have the isAfter propertypublic java.lang.Object get(int index)
AbstractSequence
get
in interface Sequence
get
in interface java.util.List
get
in class AbstractSequence
public int size()
AbstractSequence
size
in interface Sequence
size
in interface java.util.Collection
size
in interface java.util.List
size
in class AbstractSequence
public int nextIndex(int ipos)
AbstractSequence
nextIndex
in class AbstractSequence
public long savePointMark()
savePointMark
in class Buffer
public void restorePointMark(long pointMark)
restorePointMark
in class Buffer
public InPort openReader(int start, int count)
openReader
in class Buffer
public void invoke(java.lang.Runnable doRun)
Buffer
invoke
in class Buffer
Buffer.invoke(java.lang.Runnable)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |