Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.internal.le.jmod - Internal Line Editing Module
JDK 17 jdk.internal.le.jmod is the JMOD file for JDK 17 Internal Line Editing module.
JDK 17 Internal Line Editing module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.internal.le.jmod.
JDK 17 Internal Line Editing module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Internal Line Editing module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.internal.le.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/org/jline/terminal/impl/CursorSupport.java
/*
* Copyright (c) 2002-2016, the original author or authors.
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.terminal.impl;
import jdk.internal.org.jline.terminal.Cursor;
import jdk.internal.org.jline.terminal.Terminal;
import jdk.internal.org.jline.utils.Curses;
import jdk.internal.org.jline.utils.InfoCmp;
import java.io.IOError;
import java.io.IOException;
import java.util.function.IntConsumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CursorSupport {
public static Cursor getCursorPosition(Terminal terminal, IntConsumer discarded) {
try {
String u6 = terminal.getStringCapability(InfoCmp.Capability.user6);
String u7 = terminal.getStringCapability(InfoCmp.Capability.user7);
if (u6 == null || u7 == null) {
return null;
}
// Prepare parser
boolean inc1 = false;
StringBuilder patb = new StringBuilder();
int index = 0;
while (index < u6.length()) {
char ch;
switch (ch = u6.charAt(index++)) {
case '\\':
switch (u6.charAt(index++)) {
case 'e':
case 'E':
patb.append("\\x1b");
break;
default:
throw new IllegalArgumentException();
}
break;
case '%':
ch = u6.charAt(index++);
switch (ch) {
case '%':
patb.append('%');
break;
case 'i':
inc1 = true;
break;
case 'd':
patb.append("([0-9]+)");
break;
default:
throw new IllegalArgumentException();
}
break;
default:
switch (ch) {
case '[':
patb.append('\\');
break;
}
patb.append(ch);
break;
}
}
Pattern pattern = Pattern.compile(patb.toString());
// Output cursor position request
Curses.tputs(terminal.writer(), u7);
terminal.flush();
StringBuilder sb = new StringBuilder();
int start = 0;
while (true) {
int c = terminal.reader().read();
if (c < 0) {
return null;
}
sb.append((char) c);
Matcher matcher = pattern.matcher(sb.substring(start));
if (matcher.matches()) {
int y = Integer.parseInt(matcher.group(1));
int x = Integer.parseInt(matcher.group(2));
if (inc1) {
x--;
y--;
}
if (discarded != null) {
for (int i = 0; i < start; i++) {
discarded.accept(sb.charAt(i));
}
}
return new Cursor(x, y);
} else if (!matcher.hitEnd()) {
start++;
}
}
} catch (IOException e) {
throw new IOError(e);
}
}
}
⏎ jdk/internal/org/jline/terminal/impl/CursorSupport.java
Or download all of them as a single archive file:
File name: jdk.internal.le-17.0.5-src.zip File size: 231458 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.internal.opt.jmod - Internal Opt Module
⇐ JDK 17 jdk.internal.jvmstat.jmod - Internal JVM Stat Module
2023-08-25, ≈40🔥, 0💬
Popular Posts:
How to run "jarsigner" command from JDK tools.jar file? "jarsigner" command allows you to digitally ...
JRE 5 sunjce_provider.jar is the JAR file for JRE 5 Sun JCE Provider, which provides implementations...
JDK 11 jdk.localedata.jmod is the JMOD file for JDK 11 Localedata module. JDK 11 Locale Data module ...
What Is poi-scratchpad-5.2.3.jar ?poi-scratchpad-5.2.3.jar is one of the JAR files for Apache POI 5....
How to download and install JDK (Java Development Kit) 1.4? If you want to write Java applications, ...