Style.on(styles), Style.off(reverse(styles)) + Style.reset.off()); plain.append(items[1]); i = k + 2;
/** * Returns a new Text object where all the specified styles are applied to the full length of the * specified plain text. * @param plainText the string to apply all styles to. Must not contain markup! * @param styles the styles to apply to the full plain text * @return a new Text object */ public Text apply(String plainText, List<IStyle> styles) { if (plainText.length() == 0) { return new Text(0); } Text result = new Text(plainText.length()); IStyle[] all = styles.toArray(new IStyle[styles.size()]); result.sections.add(new StyledSection( 0, plainText.length(), Style.on(all), Style.off(reverse(all)) + Style.reset.off())); result.plain.append(plainText); result.length = result.plain.length(); return result; }
Style.on(styles), Style.off(reverse(styles)) + Style.reset.off()); plain.append(items[1]); i = k + 2;
/** * Returns a new Text object where all the specified styles are applied to the full length of the * specified plain text. * @param plainText the string to apply all styles to. Must not contain markup! * @param styles the styles to apply to the full plain text * @return a new Text object */ public Text apply(String plainText, List<IStyle> styles) { if (plainText.length() == 0) { return new Text(0); } Text result = new Text(plainText.length()); IStyle[] all = styles.toArray(new IStyle[styles.size()]); result.sections.add(new StyledSection( 0, plainText.length(), Style.on(all), Style.off(reverse(all)) + Style.reset.off())); result.plain.append(plainText); result.length = result.plain.length(); return result; }