|
|||||||||
| Home >> All >> org >> gjt >> sp >> jedit >> [ textarea overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.gjt.sp.jedit.textarea
Class FoldVisibilityManager

java.lang.Objectorg.gjt.sp.jedit.textarea.FoldVisibilityManager
- public class FoldVisibilityManager
- extends java.lang.Object
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) 55 and
virtualToPhysical(int) 55 methods to convert one type of line
number to another.
- Since:
- jEdit 4.0pre1
- Version:
- $Id: FoldVisibilityManager.java,v 1.30 2003/02/21 20:12:19 spestov Exp $
| Field Summary | |
private org.gjt.sp.jedit.Buffer |
buffer
|
private int |
index
|
private int |
lastPhysical
|
private int |
lastVirtual
|
private boolean |
narrowed
|
private org.gjt.sp.jedit.buffer.OffsetManager |
offsetMgr
|
private JEditTextArea |
textArea
|
| Constructor Summary | |
FoldVisibilityManager(org.gjt.sp.jedit.Buffer buffer,
org.gjt.sp.jedit.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 |
| Field Detail |
buffer
private org.gjt.sp.jedit.Buffer buffer
offsetMgr
private org.gjt.sp.jedit.buffer.OffsetManager offsetMgr
textArea
private JEditTextArea textArea
index
private int index
lastPhysical
private int lastPhysical
lastVirtual
private int lastVirtual
narrowed
private boolean narrowed
| Constructor Detail |
FoldVisibilityManager
public FoldVisibilityManager(org.gjt.sp.jedit.Buffer buffer, org.gjt.sp.jedit.buffer.OffsetManager offsetMgr, JEditTextArea textArea)
| Method Detail |
isNarrowed
public boolean isNarrowed()
- Returns if the buffer has been narrowed.
- Since:
- jEdit 4.0pre2
getVirtualLineCount
public int getVirtualLineCount()
- Returns the number of virtual lines in the buffer.
- Since:
- jEdit 4.0pre1
isLineVisible
public final boolean isLineVisible(int line)
- Returns if the specified line is visible.
- Since:
- jEdit 4.0pre1
getFirstVisibleLine
public int getFirstVisibleLine()
- Returns the physical line number of the first visible line.
- Since:
- jEdit 4.0pre3
getLastVisibleLine
public int getLastVisibleLine()
- Returns the physical line number of the last visible line.
- Since:
- jEdit 4.0pre3
getNextVisibleLine
public int getNextVisibleLine(int line)
- Returns the next visible line after the specified line index.
- Since:
- jEdit 4.0pre1
getPrevVisibleLine
public int getPrevVisibleLine(int line)
- Returns the previous visible line before the specified line index.
- Since:
- jEdit 4.0pre1
physicalToVirtual
public int physicalToVirtual(int line)
- Converts a physical line number to a virtual line number.
- Since:
- jEdit 4.0pre1
virtualToPhysical
public int virtualToPhysical(int line)
- Converts a virtual line number to a physical line number.
- Since:
- jEdit 4.0pre1
collapseFold
public void collapseFold(int line)
- Collapses the fold at the specified physical line index.
- Since:
- jEdit 4.0pre1
expandFold
public int expandFold(int line,
boolean fully)
- Expands the fold at the specified physical line index.
- Since:
- jEdit 4.0pre3
expandAllFolds
public void expandAllFolds()
- Expands all folds.
- Since:
- jEdit 4.0pre1
expandFolds
public void expandFolds(char digit)
- This method should only be called from
actions.xml.- Since:
- jEdit 4.0pre1
expandFolds
public void expandFolds(int foldLevel)
- Expands all folds with the specified fold level.
- Since:
- jEdit 4.0pre1
narrow
public void narrow(int start,
int end)
- Narrows the visible portion of the buffer to the specified
line range.
- Since:
- jEdit 4.0pre1
_grab
public final void _grab(int index)
- Do not call this method. The only reason it is public is so
that the
Bufferclass can call it.
_release
public final void _release()
- Do not call this method. The only reason it is public is so
that the
Bufferclass can call it.
_getIndex
public final int _getIndex()
- Do not call this method. The only reason it is public is so
that the
Bufferclass can call it.
_invalidate
public void _invalidate(int startLine)
- Do not call this method. The only reason it is public is so
that the
Bufferclass can call it.
foldStructureChanged
public void foldStructureChanged()
- This method is only public so that the EditPane class can call it in
response to a buffer's fold handler change.
- Since:
- jEdit 4.0pre8
|
|||||||||
| Home >> All >> org >> gjt >> sp >> jedit >> [ textarea overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.gjt.sp.jedit.textarea.FoldVisibilityManager