diff options
author | Artur Signell <artur@vaadin.com> | 2015-09-20 19:11:01 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2015-09-20 19:11:09 +0300 |
commit | 3ce90eabda07319f199233a09a4ed3689c3b3ac5 (patch) | |
tree | 75e53862bc5eb9aee64a9d2e93a891ab915603f1 /server | |
parent | 467c00af32548861c7bb44fc5e3e00fa9829b9a2 (diff) | |
download | vaadin-framework-3ce90eabda07319f199233a09a4ed3689c3b3ac5.tar.gz vaadin-framework-3ce90eabda07319f199233a09a4ed3689c3b3ac5.zip |
Use correct state class for split panels (#18942)
Change-Id: I91980343c0e8f3f35abb26411f57d2303b286cce
Diffstat (limited to 'server')
4 files changed, 74 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/HorizontalSplitPanel.java b/server/src/com/vaadin/ui/HorizontalSplitPanel.java index 14bfdba023..922986eeda 100644 --- a/server/src/com/vaadin/ui/HorizontalSplitPanel.java +++ b/server/src/com/vaadin/ui/HorizontalSplitPanel.java @@ -15,6 +15,8 @@ */ package com.vaadin.ui; +import com.vaadin.shared.ui.splitpanel.HorizontalSplitPanelState; + /** * A horizontal split panel contains two components and lays them horizontally. * The first component is on the left side. @@ -59,4 +61,9 @@ public class HorizontalSplitPanel extends AbstractSplitPanel { setFirstComponent(firstComponent); setSecondComponent(secondComponent); } + + @Override + protected HorizontalSplitPanelState getState() { + return (HorizontalSplitPanelState) super.getState(); + } } diff --git a/server/src/com/vaadin/ui/VerticalSplitPanel.java b/server/src/com/vaadin/ui/VerticalSplitPanel.java index 4476d5a19b..e5e6eb60e1 100644 --- a/server/src/com/vaadin/ui/VerticalSplitPanel.java +++ b/server/src/com/vaadin/ui/VerticalSplitPanel.java @@ -15,6 +15,8 @@ */ package com.vaadin.ui; +import com.vaadin.shared.ui.splitpanel.VerticalSplitPanelState; + /** * A vertical split panel contains two components and lays them vertically. The * first component is above the second component. @@ -53,4 +55,9 @@ public class VerticalSplitPanel extends AbstractSplitPanel { setFirstComponent(firstComponent); setSecondComponent(secondComponent); } + + @Override + protected VerticalSplitPanelState getState() { + return (VerticalSplitPanelState) super.getState(); + } } diff --git a/server/tests/src/com/vaadin/ui/HorizontalSplitPanelTest.java b/server/tests/src/com/vaadin/ui/HorizontalSplitPanelTest.java new file mode 100644 index 0000000000..9797e48924 --- /dev/null +++ b/server/tests/src/com/vaadin/ui/HorizontalSplitPanelTest.java @@ -0,0 +1,30 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.ui; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.shared.ui.splitpanel.HorizontalSplitPanelState; + +public class HorizontalSplitPanelTest { + + @Test + public void primaryStyleName() { + Assert.assertEquals(new HorizontalSplitPanelState().primaryStyleName, + new HorizontalSplitPanel().getPrimaryStyleName()); + } +} diff --git a/server/tests/src/com/vaadin/ui/VerticalSplitPanelTest.java b/server/tests/src/com/vaadin/ui/VerticalSplitPanelTest.java new file mode 100644 index 0000000000..c48caf8144 --- /dev/null +++ b/server/tests/src/com/vaadin/ui/VerticalSplitPanelTest.java @@ -0,0 +1,30 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.ui; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.shared.ui.splitpanel.VerticalSplitPanelState; + +public class VerticalSplitPanelTest { + + @Test + public void primaryStyleName() { + Assert.assertEquals(new VerticalSplitPanelState().primaryStyleName, + new VerticalSplitPanel().getPrimaryStyleName()); + } +} |