Examples of UserError


Examples of com.vaadin.server.UserError

    private TabSheet createTabSheetWith(String caption, String styleName) {
        TabSheet ts = new TabSheet();
        ts.setId("tabsheet" + debugIdCounter++);
        ts.setCaption(caption);
        ts.setComponentError(new UserError("A error message"));

        Label content = new Label("First Component");
        ts.addTab(content, "First");
        Label content2 = new Label("Second Component");
        ts.addTab(content2, "Second");
View Full Code Here

Examples of com.vaadin.server.UserError

        form.addComponent(email);

        TextField location = new TextField("Location");
        location.setValue(sg.nextString(true) + ", " + sg.nextString(true));
        location.setWidth("50%");
        location.setComponentError(new UserError("This address doesn't exist"));
        form.addComponent(location);

        TextField phone = new TextField("Phone");
        phone.setWidth("50%");
        form.addComponent(phone);
View Full Code Here

Examples of com.vaadin.server.UserError

        tf = new TextField(" ", "Space as caption, required");
        tf.setRequired(true);
        addComponent(tf);

        tf = new TextField(null, "Null caption, error");
        tf.setComponentError(new UserError("error"));
        addComponent(tf);

        tf = new TextField("", "Empty caption, error");
        tf.setComponentError(new UserError("error"));
        addComponent(tf);

        tf = new TextField(" ", "Space as caption, error");
        tf.setComponentError(new UserError("error"));
        addComponent(tf);

    }
View Full Code Here

Examples of com.vaadin.server.UserError

        tf.addStyleName("color3");
        row.addComponent(tf);

        tf = new TextField("Error");
        tf.setValue("Something’s wrong");
        tf.setComponentError(new UserError("Fix it, now!"));
        row.addComponent(tf);

        tf = new TextField("Error, borderless");
        tf.setValue("Something’s wrong");
        tf.setComponentError(new UserError("Fix it, now!"));
        tf.addStyleName("borderless");
        row.addComponent(tf);

        tf = new TextField("Read-only");
        tf.setInputPrompt("Nationality");
View Full Code Here

Examples of com.vaadin.server.UserError

        combo.addItem("Option One");
        combo.addItem("Option Two");
        combo.addItem("Option Three");
        combo.setNullSelectionAllowed(false);
        combo.select("Option One");
        combo.setComponentError(new UserError("Fix it, now!"));
        row.addComponent(combo);

        combo = new ComboBox("Error, borderless");
        combo.setInputPrompt("You can type here");
        combo.addItem("Option One");
        combo.addItem("Option Two");
        combo.addItem("Option Three");
        combo.setNullSelectionAllowed(false);
        combo.select("Option One");
        combo.setComponentError(new UserError("Fix it, now!"));
        combo.addStyleName("borderless");
        row.addComponent(combo);

        combo = new ComboBox("Disabled");
        combo.setInputPrompt("You can't type here");
View Full Code Here

Examples of com.vaadin.server.UserError

                    validationError = field.getErrorMessage();
                    if (validationError != null) {
                        // Show caption as error for fields with empty errors
                        if ("".equals(validationError.toString())) {
                            validationError = new UserError(field.getCaption());
                        }
                        break;
                    } else if (f instanceof Field && !((Field<?>) f).isValid()) {
                        // Something is wrong with the field, but no proper
                        // error is given. Generate one.
                        validationError = new UserError(field.getCaption());
                        break;
                    }
                }
            }
        }
View Full Code Here

Examples of com.vaadin.server.UserError

                addComponent(label);

                label = new Label("With an error message");
                label.addStyleName("bold");
                label.setDescription("Simple tooltip message");
                label.setComponentError(new UserError(
                        "Something terrible has happened"));
                addComponent(label);

                label = new Label("With a long error message");
                label.addStyleName("bold");
                label.setDescription("Simple tooltip message");
                label.setComponentError(new UserError(
                        "<h2>Contra legem facit qui id facit quod lex prohibet <span>Tityre, tu patulae recubans sub tegmine fagi  dolor.</span> <span>Tityre, tu patulae recubans sub tegmine fagi  dolor.</span> <span>Prima luce, cum quibus mons aliud  consensu ab eo.</span> <span>Quid securi etiam tamquam eu fugiat nulla pariatur.</span> <span>Fabio vel iudice vincam, sunt in culpa qui officia.</span> <span>Nihil hic munitissimus habendi senatus locus, nihil horum?</span></p><p><span>Plura mihi bona sunt, inclinet, amari petere vellent.</span> <span>Integer legentibus erat a ante historiarum dapibus.</span> <span>Quam diu etiam furor iste tuus nos eludet?</span> <span>Nec dubitamus multa iter quae et nos invenerat.</span> <span>Quisque ut dolor gravida, placerat libero vel, euismod.</span> <span>Quae vero auctorem tractata ab fiducia dicuntur.</span></h2>",
                        AbstractErrorMessage.ContentMode.HTML,
                        ErrorLevel.CRITICAL));
                addComponent(label);

                label = new Label("Error message only");
                label.addStyleName("bold");
                label.setComponentError(new UserError(
                        "Something terrible has happened"));
                addComponent(label);
            }
        };
        p.setContent(content);
View Full Code Here

Examples of com.vaadin.terminal.UserError

                    /*
                     * Sets the component error to the Conversion Exceptions
                     * message. This can be overriden in
                     * handleUnparsableDateString.
                     */
                    setComponentError(new UserError(e.getLocalizedMessage()));

                    /*
                     * The value of the DateField should be null if an invalid
                     * value has been given. Not using setValue() since we do
                     * not want to cause the client side value to change.
View Full Code Here

Examples of com.vaadin.terminal.UserError

    setMainWindow(window);
    Panel panel = new Panel("nazwa panelu");
    panel.setSizeUndefined();
    LoginForm loginForm = new LoginForm();
    loginForm.setCaption("ralala");
    loginForm.setComponentError(new UserError("adasd"));
    panel.addComponent(loginForm);
    window.addComponent(panel);

    HorizontalLayout horizontalLayout = new HorizontalLayout();
    window.addComponent(horizontalLayout);
View Full Code Here

Examples of com.vaadin.terminal.UserError

  private void addTestField(HorizontalSplitPanel verticalLayout) {
    final TextField textField = new TextField();
    textField.setImmediate(true);
    textField.setSizeFull();
    textField.setComponentError(new UserError("sdfds"));
    textField.setMaxLength(10);
    verticalLayout.addComponent(textField);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.