From: David ‘Bombe’ Roden Date: Mon, 18 Oct 2010 13:46:54 +0000 (+0200) Subject: Let a template page have an optional icon. X-Git-Tag: 0.1-RC1~235 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=65d624e0c8478358e859abd1d7e609e49aff2a28;p=Sone.git Let a template page have an optional icon. --- diff --git a/pom.xml b/pom.xml index c82a15f..bec9d83 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ org.freenetproject fred - 0.7.5.1292-SNAPSHOT + 0.7.5.1293-SNAPSHOT provided diff --git a/src/main/java/net/pterodactylus/sone/web/page/TemplatePage.java b/src/main/java/net/pterodactylus/sone/web/page/TemplatePage.java index e483aa3..79dd208 100644 --- a/src/main/java/net/pterodactylus/sone/web/page/TemplatePage.java +++ b/src/main/java/net/pterodactylus/sone/web/page/TemplatePage.java @@ -90,6 +90,10 @@ public class TemplatePage implements Page, LinkEnabledCallback { for (String styleSheet : getStyleSheets()) { pageNode.addCustomStyleSheet(styleSheet); } + String shortcutIcon = getShortcutIcon(); + if (shortcutIcon != null) { + pageNode.addForwardLink("icon", shortcutIcon); + } try { processTemplate(request, template); @@ -115,6 +119,15 @@ public class TemplatePage implements Page, LinkEnabledCallback { } /** + * Returns the name of the shortcut icon to include in the page’s header. + * + * @return The URL of the shortcut icon, or {@code null} for no icon + */ + protected String getShortcutIcon() { + return null; + } + + /** * Can be overridden when extending classes need to set variables in the * template before it is rendered. *