Package org.jline.terminal.impl.jni.win
Class WindowsAnsiWriter
java.lang.Object
java.io.Writer
java.io.FilterWriter
org.jline.utils.AnsiWriter
org.jline.terminal.impl.jni.win.WindowsAnsiWriter
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
A Windows ANSI escape processor, that uses JNA to access native platform
API's to change the console attributes.
- Since:
- 1.0
- Author:
- Hiram Chirino, Joris Kuipers
-
Field Summary
Fields inherited from class org.jline.utils.AnsiWriter
ATTRIBUTE_BLINK_FAST, ATTRIBUTE_BLINK_OFF, ATTRIBUTE_BLINK_SLOW, ATTRIBUTE_CONCEAL_OFF, ATTRIBUTE_CONCEAL_ON, ATTRIBUTE_INTENSITY_BOLD, ATTRIBUTE_INTENSITY_FAINT, ATTRIBUTE_INTENSITY_NORMAL, ATTRIBUTE_ITALIC, ATTRIBUTE_NEGATIVE_Off, ATTRIBUTE_NEGATIVE_OFF, ATTRIBUTE_NEGATIVE_ON, ATTRIBUTE_UNDERLINE, ATTRIBUTE_UNDERLINE_DOUBLE, ATTRIBUTE_UNDERLINE_OFF, BLACK, BLUE, CYAN, ERASE_LINE, ERASE_LINE_TO_BEGINING, ERASE_LINE_TO_END, ERASE_SCREEN, ERASE_SCREEN_TO_BEGINING, ERASE_SCREEN_TO_END, GREEN, MAGENTA, RED, WHITE, YELLOW
Fields inherited from class java.io.FilterWriter
out
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
processSGR 0
corresponding toReset / Normal
protected void
processChangeWindowTitle
(String title) processOSC 2;text BEL
corresponding toChange Window title
protected void
processCursorDown
(int count) processCSI n B
corresponding toCUD – Cursor Down
protected void
processCursorDownLine
(int count) processCSI n E
corresponding toCNL – Cursor Next Line
protected void
processCursorLeft
(int count) processCSI n D
corresponding toCUB – Cursor Back
protected void
processCursorRight
(int count) processCSI n C
corresponding toCUF – Cursor Forward
protected void
processCursorTo
(int row, int col) processCSI n ; m H
corresponding toCUP – Cursor Position
orCSI n ; m f
corresponding toHVP – Horizontal and Vertical Position
protected void
processCursorToColumn
(int x) processCSI n G
corresponding toCHA – Cursor Horizontal Absolute
protected void
processCursorUp
(int count) processCSI n A
corresponding toCUU – Cursor Up
protected void
processCursorUpLine
(int count) processCSI n F
corresponding toCPL – Cursor Previous Line
protected void
processSGR 49
corresponding toDefault background color
protected void
processSGR 39
corresponding toDefault text color (foreground)
protected void
processDeleteLine
(int optionInt) ProcessCSI s
ANSI code, corresponding toDL – Delete Line
protected void
processEraseLine
(int eraseOption) ProcessCSI n K
ANSI code, corresponding toED – Erase in Line
protected void
processEraseScreen
(int eraseOption) ProcessCSI n J
ANSI code, corresponding toED – Erase in Display
protected void
processInsertLine
(int optionInt) ProcessCSI s
ANSI code, corresponding toIL – Insert Line
protected void
ProcessCSI u
ANSI code, corresponding toRCP – Restore Cursor Position
protected void
ProcessCSI s
ANSI code, corresponding toSCP – Save Cursor Position
protected void
processSetAttribute
(int attribute) processSGR
other than0
(reset),30-39
(foreground),40-49
(background),90-97
(foreground high intensity) or100-107
(background high intensity)protected void
processSetBackgroundColorExt
(int paletteIndex) processSGR 48
corresponding toextended set background color
with a palette of 255 colors.protected void
processSetForegroundColorExt
(int paletteIndex) processSGR 38
corresponding toextended set text color (foreground)
with a palette of 255 colors.Methods inherited from class org.jline.utils.AnsiWriter
close, processChangeIconName, processChangeIconNameAndWindowTitle, processCharsetSelect, processScrollDown, processScrollUp, processSetBackgroundColor, processSetBackgroundColor, processSetBackgroundColorExt, processSetForegroundColor, processSetForegroundColor, processSetForegroundColorExt, processUnknownExtension, processUnknownOperatingSystemCommand, write, write, write
Methods inherited from class java.io.FilterWriter
flush
-
Constructor Details
-
WindowsAnsiWriter
- Throws:
IOException
-
-
Method Details
-
processEraseScreen
Description copied from class:AnsiWriter
ProcessCSI n J
ANSI code, corresponding toED – Erase in Display
- Overrides:
processEraseScreen
in classAnsiWriter
- Parameters:
eraseOption
- the erase option- Throws:
IOException
- if an error occurs
-
processEraseLine
Description copied from class:AnsiWriter
ProcessCSI n K
ANSI code, corresponding toED – Erase in Line
- Overrides:
processEraseLine
in classAnsiWriter
- Parameters:
eraseOption
- the erase option- Throws:
IOException
- if an error occurs
-
processCursorUpLine
Description copied from class:AnsiWriter
processCSI n F
corresponding toCPL – Cursor Previous Line
- Overrides:
processCursorUpLine
in classAnsiWriter
- Parameters:
count
- line count- Throws:
IOException
- if an error occurs
-
processCursorDownLine
Description copied from class:AnsiWriter
processCSI n E
corresponding toCNL – Cursor Next Line
- Overrides:
processCursorDownLine
in classAnsiWriter
- Parameters:
count
- line count- Throws:
IOException
- if an error occurs
-
processCursorLeft
Description copied from class:AnsiWriter
processCSI n D
corresponding toCUB – Cursor Back
- Overrides:
processCursorLeft
in classAnsiWriter
- Parameters:
count
- the count- Throws:
IOException
- if an error occurs
-
processCursorRight
Description copied from class:AnsiWriter
processCSI n C
corresponding toCUF – Cursor Forward
- Overrides:
processCursorRight
in classAnsiWriter
- Parameters:
count
- the count- Throws:
IOException
- if an error occurs
-
processCursorDown
Description copied from class:AnsiWriter
processCSI n B
corresponding toCUD – Cursor Down
- Overrides:
processCursorDown
in classAnsiWriter
- Parameters:
count
- the count- Throws:
IOException
- if an error occurs
-
processCursorUp
Description copied from class:AnsiWriter
processCSI n A
corresponding toCUU – Cursor Up
- Overrides:
processCursorUp
in classAnsiWriter
- Parameters:
count
- the count- Throws:
IOException
- if an error occurs
-
processCursorTo
Description copied from class:AnsiWriter
processCSI n ; m H
corresponding toCUP – Cursor Position
orCSI n ; m f
corresponding toHVP – Horizontal and Vertical Position
- Overrides:
processCursorTo
in classAnsiWriter
- Parameters:
row
- the rowcol
- the column- Throws:
IOException
- if an error occurs
-
processCursorToColumn
Description copied from class:AnsiWriter
processCSI n G
corresponding toCHA – Cursor Horizontal Absolute
- Overrides:
processCursorToColumn
in classAnsiWriter
- Parameters:
x
- the column- Throws:
IOException
- if an error occurs
-
processSetForegroundColorExt
Description copied from class:AnsiWriter
processSGR 38
corresponding toextended set text color (foreground)
with a palette of 255 colors.- Overrides:
processSetForegroundColorExt
in classAnsiWriter
- Parameters:
paletteIndex
- the text color in the palette- Throws:
IOException
- if an error occurs
-
processSetBackgroundColorExt
Description copied from class:AnsiWriter
processSGR 48
corresponding toextended set background color
with a palette of 255 colors.- Overrides:
processSetBackgroundColorExt
in classAnsiWriter
- Parameters:
paletteIndex
- the background color in the palette- Throws:
IOException
- if an error occurs
-
processDefaultTextColor
Description copied from class:AnsiWriter
processSGR 39
corresponding toDefault text color (foreground)
- Overrides:
processDefaultTextColor
in classAnsiWriter
- Throws:
IOException
- if an error occurs
-
processDefaultBackgroundColor
Description copied from class:AnsiWriter
processSGR 49
corresponding toDefault background color
- Overrides:
processDefaultBackgroundColor
in classAnsiWriter
- Throws:
IOException
- if an error occurs
-
processAttributeRest
Description copied from class:AnsiWriter
processSGR 0
corresponding toReset / Normal
- Overrides:
processAttributeRest
in classAnsiWriter
- Throws:
IOException
- if an error occurs
-
processSetAttribute
Description copied from class:AnsiWriter
processSGR
other than0
(reset),30-39
(foreground),40-49
(background),90-97
(foreground high intensity) or100-107
(background high intensity)- Overrides:
processSetAttribute
in classAnsiWriter
- Parameters:
attribute
- the attribute to set- Throws:
IOException
- if an error occurs- See Also:
-
processSaveCursorPosition
Description copied from class:AnsiWriter
ProcessCSI s
ANSI code, corresponding toSCP – Save Cursor Position
- Overrides:
processSaveCursorPosition
in classAnsiWriter
- Throws:
IOException
- if an error occurs
-
processRestoreCursorPosition
Description copied from class:AnsiWriter
ProcessCSI u
ANSI code, corresponding toRCP – Restore Cursor Position
- Overrides:
processRestoreCursorPosition
in classAnsiWriter
- Throws:
IOException
- if an error occurs
-
processInsertLine
Description copied from class:AnsiWriter
ProcessCSI s
ANSI code, corresponding toIL – Insert Line
- Overrides:
processInsertLine
in classAnsiWriter
- Parameters:
optionInt
- the option- Throws:
IOException
- if an error occurs
-
processDeleteLine
Description copied from class:AnsiWriter
ProcessCSI s
ANSI code, corresponding toDL – Delete Line
- Overrides:
processDeleteLine
in classAnsiWriter
- Parameters:
optionInt
- the option- Throws:
IOException
- if an error occurs
-
processChangeWindowTitle
Description copied from class:AnsiWriter
processOSC 2;text BEL
corresponding toChange Window title
- Overrides:
processChangeWindowTitle
in classAnsiWriter
- Parameters:
title
- the title
-