@Test public void testLocaliseWithLineBreaks_LTR() throws Exception { Locale.setDefault(Locale.UK); Configurations.currentConfiguration = new Configuration(); String[] lines = new String[] { "Line 1", "Line 2", "Line 3", }; String expected = "<html><body style='width: 100%'><div align=left><p>Line 1</p><br><p>Line 2</p><br><p>Line 3</p></div></body></html>"; assertThat(HtmlUtils.localiseWithLineBreaks(lines)).isEqualTo(expected); }
public static String localiseWithLineBreaks(String[] lines) { final StringBuilder sb; if (Languages.isLeftToRight()) { sb = new StringBuilder("<html><body style='width: 100%'><div align=left>"); } else { sb = new StringBuilder("<html><body style='width: 100%'><div align=right>"); } wrapAndLineBreak(lines, sb); sb.append("</div></body></html>"); return sb.toString(); }
HtmlUtils { public static String localiseWithLineBreaks(String[] lines) { final StringBuilder sb; if (Languages.isLeftToRight()) { sb = new StringBuilder("<html><body style='width: 100%'><div align=left>"); } else { sb = new StringBuilder("<html><body style='width: 100%'><div align=right>"); } wrapAndLineBreak(lines, sb); sb.append("</div></body></html>"); return sb.toString(); } }
HtmlUtils { public static String localiseWithLineBreaks(String[] lines) { final StringBuilder sb; if (Languages.isLeftToRight()) { sb = new StringBuilder("<html><body style='width: 100%'><div align=left>"); } else { sb = new StringBuilder("<html><body style='width: 100%'><div align=right>"); } wrapAndLineBreak(lines, sb); sb.append("</div></body></html>"); return sb.toString(); } private  HtmlUtils(); }
HtmlUtils { public static String localiseWithLineBreaks(String[] lines) { final StringBuilder sb; if (Languages.isLeftToRight()) { sb = new StringBuilder("<html><body style='width: 100%'><div align=left>"); } else { sb = new StringBuilder("<html><body style='width: 100%'><div align=right>"); } wrapAndLineBreak(lines, sb); sb.append("</div></body></html>"); return sb.toString(); } private  HtmlUtils(); static String localiseWithLineBreaks(String[] lines); static String localiseWithCenteredLinedBreaks(String[] lines); static String applyBoldFragments(String fragment, String sourceText); static String stripHtml(String html); }
HtmlUtils { public static String localiseWithLineBreaks(String[] lines) { final StringBuilder sb; if (Languages.isLeftToRight()) { sb = new StringBuilder("<html><body style='width: 100%'><div align=left>"); } else { sb = new StringBuilder("<html><body style='width: 100%'><div align=right>"); } wrapAndLineBreak(lines, sb); sb.append("</div></body></html>"); return sb.toString(); } private  HtmlUtils(); static String localiseWithLineBreaks(String[] lines); static String localiseWithCenteredLinedBreaks(String[] lines); static String applyBoldFragments(String fragment, String sourceText); static String stripHtml(String html);  }