public AttributedStringBuilder styled(AttributedStyle style, CharSequence cs) { return styled(s -> style, sb -> sb.append(cs)); }
public AttributedStringBuilder styled(Function<AttributedStyle,AttributedStyle> style, CharSequence cs) { return styled(style, sb -> sb.append(cs)); }
protected String getDisplay(Terminal terminal, Path p) { // TODO: use $LS_COLORS for output String name = p.getFileName().toString(); if (Files.isDirectory(p)) { AttributedStringBuilder sb = new AttributedStringBuilder(); sb.styled(AttributedStyle.BOLD.foreground(AttributedStyle.RED), name); sb.append("/"); name = sb.toAnsi(terminal); } else if (Files.isSymbolicLink(p)) { AttributedStringBuilder sb = new AttributedStringBuilder(); sb.styled(AttributedStyle.BOLD.foreground(AttributedStyle.RED), name); sb.append("@"); name = sb.toAnsi(terminal); } return name; }
protected String getDisplay(Terminal terminal, Path p) { // TODO: use $LS_COLORS for output String name = p.getFileName().toString(); if (Files.isDirectory(p)) { AttributedStringBuilder sb = new AttributedStringBuilder(); sb.styled(AttributedStyle.BOLD.foreground(AttributedStyle.RED), name); sb.append("/"); name = sb.toAnsi(terminal); } else if (Files.isSymbolicLink(p)) { AttributedStringBuilder sb = new AttributedStringBuilder(); sb.styled(AttributedStyle.BOLD.foreground(AttributedStyle.RED), name); sb.append("@"); name = sb.toAnsi(terminal); } return name; }
protected String getDisplay(Terminal terminal, Path p) { // TODO: use $LS_COLORS for output String name = p.getFileName().toString(); if (Files.isDirectory(p)) { AttributedStringBuilder sb = new AttributedStringBuilder(); sb.styled(AttributedStyle.BOLD.foreground(AttributedStyle.RED), name); sb.append("/"); name = sb.toAnsi(terminal); } else if (Files.isSymbolicLink(p)) { AttributedStringBuilder sb = new AttributedStringBuilder(); sb.styled(AttributedStyle.BOLD.foreground(AttributedStyle.RED), name); sb.append("@"); name = sb.toAnsi(terminal); } return name; }
AttributedStringBuilder sb = new AttributedStringBuilder(); sb.append(" "); sb.styled(AttributedStyle::bold, String.format("%3d", entry.index() + 1)); if (opt.isSet("d")) { sb.append(" ");
AttributedStringBuilder sb = new AttributedStringBuilder(); sb.append(" "); sb.styled(AttributedStyle::bold, String.format("%3d", entry.index() + 1)); if (opt.isSet("d")) { sb.append(" ");