@Override public void readDesign(Element design, DesignContext designContext) { // process default attributes super.readDesign(design, designContext); setMargin(readMargin(design, getMargin(), designContext)); // handle children for (Element childComponent : design.children()) { Attributes attr = childComponent.attributes(); Component newChild = designContext.readDesign(childComponent); addComponent(newChild); // handle alignment setComponentAlignment(newChild, DesignAttributeHandler.readAlignment(attr)); // handle expand ratio if (attr.hasKey(":expand")) { String value = attr.get(":expand"); if (!value.isEmpty()) { try { float ratio = Float.valueOf(value); setExpandRatio(newChild, ratio); } catch (NumberFormatException nfe) { getLogger() .info("Failed to parse expand ratio " + value); } } else { setExpandRatio(newChild, 1.0f); } } } }
@Override public com.haulmont.cuba.gui.components.MarginInfo getMargin() { MarginInfo vMargin = component.getMargin(); return new com.haulmont.cuba.gui.components.MarginInfo(vMargin.hasTop(), vMargin.hasRight(), vMargin.hasBottom(), vMargin.hasLeft()); }
@Override public com.haulmont.cuba.gui.components.MarginInfo getMargin() { MarginInfo vMargin = getContent().getMargin(); return new com.haulmont.cuba.gui.components.MarginInfo(vMargin.hasTop(), vMargin.hasRight(), vMargin.hasBottom(), vMargin.hasLeft()); }
newContent.setMargin((getContent()).getMargin()); newContent.setSpacing((getContent()).isSpacing()); newContent.setStyleName(SCROLLBOX_CONTENT_STYLENAME);