's { final WeblogSummary wsum = WeblogSummary.getSummary(ctx.dc); final class DoLink { Element parent; int num; String text; boolean permalink; public DoLink(Element parent, int num, String text) { this.parent = parent; this.num = num; this.text = text; this.permalink = false; } public DoLink(Element parent, int num, String text, boolean permalink) { this.parent = parent; this.num = num; this.text = text; this.permalink = permalink; } public Element doit() { final WeblogSummary.EntrySummary esum; if ( wsum != null && wsum.entries != null ) esum = wsum.entries.get(num); else esum = null; Element a; if ( esum != null ) { a = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "a"); a.setAttributeNS(DamlEngine.DAML_NS, "d:wref", "#d." + esum.date + "." + String.format("%04d", esum.id)); if ( permalink ) // TodoWrefAttr handles this attribute: a.setAttributeNS(DamlEngine.DAML_NS, "d:wrefcat", "@force-single"); } else { a = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "del"); } a.appendChild(ctx.doc.createTextNode(text)); parent.appendChild(a); return a; } } Element span, tmp; span = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "span"); beforeP.appendChild(span); LangHelper.setLangRec(span, "en"); span.appendChild(ctx.doc.createTextNode("\u2193Entry #"+entryNumberStr)); span.appendChild(ctx.doc.createTextNode(" [")); new DoLink(span, entryNumber-1, "older").doit(); span.appendChild(ctx.doc.createTextNode("|")); tmp = new DoLink(span, entryNumber, "\u203b").doit(); tmp.setAttributeNS(null, "style", "opacity: 0.1"); span.appendChild(ctx.doc.createTextNode(" ")); new DoLink(span, entryNumber, "permalink", true).doit(); span.appendChild(ctx.doc.createTextNode("|")); tmp = new DoLink(span, entryNumber+1, "newer").doit(); if ( ctx.wsc != null && ctx.wsc.sel != null && ctx.wsc.sel.contains(entryNumber+1) ) tmp.setAttributeNS(null, "style", "opacity: 0.1"); span.appendChild(ctx.doc.createTextNode("]")); beforeP.appendChild(ctx.doc.createTextNode(" / ")); span = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "span"); beforeP.appendChild(span); LangHelper.setLangRec(span, "fr"); span.appendChild(ctx.doc.createTextNode("\u2193Entr\u00e9e #"+entryNumberStr)); span.appendChild(ctx.doc.createTextNode(" [")); new DoLink(span, entryNumber-1, "pr\u00e9c\u00e9dente").doit(); span.appendChild(ctx.doc.createTextNode("|")); tmp = new DoLink(span, entryNumber, "\u203b").doit(); tmp.setAttributeNS(null, "style", "opacity: 0.1"); span.appendChild(ctx.doc.createTextNode(" ")); new DoLink(span, entryNumber, "permalien", true).doit(); span.appendChild(ctx.doc.createTextNode("|")); tmp = new DoLink(span, entryNumber+1, "suivante").doit(); if ( ctx.wsc != null && ctx.wsc.sel != null && ctx.wsc.sel.contains(entryNumber+1) ) tmp.setAttributeNS(null, "style", "opacity: 0.1"); span.appendChild(ctx.doc.createTextNode("]")); beforeP.appendChild(ctx.doc.createTextNode("\u2001\u2193")); span = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "span"); afterP.appendChild(span); LangHelper.setLangRec(span, "en"); span.appendChild(ctx.doc.createTextNode("\u2191Entry #"+entryNumberStr)); span.appendChild(ctx.doc.createTextNode(" [")); tmp = new DoLink(span, entryNumber-1, "older").doit(); if ( ctx.wsc != null && ctx.wsc.sel != null && ctx.wsc.sel.contains(entryNumber-1) ) tmp.setAttributeNS(null, "style", "opacity: 0.1"); span.appendChild(ctx.doc.createTextNode("|")); tmp = new DoLink(span, entryNumber, "\u203b").doit(); tmp.setAttributeNS(null, "title", "(Jump to top of entry)"); span.appendChild(ctx.doc.createTextNode(" ")); new DoLink(span, entryNumber, "permalink", true).doit(); span.appendChild(ctx.doc.createTextNode("|")); new DoLink(span, entryNumber+1, "newer").doit(); span.appendChild(ctx.doc.createTextNode("]")); afterP.appendChild(ctx.doc.createTextNode(" / ")); span = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "span"); afterP.appendChild(span); LangHelper.setLangRec(span, "fr"); span.appendChild(ctx.doc.createTextNode("\u2191Entr\u00e9e #"+entryNumberStr)); span.appendChild(ctx.doc.createTextNode(" [")); tmp = new DoLink(span, entryNumber-1, "pr\u00e9c\u00e9dente").doit(); if ( ctx.wsc != null && ctx.wsc.sel != null && ctx.wsc.sel.contains(entryNumber-1) ) tmp.setAttributeNS(null, "style", "opacity: 0.1"); span.appendChild(ctx.doc.createTextNode("|")); tmp = new DoLink(span, entryNumber, "\u203b").doit(); tmp.setAttributeNS(null, "title", "(Retourner du d\u00e9but de l'entr\u00e9e)"); span.appendChild(ctx.doc.createTextNode(" ")); new DoLink(span, entryNumber, "permalien", true).doit(); span.appendChild(ctx.doc.createTextNode("|")); new DoLink(span, entryNumber+1, "suivante").doit(); span.appendChild(ctx.doc.createTextNode("]")); afterP.appendChild(ctx.doc.createTextNode("\u2001\u2191")); } this.ownerDeque.registerAtStart(toProcess); } }