Created
August 23, 2024 07:12
Revisions
-
mstahv created this gist
Aug 23, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ package org.peimari.maastokanta.mobile; import com.vaadin.flow.component.Component; import com.vaadin.flow.component.html.H3; import com.vaadin.flow.component.orderedlayout.FlexComponent; import org.vaadin.firitin.components.orderedlayout.VHorizontalLayout; import org.vaadin.firitin.components.orderedlayout.VVerticalLayout; public class NavigationView extends VVerticalLayout { private final H3 titleEl = new H3(); private final VHorizontalLayout navigationBar = new VHorizontalLayout() .withPadding(false) .space() .withComponent(titleEl) .space() .alignAll(FlexComponent.Alignment.CENTER); public NavigationView(String title) { setPadding(false); setSpacing(false); titleEl.setText(title); add(navigationBar); } public void setTitle(String title) { titleEl.setText(title); } public void setLeftComponent(Component component) { navigationBar.addComponentAsFirst(component); } public void setRightComponent(Component component) { navigationBar.add(component); } public void setContent(Component mainContent) { add(mainContent); } }