1 25 package org.snipsnap.render.macro; 26 27 import org.snipsnap.render.filter.links.SnipLinks; 28 import org.snipsnap.render.macro.parameter.SnipMacroParameter; 29 import org.radeox.util.i18n.ResourceManager; 30 31 import java.io.IOException ; 32 import java.io.Writer ; 33 34 41 42 public class SnipLinkMacro extends ListOutputMacro { 43 public String getName() { 44 return "sniplinks"; 45 } 46 47 public String getDescription() { 48 return ResourceManager.getString("i18n.messages", "macro.sniplink.description"); 49 } 50 51 public String [] getParamDescription() { 52 return ResourceManager.getString("i18n.messages", "macro.sniplink.params").split(";"); 53 } 54 55 public void execute(Writer writer, SnipMacroParameter params) 56 throws IllegalArgumentException , IOException { 57 String start = "#ffffff"; 58 String end = "#b0b0b0"; 59 int width = 4; 60 if (params.getLength() >= 1) { 61 width = Integer.parseInt(params.get("0")); 62 } 63 SnipLinks.appendTo(writer, params.getSnipRenderContext().getSnip().getAccess().getBackLinks(), width, start, end); 64 } 65 } 66 | Popular Tags |