remove concatentation within appends

This commit is contained in:
zzz
2014-02-10 18:33:32 +00:00
parent 1956068698
commit 72e96cdd23
4 changed files with 34 additions and 20 deletions

View File

@ -90,8 +90,11 @@ public class ConfigClientsHelper extends HelperBase {
/** clients */ /** clients */
public String getForm1() { public String getForm1() {
StringBuilder buf = new StringBuilder(1024); StringBuilder buf = new StringBuilder(1024);
buf.append("<table>\n"); buf.append("<table>\n" +
buf.append("<tr><th align=\"right\">" + _("Client") + "</th><th>" + _("Run at Startup?") + "</th><th>" + _("Control") + "</th><th align=\"left\">" + _("Class and arguments") + "</th></tr>\n"); "<tr><th align=\"right\">").append(_("Client")).append("</th><th>")
.append(_("Run at Startup?")).append("</th><th>")
.append(_("Control")).append("</th><th align=\"left\">")
.append(_("Class and arguments")).append("</th></tr>\n");
List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context); List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context);
for (int cur = 0; cur < clients.size(); cur++) { for (int cur = 0; cur < clients.size(); cur++) {
@ -134,8 +137,11 @@ public class ConfigClientsHelper extends HelperBase {
/** webapps */ /** webapps */
public String getForm2() { public String getForm2() {
StringBuilder buf = new StringBuilder(1024); StringBuilder buf = new StringBuilder(1024);
buf.append("<table>\n"); buf.append("<table>\n" +
buf.append("<tr><th align=\"right\">" + _("WebApp") + "</th><th>" + _("Run at Startup?") + "</th><th>" + _("Control") + "</th><th align=\"left\">" + _("Description") + "</th></tr>\n"); "<tr><th align=\"right\">").append(_("WebApp")).append("</th><th>")
.append(_("Run at Startup?")).append("</th><th>")
.append(_("Control")).append("</th><th align=\"left\">")
.append(_("Description")).append("</th></tr>\n");
Properties props = RouterConsoleRunner.webAppProperties(_context); Properties props = RouterConsoleRunner.webAppProperties(_context);
Set<String> keys = new TreeSet(props.keySet()); Set<String> keys = new TreeSet(props.keySet());
for (String name : keys) { for (String name : keys) {
@ -159,8 +165,11 @@ public class ConfigClientsHelper extends HelperBase {
/** plugins */ /** plugins */
public String getForm3() { public String getForm3() {
StringBuilder buf = new StringBuilder(1024); StringBuilder buf = new StringBuilder(1024);
buf.append("<table>\n"); buf.append("<table>\n" +
buf.append("<tr><th align=\"right\">" + _("Plugin") + "</th><th>" + _("Run at Startup?") + "</th><th>" + _("Control") + "</th><th align=\"left\">" + _("Description") + "</th></tr>\n"); "<tr><th align=\"right\">").append(_("Plugin")).append("</th><th>")
.append(_("Run at Startup?")).append("</th><th>")
.append(_("Control")).append("</th><th align=\"left\">")
.append(_("Description")).append("</th></tr>\n");
Properties props = PluginStarter.pluginProperties(); Properties props = PluginStarter.pluginProperties();
Set<String> keys = new TreeSet(props.keySet()); Set<String> keys = new TreeSet(props.keySet());
for (String name : keys) { for (String name : keys) {
@ -273,15 +282,20 @@ public class ConfigClientsHelper extends HelperBase {
// The icons were way too much, so there's an X in each button class, // The icons were way too much, so there's an X in each button class,
// remove if you wnat to put them back // remove if you wnat to put them back
if (showStartButton && (!ro) && !edit) { if (showStartButton && (!ro) && !edit) {
buf.append("<button type=\"submit\" class=\"Xaccept\" name=\"action\" value=\"Start ").append(index).append("\" >" + _("Start") + "<span class=hide> ").append(index).append("</span></button>"); buf.append("<button type=\"submit\" class=\"Xaccept\" name=\"action\" value=\"Start ").append(index).append("\" >")
.append(_("Start")).append("<span class=hide> ").append(index).append("</span></button>");
} }
if (showStopButton && (!edit)) if (showStopButton && (!edit))
buf.append("<button type=\"submit\" class=\"Xstop\" name=\"action\" value=\"Stop ").append(index).append("\" >" + _("Stop") + "<span class=hide> ").append(index).append("</span></button>"); buf.append("<button type=\"submit\" class=\"Xstop\" name=\"action\" value=\"Stop ").append(index).append("\" >")
.append(_("Stop")).append("<span class=hide> ").append(index).append("</span></button>");
if (showEditButton && (!edit) && !ro) if (showEditButton && (!edit) && !ro)
buf.append("<button type=\"submit\" class=\"Xadd\" name=\"edit\" value=\"Edit ").append(index).append("\" >" + _("Edit") + "<span class=hide> ").append(index).append("</span></button>"); buf.append("<button type=\"submit\" class=\"Xadd\" name=\"edit\" value=\"Edit ").append(index).append("\" >")
.append(_("Edit")).append("<span class=hide> ").append(index).append("</span></button>");
if (showUpdateButton && (!edit) && !ro) { if (showUpdateButton && (!edit) && !ro) {
buf.append("<button type=\"submit\" class=\"Xcheck\" name=\"action\" value=\"Check ").append(index).append("\" >" + _("Check for updates") + "<span class=hide> ").append(index).append("</span></button>"); buf.append("<button type=\"submit\" class=\"Xcheck\" name=\"action\" value=\"Check ").append(index).append("\" >")
buf.append("<button type=\"submit\" class=\"Xdownload\" name=\"action\" value=\"Update ").append(index).append("\" >" + _("Update") + "<span class=hide> ").append(index).append("</span></button>"); .append(_("Check for updates")).append("<span class=hide> ").append(index).append("</span></button>");
buf.append("<button type=\"submit\" class=\"Xdownload\" name=\"action\" value=\"Update ").append(index).append("\" >")
.append(_("Update")).append("<span class=hide> ").append(index).append("</span></button>");
} }
if (showDeleteButton && (!edit) && !ro) { if (showDeleteButton && (!edit) && !ro) {
buf.append("<button type=\"submit\" class=\"Xdelete\" name=\"action\" value=\"Delete ").append(index) buf.append("<button type=\"submit\" class=\"Xdelete\" name=\"action\" value=\"Delete ").append(index)

View File

@ -45,9 +45,9 @@ public class ConfigLoggingHelper extends HelperBase {
buf.append(prefix).append('=').append(level).append('\n'); buf.append(prefix).append('=').append(level).append('\n');
} }
buf.append("</textarea><br>\n"); buf.append("</textarea><br>\n");
buf.append("<i>" + _("Add additional logging statements above. Example: net.i2p.router.tunnel=WARN") + "</i><br>"); buf.append("<i>").append(_("Add additional logging statements above. Example: net.i2p.router.tunnel=WARN")).append("</i><br>");
buf.append("<i>" + _("Or put entries in the logger.config file. Example: logger.record.net.i2p.router.tunnel=WARN") + "</i><br>"); buf.append("<i>").append(_("Or put entries in the logger.config file. Example: logger.record.net.i2p.router.tunnel=WARN")).append("</i><br>");
buf.append("<i>" + _("Valid levels are DEBUG, INFO, WARN, ERROR, CRIT") + "</i>\n"); buf.append("<i>").append(_("Valid levels are DEBUG, INFO, WARN, ERROR, CRIT")).append("</i>\n");
/**** /****
// this is too big and ugly // this is too big and ugly

View File

@ -115,9 +115,9 @@ public class ConfigUpdateHelper extends HelperBase {
buf.append("\" selected=\"selected"); buf.append("\" selected=\"selected");
if (PERIODS[i] == -1) if (PERIODS[i] == -1)
buf.append("\">" + _("Never") + "</option>\n"); buf.append("\">").append(_("Never")).append("</option>\n");
else else
buf.append("\">" + _("Every") + " ").append(DataHelper.formatDuration2(PERIODS[i])).append("</option>\n"); buf.append("\">").append(_("Every")).append(' ').append(DataHelper.formatDuration2(PERIODS[i])).append("</option>\n");
} }
buf.append("</select>\n"); buf.append("</select>\n");
return buf.toString(); return buf.toString();

View File

@ -422,11 +422,11 @@ public class SummaryHelper extends HelperBase {
buf.append("<tr><td align=\"right\"><img src=\"/themes/console/images/"); buf.append("<tr><td align=\"right\"><img src=\"/themes/console/images/");
if (_context.clientManager().shouldPublishLeaseSet(h)) if (_context.clientManager().shouldPublishLeaseSet(h))
buf.append("server.png\" alt=\"Server\" title=\"" + _("Server") + "\">"); buf.append("server.png\" alt=\"Server\" title=\"").append(_("Server")).append("\">");
else else
buf.append("client.png\" alt=\"Client\" title=\"" + _("Client") + "\">"); buf.append("client.png\" alt=\"Client\" title=\"").append(_("Client")).append("\">");
buf.append("</td><td align=\"left\"><b><a href=\"tunnels#").append(h.toBase64().substring(0,4)); buf.append("</td><td align=\"left\"><b><a href=\"tunnels#").append(h.toBase64().substring(0,4));
buf.append("\" target=\"_top\" title=\"" + _("Show tunnels") + "\">"); buf.append("\" target=\"_top\" title=\"").append(_("Show tunnels")).append("\">");
if (name.length() < 18) if (name.length() < 18)
buf.append(name); buf.append(name);
else else
@ -861,7 +861,7 @@ public class SummaryHelper extends HelperBase {
.append("\"></td><td align=\"left\">") .append("\"></td><td align=\"left\">")
.append(_(sectionNames.get(section))) .append(_(sectionNames.get(section)))
.append("</td><td align=\"right\"><input type=\"hidden\" name=\"order_") .append("</td><td align=\"right\"><input type=\"hidden\" name=\"order_")
.append(i + "_" + section) .append(i).append('_').append(section)
.append("\" value=\"") .append("\" value=\"")
.append(i) .append(i)
.append("\">"); .append("\">");