Package org.gjt.sp.jedit.textarea
Class DisplayManager
- java.lang.Object
-
- org.gjt.sp.jedit.textarea.DisplayManager
-
public class DisplayManager extends java.lang.ObjectManages low-level text display tasks, such as folding.- Since:
- jEdit 4.2pre1
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidbufferClosed(JEditBuffer buffer)voidcollapseFold(int line)Collapses the fold at the specified physical line index.voidexpandAllFolds()Expands all folds.intexpandFold(int line, boolean fully)Expands the fold at the specified physical line index.voidexpandFolds(char digit)This method should only be called fromactions.xml.voidexpandFolds(int foldLevel)Expands all folds with the specified fold level.voidexpandFolds(int foldLevel, boolean update)Expands all folds with the specified fold level.JEditBuffergetBuffer()intgetFirstVisibleLine()Returns the physical line number of the first visible line.intgetLastVisibleLine()Returns the physical line number of the last visible line.intgetNextVisibleLine(int line)Returns the next visible line after the specified line index, or (-1) if there is no next visible line.intgetPrevVisibleLine(int line)Returns the previous visible line before the specified line index.intgetScreenLineCount(int line)Returns how many screen lines contains the given physical line.intgetScrollLineCount()Returns the number of displayable lines It can be greater than the number of lines of the buffer when using soft wrap (a line can count for n lines), or when using folding, if the foldings are collapsedbooleanisLineVisible(int line)Returns if the specified physical line is visible.booleanisOutsideNarrowing(int line)Returns true if the display is narrowed and the specified line is outside of the narrowing.voidnarrow(int start, int end)Narrows the visible portion of the buffer to the specified line range.
-
-
-
Method Detail
-
bufferClosed
public static void bufferClosed(JEditBuffer buffer)
-
getBuffer
public JEditBuffer getBuffer()
- Since:
- jEdit 4.3pre3
-
isLineVisible
public boolean isLineVisible(int line)
Returns if the specified physical line is visible.- Parameters:
line- A physical line index- Since:
- jEdit 4.2pre1
-
isOutsideNarrowing
public boolean isOutsideNarrowing(int line)
Returns true if the display is narrowed and the specified line is outside of the narrowing.- Parameters:
line- A physical line index- Since:
- jEdit 4.5
-
getFirstVisibleLine
public int getFirstVisibleLine()
Returns the physical line number of the first visible line.- Since:
- jEdit 4.2pre1
-
getLastVisibleLine
public int getLastVisibleLine()
Returns the physical line number of the last visible line.- Since:
- jEdit 4.2pre1
-
getNextVisibleLine
public int getNextVisibleLine(int line)
Returns the next visible line after the specified line index, or (-1) if there is no next visible line.- Parameters:
line- A physical line index- Since:
- jEdit 4.0pre1
-
getPrevVisibleLine
public int getPrevVisibleLine(int line)
Returns the previous visible line before the specified line index.- Parameters:
line- a physical line index- Returns:
- the previous visible physical line or -1 if there is no visible line
- Since:
- jEdit 4.0pre1
-
getScreenLineCount
public int getScreenLineCount(int line)
Returns how many screen lines contains the given physical line. It can be greater than 1 when using soft wrap- Parameters:
line- the physical line- Returns:
- the screen line count
-
getScrollLineCount
public int getScrollLineCount()
Returns the number of displayable lines It can be greater than the number of lines of the buffer when using soft wrap (a line can count for n lines), or when using folding, if the foldings are collapsed- Returns:
- the number of displayable lines
-
collapseFold
public void collapseFold(int line)
Collapses the fold at the specified physical line index.- Parameters:
line- A physical line index- Since:
- jEdit 4.2pre1
-
expandFold
public int expandFold(int line, boolean fully)Expands the fold at the specified physical line index.- Parameters:
line- A physical line indexfully- If true, all subfolds will also be expanded- Returns:
- the line number of the first subfold, or -1 if none
- Since:
- jEdit 4.2pre1
-
expandAllFolds
public void expandAllFolds()
Expands all folds.- Since:
- jEdit 4.2pre1
-
expandFolds
public void expandFolds(char digit)
This method should only be called fromactions.xml.- Since:
- jEdit 4.2pre1
-
expandFolds
public void expandFolds(int foldLevel, boolean update)Expands all folds with the specified fold level.- Parameters:
foldLevel- The fold levelupdate- If true, notify the text area of a fold level change. Since this will automatically move the caret if still inside a fold, this may not be what we want.- Since:
- jEdit 4.5
-
expandFolds
public void expandFolds(int foldLevel)
Expands all folds with the specified fold level.- Parameters:
foldLevel- The fold level- Since:
- jEdit 4.2pre1
-
narrow
public void narrow(int start, int end)Narrows the visible portion of the buffer to the specified line range.- Parameters:
start- The first lineend- The last line- Since:
- jEdit 4.2pre1
-
-