// Category, Name, Desc, Class, Viewed
// Getting started: Labels
{ "Getting started", "Labels", "Some variations of Labels",
- LabelsExample.class },
+ LabelExample.class },
// Getting started: Buttons
{ "Getting started", "Buttons and links",
"Some variations of Buttons and Links", ButtonExample.class },
--- /dev/null
+package com.itmill.toolkit.demo.featurebrowser;\r
+\r
+import com.itmill.toolkit.ui.CustomComponent;\r
+import com.itmill.toolkit.ui.GridLayout;\r
+import com.itmill.toolkit.ui.Label;\r
+import com.itmill.toolkit.ui.OrderedLayout;\r
+import com.itmill.toolkit.ui.Panel;\r
+\r
+/**\r
+ * Shows a few variations of Labels, including the effects of XHTML- and\r
+ * pre-formatted mode.\r
+ * \r
+ * @author IT Mill Ltd.\r
+ */\r
+public class LabelExample extends CustomComponent {\r
+\r
+ private static final String xhtml = "This text has <b>HTML</b> formatting.<br/>"\r
+ + "A plain <i>Label</i> will show the markup, while a <u>XHTML-mode</u>"\r
+ + " <i>Label</i> will show the formatted text.";\r
+\r
+ private static final String pre = "This text has linebreaks.\n\n"\r
+ + "They will show up in a preformatted Label,\n"\r
+ + "but not in a \"plain\" Label.\n\n"\r
+ + " This is an indented row. \n Same indentation here.";\r
+\r
+ public LabelExample() {\r
+\r
+ OrderedLayout main = new OrderedLayout();\r
+ main.setMargin(true);\r
+ setCompositionRoot(main);\r
+\r
+ GridLayout g = new GridLayout(2, 4);\r
+ main.addComponent(g);\r
+\r
+ // plain w/o caption\r
+ Panel p = new Panel("Plain");\r
+ p.setStyleName(Panel.STYLE_LIGHT);\r
+ Label l = new Label("A plain label without caption.");\r
+ p.addComponent(l);\r
+ g.addComponent(p);\r
+ // plain w/ caption\r
+ p = new Panel("Plain w/ caption + tooltip");\r
+ p.setStyleName(Panel.STYLE_LIGHT);\r
+ l = new Label("A plain label with caption.");\r
+ l.setCaption("Label caption");\r
+ l.setDescription("This is a description (tooltip) for the label.");\r
+ p.addComponent(l);\r
+ g.addComponent(p);\r
+ // plain w/ xhtml\r
+ p = new Panel("Plain w/ XHTML content");\r
+ p.setStyleName(Panel.STYLE_LIGHT);\r
+ l = new Label(xhtml);\r
+ p.addComponent(l);\r
+ g.addComponent(p);\r
+ // xhtml w/ xhtml\r
+ p = new Panel("XHTML-mode w/ XHTML content");\r
+ p.setStyleName(Panel.STYLE_LIGHT);\r
+ l = new Label(xhtml);\r
+ l.setContentMode(Label.CONTENT_XHTML);\r
+ p.addComponent(l);\r
+ g.addComponent(p);\r
+ // plain w/ preformatted\r
+ p = new Panel("Plain w/ preformatted content");\r
+ p.setStyleName(Panel.STYLE_LIGHT);\r
+ l = new Label(pre);\r
+ p.addComponent(l);\r
+ g.addComponent(p);\r
+ // preformatted w/ preformatted\r
+ p = new Panel("Preformatted-mode w/ preformatted content");\r
+ p.setStyleName(Panel.STYLE_LIGHT);\r
+ l = new Label(pre);\r
+ l.setContentMode(Label.CONTENT_PREFORMATTED);\r
+ p.addComponent(l);\r
+ g.addComponent(p);\r
+\r
+ }\r
+}\r
+++ /dev/null
-package com.itmill.toolkit.demo.featurebrowser;\r
-\r
-import com.itmill.toolkit.ui.CustomComponent;\r
-import com.itmill.toolkit.ui.GridLayout;\r
-import com.itmill.toolkit.ui.Label;\r
-import com.itmill.toolkit.ui.OrderedLayout;\r
-import com.itmill.toolkit.ui.Panel;\r
-\r
-/**\r
- * Shows a few variations of Labels, including the effects of XHTML- and\r
- * pre-formatted mode.\r
- * \r
- * @author IT Mill Ltd.\r
- */\r
-public class LabelsExample extends CustomComponent {\r
-\r
- private static final String xhtml = "This text has <b>HTML</b> formatting.<br/>"\r
- + "A plain <i>Label</i> will show the markup, while a <u>XHTML-mode</u>"\r
- + " <i>Label</i> will show the formatted text.";\r
-\r
- private static final String pre = "This text has linebreaks.\n\n"\r
- + "They will show up in a preformatted Label,\n"\r
- + "but not in a \"plain\" Label.\n\n"\r
- + " This is an indented row. \n Same indentation here.";\r
-\r
- public LabelsExample() {\r
-\r
- OrderedLayout main = new OrderedLayout();\r
- main.setMargin(true);\r
- setCompositionRoot(main);\r
-\r
- GridLayout g = new GridLayout(2, 4);\r
- main.addComponent(g);\r
-\r
- // plain w/o caption\r
- Panel p = new Panel("Plain");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
- Label l = new Label("A plain label without caption.");\r
- p.addComponent(l);\r
- g.addComponent(p);\r
- // plain w/ caption\r
- p = new Panel("Plain w/ caption + tooltip");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
- l = new Label("A plain label with caption.");\r
- l.setCaption("Label caption");\r
- l.setDescription("This is a description (tooltip) for the label.");\r
- p.addComponent(l);\r
- g.addComponent(p);\r
- // plain w/ xhtml\r
- p = new Panel("Plain w/ XHTML content");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
- l = new Label(xhtml);\r
- p.addComponent(l);\r
- g.addComponent(p);\r
- // xhtml w/ xhtml\r
- p = new Panel("XHTML-mode w/ XHTML content");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
- l = new Label(xhtml);\r
- l.setContentMode(Label.CONTENT_XHTML);\r
- p.addComponent(l);\r
- g.addComponent(p);\r
- // plain w/ preformatted\r
- p = new Panel("Plain w/ preformatted content");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
- l = new Label(pre);\r
- p.addComponent(l);\r
- g.addComponent(p);\r
- // preformatted w/ preformatted\r
- p = new Panel("Preformatted-mode w/ preformatted content");\r
- p.setStyleName(Panel.STYLE_LIGHT);\r
- l = new Label(pre);\r
- l.setContentMode(Label.CONTENT_PREFORMATTED);\r
- p.addComponent(l);\r
- g.addComponent(p);\r
-\r
- }\r
-}\r