3
3
import com .vaadin .flow .component .HasSize ;
4
4
import com .vaadin .flow .component .UI ;
5
5
import com .vaadin .flow .component .button .Button ;
6
+ import com .vaadin .flow .component .html .Div ;
6
7
import com .vaadin .flow .component .icon .VaadinIcon ;
7
8
import com .vaadin .flow .component .orderedlayout .VerticalLayout ;
9
+ import com .vaadin .flow .component .splitlayout .SplitLayout ;
8
10
import com .vaadin .flow .dom .ThemeList ;
9
11
import com .vaadin .flow .router .Route ;
10
12
import com .vaadin .flow .theme .lumo .Lumo ;
@@ -15,15 +17,20 @@ public class DateRangePickerStyledDemo extends AbstractSimpleChangeDemo
15
17
{
16
18
public static final String NAV = "styled" ;
17
19
18
- private final Button btnDarkMode = new Button ("Toogle theme" );
20
+ private final Button btnDarkMode = new Button ("Toggle theme" );
19
21
20
22
public DateRangePickerStyledDemo ()
21
23
{
22
24
this .initUI ();
23
25
}
24
26
27
+ @ SuppressWarnings ("checkstyle:MagicNumber" )
25
28
protected void initUI ()
26
29
{
30
+ this .dateRangePicker .setWidthFull ();
31
+
32
+ this .taResult .setSizeFull ();
33
+
27
34
this .btnDarkMode .addClickListener (ev ->
28
35
{
29
36
final ThemeList themeList = UI .getCurrent ().getElement ().getThemeList ();
@@ -40,11 +47,13 @@ protected void initUI()
40
47
this .updateBtnDarkMode ();
41
48
});
42
49
43
- this .taResult .setSizeFull ();
50
+ final SplitLayout splitLayout = new SplitLayout (this .dateRangePicker , new Div ());
51
+ splitLayout .setSplitterPosition (25 );
52
+ splitLayout .setWidthFull ();
44
53
45
54
this .getContent ().setPadding (false );
46
55
this .getContent ().add (
47
- new VerticalLayout ( this . dateRangePicker ) ,
56
+ splitLayout ,
48
57
new VerticalLayout (this .taResult , this .btnDarkMode ));
49
58
this .getContent ().getChildren ().forEach (comp -> ((HasSize )comp ).setHeight ("50%" ));
50
59
this .getContent ().setHeightFull ();
0 commit comments