diff options
author | Henrik Paul <henrik@vaadin.com> | 2015-01-12 16:08:18 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-01-13 15:12:04 +0000 |
commit | bb2e6035d2297025fb55f88911d435747eab3819 (patch) | |
tree | c9f612162813d2564514bae4ef6b1c7451b6441c | |
parent | 2e0d4f149a9b02e38fe32411d66b715714bd526a (diff) | |
download | vaadin-framework-bb2e6035d2297025fb55f88911d435747eab3819.tar.gz vaadin-framework-bb2e6035d2297025fb55f88911d435747eab3819.zip |
Adds PROGRESSBAR_STATIC to Reindeer and Runo (#16173)
Grid's ProgressBarRenderer uses that style by default.
Change-Id: Ie3e1ec33168f61f921efdaf554714fba10cb2644
11 files changed, 161 insertions, 11 deletions
diff --git a/WebContent/VAADIN/themes/reindeer/progressindicator/img/base-static.gif b/WebContent/VAADIN/themes/reindeer/progressindicator/img/base-static.gif Binary files differnew file mode 100644 index 0000000000..474b684196 --- /dev/null +++ b/WebContent/VAADIN/themes/reindeer/progressindicator/img/base-static.gif diff --git a/WebContent/VAADIN/themes/reindeer/progressindicator/progressindicator.scss b/WebContent/VAADIN/themes/reindeer/progressindicator/progressindicator.scss index 52e4239752..2417202828 100644 --- a/WebContent/VAADIN/themes/reindeer/progressindicator/progressindicator.scss +++ b/WebContent/VAADIN/themes/reindeer/progressindicator/progressindicator.scss @@ -11,4 +11,10 @@ background: #f7f9f9 url(img/progress.png); } -}
\ No newline at end of file +// Static style + +.#{$primaryStyleName}-static .#{$primaryStyleName}-wrapper { + background: #dfe2e4 url(img/base-static.gif) repeat-x; +} + +} diff --git a/WebContent/VAADIN/themes/runo/progressindicator/img/base-static.gif b/WebContent/VAADIN/themes/runo/progressindicator/img/base-static.gif Binary files differnew file mode 100644 index 0000000000..474b684196 --- /dev/null +++ b/WebContent/VAADIN/themes/runo/progressindicator/img/base-static.gif diff --git a/WebContent/VAADIN/themes/runo/progressindicator/progressindicator.scss b/WebContent/VAADIN/themes/runo/progressindicator/progressindicator.scss index 9664a473b2..432123cf1f 100644 --- a/WebContent/VAADIN/themes/runo/progressindicator/progressindicator.scss +++ b/WebContent/VAADIN/themes/runo/progressindicator/progressindicator.scss @@ -20,4 +20,10 @@ background: #dfe2e4; } -}
\ No newline at end of file +// Static style + +.#{$primaryStyleName}-static .#{$primaryStyleName}-wrapper { + background: #dfe2e4 url(img/base-static.gif) repeat-x; +} + +} diff --git a/client/src/com/vaadin/client/renderers/ProgressBarRenderer.java b/client/src/com/vaadin/client/renderers/ProgressBarRenderer.java index 8e09641cfc..5b2c70d274 100644 --- a/client/src/com/vaadin/client/renderers/ProgressBarRenderer.java +++ b/client/src/com/vaadin/client/renderers/ProgressBarRenderer.java @@ -29,7 +29,9 @@ public class ProgressBarRenderer extends WidgetRenderer<Double, VProgressBar> { @Override public VProgressBar createWidget() { - return GWT.create(VProgressBar.class); + VProgressBar progressBar = GWT.create(VProgressBar.class); + progressBar.addStyleDependentName("static"); + return progressBar; } @Override diff --git a/server/src/com/vaadin/ui/themes/Reindeer.java b/server/src/com/vaadin/ui/themes/Reindeer.java index 6eeebd8a03..e0ab792a15 100644 --- a/server/src/com/vaadin/ui/themes/Reindeer.java +++ b/server/src/com/vaadin/ui/themes/Reindeer.java @@ -15,14 +15,6 @@ */ package com.vaadin.ui.themes; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.VerticalSplitPanel; - public class Reindeer extends BaseTheme { public static final String THEME_NAME = "reindeer"; @@ -90,6 +82,18 @@ public class Reindeer extends BaseTheme { /*************************************************************************** * + * ProgressBar Styles + * + **************************************************************************/ + + /** + * Displays the progress bar with a static background, instead of an + * animated one. + */ + public static final String PROGRESSBAR_STATIC = "static"; + + /*************************************************************************** + * * SplitPanel styles * **************************************************************************/ diff --git a/server/src/com/vaadin/ui/themes/Runo.java b/server/src/com/vaadin/ui/themes/Runo.java index 11f1bae682..6f8d5f37d9 100644 --- a/server/src/com/vaadin/ui/themes/Runo.java +++ b/server/src/com/vaadin/ui/themes/Runo.java @@ -59,6 +59,18 @@ public class Runo extends BaseTheme { /*************************************************************************** * + * ProgressBar Styles + * + **************************************************************************/ + + /** + * Displays the progress bar with a static background, instead of an + * animated one. + */ + public static final String PROGRESSBAR_STATIC = "static"; + + /*************************************************************************** + * * TabSheet styles * **************************************************************************/ diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticReindeer.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticReindeer.java new file mode 100644 index 0000000000..6cf7fb0ded --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticReindeer.java @@ -0,0 +1,32 @@ +/* + * 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.tests.components.progressindicator; + +import com.vaadin.annotations.Theme; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.ProgressBar; +import com.vaadin.ui.themes.Reindeer; + +@Theme(Reindeer.THEME_NAME) +public class ProgressBarStaticReindeer extends AbstractTestUI { + @Override + protected void setup(VaadinRequest request) { + ProgressBar progressBar = new ProgressBar(); + progressBar.addStyleName(Reindeer.PROGRESSBAR_STATIC); + addComponent(progressBar); + } +} diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticReindeerTest.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticReindeerTest.java new file mode 100644 index 0000000000..f1056a640d --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticReindeerTest.java @@ -0,0 +1,28 @@ +/* + * 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.tests.components.progressindicator; + +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ProgressBarStaticReindeerTest extends MultiBrowserTest { + @Test + public void compareScreenshot() throws Exception { + openTestURL(); + compareScreen("screen"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticRuno.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticRuno.java new file mode 100644 index 0000000000..4e1ff7c886 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticRuno.java @@ -0,0 +1,32 @@ +/* + * 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.tests.components.progressindicator; + +import com.vaadin.annotations.Theme; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.ProgressBar; +import com.vaadin.ui.themes.Runo; + +@Theme(Runo.THEME_NAME) +public class ProgressBarStaticRuno extends AbstractTestUI { + @Override + protected void setup(VaadinRequest request) { + ProgressBar progressBar = new ProgressBar(); + progressBar.addStyleName(Runo.PROGRESSBAR_STATIC); + addComponent(progressBar); + } +} diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticRunoTest.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticRunoTest.java new file mode 100644 index 0000000000..751e048694 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticRunoTest.java @@ -0,0 +1,28 @@ +/* + * 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.tests.components.progressindicator; + +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ProgressBarStaticRunoTest extends MultiBrowserTest { + @Test + public void compareScreenshot() throws Exception { + openTestURL(); + compareScreen("screen"); + } +} |