.i-formlayout-captioncell {
text-align:right;
}
+
+.i-formlayout-spacing .i-formlayout-row .i-formlayout-captioncell,
+.i-formlayout-spacing .i-formlayout-row .i-formlayout-contentcell,
+.i-formlayout-spacing .i-formlayout-row .i-formlayout-errorcell {
+ padding-top: 8px;
+}
+
+.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-captioncell,
+.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-contentcell,
+.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-errorcell {
+ padding-top: 0;
+}
+
+.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-captioncell,
+.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-contentcell,
+.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-errorcell {
+ padding-top: 15px;
+}
+.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-captioncell,
+.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-contentcell,
+.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-errorcell {
+ padding-bottom: 15px;
+}
+.i-formlayout-margin-left .i-formlayout-captioncell {
+ padding-left: 18px;
+}
+.i-formlayout-margin-right .i-formlayout-contentcell {
+ padding-right: 18px;
+}
+
+/* form */
+
.i-form-errormessage {
background: transparent url(../icons/16/error.png) no-repeat top left;
padding-left: 20px;
.i-formlayout-captioncell {
text-align:right;
}
+
+.i-formlayout-spacing .i-formlayout-row .i-formlayout-captioncell,
+.i-formlayout-spacing .i-formlayout-row .i-formlayout-contentcell,
+.i-formlayout-spacing .i-formlayout-row .i-formlayout-errorcell {
+ padding-top: 8px;
+}
+
+.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-captioncell,
+.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-contentcell,
+.i-formlayout-spacing .i-formlayout-firstrow .i-formlayout-errorcell {
+ padding-top: 0;
+}
+
+.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-captioncell,
+.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-contentcell,
+.i-formlayout-margin-top .i-formlayout-firstrow .i-formlayout-errorcell {
+ padding-top: 15px;
+}
+.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-captioncell,
+.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-contentcell,
+.i-formlayout-margin-bottom .i-formlayout-lastrow .i-formlayout-errorcell {
+ padding-bottom: 15px;
+}
+.i-formlayout-margin-left .i-formlayout-captioncell {
+ padding-left: 18px;
+}
+.i-formlayout-margin-right .i-formlayout-contentcell {
+ padding-right: 18px;
+}
+
+/* form */
+
.i-form-errormessage {
background: transparent url(icons/16/error.png) no-repeat top left;
padding-left: 20px;
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection;
import com.itmill.toolkit.terminal.gwt.client.Container;
import com.itmill.toolkit.terminal.gwt.client.Paintable;
+import com.itmill.toolkit.terminal.gwt.client.StyleConstants;
import com.itmill.toolkit.terminal.gwt.client.UIDL;
import com.itmill.toolkit.terminal.gwt.client.Util;
*/
public class IFormLayout extends FlexTable implements Container {
+ private final static String CLASSNAME = "i-formlayout";
+
HashMap componentToCaption = new HashMap();
private ApplicationConnection client;
private HashMap componentToError = new HashMap();
return;
}
+ final MarginInfo margins = new MarginInfo(uidl
+ .getIntAttribute("margins"));
+
+ Element margin = getElement();
+ setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_TOP,
+ margins.hasTop());
+ setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_RIGHT,
+ margins.hasRight());
+ setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_BOTTOM,
+ margins.hasBottom());
+ setStyleName(margin, CLASSNAME + "-" + StyleConstants.MARGIN_LEFT,
+ margins.hasLeft());
+
+ setStyleName(margin, CLASSNAME + "-" + "spacing", uidl
+ .hasAttribute("spacing"));
+
int i = 0;
for (final Iterator it = uidl.getChildIterator(); it.hasNext(); i++) {
prepareCell(i, 1);
client.unregisterPaintable(oldComponent);
setWidget(i, 2, (Widget) p);
}
- getCellFormatter().setStyleName(i, 0, "i-formlayout-captioncell");
+ getCellFormatter().setStyleName(i, 2, CLASSNAME + "-contentcell");
+ getCellFormatter().setStyleName(i, 0, CLASSNAME + "-captioncell");
setWidget(i, 0, caption);
- getCellFormatter().setStyleName(i, 1, "i-formlayout-errorcell");
+ getCellFormatter().setStyleName(i, 1, CLASSNAME + "-errorcell");
setWidget(i, 1, error);
p.updateFromUIDL(childUidl, client);
+ String rowstyles = CLASSNAME + "-row";
+ if (i == 0) {
+ rowstyles += " " + CLASSNAME + "-firstrow";
+ }
+ if (!it.hasNext()) {
+ rowstyles += " " + CLASSNAME + "-lastrow";
+ }
+
+ getRowFormatter().setStyleName(i, rowstyles);
+
}
while (getRowCount() > i) {