forked from moewes/quarkus-vaadin-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
48 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
39 changes: 39 additions & 0 deletions
39
example/src/main/java/net/moewes/cloud/ui/plain/TabView.java
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package net.moewes.cloud.ui.plain; | ||
|
||
import com.vaadin.flow.component.Text; | ||
import com.vaadin.flow.component.orderedlayout.VerticalLayout; | ||
import com.vaadin.flow.component.tabs.Tab; | ||
import com.vaadin.flow.component.tabs.Tabs; | ||
import com.vaadin.flow.router.Route; | ||
|
||
@Route("tabs") | ||
public class TabView extends VerticalLayout { | ||
|
||
public TabView() { | ||
Tab tab1 = new Tab("Tab one"); | ||
Tab tab2 = new Tab("Tab two"); | ||
Tab tab3 = new Tab("Tab three"); | ||
Tabs tabs = new Tabs(tab1, tab2, tab3); | ||
|
||
add(tabs); | ||
|
||
Text newText = new Text(""); | ||
Text oldText = new Text(""); | ||
VerticalLayout l = new VerticalLayout(); | ||
l.setPadding(true); | ||
l.setSpacing(true); | ||
|
||
l.add(newText, oldText); | ||
|
||
add(l); | ||
|
||
tabs.addSelectedChangeListener(event -> { | ||
newText.setText("Current tab : " + event.getSelectedTab().getLabel()); | ||
|
||
if (event.getPreviousTab() != null) { | ||
oldText.setText( | ||
"Previous tab : " + event.getPreviousTab().getLabel()); | ||
} | ||
}); | ||
} | ||
} |
This file contains 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 characters
This file contains 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 characters
13 changes: 0 additions & 13 deletions
13
runtime/src/main/java/net/moewes/quarkus/vaadin/MyTestView.java
This file was deleted.
Oops, something went wrong.
This file contains 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 characters