You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Labels.java 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * Copyright 2000-2013 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.themes.valo;
  17. import com.vaadin.navigator.View;
  18. import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
  19. import com.vaadin.shared.ui.ContentMode;
  20. import com.vaadin.shared.ui.MarginInfo;
  21. import com.vaadin.ui.HorizontalLayout;
  22. import com.vaadin.ui.Label;
  23. import com.vaadin.ui.Panel;
  24. import com.vaadin.ui.VerticalLayout;
  25. import com.vaadin.ui.themes.ValoTheme;
  26. /**
  27. *
  28. * @since
  29. * @author Vaadin Ltd
  30. */
  31. public class Labels extends VerticalLayout implements View {
  32. public Labels() {
  33. setSpacing(false);
  34. Label h1 = new Label("Labels");
  35. h1.addStyleName(ValoTheme.LABEL_H1);
  36. addComponent(h1);
  37. HorizontalLayout split = new HorizontalLayout();
  38. split.setWidth("100%");
  39. split.setSpacing(false);
  40. addComponent(split);
  41. VerticalLayout left = new VerticalLayout();
  42. left.setSpacing(false);
  43. left.setMargin(new MarginInfo(false, true, false, false));
  44. split.addComponent(left);
  45. Label huge = new Label("Huge type for display text.");
  46. huge.setWidth("100%");
  47. huge.addStyleName(ValoTheme.LABEL_HUGE);
  48. left.addComponent(huge);
  49. Label large = new Label(
  50. "Large type for introductory text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
  51. large.setWidth("100%");
  52. large.addStyleName(ValoTheme.LABEL_LARGE);
  53. left.addComponent(large);
  54. Label h2 = new Label("Subtitle");
  55. h2.addStyleName(ValoTheme.LABEL_H2);
  56. left.addComponent(h2);
  57. Label normal = new Label(
  58. "Normal type for plain text, with a <a href=\"https://vaadin.com\">regular link</a>. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.",
  59. ContentMode.HTML);
  60. normal.setWidth("100%");
  61. left.addComponent(normal);
  62. Label h3 = new Label("Small Title");
  63. h3.addStyleName(ValoTheme.LABEL_H3);
  64. left.addComponent(h3);
  65. Label small = new Label(
  66. "Small type for additional text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
  67. small.setWidth("100%");
  68. small.addStyleName(ValoTheme.LABEL_SMALL);
  69. left.addComponent(small);
  70. Label tiny = new Label("Tiny type for minor text.");
  71. tiny.setWidth("100%");
  72. tiny.addStyleName(ValoTheme.LABEL_TINY);
  73. left.addComponent(tiny);
  74. Label h4 = new Label("Section Title");
  75. h4.addStyleName(ValoTheme.LABEL_H4);
  76. left.addComponent(h4);
  77. normal = new Label(
  78. "Normal type for plain text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
  79. normal.setWidth("100%");
  80. left.addComponent(normal);
  81. Panel p = new Panel("Additional Label Styles");
  82. split.addComponent(p);
  83. VerticalLayout right = new VerticalLayout();
  84. p.setContent(right);
  85. Label label = new Label(
  86. "Bold type for prominent text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
  87. label.setWidth("100%");
  88. label.addStyleName(ValoTheme.LABEL_BOLD);
  89. right.addComponent(label);
  90. label = new Label(
  91. "Light type for subtle text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
  92. label.setWidth("100%");
  93. label.addStyleName(ValoTheme.LABEL_LIGHT);
  94. right.addComponent(label);
  95. label = new Label(
  96. "Colored type for highlighted text. Etiam at risus et justo dignissim congue. Donec congue lacinia dui, a porttitor lectus condimentum laoreet. Nunc eu.");
  97. label.setWidth("100%");
  98. label.addStyleName(ValoTheme.LABEL_COLORED);
  99. right.addComponent(label);
  100. label = new Label("A label for success");
  101. label.setWidth("100%");
  102. label.addStyleName(ValoTheme.LABEL_SUCCESS);
  103. right.addComponent(label);
  104. label = new Label("A label for failure");
  105. label.setWidth("100%");
  106. label.addStyleName(ValoTheme.LABEL_FAILURE);
  107. right.addComponent(label);
  108. }
  109. @Override
  110. public void enter(ViewChangeEvent event) {
  111. // TODO Auto-generated method stub
  112. }
  113. }