• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AbstractComponentContainer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;
}
 
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:25,代码来源:AbstractForm.java


示例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;
}
 
开发者ID:viritin,项目名称:viritin,代码行数:25,代码来源:AbstractForm.java


示例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;
}
 
开发者ID:frincon,项目名称:abstractform,代码行数:18,代码来源:VaadinFormToolkit.java


示例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;
}
 
开发者ID:frincon,项目名称:abstractform,代码行数:20,代码来源:VaadinFormToolkit.java


示例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("&nbsp;", 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;
}
 
开发者ID:frincon,项目名称:abstractform,代码行数:24,代码来源:VaadinFormToolkit.java


示例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;
}
 
开发者ID:viritin,项目名称:viritin,代码行数:29,代码来源:AbstractForm.java


示例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;
}
 
开发者ID:frincon,项目名称:abstractform,代码行数:32,代码来源:VaadinFormToolkit.java


示例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;
}
 
开发者ID:frincon,项目名称:abstractform,代码行数:11,代码来源:VaadinFormToolkit.java


示例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);
           }
	}
}
 
开发者ID:xaadin,项目名称:xaadin,代码行数:13,代码来源:AbstractDefaultLayoutElementFactory.java



注:本文中的com.vaadin.ui.AbstractComponentContainer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DatabaseResults类代码示例发布时间:2022-05-22
下一篇:
Java PluginBase类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap