From: Artur Signell Date: Fri, 26 Oct 2012 10:09:33 +0000 (+0300) Subject: Test for #10081 X-Git-Tag: 7.0.0.beta7~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2972c7d1da1e3fe2939be5120324b3043604a412;p=vaadin-framework.git Test for #10081 Change-Id: I98f2237528451520f36e2d37e179d160418bb8ea --- 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 index 0000000000..6bf08f4ef6 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/label/LabelStyles.java @@ -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; + } + +}