List of usage examples for com.vaadin.ui.declarative DesignContext readDesign
public Component readDesign(Element componentDesign)
From source file:org.opencms.ui.components.CmsBasicDialog.java
License:Open Source License
/** * @see com.vaadin.ui.AbstractOrderedLayout#readDesign(org.jsoup.nodes.Element, com.vaadin.ui.declarative.DesignContext) *//* ww w .j av a 2 s . com*/ @Override public void readDesign(Element design, DesignContext designContext) { for (Element child : design.children()) { boolean contentRead = false; boolean buttonsRead = false; boolean aboveRead = false; boolean belowRead = false; if ("content".equals(child.tagName()) && !contentRead) { Component content = designContext.readDesign(child.child(0)); setContent(content); contentRead = true; } else if ("buttons".equals(child.tagName()) && !buttonsRead) { for (Element buttonElement : child.children()) { Component button = designContext.readDesign(buttonElement); Attributes attr = buttonElement.attributes(); addButton(button, !attr.hasKey(":left")); } buttonsRead = true; } else if ("above".equals(child.tagName()) && !aboveRead) { Component aboveContent = designContext.readDesign(child.child(0)); setAbove(aboveContent); aboveRead = true; } else if ("below".equals(child.tagName()) && !belowRead) { Component belowContent = designContext.readDesign(child.child(0)); setBelow(belowContent); belowRead = true; } } }