Skip to content

Commit 4476aeb

Browse files
committed
refactor!: remove parameterized type from SplitLayoutDemo
1 parent 8b52a55 commit 4476aeb

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/main/java/com/flowingcode/vaadin/addons/demo/SplitLayoutDemo.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,14 @@
2525
import com.vaadin.flow.component.splitlayout.SplitLayout.Orientation;
2626

2727
@SuppressWarnings("serial")
28-
class SplitLayoutDemo<T extends Component> extends Composite<SplitLayout> {
28+
class SplitLayoutDemo extends Composite<SplitLayout> {
2929

3030
private SourceCodeView code;
31-
private T demo;
3231

33-
public SplitLayoutDemo(T demo, String sourceUrl) {
34-
// Split layout
32+
public SplitLayoutDemo(Component demo, String sourceUrl) {
3533
getContent().setOrientation(Orientation.HORIZONTAL);
3634
code = new SourceCodeView(sourceUrl);
3735

38-
this.demo = demo;
3936
getContent().addToPrimary(demo);
4037
getContent().addToSecondary(code);
4138
getContent().setSizeFull();

src/main/java/com/flowingcode/vaadin/addons/demo/TabbedDemo.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ public class TabbedDemo extends VerticalLayout {
3737

3838
private Tabs tabs;
3939
private HorizontalLayout footer;
40-
private SplitLayoutDemo<Component> currentLayout;
40+
private SplitLayoutDemo currentLayout;
4141
private Map<Tab, Component> demos;
4242
private Checkbox orientationCB;
4343
private Checkbox codeCB;
4444

45-
@SuppressWarnings("unchecked")
4645
public TabbedDemo() {
4746
tabs = new Tabs();
4847
demos = new HashMap<>();
4948
tabs.setWidthFull();
49+
5050
// Footer
5151
orientationCB = new Checkbox("Toggle Orientation");
5252
orientationCB.setValue(true);
@@ -70,7 +70,7 @@ public TabbedDemo() {
7070
Component currentDemo = demos.get(tabs.getSelectedTab());
7171
this.add(tabs, currentDemo);
7272
if (currentDemo instanceof SplitLayoutDemo) {
73-
currentLayout = (SplitLayoutDemo<Component>) currentDemo;
73+
currentLayout = (SplitLayoutDemo) currentDemo;
7474
this.add(footer);
7575
updateSplitterPosition();
7676
updateSplitterOrientation();
@@ -92,7 +92,7 @@ public TabbedDemo() {
9292
public void addDemo(Component demo, String label, String sourceCodeUrl) {
9393
Tab tab = new Tab(label);
9494
if (sourceCodeUrl != null) {
95-
demos.put(tab, new SplitLayoutDemo<>(demo, sourceCodeUrl));
95+
demos.put(tab, new SplitLayoutDemo(demo, sourceCodeUrl));
9696
} else {
9797
demos.put(tab, demo);
9898
}

0 commit comments

Comments
 (0)