本文整理汇总了Java中at.punkt.lodms.integration.UIComponent类的典型用法代码示例。如果您正苦于以下问题:Java UIComponent类的具体用法?Java UIComponent怎么用?Java UIComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UIComponent类属于at.punkt.lodms.integration包,在下文中一共展示了UIComponent类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayConfigWindow
import at.punkt.lodms.integration.UIComponent; //导入依赖的package包/类
public void displayConfigWindow(final ConfigBeanProvider configBeanProvider, final ConfigSuccessHandler handler, Object config) {
configWindow.removeAllComponents();
configWindow.setCaption("Configuration: " + ((UIComponent) configBeanProvider).getName());
VerticalLayout configWinLayout = new VerticalLayout();
Form form = new Form(new VerticalLayout());
if (config == null) {
config = configBeanProvider.newDefaultConfig();
}
final BeanItem beanItem = new BeanItem(config);
form.setItemDataSource(beanItem);
form.setImmediate(true);
configWinLayout.addComponent(form);
Button configureButton = new Button("Configure");
configureButton.addListener(new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
try {
configBeanProvider.configure(beanItem.getBean());
handler.configured();
getMainWindow().removeWindow(configWindow);
} catch (ConfigurationException ex) {
getMainWindow().showNotification(ex.getMessage(), Notification.TYPE_ERROR_MESSAGE);
logger.error("Unable to configure component", ex);
}
}
});
Label configExplanation = new Label(CONFIG_INFO, Label.CONTENT_TEXT);
configExplanation.addStyleName("lodms-config-info");
configWinLayout.addComponent(configExplanation);
configWinLayout.addComponent(configureButton);
configWinLayout.setComponentAlignment(configureButton, Alignment.BOTTOM_CENTER);
configWindow.addComponent(configWinLayout);
getMainWindow().addWindow(configWindow);
}