|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gjt.sp.jedit.textarea.FoldVisibilityManager
Manages fold visibility.
This class contains methods for translating between physical and virtual line numbers, for determining which lines are visible and which aren't, and for expanding and collapsing folds.
When jEdit's folding or narrowing features are used to hide portions of a buffer, the "virtual" line count visible in the text area is generally not equal to the "physical" line count of the buffer represented by the gutter's display.
You can use the physicalToVirtual(int)
and
virtualToPhysical(int)
methods to convert one type of line
number to another.
Constructor Summary | |
FoldVisibilityManager(Buffer buffer,
OffsetManager offsetMgr,
JEditTextArea textArea)
|
Method Summary | |
int |
_getIndex()
Do not call this method. |
void |
_grab(int index)
Do not call this method. |
void |
_invalidate(int startLine)
Do not call this method. |
void |
_release()
Do not call this method. |
void |
collapseFold(int line)
Collapses the fold at the specified physical line index. |
void |
expandAllFolds()
Expands all folds. |
int |
expandFold(int line,
boolean fully)
Expands the fold at the specified physical line index. |
void |
expandFolds(char digit)
This method should only be called from actions.xml . |
void |
expandFolds(int foldLevel)
Expands all folds with the specified fold level. |
void |
foldStructureChanged()
This method is only public so that the EditPane class can call it in response to a buffer's fold handler change. |
int |
getFirstVisibleLine()
Returns the physical line number of the first visible line. |
int |
getLastVisibleLine()
Returns the physical line number of the last visible line. |
int |
getNextVisibleLine(int line)
Returns the next visible line after the specified line index. |
int |
getPrevVisibleLine(int line)
Returns the previous visible line before the specified line index. |
int |
getVirtualLineCount()
Returns the number of virtual lines in the buffer. |
boolean |
isLineVisible(int line)
Returns if the specified line is visible. |
boolean |
isNarrowed()
Returns if the buffer has been narrowed. |
void |
narrow(int start,
int end)
Narrows the visible portion of the buffer to the specified line range. |
int |
physicalToVirtual(int line)
Converts a physical line number to a virtual line number. |
int |
virtualToPhysical(int line)
Converts a virtual line number to a physical line number. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FoldVisibilityManager(Buffer buffer, OffsetManager offsetMgr, JEditTextArea textArea)
Method Detail |
public boolean isNarrowed()
public int getVirtualLineCount()
public final boolean isLineVisible(int line)
line
- A physical line indexpublic int getFirstVisibleLine()
public int getLastVisibleLine()
public int getNextVisibleLine(int line)
line
- A physical line indexpublic int getPrevVisibleLine(int line)
line
- A physical line indexpublic int physicalToVirtual(int line)
line
- A physical line indexpublic int virtualToPhysical(int line)
line
- A virtual line indexpublic void collapseFold(int line)
line
- A physical line indexpublic int expandFold(int line, boolean fully)
line
- A physical line indexfully
- If true, all subfolds will also be expandedpublic void expandAllFolds()
public void expandFolds(char digit)
actions.xml
.
public void expandFolds(int foldLevel)
foldLevel
- The fold levelpublic void narrow(int start, int end)
start
- The first lineend
- The last linepublic final void _grab(int index)
Buffer
class can call it.
public final void _release()
Buffer
class can call it.
public final int _getIndex()
Buffer
class can call it.
public void _invalidate(int startLine)
Buffer
class can call it.
public void foldStructureChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |