com.raelity.jvi
Interface ViTextView

All Superinterfaces:
ViOptionBag
All Known Implementing Classes:
TextView

public interface ViTextView
extends ViOptionBag

The information needed by vim when running on a GUI. We abstract this, rather than using native swing, since different environments, e.g. JBuilder, have their own abstractions. Some abstraction that presents a line oriented interface is useful for vim.

This has had a few "window" methods added to it, and it is now the primary class referenced by most of the vi code. This allows it to be G.curwin.

NEEDSWORK: get rid of JEditorPane reference, should not refer to swing.


Nested Class Summary
static class ViTextView.FOLDOP
           
static class ViTextView.JLOP
          jump list operations
static class ViTextView.MARKOP
          annonymous mark operations
static class ViTextView.NLOP
          open new line forward/backward
static class ViTextView.TABOP
          move to other tab
static class ViTextView.TAGOP
          tags and tagstack operations
static class ViTextView.WMOP
          word match opertations
 
Method Summary
 void anonymousMark(ViTextView.MARKOP op, int count)
          Anonymous mark handling.
 void attach()
          establish all the listeners
 void clearSelect()
          clear the select, if any, on the screen, don't move the caret
 int coladvanceCoord(int lineOffset, int col)
           
 void computeCursorPosition(MutableInt offset, MutableInt line, MutableInt column)
          Determine cursor position, all args get set (call by reference).
 void deleteChar(int start, int end)
          Delete a bunch of characters
 void deletePreviousChar()
          Delete previous character (backspace).
 void detach()
          tear down all the listeners
 void findMatch()
          find matching character for character under the cursor.
 void foldOperation(ViTextView.FOLDOP op)
          Perform the fold operation.
 void foldOperation(ViTextView.FOLDOP op, int offset)
          Perform the fold operation.
 Buffer getBuffer()
           
 int getBufferLineOffset(int line)
          Reverse of getCoordLine, convert coord line to document line
 int getCaretPosition()
           
 int getCoordLine(int line)
           
 int getCoordLineCount()
           
 JEditorPane getEditorComponent()
           
 ViMark getMark(int i)
           
 int getMarkPosition()
           
 ViMark getPCMark()
           
 ViMark getPrevPCMark()
           
 ViStatusDisplay getStatusDisplay()
          Handle displayable editor state changes
 int getViewBlankLines()
           
 int getViewBottomLine()
           
 int getViewCoordBlankLines()
           
 int getViewCoordBottomLine()
           
 int getViewCoordTopLine()
           
 int getViewLines()
           
 int getViewTopLine()
           
 ViFPOS getWCursor()
           
 int getWCurswant()
           
 Window getWindow()
           
 boolean getWPList()
           
 int getWPScroll()
           
 boolean getWSetCurswant()
           
 void insertChar(char c)
          insert text at current cursor location.
 void insertNewLine()
          Insert new line at current position
 void insertTab()
          Insert tab at current position
 void insertText(int offset, String s)
          insert text at specified location
 void insertTypedChar(char c)
          insert the char verbatim, no special actions
 boolean isEditable()
          Can the editor text be changed
 boolean isShutdown()
           
 void jumpDefinition(String ident)
          Jump to the definition of the identifier under the cursor.
 void jumpList(ViTextView.JLOP op, int count)
          Jump list handling
 boolean openNewLine(ViTextView.NLOP op)
          Open line is like insertNewLine, but is does autoindent dance
 void pushPCMark()
           
 void redo()
          redo a change
 void replaceChar(char c, boolean advanceCursor)
          Replace character at current cursor location with argument character
 void replaceString(int start, int end, String s)
          Replace indicated region with string
 void scroll(int n_lines)
          Scroll down (n_lines positive) or up (n_lines negative) the specified number of lines.
 void setCaretPosition(int offset)
          set the caret to the indicated position.
 void setCaretPosition(int lnum, int col)
          set the caret to the indicated position.
 void setCursorCoordLine(int line, int col)
           
 void setSelect(int dot, int mark)
          select a region of the screen
 void setViewCoordTopLine(int line)
          cause the idndicated line to be displayed as top line in view.
 void setViewTopLine(int line)
          cause the idndicated line to be displayed as top line in view.
 void setWCurswant(int c)
           
 void setWindow(Window window)
           
 void setWPList(boolean f)
           
 void setWPScroll(int n)
           
 void setWSetCurswant(boolean f)
           
 void shutdown()
          going away, do any remaining cleanup
 void startup(Buffer buf)
          called after TV and Buffer are constructed
 void tabOperation(ViTextView.TABOP op, int count)
          move to other file tab.
For NEXT,PREV if count == 0 then neighboring tab; if count != 0 then countTh tab, where first is one
 void undo()
          undo a change
 void updateCursor(ViCursor cursor)
          Change the cursor shape
 void updateHighlightSearchState()
          Update the hightlight search state
 void updateVisualState()
          Update the visual state (selection) of the window.
 void win_close_others(boolean forceit)
          Close other windows
 void win_close(boolean freeBuf)
          Close this window.
 void win_cycle(int n)
          Cycle to the indicated buffer.
 void win_goto(int n)
          Goto the indicated buffer.
 void win_quit()
          Quit editing window.
 void win_split(int n)
          Split this window.
 void wordMatchOperation(ViTextView.WMOP op)
           
 
Methods inherited from interface com.raelity.jvi.ViOptionBag
activateOptions, viOptionSet
 

Method Detail

getWindow

Window getWindow()
Returns:
the associated Window

setWindow

void setWindow(Window window)

getWCursor

ViFPOS getWCursor()
Returns:
the current location of the cursor in the window

getWCurswant

int getWCurswant()

setWCurswant

void setWCurswant(int c)

getWSetCurswant

boolean getWSetCurswant()

setWSetCurswant

void setWSetCurswant(boolean f)

getPCMark

ViMark getPCMark()

getPrevPCMark

ViMark getPrevPCMark()

pushPCMark

void pushPCMark()

getMark

ViMark getMark(int i)

getWPScroll

int getWPScroll()

setWPScroll

void setWPScroll(int n)

getWPList

boolean getWPList()

setWPList

void setWPList(boolean f)

getBuffer

Buffer getBuffer()
Returns:
the associated Buffer

getEditorComponent

JEditorPane getEditorComponent()
Returns:
the underlying text component

isEditable

boolean isEditable()
Can the editor text be changed


insertNewLine

void insertNewLine()
Insert new line at current position


openNewLine

boolean openNewLine(ViTextView.NLOP op)
Open line is like insertNewLine, but is does autoindent dance


insertTab

void insertTab()
Insert tab at current position


replaceChar

void replaceChar(char c,
                 boolean advanceCursor)
Replace character at current cursor location with argument character


deletePreviousChar

void deletePreviousChar()
Delete previous character (backspace).


insertChar

void insertChar(char c)
insert text at current cursor location. For some characters special actions may be taken


insertTypedChar

void insertTypedChar(char c)
insert the char verbatim, no special actions


replaceString

void replaceString(int start,
                   int end,
                   String s)
Replace indicated region with string


deleteChar

void deleteChar(int start,
                int end)
Delete a bunch of characters


insertText

void insertText(int offset,
                String s)
insert text at specified location


getCaretPosition

int getCaretPosition()
Returns:
the offset of the text insertion caret

getMarkPosition

int getMarkPosition()
Returns:
the offset of the text insertion caret

computeCursorPosition

void computeCursorPosition(MutableInt offset,
                           MutableInt line,
                           MutableInt column)
Determine cursor position, all args get set (call by reference).


setCaretPosition

void setCaretPosition(int offset)
set the caret to the indicated position.


setCaretPosition

void setCaretPosition(int lnum,
                      int col)
set the caret to the indicated position.


setSelect

void setSelect(int dot,
               int mark)
select a region of the screen


clearSelect

void clearSelect()
clear the select, if any, on the screen, don't move the caret


undo

void undo()
undo a change


redo

void redo()
redo a change


anonymousMark

void anonymousMark(ViTextView.MARKOP op,
                   int count)
Anonymous mark handling. Count is the Nth mark forward, back. It is ignored by TOGGLE.


findMatch

void findMatch()
find matching character for character under the cursor. This is the '%' command. It is here to take advantage of existing functionality in target environments.


jumpDefinition

void jumpDefinition(String ident)
Jump to the definition of the identifier under the cursor.


jumpList

void jumpList(ViTextView.JLOP op,
              int count)
Jump list handling


foldOperation

void foldOperation(ViTextView.FOLDOP op)
Perform the fold operation.


foldOperation

void foldOperation(ViTextView.FOLDOP op,
                   int offset)
Perform the fold operation.


wordMatchOperation

void wordMatchOperation(ViTextView.WMOP op)

tabOperation

void tabOperation(ViTextView.TABOP op,
                  int count)
move to other file tab.
For NEXT,PREV if count == 0 then neighboring tab; if count != 0 then countTh tab, where first is one


getViewTopLine

int getViewTopLine()
Returns:
the line number of first visible line in window

setViewTopLine

void setViewTopLine(int line)
cause the idndicated line to be displayed as top line in view.


getViewBottomLine

int getViewBottomLine()
Returns:
the line number of line *after* end of window

getViewBlankLines

int getViewBlankLines()
Returns:
the number of unused lines on the display

getViewLines

int getViewLines()
Returns:
the number of lines in window

scroll

void scroll(int n_lines)
Scroll down (n_lines positive) or up (n_lines negative) the specified number of lines.


getViewCoordTopLine

int getViewCoordTopLine()
Returns:
the line number of first visible line in window

setViewCoordTopLine

void setViewCoordTopLine(int line)
cause the idndicated line to be displayed as top line in view.


getViewCoordBottomLine

int getViewCoordBottomLine()
Returns:
the line number of line *after* end of window

getViewCoordBlankLines

int getViewCoordBlankLines()
Returns:
the number of unused lines on the display

getCoordLineCount

int getCoordLineCount()

getCoordLine

int getCoordLine(int line)

setCursorCoordLine

void setCursorCoordLine(int line,
                        int col)

coladvanceCoord

int coladvanceCoord(int lineOffset,
                    int col)

getBufferLineOffset

int getBufferLineOffset(int line)
Reverse of getCoordLine, convert coord line to document line


attach

void attach()
establish all the listeners


detach

void detach()
tear down all the listeners


startup

void startup(Buffer buf)
called after TV and Buffer are constructed


shutdown

void shutdown()
going away, do any remaining cleanup


isShutdown

boolean isShutdown()
Returns:
true if this text view is shutdown

updateCursor

void updateCursor(ViCursor cursor)
Change the cursor shape


win_quit

void win_quit()
Quit editing window. Can close last view.


win_split

void win_split(int n)
Split this window.

Parameters:
n - the size of the new window.

win_close

void win_close(boolean freeBuf)
Close this window. Does not close last view.

Parameters:
freeBuf - true if the related buffer may be freed

win_close_others

void win_close_others(boolean forceit)
Close other windows

Parameters:
forceit - true if always hide all other windows

win_goto

void win_goto(int n)
Goto the indicated buffer.

Parameters:
n - the index of the window to make current

win_cycle

void win_cycle(int n)
Cycle to the indicated buffer.

Parameters:
n - the positive/negative number of windows to cycle.

getStatusDisplay

ViStatusDisplay getStatusDisplay()
Handle displayable editor state changes


updateVisualState

void updateVisualState()
Update the visual state (selection) of the window.


updateHighlightSearchState

void updateHighlightSearchState()
Update the hightlight search state