From: Marc Englund Date: Mon, 3 Dec 2007 13:27:58 +0000 (+0000) Subject: Renamed LabelsExample -> LabelExample X-Git-Tag: 6.7.0.beta1~5318 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c8b6efdceefb2c8f4f52c1df33e144e81e1dcba5;p=vaadin-framework.git Renamed LabelsExample -> LabelExample svn changeset:3121/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java b/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java index 220ac9960f..a018744838 100644 --- a/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java +++ b/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java @@ -49,7 +49,7 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements // 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 }, diff --git a/src/com/itmill/toolkit/demo/featurebrowser/LabelExample.java b/src/com/itmill/toolkit/demo/featurebrowser/LabelExample.java new file mode 100644 index 0000000000..41e14b8841 --- /dev/null +++ b/src/com/itmill/toolkit/demo/featurebrowser/LabelExample.java @@ -0,0 +1,77 @@ +package com.itmill.toolkit.demo.featurebrowser; + +import com.itmill.toolkit.ui.CustomComponent; +import com.itmill.toolkit.ui.GridLayout; +import com.itmill.toolkit.ui.Label; +import com.itmill.toolkit.ui.OrderedLayout; +import com.itmill.toolkit.ui.Panel; + +/** + * Shows a few variations of Labels, including the effects of XHTML- and + * pre-formatted mode. + * + * @author IT Mill Ltd. + */ +public class LabelExample extends CustomComponent { + + private static final String xhtml = "This text has HTML formatting.
" + + "A plain Label will show the markup, while a XHTML-mode" + + " Label will show the formatted text."; + + private static final String pre = "This text has linebreaks.\n\n" + + "They will show up in a preformatted Label,\n" + + "but not in a \"plain\" Label.\n\n" + + " This is an indented row. \n Same indentation here."; + + public LabelExample() { + + OrderedLayout main = new OrderedLayout(); + main.setMargin(true); + setCompositionRoot(main); + + GridLayout g = new GridLayout(2, 4); + main.addComponent(g); + + // plain w/o caption + Panel p = new Panel("Plain"); + p.setStyleName(Panel.STYLE_LIGHT); + Label l = new Label("A plain label without caption."); + p.addComponent(l); + g.addComponent(p); + // plain w/ caption + p = new Panel("Plain w/ caption + tooltip"); + p.setStyleName(Panel.STYLE_LIGHT); + l = new Label("A plain label with caption."); + l.setCaption("Label caption"); + l.setDescription("This is a description (tooltip) for the label."); + p.addComponent(l); + g.addComponent(p); + // plain w/ xhtml + p = new Panel("Plain w/ XHTML content"); + p.setStyleName(Panel.STYLE_LIGHT); + l = new Label(xhtml); + p.addComponent(l); + g.addComponent(p); + // xhtml w/ xhtml + p = new Panel("XHTML-mode w/ XHTML content"); + p.setStyleName(Panel.STYLE_LIGHT); + l = new Label(xhtml); + l.setContentMode(Label.CONTENT_XHTML); + p.addComponent(l); + g.addComponent(p); + // plain w/ preformatted + p = new Panel("Plain w/ preformatted content"); + p.setStyleName(Panel.STYLE_LIGHT); + l = new Label(pre); + p.addComponent(l); + g.addComponent(p); + // preformatted w/ preformatted + p = new Panel("Preformatted-mode w/ preformatted content"); + p.setStyleName(Panel.STYLE_LIGHT); + l = new Label(pre); + l.setContentMode(Label.CONTENT_PREFORMATTED); + p.addComponent(l); + g.addComponent(p); + + } +} diff --git a/src/com/itmill/toolkit/demo/featurebrowser/LabelsExample.java b/src/com/itmill/toolkit/demo/featurebrowser/LabelsExample.java deleted file mode 100644 index adb4b53bbc..0000000000 --- a/src/com/itmill/toolkit/demo/featurebrowser/LabelsExample.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.itmill.toolkit.demo.featurebrowser; - -import com.itmill.toolkit.ui.CustomComponent; -import com.itmill.toolkit.ui.GridLayout; -import com.itmill.toolkit.ui.Label; -import com.itmill.toolkit.ui.OrderedLayout; -import com.itmill.toolkit.ui.Panel; - -/** - * Shows a few variations of Labels, including the effects of XHTML- and - * pre-formatted mode. - * - * @author IT Mill Ltd. - */ -public class LabelsExample extends CustomComponent { - - private static final String xhtml = "This text has HTML formatting.
" - + "A plain Label will show the markup, while a XHTML-mode" - + " Label will show the formatted text."; - - private static final String pre = "This text has linebreaks.\n\n" - + "They will show up in a preformatted Label,\n" - + "but not in a \"plain\" Label.\n\n" - + " This is an indented row. \n Same indentation here."; - - public LabelsExample() { - - OrderedLayout main = new OrderedLayout(); - main.setMargin(true); - setCompositionRoot(main); - - GridLayout g = new GridLayout(2, 4); - main.addComponent(g); - - // plain w/o caption - Panel p = new Panel("Plain"); - p.setStyleName(Panel.STYLE_LIGHT); - Label l = new Label("A plain label without caption."); - p.addComponent(l); - g.addComponent(p); - // plain w/ caption - p = new Panel("Plain w/ caption + tooltip"); - p.setStyleName(Panel.STYLE_LIGHT); - l = new Label("A plain label with caption."); - l.setCaption("Label caption"); - l.setDescription("This is a description (tooltip) for the label."); - p.addComponent(l); - g.addComponent(p); - // plain w/ xhtml - p = new Panel("Plain w/ XHTML content"); - p.setStyleName(Panel.STYLE_LIGHT); - l = new Label(xhtml); - p.addComponent(l); - g.addComponent(p); - // xhtml w/ xhtml - p = new Panel("XHTML-mode w/ XHTML content"); - p.setStyleName(Panel.STYLE_LIGHT); - l = new Label(xhtml); - l.setContentMode(Label.CONTENT_XHTML); - p.addComponent(l); - g.addComponent(p); - // plain w/ preformatted - p = new Panel("Plain w/ preformatted content"); - p.setStyleName(Panel.STYLE_LIGHT); - l = new Label(pre); - p.addComponent(l); - g.addComponent(p); - // preformatted w/ preformatted - p = new Panel("Preformatted-mode w/ preformatted content"); - p.setStyleName(Panel.STYLE_LIGHT); - l = new Label(pre); - l.setContentMode(Label.CONTENT_PREFORMATTED); - p.addComponent(l); - g.addComponent(p); - - } -}