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/reader/impl/DefaultHighlighter.java
/*
* Copyright (c) 2002-2021, 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.reader.impl;
import java.util.regex.Pattern;
import jdk.internal.org.jline.reader.LineReader;
import jdk.internal.org.jline.reader.LineReader.RegionType;
import jdk.internal.org.jline.reader.Highlighter;
import jdk.internal.org.jline.utils.AttributedString;
import jdk.internal.org.jline.utils.AttributedStringBuilder;
import jdk.internal.org.jline.utils.AttributedStyle;
import jdk.internal.org.jline.utils.WCWidth;
public class DefaultHighlighter implements Highlighter {
protected Pattern errorPattern;
protected int errorIndex = -1;
@Override
public void setErrorPattern(Pattern errorPattern) {
this.errorPattern = errorPattern;
}
@Override
public void setErrorIndex(int errorIndex) {
this.errorIndex = errorIndex;
}
@Override
public AttributedString highlight(LineReader reader, String buffer) {
int underlineStart = -1;
int underlineEnd = -1;
int negativeStart = -1;
int negativeEnd = -1;
String search = reader.getSearchTerm();
if (search != null && search.length() > 0) {
underlineStart = buffer.indexOf(search);
if (underlineStart >= 0) {
underlineEnd = underlineStart + search.length() - 1;
}
}
if (reader.getRegionActive() != RegionType.NONE) {
negativeStart = reader.getRegionMark();
negativeEnd = reader.getBuffer().cursor();
if (negativeStart > negativeEnd) {
int x = negativeEnd;
negativeEnd = negativeStart;
negativeStart = x;
}
if (reader.getRegionActive() == RegionType.LINE) {
while (negativeStart > 0 && reader.getBuffer().atChar(negativeStart - 1) != '\n') {
negativeStart--;
}
while (negativeEnd < reader.getBuffer().length() - 1 && reader.getBuffer().atChar(negativeEnd + 1) != '\n') {
negativeEnd++;
}
}
}
AttributedStringBuilder sb = new AttributedStringBuilder();
for (int i = 0; i < buffer.length(); i++) {
if (i == underlineStart) {
sb.style(AttributedStyle::underline);
}
if (i == negativeStart) {
sb.style(AttributedStyle::inverse);
}
if (i == errorIndex) {
sb.style(AttributedStyle::inverse);
}
char c = buffer.charAt(i);
if (c == '\t' || c == '\n') {
sb.append(c);
} else if (c < 32) {
sb.style(AttributedStyle::inverseNeg)
.append('^')
.append((char) (c + '@'))
.style(AttributedStyle::inverseNeg);
} else {
int w = WCWidth.wcwidth(c);
if (w > 0) {
sb.append(c);
}
}
if (i == underlineEnd) {
sb.style(AttributedStyle::underlineOff);
}
if (i == negativeEnd) {
sb.style(AttributedStyle::inverseOff);
}
if (i == errorIndex) {
sb.style(AttributedStyle::inverseOff);
}
}
if (errorPattern != null) {
sb.styleMatches(errorPattern, AttributedStyle.INVERSE);
}
return sb.toAttributedString();
}
}
⏎ jdk/internal/org/jline/reader/impl/DefaultHighlighter.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, ≈39🔥, 0💬
Popular Posts:
Where to get the Java source code for Connector/J 8.0 Core API module? Java source code files for Co...
Old version of xml-apis.jar. JAR File Size and Download Location: File name: xmlParserAPIs.jar File ...
The JDT project provides the tool plug-ins that implement a Java IDE supporting the development of a...
If you are a Java developer, it is very often that you need to use some 3rd party libraries to perfo...
The Web Services Description Language for Java Toolkit (WSDL4J), Release 1.6.2, allows the creation,...