Skip to content

Commit 8e6e2d5

Browse files
committed
refactor(demo)!: make demo view extend TabbedDemo
1 parent 1d29fcf commit 8e6e2d5

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/test/java/com/flowingcode/vaadin/addons/carousel/CarouselDemoView.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
import com.flowingcode.vaadin.addons.DemoLayout;
2323
import com.flowingcode.vaadin.addons.GithubLink;
2424
import com.flowingcode.vaadin.addons.demo.TabbedDemo;
25-
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
2625
import com.vaadin.flow.router.Route;
2726

2827
@SuppressWarnings("serial")
2928
@Route(value = "carousel", layout = DemoLayout.class)
3029
@GithubLink("https://github.com/FlowingCode/CarouselAddon")
31-
public class CarouselDemoView extends VerticalLayout {
30+
public class CarouselDemoView extends TabbedDemo {
3231

3332
private static final String LISTENER_DEMO = "Slide Listener";
3433
private static final String AUTOPROGRESS_DEMO = "Auto Progress";
@@ -38,11 +37,9 @@ public class CarouselDemoView extends VerticalLayout {
3837
private static final String BUTTONS_SOURCE = "https://github.com/FlowingCode/CarouselAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/carousel/SlideButtonsDemo.java";
3938

4039
public CarouselDemoView() {
41-
TabbedDemo demo = new TabbedDemo();
42-
demo.addDemo(new ListenerDemo(), LISTENER_DEMO, LISTENER_SOURCE);
43-
demo.addDemo(new AutoProgressDemo(), AUTOPROGRESS_DEMO, AUTPROGRESS_SOURCE);
44-
demo.addDemo(new SlideButtonsDemo(), BUTTONS_DEMO, BUTTONS_SOURCE);
45-
add(demo);
40+
addDemo(new ListenerDemo(), LISTENER_DEMO, LISTENER_SOURCE);
41+
addDemo(new AutoProgressDemo(), AUTOPROGRESS_DEMO, AUTPROGRESS_SOURCE);
42+
addDemo(new SlideButtonsDemo(), BUTTONS_DEMO, BUTTONS_SOURCE);
4643
setSizeFull();
4744
}
4845
}

0 commit comments

Comments
 (0)