-.i-orderedlayout {
+.i-horizontallayout, .i-verticallayout {
overflow: hidden;
}
-.i-orderedlayout-margin-top {
+.i-horizontallayout-margin-top, .i-verticallayout-margin-top {
padding-top: 15px;
}
-.i-orderedlayout-margin-right {
+.i-horizontallayout-margin-right, .i-verticallayout-margin-right {
padding-right: 18px;
}
-.i-orderedlayout-margin-bottom {
+.i-horizontallayout-margin-bottom, .i-verticallayout-margin-bottom {
padding-bottom: 15px;
}
-.i-orderedlayout-margin-left {
+.i-horizontallayout-margin-left, .i-verticallayout-margin-left {
padding-left: 18px;
}
-.i-orderedlayout-spacing-on {
+.i-horizontallayout-spacing-on, .i-verticallayout-spacing-on {
padding-top: 8px;
padding-left: 8px;
}
/** This can be used to define spacing if spacing is off server side */
-.i-orderedlayout-spacing-off {
+.i-horizontallayout-spacing-off, .i-verticallayout-spacing-off {
padding-top: 0px;
padding-left: 0px;
}
cursor: default;
}
-
-
.i-link img {
vertical-align: middle;
}
}
/* ./WebContent/ITMILL/themes/default/orderedlayout/orderedlayout.css */
-.i-orderedlayout {
+.i-horizontallayout, .i-verticallayout {
overflow: hidden;
}
-.i-orderedlayout-margin-top {
+.i-horizontallayout-margin-top, .i-verticallayout-margin-top {
padding-top: 15px;
}
-.i-orderedlayout-margin-right {
+.i-horizontallayout-margin-right, .i-verticallayout-margin-right {
padding-right: 18px;
}
-.i-orderedlayout-margin-bottom {
+.i-horizontallayout-margin-bottom, .i-verticallayout-margin-bottom {
padding-bottom: 15px;
}
-.i-orderedlayout-margin-left {
+.i-horizontallayout-margin-left, .i-verticallayout-margin-left {
padding-left: 18px;
}
-.i-orderedlayout-spacing-on {
+.i-horizontallayout-spacing-on, .i-verticallayout-spacing-on {
padding-top: 8px;
padding-left: 8px;
}
/** This can be used to define spacing if spacing is off server side */
-.i-orderedlayout-spacing-off {
+.i-horizontallayout-spacing-off, .i-verticallayout-spacing-off {
padding-top: 0px;
padding-left: 0px;
}
import com.itmill.toolkit.terminal.gwt.client.ui.IForm;
import com.itmill.toolkit.terminal.gwt.client.ui.IFormLayout;
import com.itmill.toolkit.terminal.gwt.client.ui.IGridLayout;
+import com.itmill.toolkit.terminal.gwt.client.ui.IHorizontalLayout;
import com.itmill.toolkit.terminal.gwt.client.ui.ILabel;
import com.itmill.toolkit.terminal.gwt.client.ui.ILink;
import com.itmill.toolkit.terminal.gwt.client.ui.IListSelect;
import com.itmill.toolkit.terminal.gwt.client.ui.IUnknownComponent;
import com.itmill.toolkit.terminal.gwt.client.ui.IUpload;
import com.itmill.toolkit.terminal.gwt.client.ui.IUriFragmentUtility;
+import com.itmill.toolkit.terminal.gwt.client.ui.IVerticalLayout;
import com.itmill.toolkit.terminal.gwt.client.ui.IWindow;
import com.itmill.toolkit.terminal.gwt.client.ui.richtextarea.IRichTextArea;
return new IWindow();
} else if (IOrderedLayout.class == classType) {
return new IOrderedLayout();
+ } else if (IVerticalLayout.class == classType) {
+ return new IVerticalLayout();
+ } else if (IHorizontalLayout.class == classType) {
+ return new IHorizontalLayout();
} else if (ILabel.class == classType) {
return new ILabel();
} else if (ILink.class == classType) {
return IWindow.class;
} else if ("orderedlayout".equals(tag)) {
return IOrderedLayout.class;
+ } else if ("verticallayout".equals(tag)) {
+ return IVerticalLayout.class;
+ } else if ("horizontallayout".equals(tag)) {
+ return IHorizontalLayout.class;
} else if ("label".equals(tag)) {
return ILabel.class;
} else if ("link".equals(tag)) {
--- /dev/null
+package com.itmill.toolkit.terminal.gwt.client.ui;\r
+\r
+public class IHorizontalLayout extends IOrderedLayout {\r
+\r
+ public static final String CLASSNAME = "i-horizontallayout";\r
+\r
+ public IHorizontalLayout() {\r
+ super(CLASSNAME, ORIENTATION_HORIZONTAL);\r
+ }\r
+\r
+}\r
\r
public static final String CLASSNAME = "i-orderedlayout";\r
\r
- static {\r
- STYLENAME_SPACING = "i-orderedlayout-spacing";\r
- STYLENAME_MARGIN_TOP = "i-orderedlayout-margin-top";\r
- STYLENAME_MARGIN_RIGHT = "i-orderedlayout-margin-right";\r
- STYLENAME_MARGIN_BOTTOM = "i-orderedlayout-margin-bottom";\r
- STYLENAME_MARGIN_LEFT = "i-orderedlayout-margin-left";\r
- }\r
+ private int orientation;\r
\r
- private int orientation = ORIENTATION_HORIZONTAL;\r
+ // Can be removed once OrderedLayout is removed\r
+ private boolean allowOrientationUpdate = false;\r
\r
/**\r
* Size of the layout excluding any margins.\r
private String width = "";\r
\r
public IOrderedLayout() {\r
- setStyleName(CLASSNAME);\r
+ this(CLASSNAME, ORIENTATION_VERTICAL);\r
+ allowOrientationUpdate = true;\r
+ }\r
+\r
+ protected IOrderedLayout(String className, int orientation) {\r
+ setStyleName(className);\r
+ this.orientation = orientation;\r
+\r
+ STYLENAME_SPACING = className + "-spacing";\r
+ STYLENAME_MARGIN_TOP = className + "-margin-top";\r
+ STYLENAME_MARGIN_RIGHT = className + "-margin-right";\r
+ STYLENAME_MARGIN_BOTTOM = className + "-margin-bottom";\r
+ STYLENAME_MARGIN_LEFT = className + "-margin-left";\r
+\r
}\r
\r
@Override\r
return;\r
}\r
\r
- handleOrientationUpdate(uidl);\r
+ if (allowOrientationUpdate) {\r
+ handleOrientationUpdate(uidl);\r
+ }\r
\r
// IStopWatch w = new IStopWatch("OrderedLayout.updateFromUIDL");\r
\r
--- /dev/null
+package com.itmill.toolkit.terminal.gwt.client.ui;\r
+\r
+public class IVerticalLayout extends IOrderedLayout {\r
+\r
+ public static final String CLASSNAME = "i-verticallayout";\r
+\r
+ public IVerticalLayout() {\r
+ super(CLASSNAME, ORIENTATION_VERTICAL);\r
+ }\r
+\r
+}\r
private boolean marginsNeedsRecalculation = false;
+ protected String STYLENAME_SPACING = "";
+ protected String STYLENAME_MARGIN_TOP = "";
+ protected String STYLENAME_MARGIN_RIGHT = "";
+ protected String STYLENAME_MARGIN_BOTTOM = "";
+ protected String STYLENAME_MARGIN_LEFT = "";
+
public static class Spacing {
public int hSpacing = 0;
}
- protected static String STYLENAME_SPACING = "";
- protected static String STYLENAME_MARGIN_TOP = "";
- protected static String STYLENAME_MARGIN_RIGHT = "";
- protected static String STYLENAME_MARGIN_BOTTOM = "";
- protected static String STYLENAME_MARGIN_LEFT = "";
-
@Override
public void setStyleName(String styleName) {
super.setStyleName(styleName);
package com.itmill.toolkit.ui;
-import com.itmill.toolkit.terminal.PaintException;
-import com.itmill.toolkit.terminal.PaintTarget;
-
/**
* Horizontal layout
*
}
@Override
- public void paintContent(PaintTarget target) throws PaintException {
- super.paintContent(target);
-
- // Adds the attributes: orientation
- target.addAttribute("orientation", "horizontal");
-
+ public String getTag() {
+ return "horizontallayout";
}
}
setWidth("100%");
}
- /*
- * An AbstractOrderedLayout is by default vertical so we do not need to
- * override paintContent for that
- */
+ @Override
+ public String getTag() {
+ return "verticallayout";
+ }
+
}