]> source.dussan.org Git - vaadin-framework.git/commitdiff
Adds PROGRESSBAR_STATIC to Reindeer and Runo (#16173)
authorHenrik Paul <henrik@vaadin.com>
Mon, 12 Jan 2015 14:08:18 +0000 (16:08 +0200)
committerVaadin Code Review <review@vaadin.com>
Tue, 13 Jan 2015 15:12:04 +0000 (15:12 +0000)
Grid's ProgressBarRenderer uses that style by default.

Change-Id: Ie3e1ec33168f61f921efdaf554714fba10cb2644

WebContent/VAADIN/themes/reindeer/progressindicator/img/base-static.gif [new file with mode: 0644]
WebContent/VAADIN/themes/reindeer/progressindicator/progressindicator.scss
WebContent/VAADIN/themes/runo/progressindicator/img/base-static.gif [new file with mode: 0644]
WebContent/VAADIN/themes/runo/progressindicator/progressindicator.scss
client/src/com/vaadin/client/renderers/ProgressBarRenderer.java
server/src/com/vaadin/ui/themes/Reindeer.java
server/src/com/vaadin/ui/themes/Runo.java
uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticReindeer.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticReindeerTest.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticRuno.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarStaticRunoTest.java [new file with mode: 0644]

diff --git a/WebContent/VAADIN/themes/reindeer/progressindicator/img/base-static.gif b/WebContent/VAADIN/themes/reindeer/progressindicator/img/base-static.gif
new file mode 100644 (file)
index 0000000..474b684
Binary files /dev/null and b/WebContent/VAADIN/themes/reindeer/progressindicator/img/base-static.gif differ
index 52e423975240b96325462e8cca221469375c58bf..2417202828285511d33ceba3e35f605a779f2e6c 100644 (file)
        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
new file mode 100644 (file)
index 0000000..474b684
Binary files /dev/null and b/WebContent/VAADIN/themes/runo/progressindicator/img/base-static.gif differ
index 9664a473b2d063fc1a9b862926c58fe87c01d2d4..432123cf1f16432dbfc5094eb3d5096aed199791 100644 (file)
        background: #dfe2e4;
 }
 
-}
\ No newline at end of file
+// Static style
+
+.#{$primaryStyleName}-static .#{$primaryStyleName}-wrapper {
+  background: #dfe2e4 url(img/base-static.gif) repeat-x;
+}
+
+}
index 8e09641cfcc1bfcbdc516b57a4f9263f9cb5d946..5b2c70d274ec5b7d20cde9eb022ad5dac1f0eca2 100644 (file)
@@ -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
index 6eeebd8a0316e093120f4ed88caf4477283dd06f..e0ab792a156f07f2665527a138a75ba6dee86f95 100644 (file)
  */
 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";
@@ -88,6 +80,18 @@ public class Reindeer extends BaseTheme {
      */
     public static final String PANEL_LIGHT = "light";
 
+    /***************************************************************************
+     * 
+     * ProgressBar Styles
+     * 
+     **************************************************************************/
+
+    /**
+     * Displays the progress bar with a static background, instead of an
+     * animated one.
+     */
+    public static final String PROGRESSBAR_STATIC = "static";
+
     /***************************************************************************
      * 
      * SplitPanel styles
index 11f1bae682db06906cf5af7c88df29bb867e029d..6f8d5f37d9d89e7adeb604f19bc193a5f2078a98 100644 (file)
@@ -57,6 +57,18 @@ public class Runo extends BaseTheme {
      */
     public static final String PANEL_LIGHT = "light";
 
+    /***************************************************************************
+     * 
+     * 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 (file)
index 0000000..6cf7fb0
--- /dev/null
@@ -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 (file)
index 0000000..f1056a6
--- /dev/null
@@ -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 (file)
index 0000000..4e1ff7c
--- /dev/null
@@ -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 (file)
index 0000000..751e048
--- /dev/null
@@ -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");
+    }
+}