@Override public void setMargin(boolean enabled) { setMargin(new MarginInfo(enabled)); }
@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 void setMargin(com.haulmont.cuba.gui.components.MarginInfo marginInfo) { MarginInfo vMargin = new MarginInfo(marginInfo.hasTop(), marginInfo.hasRight(), marginInfo.hasBottom(), marginInfo.hasLeft()); component.setMargin(vMargin); }
public WebScrollBoxLayout() { component = new CubaScrollBoxLayout(); component.setWidth(100, Sizeable.Unit.PERCENTAGE); component.setPrimaryStyleName(SCROLLBOX_STYLENAME); CubaVerticalActionsLayout content = new CubaVerticalActionsLayout(); content.setWidth(100, Sizeable.Unit.PERCENTAGE); content.setStyleName(SCROLLBOX_CONTENT_STYLENAME); component.addComponent(content); getContent().setMargin(false); }
newContent.setMargin(currentContent.getMargin()); newContent.setSpacing(currentContent.isSpacing());
newContent.setMargin((getContent()).getMargin()); newContent.setSpacing((getContent()).isSpacing()); newContent.setStyleName(SCROLLBOX_CONTENT_STYLENAME);
private final void init() { if (content instanceof AbstractOrderedLayout) { ((AbstractOrderedLayout) content).setSpacing(true); ((AbstractOrderedLayout) content).setMargin(true); } if (content instanceof GridLayout) { addStyleName("marginTop"); } if (content != null) { mainLayout.addComponent(content); mainLayout.setExpandRatio(content, 1.0F); } createMandatoryLabel(); final HorizontalLayout buttonLayout = createActionButtonsLayout(); mainLayout.addComponent(buttonLayout); mainLayout.setComponentAlignment(buttonLayout, Alignment.TOP_CENTER); setCaption(caption); setCaptionAsHtml(true); setContent(mainLayout); setResizable(false); center(); setModal(true); addStyleName("fontsize"); setOrginaleValues(); addComponentListeners(); }
private final void init() { if (content instanceof AbstractOrderedLayout) { ((AbstractOrderedLayout) content).setSpacing(true); ((AbstractOrderedLayout) content).setMargin(true); } if (content instanceof GridLayout) { addStyleName("marginTop"); } if (content != null) { mainLayout.addComponent(content); mainLayout.setExpandRatio(content, 1.0F); } createMandatoryLabel(); final HorizontalLayout buttonLayout = createActionButtonsLayout(); mainLayout.addComponent(buttonLayout); mainLayout.setComponentAlignment(buttonLayout, Alignment.TOP_CENTER); setCaption(caption); setCaptionAsHtml(true); setContent(mainLayout); setResizable(false); center(); setModal(true); addStyleName("fontsize"); setOrginaleValues(); addComponentListeners(); }