本文整理了Java中org.fusesource.jansi.internal.WindowsSupport.getLastErrorMessage()
方法的一些代码示例,展示了WindowsSupport.getLastErrorMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WindowsSupport.getLastErrorMessage()
方法的具体详情如下:
包路径:org.fusesource.jansi.internal.WindowsSupport
类名称:WindowsSupport
方法名:getLastErrorMessage
暂无
代码示例来源:origin: org.jline/jline
@Override
protected void writeConsole(char[] text, int len) throws IOException {
if (WriteConsoleW(console, text, len, writtenChars, 0) == 0) {
throw new IOException("Failed to write to console: " + WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.jline/jline
private void applyCursorPosition() throws IOException {
info.cursorPosition.x = (short) Math.max(0, Math.min(info.size.x - 1, info.cursorPosition.x));
info.cursorPosition.y = (short) Math.max(0, Math.min(info.size.y - 1, info.cursorPosition.y));
if (SetConsoleCursorPosition(console, info.cursorPosition.copy()) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.fusesource.jansi/jansi
private void applyAttribute() throws IOException {
out.flush(); // expected diff with WindowsAnsiPrintStream.java
short attributes = info.attributes;
if (negative) {
attributes = invertAttributeColors(attributes);
}
if (SetConsoleTextAttribute(console, attributes) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.jline/jline
private void getConsoleInfo() throws IOException {
out.flush();
if (GetConsoleScreenBufferInfo(console, info) == 0) {
throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
}
if (negative) {
info.attributes = invertAttributeColors(info.attributes);
}
}
代码示例来源:origin: org.fusesource.jansi/jansi
private void applyAttribute() throws IOException {
ps.flush(); // expected diff with WindowsAnsiOutputStream.java
short attributes = info.attributes;
if (negative) {
attributes = invertAttributeColors(attributes);
}
if (SetConsoleTextAttribute(console, attributes) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.gradle/gradle-logging
private void applyCursorPosition() throws IOException {
if (SetConsoleCursorPosition(CONSOLE, info.cursorPosition.copy()) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.gradle/gradle-logging
private void getConsoleInfo() throws IOException {
out.flush();
if (GetConsoleScreenBufferInfo(CONSOLE, info) == 0) {
throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
}
if (negative) {
info.attributes = invertAttributeColors(info.attributes);
}
}
代码示例来源:origin: org.fusesource.jansi/jansi
private void getConsoleInfo() throws IOException {
ps.flush(); // expected diff with WindowsAnsiOutputStream.java
if (GetConsoleScreenBufferInfo(console, info) == 0) {
throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
}
if (negative) {
info.attributes = invertAttributeColors(info.attributes);
}
}
代码示例来源:origin: org.fusesource.jansi/jansi
private void getConsoleInfo() throws IOException {
out.flush(); // expected diff with WindowsAnsiPrintStream.java
if (GetConsoleScreenBufferInfo(console, info) == 0) {
throw new IOException("Could not get the screen info: " + WindowsSupport.getLastErrorMessage());
}
if (negative) {
info.attributes = invertAttributeColors(info.attributes);
}
}
代码示例来源:origin: org.fusesource.jansi/jansi
private void applyCursorPosition() throws IOException {
if (SetConsoleCursorPosition(console, info.cursorPosition.copy()) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.aesh/aesh-readline
@Override
public void accept(int[] input) {
CharBuffer buffer = Encoder.toCharBuffer(input);
char[] chars = buffer.array();
if (WriteConsoleW(console, chars, chars.length, writtenChars, 0) == 0) {
LOGGER.log(Level.WARNING, "Failed to write out.", WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.gradle/gradle-logging
private void applyAttribute() throws IOException {
out.flush();
short attributes = info.attributes;
if (negative) {
attributes = invertAttributeColors(attributes);
}
if (SetConsoleTextAttribute(CONSOLE, attributes) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.fusesource.jansi/jansi
private void applyCursorPosition() throws IOException {
if (SetConsoleCursorPosition(console, info.cursorPosition.copy()) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.jline/jline
@Override
public Cursor getCursorPosition(IntConsumer discarded) {
CONSOLE_SCREEN_BUFFER_INFO info = new CONSOLE_SCREEN_BUFFER_INFO();
long console = GetStdHandle(STD_OUTPUT_HANDLE);
if (GetConsoleScreenBufferInfo(console, info) == 0) {
throw new IOError(new IOException("Could not get the cursor position: " + WindowsSupport.getLastErrorMessage()));
}
return new Cursor(info.cursorPosition.x, info.cursorPosition.y);
}
代码示例来源:origin: org.fusesource.jansi/jansi
@Override
protected void processInsertLine(int optionInt) throws IOException {
getConsoleInfo();
SMALL_RECT scroll = info.window.copy();
scroll.top = info.cursorPosition.y;
COORD org = new COORD();
org.x = 0;
org.y = (short)(info.cursorPosition.y + optionInt);
CHAR_INFO info = new CHAR_INFO();
info.attributes = originalColors;
info.unicodeChar = ' ';
if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.fusesource.jansi/jansi
@Override
protected void processDeleteLine(int optionInt) throws IOException {
getConsoleInfo();
SMALL_RECT scroll = info.window.copy();
scroll.top = info.cursorPosition.y;
COORD org = new COORD();
org.x = 0;
org.y = (short)(info.cursorPosition.y - optionInt);
CHAR_INFO info = new CHAR_INFO();
info.attributes = originalColors;
info.unicodeChar = ' ';
if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.fusesource.jansi/jansi
@Override
protected void processDeleteLine(int optionInt) throws IOException {
getConsoleInfo();
SMALL_RECT scroll = info.window.copy();
scroll.top = info.cursorPosition.y;
COORD org = new COORD();
org.x = 0;
org.y = (short)(info.cursorPosition.y - optionInt);
CHAR_INFO info = new CHAR_INFO();
info.attributes = originalColors;
info.unicodeChar = ' ';
if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.fusesource.jansi/jansi
@Override
protected void processInsertLine(int optionInt) throws IOException {
getConsoleInfo();
SMALL_RECT scroll = info.window.copy();
scroll.top = info.cursorPosition.y;
COORD org = new COORD();
org.x = 0;
org.y = (short)(info.cursorPosition.y + optionInt);
CHAR_INFO info = new CHAR_INFO();
info.attributes = originalColors;
info.unicodeChar = ' ';
if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.jline/jline
@Override
protected void processInsertLine(int optionInt) throws IOException {
getConsoleInfo();
SMALL_RECT scroll = info.window.copy();
scroll.top = info.cursorPosition.y;
COORD org = new COORD();
org.x = 0;
org.y = (short)(info.cursorPosition.y + optionInt);
CHAR_INFO info = new CHAR_INFO();
info.attributes = originalColors;
info.unicodeChar = ' ';
if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
代码示例来源:origin: org.jline/jline
@Override
protected void processDeleteLine(int optionInt) throws IOException {
getConsoleInfo();
SMALL_RECT scroll = info.window.copy();
scroll.top = info.cursorPosition.y;
COORD org = new COORD();
org.x = 0;
org.y = (short)(info.cursorPosition.y - optionInt);
CHAR_INFO info = new CHAR_INFO();
info.attributes = originalColors;
info.unicodeChar = ' ';
if (ScrollConsoleScreenBuffer(console, scroll, scroll, org, info) == 0) {
throw new IOException(WindowsSupport.getLastErrorMessage());
}
}
内容来源于网络,如有侵权,请联系作者删除!