List of usage examples for org.apache.wicket.util.value ValueMap getString
@Override public final String getString(final String key, final String defaultValue)
From source file:net.kornr.swit.button.ButtonResource.java
License:Apache License
@Override protected void setHeaders(WebResponse response) { ValueMap map = this.getParameters(); String download = map.getString("download", null); if (download != null) { String name = map.getString("filename", "image"); response.getHttpServletResponse().addHeader("content-disposition", "attachment; filename=" + name + ".png"); response.setContentType("application/octet-stream"); }/*from w w w.j ava 2 s. c o m*/ super.setHeaders(response); }
From source file:net.kornr.swit.wicket.border.graphics.BorderMaker.java
License:Apache License
@Override public IResourceStream getResourceStream() { ValueMap map = this.getParameters(); String border = map.getString("border", "full"); Long id = map.getAsLong("id"); String indx = map.getString("type", "rgb"); BorderMaker processor = this; if (id != null) { processor = s_regCache.get(id);// ww w . j av a 2 s . c o m if (processor == null) processor = s_regTemporaryCache.get(id); } return processor.process(border, indx.equals("indexed")); }
From source file:net.kornr.swit.wicket.layout.threecol.ThreeColumnsLayoutResource.java
License:Apache License
@Override public IResourceStream getResourceStream() { ValueMap map = this.getParameters(); String name = map.getString("id", null); if (name == null) return null; LayoutInfo current = m_layouts.get(name); current = current.duplicate();/* w w w .j a va2 s . co m*/ try { current.setLeftSize(map.getInt("left", current.getLeftSize())); current.setRightSize(map.getInt("right", current.getRightSize())); current.setUnit(map.getInt("unit", current.getUnit())); String leftcol = map.getString("leftcol", null); if (leftcol != null) current.setLeftColor(new Color(Integer.parseInt(leftcol))); String rightcol = map.getString("rightcol", null); if (rightcol != null) current.setLeftColor(new Color(Integer.parseInt(rightcol))); String middlecol = map.getString("middlecol", null); if (middlecol != null) current.setLeftColor(new Color(Integer.parseInt(middlecol))); } catch (Exception exc) { // We don't really care if there's an error exc.printStackTrace(); } String css = getStyle(current); return new StringResourceStream(css, "text/css"); }