本文整理了Java中com.vaadin.ui.Layout.replaceComponent()
方法的一些代码示例,展示了Layout.replaceComponent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Layout.replaceComponent()
方法的具体详情如下:
包路径:com.vaadin.ui.Layout
类名称:Layout
方法名:replaceComponent
暂无
代码示例来源:origin: com.vaadin/vaadin-compatibility-server
getLayout().replaceComponent(oldField, newField);
fields.put(propertyId, newField);
newField.addListener(fieldValueChangeListener);
代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework
private void initialize() {
optionsField = formFieldFactory.createField(definition.getField(), locale);
layout.addComponent(optionsField);
optionsField.addValueChangeListener(e -> {
if (e.getOldValue() == null || e.getOldValue() == null) {
return;
}
EditorView<T> oldView = subForm(e.getOldValue());
EditorView<T> newView = subForm(e.getValue());
layout.replaceComponent(oldView.asVaadinComponent(), newView.asVaadinComponent());
});
definition.getForms().forEach(formDefinition -> {
ItemProviderStrategy<T> subFormProviderStrategy = create(((ComplexPropertyDefinition<T>) formDefinition).getItemProvider(), formDefinition, itemProviderStrategy);
EditorView<T> subForm = getViewProvider().create(formDefinition);
subForms.put(formDefinition.getName(), Pair.of(subForm, subFormProviderStrategy));
});
binder = ConfiguredBinder.withPropertySet(propertySetFactory.fromFieldDefinitions(Collections.singletonList(definition.getField()), locale));
binder.forField(optionsField)
.withConverter(new StringToOptionDefinitionConverter(definition.getField()))
.bind(resolvePropertyNameByLocale(definition.getField().getName(), locale, definition.getField().isI18n()));
}
内容来源于网络,如有侵权,请联系作者删除!