Skip to content

Commit 6668e85

Browse files
committed
refactor(demo): update implementation of TabbedDemo
1 parent c3fc344 commit 6668e85

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/test/java/com/flowingcode/vaadin/addons/orgchart/OrgchartDemoView.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,24 @@
2121

2222
import com.flowingcode.vaadin.addons.DemoLayout;
2323
import com.flowingcode.vaadin.addons.GithubLink;
24-
import com.flowingcode.vaadin.addons.demo.impl.TabbedDemoImpl;
24+
import com.flowingcode.vaadin.addons.demo.TabbedDemo;
2525
import com.vaadin.flow.component.dependency.StyleSheet;
26-
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
2726
import com.vaadin.flow.router.Route;
2827

2928
@SuppressWarnings("serial")
3029
@Route(value = "orgchart", layout = DemoLayout.class)
3130
@StyleSheet("context://frontend/styles/orgchart/demo-styles.css")
3231
@StyleSheet("context://frontend/styles/orgchart/font-awesome.css")
3332
@GithubLink("https://github.com/FlowingCode/OrgChartAddon")
34-
public class OrgchartDemoView extends VerticalLayout {
33+
public class OrgchartDemoView extends TabbedDemo {
3534

3635
private static final String DRAGNDROP_DEMO = "Drag and Drop";
3736
private static final String BOTTOMTOP_DEMO = "Bottom to Top";
3837
private static final String DRAGNDROP_SOURCE = "https://github.com/FlowingCode/OrgChartAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/orgchart/DragAndDropExportDemo.java";
3938
private static final String BOTTOMTOP_SOURCE = "https://github.com/FlowingCode/OrgChartAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/orgchart/BottomTopDemo.java";
4039

4140
public OrgchartDemoView() {
42-
TabbedDemoImpl<DragAndDropExportDemo> orgDemo = new TabbedDemoImpl<>(new DragAndDropExportDemo(),
43-
DRAGNDROP_DEMO, DRAGNDROP_SOURCE);
44-
orgDemo.addDemo(new BottomTopDemo(), BOTTOMTOP_DEMO, BOTTOMTOP_SOURCE);
45-
setSizeFull();
46-
add(orgDemo);
41+
addDemo(new DragAndDropExportDemo(), DRAGNDROP_DEMO, DRAGNDROP_SOURCE);
42+
addDemo(new BottomTopDemo(), BOTTOMTOP_DEMO, BOTTOMTOP_SOURCE);
4743
}
4844
}

0 commit comments

Comments
 (0)