Examples of UserError


Examples of com.vaadin.server.UserError

        Form form = new Form();
        form.setCaption(caption);
        form.addField("value", new TextField("MyField"));

        if (withError) {
            form.setComponentError(new UserError("Has error"));
        }

        if (withFooter) {
            form.getFooter().addComponent(new Button("Footer button"));
        } else {
View Full Code Here

Examples of com.vaadin.server.UserError

                    System.out.println("b click");

                }
            });
            button.setDescription("Yep yep");
            button.setComponentError(new UserError("Error"));
            content.add(button);
            t.addItem(content.toArray(), "" + i);
        }
        return t;
    }
View Full Code Here

Examples of com.vaadin.server.UserError

        ol.addComponent(tf);

        tf = new TextField(
                "A very long caption which is probably much longer than the field and includes indicators");
        tf.setRequired(true);
        tf.setComponentError(new UserError("abc123"));
        ol.addComponent(tf);

        // for (int i = 0; i < 3; i++) {
        // Button b = new Button("Button " + i);
        // if (i == 2) {
View Full Code Here

Examples of com.vaadin.server.UserError

        ol.setCaption("Caption test with fixed size");

        TextField tf;
        tf = new TextField("Short caption");
        tf.setValue("Undefined width");
        tf.setComponentError(new UserError("123"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);

        tf = new TextField(
                "A long caption which is probably much longer than the field");
        tf.setValue("Undefined width");
        tf.setRequired(true);
        tf.setComponentError(new UserError("123"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);

        tf = new TextField(
                "A very long caption which is probably much longer than the field and includes indicators");
        tf.setValue("Undefined width");
        tf.setIcon(new ThemeResource("icons/16/document-add.png"));
        tf.setRequired(true);
        tf.setComponentError(new UserError("abc123"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);

        // for (int i = 0; i < 3; i++) {
        // Button b = new Button("Button " + i);
View Full Code Here

Examples of com.vaadin.server.UserError

        TextField tf;
        tf = new TextField("Short caption");
        tf.setSizeFull();
        tf.setValue("100% wide field, ratio 1");

        tf.setComponentError(new UserError("123"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);
        ol.setExpandRatio(tf, 1);

        tf = new TextField(
                "A long caption which is probably much longer than the field");
        tf.setValue("100% wide field, ratio 2");
        tf.setSizeFull();
        tf.setRequired(true);
        tf.setComponentError(new UserError("123"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);
        ol.setExpandRatio(tf, 2);

        tf = new TextField(
                "A very long caption which is probably much longer than the field and includes indicators");
        tf.setValue("100% wide field, ratio 3");
        tf.setSizeFull();
        tf.setIcon(new ThemeResource("icons/16/document-add.png"));
        tf.setRequired(true);
        tf.setComponentError(new UserError("abc123"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);
        ol.setExpandRatio(tf, 3);

        // for (int i = 0; i < 3; i++) {
View Full Code Here

Examples of com.vaadin.server.UserError

        TextField tf;
        tf = new TextField("Short caption");
        tf.setValue("250px wide field");
        tf.setWidth("250px");
        tf.setComponentError(new UserError("123"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);

        tf = new TextField(
                "A long caption which is probably much longer than the field");
        tf.setWidth("250px");
        tf.setValue("250px wide field");
        tf.setRequired(true);
        tf.setComponentError(new UserError("123"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);

        tf = new TextField(
                "A very long caption which is probably much longer than the field and includes indicators");
        tf.setValue("200px wide field");
        tf.setWidth("200px");
        tf.setIcon(new ThemeResource("icons/16/document-add.png"));
        tf.setRequired(true);
        tf.setComponentError(new UserError("abc123"));
        ol.addComponent(tf);
        ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT);

        // for (int i = 0; i < 3; i++) {
        // Button b = new Button("Button " + i);
View Full Code Here

Examples of com.vaadin.server.UserError

        VerticalLayout vl = new VerticalLayout();
        vl.setCaption("VerticalLayout");
        vl.setMargin(true);
        vl.setSpacing(true);
        vl.setComponentError(new UserError("A error message..."));
        vl.addComponent(new Label("Some content"));
        vl.setId("layout" + debugIdCounter++);
        addComponent(vl);

        CssLayout css = new CssLayout();
        css.setCaption("CssLayout");
        css.addComponent(new Label("Some content"));
        css.setId("layout" + debugIdCounter++);
        addComponent(css);

        AbsoluteLayout abs = new AbsoluteLayout();
        abs.setCaption("Abs layout");
        abs.addComponent(new Label("Some content"));
        abs.setComponentError(new UserError("A error message..."));
        abs.setId("layout" + debugIdCounter++);

        addComponent(abs);

        GridLayout gl = new GridLayout();
        gl.setMargin(true);
        gl.setSpacing(true);
        gl.setCaption("GridLayout");
        gl.setComponentError(new UserError("A error message..."));
        gl.addComponent(new Label("Some content"));
        gl.setId("layout" + debugIdCounter++);

        addComponent(gl);

        VerticalSplitPanel vert = new VerticalSplitPanel();
        vert.setCaption("VertSplitPan");
        vert.setFirstComponent(new Label("Some content 1"));
        vert.setSecondComponent(new Label("Some content 2"));
        vert.setComponentError(new UserError("A error message..."));
        vert.setSplitPosition(50);
        vert.setEnabled(false);
        vert.setHeight("50px");
        vert.setId("layout" + debugIdCounter++);

        addComponent(vert);

        HorizontalSplitPanel horiz = new HorizontalSplitPanel();
        horiz.setSplitPosition(50);
        horiz.setFirstComponent(new Label("Some content 1"));
        horiz.setSecondComponent(new Label("Some content 2"));
        horiz.setIcon(new ThemeResource(parent.ICON_URL));
        horiz.setCaption("HorizSplitPan");
        horiz.setId("layout" + debugIdCounter++);

        addComponent(horiz);

        VerticalSplitPanel smallSplitPanel = new VerticalSplitPanel();
        smallSplitPanel.setCaption("SmallVertSplitPan");
        smallSplitPanel.setFirstComponent(new Label("Some content 1"));
        smallSplitPanel.setSecondComponent(new Label("Some content 2"));
        smallSplitPanel.setComponentError(new UserError("A error message..."));
        smallSplitPanel.setSplitPosition(50);
        smallSplitPanel.addStyleName(Reindeer.SPLITPANEL_SMALL);
        smallSplitPanel.setEnabled(false);
        smallSplitPanel.setHeight("50px");
        smallSplitPanel.setId("layout" + debugIdCounter++);
        addComponent(smallSplitPanel);

        String customLayoutSrc = "<html><div location='pos1' class='customclass'> </div></html>";

        CustomLayout custom;
        try {
            custom = new CustomLayout(new ByteArrayInputStream(
                    customLayoutSrc.getBytes()));
            custom.addComponent(new Label("Some content"), "pos1");
            custom.setComponentError(new UserError("A error mesasge..."));
            custom.setCaption("CustomLayout");
            custom.setId("layout" + debugIdCounter++);

            addComponent(custom);
        } catch (IOException e) {
View Full Code Here

Examples of com.vaadin.server.UserError

        VerticalLayout panelLayout = new VerticalLayout();
        panelLayout.setMargin(true);
        Panel panel = new Panel(caption, panelLayout);
        panelLayout.addComponent(new Label("Some content"));
        panel.setIcon(new ThemeResource(parent.ICON_URL));
        panel.setComponentError(new UserError("A error message..."));
        panel.setId("layout" + debugIdCounter++);

        if (styleName != null) {
            panel.addStyleName(styleName);
        }
View Full Code Here

Examples of com.vaadin.server.UserError

                    tf.setIcon(new ThemeResource(icons.get(random.nextInt(icons
                            .size())) + "?" + timestamp));
                } else if (value.equals("Required")) {
                    tf.setRequired(true);
                } else if (value.equals("Error")) {
                    tf.setComponentError(new UserError("Nooooo..."));
                }
            }
        }
    }
View Full Code Here

Examples of com.vaadin.server.UserError

    private Accordion createAccordionWith(String caption, String styleName) {
        Accordion acc = new Accordion();
        acc.setId("accordion" + debugIdCounter++);
        acc.setCaption(caption);
        acc.setComponentError(new UserError("A error message..."));

        if (styleName != null) {
            acc.addStyleName(styleName);
        }
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.