本文整理汇总了Java中com.vaadin.ui.AbstractComponentContainer类的典型用法代码示例。如果您正苦于以下问题:Java AbstractComponentContainer类的具体用法?Java AbstractComponentContainer怎么用?Java AbstractComponentContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractComponentContainer类属于com.vaadin.ui包,在下文中一共展示了AbstractComponentContainer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findFieldAndFocus
import com.vaadin.ui.AbstractComponentContainer; //导入依赖的package包/类
private boolean findFieldAndFocus(Component compositionRoot) {
if (compositionRoot instanceof AbstractComponentContainer) {
AbstractComponentContainer cc = (AbstractComponentContainer) compositionRoot;
for (Component component : cc) {
if (component instanceof AbstractTextField) {
AbstractTextField abstractTextField = (AbstractTextField) component;
abstractTextField.selectAll();
return true;
}
if (component instanceof AbstractField) {
AbstractField<?> abstractField = (AbstractField<?>) component;
abstractField.focus();
return true;
}
if (component instanceof AbstractComponentContainer) {
if (findFieldAndFocus(component)) {
return true;
}
}
}
}
return false;
}
示例2: findFieldAndFocus
import com.vaadin.ui.AbstractComponentContainer; //导入依赖的package包/类
private boolean findFieldAndFocus(Component compositionRoot) {
if (compositionRoot instanceof AbstractComponentContainer) {
AbstractComponentContainer cc = (AbstractComponentContainer) compositionRoot;
for (Component component : cc) {
if (component instanceof AbstractTextField) {
AbstractTextField abstractTextField = (AbstractTextField) component;
abstractTextField.selectAll();
return true;
}
if (component instanceof AbstractField) {
AbstractField abstractField = (AbstractField) component;
abstractField.focus();
return true;
}
if (component instanceof AbstractComponentContainer) {
if (findFieldAndFocus(component)) {
return true;
}
}
}
}
return false;
}
示例3: buildComponent
import com.vaadin.ui.AbstractComponentContainer; //导入依赖的package包/类
private ComponentContainer buildComponent(Component component, Map<String, AbstractComponent> mapComponents,
List<String> fieldIdList, Map<String, Object> extraObjects) {
AbstractComponentContainer container;
if (component instanceof Drawer) {
container = buildDrawer((Drawer) component, mapComponents, fieldIdList, extraObjects);
} else if (component instanceof Section) {
container = buildSection((Section) component, mapComponents, fieldIdList, extraObjects);
} else if (component instanceof SubForm) {
container = buildSubForm((SubForm) component, mapComponents, fieldIdList, extraObjects);
} else if (component instanceof TabSheet) {
container = buildTabSheet((TabSheet) component, mapComponents, fieldIdList, extraObjects);
} else {
throw new UnsupportedOperationException();
}
addComponent(mapComponents, component, container);
return container;
}
示例4: buildTabSheet
import com.vaadin.ui.AbstractComponentContainer; //导入依赖的package包/类
private AbstractComponentContainer buildTabSheet(TabSheet part, Map<String, AbstractComponent> mapComponents,
List<String> fieldIdList, Map<String, Object> extraObjects) {
com.vaadin.ui.TabSheet tabSheet = new com.vaadin.ui.TabSheet();
for (Component component : part.getChildList()) {
if (component instanceof Tab) {
Tab tab = (Tab) component;
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
for (Component child : tab.getChildList()) {
layout.addComponent(buildComponent(child, mapComponents, fieldIdList, extraObjects));
}
tabSheet.addTab(layout, tab.getName());
} else {
throw new UnsupportedOperationException();
}
}
tabSheet.setSizeFull();
return tabSheet;
}
示例5: buildSubForm
import com.vaadin.ui.AbstractComponentContainer; //导入依赖的package包/类
private AbstractComponentContainer buildSubForm(SubForm subForm, Map<String, AbstractComponent> mapComponents,
List<String> fieldIdList, Map<String, Object> extraObjects) {
//panel.setCaption(formEditor.getName());
GridLayout layout = new GridLayout(subForm.getColumns(), subForm.getRows());
layout.setWidth("100%");
layout.setSpacing(true);
for (int row = 0; row < subForm.getRows(); row++) {
for (int column = 0; column < subForm.getColumns(); column++) {
Component component = subForm.getField(row, column);
if (component == null) {
layout.addComponent(new Label(" ", Label.CONTENT_XHTML));
} else if (component instanceof Field) {
Field editor = (Field) component;
if (editor != null) {
layout.addComponent(buildField(editor, mapComponents, fieldIdList, extraObjects));
}
} else {
buildComponent(component, mapComponents, fieldIdList, extraObjects);
}
}
}
return layout;
}
示例6: findFieldAndFocus
import com.vaadin.ui.AbstractComponentContainer; //导入依赖的package包/类
private boolean findFieldAndFocus(Component compositionRoot) {
if (compositionRoot instanceof AbstractComponentContainer) {
AbstractComponentContainer cc = (AbstractComponentContainer) compositionRoot;
for (Component component : cc) {
if (component instanceof AbstractTextField) {
AbstractTextField abstractTextField = (AbstractTextField) component;
if (!abstractTextField.isReadOnly()) {
abstractTextField.selectAll();
return true;
}
}
if (component instanceof AbstractField) {
AbstractField abstractField = (AbstractField) component;
if (!abstractField.isReadOnly()) {
abstractField.focus();
return true;
}
}
if (component instanceof AbstractComponentContainer) {
if (findFieldAndFocus(component)) {
return true;
}
}
}
}
return false;
}
示例7: buildDrawer
import com.vaadin.ui.AbstractComponentContainer; //导入依赖的package包/类
private AbstractComponentContainer buildDrawer(final Drawer drawer, Map<String, AbstractComponent> mapComponents,
List<String> fieldIdList, Map<String, Object> extraObjects) {
VerticalLayout layout = new VerticalLayout();
final Button button = new Button();
// button.setStyleName(BaseTheme.BUTTON_LINK);
button.setCaption("\u25B6" + drawer.getName());
final VerticalLayout innerLayout = new VerticalLayout();
for (Component component : drawer.getChildList()) {
ComponentContainer container = buildComponent(component, mapComponents, fieldIdList, extraObjects);
innerLayout.addComponent(container);
}
button.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 4970466538378502562L;
@Override
public void buttonClick(ClickEvent event) {
innerLayout.setVisible(!innerLayout.isVisible());
if (innerLayout.isVisible()) {
button.setCaption("\u25BC" + drawer.getName());
} else {
button.setCaption("\u25B6" + drawer.getName());
}
}
});
layout.addComponent(button);
layout.addComponent(innerLayout);
innerLayout.setVisible(false);
return layout;
}
示例8: buildSection
import com.vaadin.ui.AbstractComponentContainer; //导入依赖的package包/类
private AbstractComponentContainer buildSection(Section part, Map<String, AbstractComponent> mapComponents,
List<String> fieldIdList, Map<String, Object> extraObjects) {
Panel panel = new Panel();
panel.setCaption(part.getName());
for (Component component : part.getChildList()) {
ComponentContainer container = buildComponent(component, mapComponents, fieldIdList, extraObjects);
panel.addComponent(container);
}
return panel;
}
示例9: addComponentToParent
import com.vaadin.ui.AbstractComponentContainer; //导入依赖的package包/类
public void addComponentToParent(VisualTreeNode parent, VisualTreeNode child) throws ElementFactoryException {
if (parent.getComponent() instanceof AbstractComponentContainer) {
Component childComponent = child.getComponent();
AbstractComponentContainer parentContainer = parent.getComponent();
parentContainer.addComponent(childComponent);
if (parentContainer instanceof AbstractOrderedLayout) {
Alignment alignment = parseAlignment(child.getAdditionalParameter("alignment", "MIDDLE_LEFT"));
((AbstractOrderedLayout) parentContainer).setComponentAlignment(childComponent, alignment);
}
}
}