forked from I2P_Developers/i2p.i2p
Implementation of customisable summary bar via routerconsole.summaryBar property
The initial attempt using mapping of strings to methods is shorter and neater, but also doesn't work so is commented out.
This commit is contained in:
@ -36,7 +36,7 @@ public class SummaryHelper extends HelperBase {
|
||||
//static final String THINSP = " / ";
|
||||
static final String THINSP = " / ";
|
||||
private static final char S = ',';
|
||||
static final String PROP_SUMMARYBAR = "routerconsole.summarybar";
|
||||
static final String PROP_SUMMARYBAR = "routerconsole.summaryBar";
|
||||
|
||||
static final String PRESET_FULL =
|
||||
"HelpAndFAQ" + S +
|
||||
@ -739,6 +739,18 @@ public class SummaryHelper extends HelperBase {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public String[] getSummaryBarSections() {
|
||||
String config = _context.getProperty(PROP_SUMMARYBAR, PRESET_FULL);
|
||||
return config.split("" + S);
|
||||
}
|
||||
|
||||
public void saveSummaryBarSections(String[] sections) {
|
||||
StringBuilder buf = new StringBuilder(512);
|
||||
for(int i = 0; i < sections.length; i++)
|
||||
buf.append(sections[i]).append(S);
|
||||
_context.router().saveConfig(PROP_SUMMARYBAR, buf.toString());
|
||||
}
|
||||
|
||||
/** output the summary bar to _out */
|
||||
public void renderSummaryBar() throws IOException {
|
||||
SummaryBarRenderer renderer = new SummaryBarRenderer(_context, this);
|
||||
|
Reference in New Issue
Block a user