use of com.vaadin.flow.component.HasSize in project flow-components by vaadin.
the class LayoutComponent method toggleSidebar.
private void toggleSidebar() {
if (sidebarWrapper == null) {
sidebarWrapper = new SplitLayout();
sidebarWrapper.setSplitterPosition(80);
sidebarWrapper.setSizeFull();
sidebarWrapper.addToPrimary(content);
this.contentContainer.removeAll();
sidebarWrapper.addToSecondary(new Span("Sidebar"));
this.contentContainer.add(sidebarWrapper);
} else {
Component primaryComponent = sidebarWrapper.getPrimaryComponent();
contentContainer.removeAll();
contentContainer.add(primaryComponent);
if (primaryComponent instanceof HasSize) {
((HasSize) primaryComponent).setSizeFull();
}
sidebarWrapper = null;
}
}
use of com.vaadin.flow.component.HasSize in project linkki by linkki-framework.
the class ComponentColumnProvider method apply.
@Override
public Component apply(ROW source) {
NoLabelComponentWrapper wrapper = UiCreator.createUiElement(method, source, bindingContext, c -> new NoLabelComponentWrapper((Component) c, WrapperType.FIELD));
Component component = wrapper.getComponent();
if (component instanceof HasValue && component instanceof HasSize) {
((HasSize) component).setWidthFull();
}
return component;
}
Aggregations