本文整理了Java中org.jline.terminal.Attributes.<init>()
方法的一些代码示例,展示了Attributes.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attributes.<init>()
方法的具体详情如下:
包路径:org.jline.terminal.Attributes
类名称:Attributes
方法名:<init>
暂无
代码示例来源:origin: apache/flink
private Tuple2<Attributes, Map<Signal, SignalHandler>> prepareTerminal() {
final Terminal terminal = client.getTerminal();
final Attributes prevAttributes = terminal.getAttributes();
// adopted from org.jline.builtins.Nano
// see also https://en.wikibooks.org/wiki/Serial_Programming/termios#Basic_Configuration_of_a_Serial_Interface
// no line processing
// canonical mode off, echo off, echo newline off, extended input processing off
Attributes newAttr = new Attributes(prevAttributes);
newAttr.setLocalFlags(EnumSet.of(LocalFlag.ICANON, LocalFlag.ECHO, LocalFlag.IEXTEN), false);
// turn off input processing
newAttr.setInputFlags(EnumSet.of(Attributes.InputFlag.IXON, Attributes.InputFlag.ICRNL, Attributes.InputFlag.INLCR), false);
// one input byte is enough to return from read, inter-character timer off
newAttr.setControlChar(Attributes.ControlChar.VMIN, 1);
newAttr.setControlChar(Attributes.ControlChar.VTIME, 0);
newAttr.setControlChar(Attributes.ControlChar.VINTR, 0);
terminal.setAttributes(newAttr);
final Map<Signal, SignalHandler> prevSignals = new HashMap<>();
prevSignals.put(Signal.WINCH, terminal.handle(Signal.WINCH, this::handleSignal));
prevSignals.put(Signal.INT, terminal.handle(Signal.INT, this::handleSignal));
prevSignals.put(Signal.QUIT, terminal.handle(Signal.QUIT, this::handleSignal));
return Tuple2.of(prevAttributes, prevSignals);
}
代码示例来源:origin: org.jline/jline
public Attributes getAttributes() {
Attributes attr = new Attributes();
attr.copy(attributes);
return attr;
}
代码示例来源:origin: org.jline/jline
@Override
public void setAttr(Attributes attr) throws IOException {
current = new Attributes(attr);
doSetAttr(attr);
}
代码示例来源:origin: org.jline/jline
public Attributes getAttributes() {
Attributes attr = new Attributes();
attr.copy(attributes);
return attr;
}
代码示例来源:origin: org.jline/jline
public Attributes getAttributes() {
int mode = getConsoleMode();
if ((mode & ENABLE_ECHO_INPUT) != 0) {
attributes.setLocalFlag(Attributes.LocalFlag.ECHO, true);
}
if ((mode & ENABLE_LINE_INPUT) != 0) {
attributes.setLocalFlag(Attributes.LocalFlag.ICANON, true);
}
return new Attributes(attributes);
}
代码示例来源:origin: org.jline/jline
public Attributes enterRawMode() {
Attributes prvAttr = getAttributes();
Attributes newAttr = new Attributes(prvAttr);
newAttr.setLocalFlags(EnumSet.of(LocalFlag.ICANON, LocalFlag.ECHO, LocalFlag.IEXTEN), false);
newAttr.setInputFlags(EnumSet.of(InputFlag.IXON, InputFlag.ICRNL, InputFlag.INLCR), false);
newAttr.setControlChar(ControlChar.VMIN, 0);
newAttr.setControlChar(ControlChar.VTIME, 1);
setAttributes(newAttr);
return prvAttr;
}
代码示例来源:origin: org.jline/jline
static Attributes doGetAttr(String cfg) throws IOException {
Attributes attributes = new Attributes();
for (InputFlag flag : InputFlag.values()) {
Boolean value = doGetFlag(cfg, flag);
代码示例来源:origin: org.jline/jline
this.reader = NonBlocking.nonBlocking(getName(), input, encoding());
this.writer = new PrintWriter(new OutputStreamWriter(output, encoding()));
this.attributes = new Attributes();
this.attributes.setControlChar(ControlChar.VERASE, (char) 127);
this.attributes.setControlChar(ControlChar.VWERASE, (char) 23);
代码示例来源:origin: apache/samza
Attributes newAttributes = new Attributes(prevStatus.attributes);
代码示例来源:origin: org.jline/jline
public Attributes toAttributes() {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline-terminal-jna
public Attributes toAttributes() {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline
protected Attributes toAttributes(CLibrary.Termios tio) {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline
public Attributes toAttributes() {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline
public Attributes toAttributes() {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline-terminal-jna
public Attributes toAttributes() {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline-terminal-jna
public Attributes toAttributes() {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline
protected Attributes toAttributes(CLibrary.Termios tio) {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline
protected Attributes toAttributes(CLibrary.Termios tio) {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline
protected Attributes toAttributes(CLibrary.Termios tio) {
Attributes attr = new Attributes();
代码示例来源:origin: org.jline/jline
public Attributes toAttributes() {
Attributes attr = new Attributes();
内容来源于网络,如有侵权,请联系作者删除!