01: /*
02: * @author <a href="mailto:wehrens@gridsphere.org">Oliver Wehrens</a>
03: * @version $Id: ColumnLayout.java 6385 2007-10-25 14:02:26Z wehrens $
04: */
05: package org.gridsphere.layout.view.brush;
06:
07: import org.gridsphere.layout.PortletComponent;
08: import org.gridsphere.layout.view.BaseRender;
09: import org.gridsphere.layout.view.Render;
10: import org.gridsphere.portletcontainer.GridSphereEvent;
11:
12: public class ColumnLayout extends BaseRender implements Render {
13:
14: public ColumnLayout() {
15: }
16:
17: public StringBuffer doStart(GridSphereEvent event,
18: PortletComponent comp) {
19: StringBuffer sb = new StringBuffer();
20: StringBuffer temp = new StringBuffer(
21: "\n<div class=\"gridsphere-layout-column\"");
22: if (!comp.getWidth().equals("")) {
23: sb.append(" width: ").append(comp.getWidth()).append(";");
24: }
25: if (!comp.getStyle().equals("")) {
26: sb.append(comp.getStyle());
27: }
28:
29: if (sb.length() > 0)
30: temp.append(" style=\"").append(sb).append("\"");
31: temp
32: .append("> <!-- ========================== start column -->\n");
33: return temp;
34: }
35:
36: public StringBuffer doEnd(GridSphereEvent event,
37: PortletComponent comp) {
38: return new StringBuffer(
39: "\n</div> <!-- ========================== end column -->\n");
40: }
41:
42: }
|