APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.org.jline.utils

public Class Display

extends Object
Class Inheritance
Known Direct Subclasses
jdk.internal.org.jline.utils.Status.MovingCursorDisplay
Imports
java.util.Collections, .HashMap, .List, .Map, .Objects, java.util.stream.Collectors, jdk.internal.org.jline.terminal.Terminal, jdk.internal.org.jline.utils.InfoCmp.Capability

Handle display and visual cursor.
Author
Guillaume Nodet

Field Summary

Modifier and TypeField and Description
protected final boolean
protected int
protected int
protected final Map<InfoCmp.Capability, Integer>
protected final boolean
protected int
protected final boolean
protected boolean
public static boolean
DISABLE_CR

OpenJDK: When true, when the cursor is moved to column 0, carriage_return capability is not used, but rather the cursor is moved left the appropriate number of positions.

protected final boolean
protected List<AttributedString>
protected boolean
protected int
protected final Terminal
protected final boolean

Constructor Summary

AccessConstructor and Description
public
Display(Terminal terminal, boolean fullscreen)

Method Summary

Modifier and TypeMethod and Description
protected boolean
public void
clear()

Clears the whole screen.

private int
private int
public boolean

Returns:

true if line wrap is delayed, false otherwise
delayLineWrap
()

If cursor is at right margin, don't wrap immediately.

protected boolean
deleteChars(int nb)

protected boolean
deleteLines(int nb)

protected boolean
insertChars(int nb)

protected boolean
insertLines(int nb)

private static int[]
protected void
moveVisualCursorTo(int targetPos, List<AttributedString> newLines)

protected int
protected boolean
perform(InfoCmp.Capability single, InfoCmp.Capability multi, int nb)

pack-priv void
rawPrint(char c, int num)

pack-priv void
rawPrint(int c)

pack-priv void
public void
public void
resize(int rows, int columns)

public void
setDelayLineWrap(boolean v)

public void
update(List<AttributedString>
the lines to display
newLines
,
int
desired cursor position - see Size.cursorPos.
targetCursorPos
)

Update the display according to the new lines and flushes the output.

public void
update(List<AttributedString>
the lines to display
newLines
,
int
desired cursor position - see Size.cursorPos.
targetCursorPos
,
boolean
whether the output should be flushed or not
flush
)

Update the display according to the new lines.

public void
updateAnsi(List<String> newLines, int targetCursorPos)

public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

canScrollback to summary
protected final boolean canScroll
columnsback to summary
protected int columns
columns1back to summary
protected int columns1
costback to summary
protected final Map<InfoCmp.Capability, Integer> cost
cursorDownIsNewLineback to summary
protected final boolean cursorDownIsNewLine
cursorPosback to summary
protected int cursorPos
delayedWrapAtEolback to summary
protected final boolean delayedWrapAtEol
delayLineWrapback to summary
protected boolean delayLineWrap
DISABLE_CRback to summary
public static boolean DISABLE_CR

OpenJDK: When true, when the cursor is moved to column 0, carriage_return capability is not used, but rather the cursor is moved left the appropriate number of positions. This is useful when there's something already printed on the first line (which is not specified as a prompt), for example when the user is providing an input.

fullScreenback to summary
protected final boolean fullScreen
oldLinesback to summary
protected List<AttributedString> oldLines
resetback to summary
protected boolean reset
rowsback to summary
protected int rows
terminalback to summary
protected final Terminal terminal
wrapAtEolback to summary
protected final boolean wrapAtEol

Constructor Detail

Displayback to summary
public Display(Terminal terminal, boolean fullscreen)
Annotations
@SuppressWarnings:this-escape

Method Detail

canback to summary
protected boolean can(InfoCmp.Capability single, InfoCmp.Capability multi)
clearback to summary
public void clear()

Clears the whole screen. Use this method only when using full-screen / application mode.

computeCostback to summary
private int computeCost(InfoCmp.Capability cap)
costback to summary
private int cost(InfoCmp.Capability cap)
delayLineWrapback to summary
public boolean delayLineWrap()

If cursor is at right margin, don't wrap immediately. See org.jline.reader.LineReader.Option#DELAY_LINE_WRAP.

Returns:boolean

true if line wrap is delayed, false otherwise

deleteCharsback to summary
protected boolean deleteChars(int nb)
deleteLinesback to summary
protected boolean deleteLines(int nb)
insertCharsback to summary
protected boolean insertChars(int nb)
insertLinesback to summary
protected boolean insertLines(int nb)
longestCommonback to summary
private static int[] longestCommon(List<AttributedString> l1, List<AttributedString> l2)
moveVisualCursorToback to summary
protected void moveVisualCursorTo(int targetPos, List<AttributedString> newLines)
moveVisualCursorToback to summary
protected int moveVisualCursorTo(int i1)
performback to summary
protected boolean perform(InfoCmp.Capability single, InfoCmp.Capability multi, int nb)
rawPrintback to summary
pack-priv void rawPrint(char c, int num)
rawPrintback to summary
pack-priv void rawPrint(int c)
rawPrintback to summary
pack-priv void rawPrint(AttributedString str)
resetback to summary
public void reset()
resizeback to summary
public void resize(int rows, int columns)
setDelayLineWrapback to summary
public void setDelayLineWrap(boolean v)
updateback to summary
public void update(List<AttributedString> newLines, int targetCursorPos)

Update the display according to the new lines and flushes the output.

Parameters
newLines:List<AttributedString>

the lines to display

targetCursorPos:int

desired cursor position - see Size.cursorPos.

updateback to summary
public void update(List<AttributedString> newLines, int targetCursorPos, boolean flush)

Update the display according to the new lines.

Parameters
newLines:List<AttributedString>

the lines to display

targetCursorPos:int

desired cursor position - see Size.cursorPos.

flush:boolean

whether the output should be flushed or not

updateAnsiback to summary
public void updateAnsi(List<String> newLines, int targetCursorPos)
wcwidthback to summary
public int wcwidth(String str)