Package com.vaadin.ui

Examples of com.vaadin.ui.LegacyWindow


    private ComboBox combo;
    private Label labelLong;

    @Override
    public void init() {
        setMainWindow(new LegacyWindow());

        gl = new GridLayout(1, 2);
        gl.setStyleName("borders");
        getMainWindow().addComponent(gl);
        setTheme("tests-tickets");
View Full Code Here


public class Ticket2107 extends LegacyApplication {

    @Override
    public void init() {
        final LegacyWindow w = new LegacyWindow("Testing for #2107");
        setMainWindow(w);

        final TextField tf = new TextField(
                "Required field that validated the input");
        tf.setDescription("Enter someting and click outside the field to activate");
        tf.setRequired(true);
        tf.setImmediate(true);
        tf.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                w.showNotification("TextField is " + (tf.isValid() ? "" : "in")
                        + "valid, with error: " + tf.getErrorMessage(),
                        Notification.TYPE_WARNING_MESSAGE);
            }
        });
        tf.addValidator(new Validator() {

            @Override
            public void validate(Object value) throws InvalidValueException {
                if (value == null || value.toString().length() <= 3) {
                    throw new InvalidValueException(
                            "Text length must exceed 3 characters");
                }
            }
        });
        w.addComponent(tf);

        final CheckBox b = new CheckBox(
                "Field should use error message. (!) should be shown when empty.",
                false);
        w.addComponent(b);
        b.setImmediate(true);
        b.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                tf.setRequiredError(b.getValue() ? "Field must not be empty"
View Full Code Here

     * Builds a simple view for application with Table and a row of buttons
     * below it.
     */
    private void buildView() {

        final LegacyWindow w = new LegacyWindow("Workout Log");

        // set theme and some layout stuff
        setMainWindow(w);
        w.getContent().setSizeFull();
        ((MarginHandler) w.getContent()).setMargin(false);

        Panel p = new Panel("Workout Log");
        p.setStyleName(Reindeer.PANEL_LIGHT);
        w.addComponent(p);
        mainLayout = new VerticalLayout();
        p.setContent(mainLayout);

        populateAndConfigureTable();

View Full Code Here

    Table t;

    @Override
    public void init() {
        LegacyWindow mainWindow = new LegacyWindow(getClass().getName());
        setMainWindow(mainWindow);
        mainWindow.getContent().setSizeFull();

        t = new Table();
        t.setSizeFull();
        t.setSelectable(true);
        t.setContainerDataSource(buildContainer());
        mainWindow.addComponent(t);
        ((VerticalLayout) mainWindow.getContent()).setExpandRatio(t, 1);

        // Button button = new Button("Refresh");
        // button.addListener(new Button.ClickListener() {
        // public void buttonClick(ClickEvent event) {
        // t.refreshRowCache();
        // }
        // });
        // mainWindow.addComponent(button);

        ProgressIndicator pi = new ProgressIndicator();
        pi.setPollingInterval(1000);
        pi.setIndeterminate(true);
        mainWindow.addComponent(pi);

        Thread r = new Thread() {
            @Override
            public void run() {
                while (t != null) {
View Full Code Here

    private Button button2;
    private Button button3;

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);
        // setTheme("tests-tickets");
        GridLayout layout = new GridLayout(10, 10);
        w.setContent(layout);
        createUI(layout);
    }
View Full Code Here

    AbstractComponent c = new Button();

    @Override
    public void init() {
        LegacyWindow main = new LegacyWindow();
        setMainWindow(main);

        String[] sizes = { "20", "100", "1", "0", "-1", "", "z" };
        String[] units = { "%", "px", "em", "ex", "in", "cm", "mm", "pt", "pc",
                "", "p", "zyx" };

        GridLayout gl = new GridLayout(units.length, sizes.length);
        main.addComponent(gl);
        for (int i = 0; i < sizes.length; i++) {
            for (int j = 0; j < units.length; j++) {
                String s = sizes[i] + units[j];
                gl.addComponent(new Button(s, this));
            }
        }

        gl.addComponent(new Button("null", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                c.setWidth(null);
                c.setHeight(null);

            }

        }));

        main.addComponent(c);

    }
View Full Code Here

public class Ticket932 extends LegacyApplication {

    @Override
    public void init() {

        final LegacyWindow mainWin = new LegacyWindow(
                "Test app for max length feature");
        setMainWindow(mainWin);

        final TextField tx = new TextField(
                "Textfield with maxlenght 10, single row");
        tx.setImmediate(true);
        tx.setMaxLength(10);

        final Label l = new Label();

        Button b = new Button("Check value");
        b.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                l.setValue("Length: " + tx.getValue().toString().length()
                        + " Content: " + tx.getValue());
            }
        });

        mainWin.addComponent(tx);
        mainWin.addComponent(b);

        final TextArea tx2 = new TextArea(
                "Textfield with maxlenght 10, multirow ");
        mainWin.addComponent(tx2);
        tx2.setImmediate(true);
        tx2.setRows(5);
        tx2.setMaxLength(10);

        Button b2 = new Button("Check value");
        b2.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                l.setValue("Length: " + tx2.getValue().toString().length()
                        + " Content: " + tx2.getValue());
            }
        });

        mainWin.addComponent(tx);
        mainWin.addComponent(b);

        mainWin.addComponent(l);

    }
View Full Code Here

public class Ticket1775 extends com.vaadin.server.LegacyApplication {

    @Override
    public void init() {

        final LegacyWindow main = new LegacyWindow("#1775");
        setMainWindow(main);
        setTheme("tests-tickets");
        String layoutName = "Ticket1775";
        final CustomLayout layout = new CustomLayout(layoutName);

        main.addComponent(layout);

        Button button2 = new Button("Populate content");
        main.addComponent(button2);

        final Button button = new Button("Change content");
        main.addComponent(button);

        button2.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
View Full Code Here

    private CustomLayout cl1;
    private CustomLayout cl2;

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getName());
        setMainWindow(w);
        setTheme("tests-tickets");
        GridLayout layout = new GridLayout(1, 10);
        w.setContent(layout);
        createUI(layout);
    }
View Full Code Here

    /**
     * Initialize Application. Demo components are added to main window.
     */
    @Override
    public void init() {
        final LegacyWindow mainWindow = new LegacyWindow("CustomLayout demo");
        setMainWindow(mainWindow);

        // set the application to use example -theme
        setTheme("tests-components");

        // Create custom layout, themes/example/layout/mainLayout.html
        mainLayout = new CustomLayout("mainLayout");
        // wrap custom layout inside a panel
        VerticalLayout customLayoutPanelLayout = new VerticalLayout();
        customLayoutPanelLayout.setMargin(true);
        final Panel customLayoutPanel = new Panel(
                "Panel containing custom layout (mainLayout.html)",
                customLayoutPanelLayout);
        customLayoutPanelLayout.addComponent(mainLayout);

        // Login components
        mainLayout.addComponent(username, "loginUser");
        mainLayout.addComponent(loginPwd, "loginPassword");
        mainLayout.addComponent(loginButton, "loginButton");

        // Menu component, when clicked bodyPanel is updated
        menu.addItem("Welcome");
        menu.addItem("Products");
        menu.addItem("Support");
        menu.addItem("News");
        menu.addItem("Developers");
        menu.addItem("Contact");
        // "this" handles all menu events, e.g. node clicked event
        menu.addListener(this);
        // Value changes are immediate
        menu.setImmediate(true);
        menu.setNullSelectionAllowed(false);
        mainLayout.addComponent(menu, "menu");

        // Body component
        mainLayout.addComponent(bodyPanel, "body");

        // Initial body are comes from Welcome.html
        setBody("Welcome");

        // Add heading label and custom layout panel to main window
        mainWindow.addComponent(new Label("<h3>Custom layout demo</h3>",
                ContentMode.HTML));
        mainWindow.addComponent(customLayoutPanel);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.LegacyWindow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.