<commit_before>package com.vaadin.demo.themes;

import java.util.Date;

import com.vaadin.Application;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.DateField;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.InlineDateField;
import com.vaadin.ui.Label;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Panel;
import com.vaadin.ui.SplitPanel;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.TwinColSelect;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;

/**
 * This Vaadin application demonstrates all the available styles that the
 * Reindeer theme includes.
 * 
 * @author <NAME>, IT Mill Ltd.
 * 
 */
@SuppressWarnings("serial")
public class ReindeerThemeStyles extends Application {

    private Window main;
    private VerticalLayout mainLayout;

    @Override
    public void init() {
        setTheme("reindeer");

        main = new Window("Vaadin Reindeer Theme - Included Style Names");
        setMainWindow(main);

        mainLayout = (VerticalLayout) main.getContent();
        mainLayout.setSpacing(true);

        mainLayout.addComponent(new H1("Reindeer theme style reference"));
        mainLayout.addComponent(buildBackgroundToggles());
        mainLayout.addComponent(buildLabels());
        mainLayout.addComponent(buildButtons());
        mainLayout.addComponent(buildTextFields());
        mainLayout.addComponent(buildSelects());
        mainLayout.addComponent(buildDateFields());
        mainLayout.addComponent(buildTabSheets());
        mainLayout.addComponent(buildPanels());
        mainLayout.addComponent(buildTables());
        mainLayout.addComponent(buildWindows());
        mainLayout.addComponent(buildSplitPanels());

    }

    private VerticalLayout buildBackgroundToggles() {
        VerticalLayout l = new VerticalLayout();
        l.setSpacing(true);
        l.setMargin(true, false, true, false);
        l.setWidth(null);

        l.addComponent(new Ruler());

        HorizontalLayout hl = new HorizontalLayout();
        hl.setSpacing(true);
        l.addComponent(hl);

        Button toggle = new Button("Toggle blue style for main layout",
                new Button.ClickListener() {
                    public void buttonClick(ClickEvent event) {
                        if (!mainLayout.getStyleName().contains("blue")) {
                            mainLayout.setStyleName("blue");
                        } else {
                            mainLayout.setStyleName("");
                        }
                    }
                });
        hl.addComponent(toggle);

        toggle = new Button("Toggle black style for main layout",
                new Button.ClickListener() {
                    public void buttonClick(ClickEvent event) {
                        if (!mainLayout.getStyleName().contains("black")) {
                            mainLayout.setStyleName("black");
                        } else {
                            mainLayout.setStyleName("");
                        }
                    }
                });
        hl.addComponent(toggle);

        Label info = new Label(
                "These buttons only change the style name of the main layout in the application. No other changes are needed in order to make the contained components to change style accordingly.");
        info.setStyleName("light");
        l.addComponent(info);

        info = new Label(
                "Note, though, that some components don't different style on a black background, and some styles aren't designed to be used on a black background. Some components aren't even supported to be used on black background currently (i.e. normal Panel).");
        info.setStyleName("light");
        l.addComponent(info);

        l.addComponent(new Ruler());

        return l;
    }

    private VerticalLayout buildLabels() {
        VerticalLayout l = new VerticalLayout();
        l.setSpacing(true);
        l.setMargin(false, false, true, false);
        l.setWidth("400px");

        Label h1 = new H1("Header Label (style \"h1\")");

        Label text = new Label(
                "This is a normal Label. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam lectus. Sed lectus purus, volutpat sit amet, volutpat sed, venenatis ut, libero. Phasellus auctor.");

        Label h2 = new H2("Second Level Header (style \"h2\")");

        Label light = new Label(
                "This is a light (stylename \"light\") Label, that can be used to display secondary information to the user. Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
        light.setStyleName("light");

        l.addComponent(h1);
        l.addComponent(text);
        l.addComponent(h2);
        l.addComponent(light);

        return l;
    }

    private VerticalLayout buildButtons() {
        Base l = new Base("Buttons");

        HorizontalLayout hl = new HorizontalLayout();
        hl.setSpacing(true);

        Button b = new Button("Primary style");
        b.setStyleName("primary");
        hl.addComponent(b);

        b = new Button("Normal");
        hl.addComponent(b);

        b = new Button("Disabled");
        b.setEnabled(false);
        hl.addComponent(b);

        b = new Button("Small style");
        b.setStyleName("small");
        hl.addComponent(b);

        b = new Button("Link style");
        b.setStyleName("link");

        l.addComponent(hl);

        return l;
    }

    private VerticalLayout buildTextFields() {
        Base l = new Base("Text Fields");

        l.addComponent(new TextField("Normal Text field"));
        TextField tf = new TextField();
        tf.setStyleName("small");
        tf.setInputPrompt("Small style textfield");
        l.addComponent(tf);

        return l;
    }
<commit_msg>Added link style button to Reindeer theme example.<commit_after>package com.vaadin.demo.themes;

import java.util.Date;

import com.vaadin.Application;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.DateField;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.InlineDateField;
import com.vaadin.ui.Label;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Panel;
import com.vaadin.ui.SplitPanel;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.TwinColSelect;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;

/**
 * This Vaadin application demonstrates all the available styles that the
 * Reindeer theme includes.
 * 
 * @author <NAME>, IT Mill Ltd.
 * 
 */
@SuppressWarnings("serial")
public class ReindeerThemeStyles extends Application {

    private Window main;
    private VerticalLayout mainLayout;

    @Override
    public void init() {
        setTheme("reindeer");

        main = new Window("Vaadin Reindeer Theme - Included Style Names");
        setMainWindow(main);

        mainLayout = (VerticalLayout) main.getContent();
        mainLayout.setSpacing(true);

        mainLayout.addComponent(new H1("Reindeer theme style reference"));
        mainLayout.addComponent(buildBackgroundToggles());
        mainLayout.addComponent(buildLabels());
        mainLayout.addComponent(buildButtons());
        mainLayout.addComponent(buildTextFields());
        mainLayout.addComponent(buildSelects());
        mainLayout.addComponent(buildDateFields());
        mainLayout.addComponent(buildTabSheets());
        mainLayout.addComponent(buildPanels());
        mainLayout.addComponent(buildTables());
        mainLayout.addComponent(buildWindows());
        mainLayout.addComponent(buildSplitPanels());

    }

    private VerticalLayout buildBackgroundToggles() {
        VerticalLayout l = new VerticalLayout();
        l.setSpacing(true);
        l.setMargin(true, false, true, false);
        l.setWidth(null);

        l.addComponent(new Ruler());

        HorizontalLayout hl = new HorizontalLayout();
        hl.setSpacing(true);
        l.addComponent(hl);

        Button toggle = new Button("Toggle blue style for main layout",
                new Button.ClickListener() {
                    public void buttonClick(ClickEvent event) {
                        if (!mainLayout.getStyleName().contains("blue")) {
                            mainLayout.setStyleName("blue");
                        } else {
                            mainLayout.setStyleName("");
                        }
                    }
                });
        hl.addComponent(toggle);

        toggle = new Button("Toggle black style for main layout",
                new Button.ClickListener() {
                    public void buttonClick(ClickEvent event) {
                        if (!mainLayout.getStyleName().contains("black")) {
                            mainLayout.setStyleName("black");
                        } else {
                            mainLayout.setStyleName("");
                        }
                    }
                });
        hl.addComponent(toggle);

        Label info = new Label(
                "These buttons only change the style name of the main layout in the application. No other changes are needed in order to make the contained components to change style accordingly.");
        info.setStyleName("light");
        l.addComponent(info);

        info = new Label(
                "Note, though, that some components don't different style on a black background, and some styles aren't designed to be used on a black background. Some components aren't even supported to be used on black background currently (i.e. normal Panel).");
        info.setStyleName("light");
        l.addComponent(info);

        l.addComponent(new Ruler());

        return l;
    }

    private VerticalLayout buildLabels() {
        VerticalLayout l = new VerticalLayout();
        l.setSpacing(true);
        l.setMargin(false, false, true, false);
        l.setWidth("400px");

        Label h1 = new H1("Header Label (style \"h1\")");

        Label text = new Label(
                "This is a normal Label. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam lectus. Sed lectus purus, volutpat sit amet, volutpat sed, venenatis ut, libero. Phasellus auctor.");

        Label h2 = new H2("Second Level Header (style \"h2\")");

        Label light = new Label(
                "This is a light (stylename \"light\") Label, that can be used to display secondary information to the user. Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
        light.setStyleName("light");

        l.addComponent(h1);
        l.addComponent(text);
        l.addComponent(h2);
        l.addComponent(light);

        return l;
    }

    private VerticalLayout buildButtons() {
        Base l = new Base("Buttons");

        HorizontalLayout hl = new HorizontalLayout();
        hl.setSpacing(true);

        Button b = new Button("Primary style");
        b.setStyleName("primary");
        hl.addComponent(b);

        b = new Button("Normal");
        hl.addComponent(b);

        b = new Button("Disabled");
        b.setEnabled(false);
        hl.addComponent(b);

        b = new Button("Small style");
        b.setStyleName("small");
        hl.addComponent(b);

        b = new Button("Link style");
        b.setStyleName("link");
        hl.addComponent(b);

        l.addComponent(hl);

        return l;
    }

    private VerticalLayout buildTextFields() {
        Base l = new Base("Text Fields");

        l.addComponent(new TextField("Normal Text field"));
        TextField tf = new TextField();
        tf.setStyleName("small");
        tf.setInputPrompt("Small style textfield");
        l.addComponent(tf);

        return l;
    }

{'fraction_non_alphanumeric': 0.1067141319645666, 'fraction_numerical': 0.0019869194469740873, 'mean_word_length': 2.354623715634546, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2885743', 'n_tokens_mistral': 3370, 'n_tokens_neox': 3172, 'n_words': 840}