]> source.dussan.org Git - vaadin-framework.git/commitdiff
Test for #10081
authorArtur Signell <artur@vaadin.com>
Fri, 26 Oct 2012 10:09:33 +0000 (13:09 +0300)
committerArtur Signell <artur@vaadin.com>
Fri, 26 Oct 2012 10:15:39 +0000 (13:15 +0300)
Change-Id: I98f2237528451520f36e2d37e179d160418bb8ea

uitest/src/com/vaadin/tests/components/label/LabelStyles.java [new file with mode: 0644]

diff --git a/uitest/src/com/vaadin/tests/components/label/LabelStyles.java b/uitest/src/com/vaadin/tests/components/label/LabelStyles.java
new file mode 100644 (file)
index 0000000..6bf08f4
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2011 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.label;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.themes.Reindeer;
+
+public class LabelStyles extends AbstractTestUI {
+
+    @Override
+    protected void setup(VaadinRequest request) {
+        addComponent(createPanel(null, 1));
+        addComponent(createPanel(null, 2));
+        addComponent(createPanel(Reindeer.LABEL_SMALL, 1));
+        addComponent(createPanel(Reindeer.LABEL_SMALL, 2));
+        addComponent(createPanel(Reindeer.LABEL_H1, 1));
+        addComponent(createPanel(Reindeer.LABEL_H1, 2));
+        addComponent(createPanel(Reindeer.LABEL_H2, 1));
+        addComponent(createPanel(Reindeer.LABEL_H2, 2));
+
+    }
+
+    private Panel createPanel(String styleName, int labels) {
+        Panel p = new Panel("");
+        if (styleName != null) {
+            p.setCaption(styleName);
+        }
+        p.setContent(new GridLayout());
+        // ((VerticalLayout) p.getContent()).setMargin(false);
+        p.setSizeUndefined();
+        p.getContent().setSizeUndefined();
+
+        for (int i = 0; i < labels; i++) {
+            Label l = new Label("Label " + i);
+            if (styleName != null) {
+                l.setStyleName(styleName);
+            }
+            p.addComponent(l);
+        }
+
+        return p;
+    }
+
+    @Override
+    protected String getTestDescription() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}