.i-gridlayout-margin-right {
padding-right: 18px;
}
+
+.i-gridlayout-grid {
+ margin:0;
+ padding:0;
+ border-collapse: collapse;
+ border:0;
+}
+
+.i-gridlayout-cell {
+ margin:0;
+ padding:0;
+}
+
+.i-gridlayout-spacing .i-gridlayout-cell {
+ padding-left: 15px;
+ padding-top:15px;
+}
+
+.i-gridlayout-spacing .i-gridlayout-firstcol {
+ padding-left: 0;
+}
+.i-gridlayout-spacing .i-gridlayout-firstrow {
+ padding-top: 0;
+}
padding-right: 18px;
}
+.i-gridlayout-grid {
+ margin:0;
+ padding:0;
+ border-collapse: collapse;
+ border:0;
+}
+
+.i-gridlayout-cell {
+ margin:0;
+ padding:0;
+}
+
+.i-gridlayout-spacing .i-gridlayout-cell {
+ padding-left: 15px;
+ padding-top:15px;
+}
+.i-gridlayout-spacing .i-gridlayout-firstcol {
+ padding-left: 0;
+}
+.i-gridlayout-spacing .i-gridlayout-firstrow {
+ padding-top: 0;
+}
+
.i-Notification {
font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif;
background-color: #999999;
setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_LEFT,
margins.hasLeft());
+ setStyleName(margin, CLASSNAME + "-" + "spacing", uidl
+ .hasAttribute("spacing"));
+
grid.updateFromUIDL(uidl, client);
}
public Grid() {
super();
- setStyleName(CLASSNAME);
+ setStyleName(CLASSNAME + "-grid");
}
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
ha = HasHorizontalAlignment.ALIGN_RIGHT;
}
- getCellFormatter()
- .setAlignment(row, column, ha, va);
+ FlexCellFormatter formatter = (FlexCellFormatter) getCellFormatter();
+
+ formatter.setAlignment(row, column, ha, va);
// set col span
- ((FlexCellFormatter) getCellFormatter())
- .setColSpan(row, column, w);
+ formatter.setColSpan(row, column, w);
+
+ String styleNames = CLASSNAME + "-cell";
+ if (column == 0) {
+ styleNames += " " + CLASSNAME + "-firstcol";
+ }
+ if (row == 0) {
+ styleNames += " " + CLASSNAME + "-firstrow";
+ }
+ formatter.setStyleName(row, column, styleNames);
// Set cell height
int h;
main.addComponent(b);\r
\r
Button b2 = new Button("next spacing state");\r
- b.addListener(new Button.ClickListener() {\r
+ b2.addListener(new Button.ClickListener() {\r
public void buttonClick(ClickEvent event) {\r
nextSpacingState();\r
}\r
}\r
}\r
\r
+ private boolean spacing = true;\r
+\r
private void nextSpacingState() {\r
- spacingstate.setValue(" // TODO Auto-generated method stub");\r
+ spacing = !spacing;\r
+ if (spacing) {\r
+ gl.setSpacing(true);\r
+ spacingstate.setValue("Spacing on");\r
+ } else {\r
+ gl.setSpacing(false);\r
+ spacingstate.setValue("Spacing off");\r
+ }\r
}\r
\r
}\r