当前位置: 首页>>代码示例>>Java>>正文


Java AttributedStyle.DEFAULT属性代码示例

本文整理汇总了Java中org.jline.utils.AttributedStyle.DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java AttributedStyle.DEFAULT属性的具体用法?Java AttributedStyle.DEFAULT怎么用?Java AttributedStyle.DEFAULT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.jline.utils.AttributedStyle的用法示例。


在下文中一共展示了AttributedStyle.DEFAULT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: appendLines

@Override
public void appendLines(List<AttributedString> lines, int width, int height) {
    int startLines = lines.size();
    if (state == State.Goto) {
        AttributedStringBuilder addrPromptLine = new AttributedStringBuilder();
        addrPromptLine.append('│');
        addrPromptLine.append(addressField.getAddressPrompt());
        AttributedStyle style = AttributedStyle.DEFAULT;
        if (!addressField.isCurrentInputValid()) {
            style = style.foreground(AttributedStyle.RED);
        }
        addrPromptLine.append(addressField.getCurrentInput(), style);
        View.padToLength(addrPromptLine, width - 1);
        addrPromptLine.append('│');
        lines.add(addrPromptLine.toAttributedString());

        AttributedStringBuilder addrPromptBottomLine = new AttributedStringBuilder();
        addrPromptBottomLine.append('└');
        View.horizontalLine(addrPromptBottomLine, width - 2);
        addrPromptBottomLine.append('┘');
        lines.add(addrPromptBottomLine.toAttributedString());

        AttributedStringBuilder actionsLine = new AttributedStringBuilder();
        actionsLine.append(" └Abort(");
        actionsLine.append("q", AttributedStyle.DEFAULT.underline());
        actionsLine.append(")┘ └Go(");
        actionsLine.append("⏎", addressField.isCurrentInputValid() ? AttributedStyle.DEFAULT.underline() : AttributedStyle.DEFAULT);
        actionsLine.append(")┘");
        lines.add(actionsLine.toAttributedString());
    } else {
        AttributedStringBuilder gotoLine = new AttributedStringBuilder();
        gotoLine.append(" └");
        gotoLine.append("G", AttributedStyle.DEFAULT.underline());
        gotoLine.append("oto┘");
        lines.add(gotoLine.toAttributedString());
    }
    int remainingHeight = height - (lines.size() - startLines);
    verticalBoxes.appendLines(lines, width, remainingHeight);
}
 
开发者ID:gilles-duboscq,项目名称:jvb,代码行数:39,代码来源:MemoryView.java

示例2: cell

@Override
protected void cell(AttributedStringBuilder asb, VSUChannel channel) {
    AttributedStyle style = channel.useDuration() ? AttributedStyle.DEFAULT : AttributedStyle.DEFAULT.faint();
    double durationMS = (double) channel.getDurationCycles() * 1000.0 / CPU.CLOCK_HZ;
    asb.append(String.format("%.1f", durationMS), style);
}
 
开发者ID:gilles-duboscq,项目名称:jvb,代码行数:6,代码来源:VSUView.java

示例3: appendLines

@Override
public void appendLines(List<AttributedString> lines, int width, int height) {
    int startLines = lines.size();
    if (state == State.Adding) {
        AttributedStringBuilder addrPromptLine = new AttributedStringBuilder();
        addrPromptLine.append('│');
        addrPromptLine.append(addressField.getAddressPrompt());
        AttributedStyle style = AttributedStyle.DEFAULT;
        if (!addressField.isCurrentInputValid()) {
            style = style.foreground(AttributedStyle.RED);
        }
        addrPromptLine.append(addressField.getCurrentInput(), style);
        View.padToLength(addrPromptLine, width - 1);
        addrPromptLine.append('│');
        lines.add(addrPromptLine.toAttributedString());

        AttributedStringBuilder modeLine = new AttributedStringBuilder();
        modeLine.append('│');
        if (addingExec) {
            modeLine.style(AttributedStyle.INVERSE);
        }
        modeLine.append('E');
        modeLine.append("X", AttributedStyle.DEFAULT.underline());
        modeLine.append("EC");
        modeLine.style(AttributedStyle.INVERSE_OFF);
        modeLine.append(' ');
        if (addingRead) {
            modeLine.style(AttributedStyle.INVERSE);
        }
        modeLine.append("R", AttributedStyle.DEFAULT.underline());
        modeLine.append("EAD");
        modeLine.style(AttributedStyle.INVERSE_OFF);
        modeLine.append(' ');
        if (addingWrite) {
            modeLine.style(AttributedStyle.INVERSE);
        }
        modeLine.append("W", AttributedStyle.DEFAULT.underline());
        modeLine.append("RITE");
        modeLine.style(AttributedStyle.INVERSE_OFF);
        View.padToLength(modeLine, width - 1);
        modeLine.append('│');
        lines.add(modeLine.toAttributedString());

        AttributedStringBuilder addrPromptBottomLine = new AttributedStringBuilder();
        addrPromptBottomLine.append('└');
        View.horizontalLine(addrPromptBottomLine, width - 2);
        addrPromptBottomLine.append('┘');
        lines.add(addrPromptBottomLine.toAttributedString());

        AttributedStringBuilder actionsLine = new AttributedStringBuilder();
        actionsLine.append(" └Abort(");
        actionsLine.append("q", AttributedStyle.DEFAULT.underline());
        actionsLine.append(")┘ └Accept(");
        actionsLine.append("⏎", addressField.isCurrentInputValid() ? AttributedStyle.DEFAULT.underline() : AttributedStyle.DEFAULT);
        actionsLine.append(")┘");
        lines.add(actionsLine.toAttributedString());
    } else {
        AttributedStringBuilder addLine = new AttributedStringBuilder();
        addLine.append(" └");
        addLine.append("A", AttributedStyle.DEFAULT.underline());
        addLine.append("dd┘");
        lines.add(addLine.toAttributedString());
    }
    int remainingHeight = height - (lines.size() - startLines);
    verticalBoxes.appendLines(lines, width, remainingHeight);
}
 
开发者ID:gilles-duboscq,项目名称:jvb,代码行数:66,代码来源:Breakpoints.java

示例4: getStyle

private AttributedStyle getStyle(ColorType color) {
    // This check is done to allow for default contrasting color texts to be shown on black or white screens
    return color == ColorType.BLACK || color == ColorType.WHITE ? AttributedStyle.DEFAULT
            : AttributedStyle.DEFAULT.foreground(color.value);
}
 
开发者ID:anand1st,项目名称:sshd-shell-spring-boot,代码行数:5,代码来源:TerminalProcessor.java

示例5: makeStyle

public static AttributedStyle makeStyle(String... styles) {
    AttributedStyle attributedStyle = AttributedStyle.DEFAULT;
    return makeStyle(attributedStyle, styles);
}
 
开发者ID:aspectran,项目名称:aspectran,代码行数:4,代码来源:JLineAnsiStyler.java


注:本文中的org.jline.utils.AttributedStyle.DEFAULT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。