Package com.vaadin.ui

Examples of com.vaadin.ui.TextField


        addWindow(window);
        addComponent(createTextField("tf2"));
    }

    private TextField createTextField(String id) {
        TextField tf = new TextField("TextField with a tooltip");
        tf.setDescription("My tooltip");
        tf.setId(id);
        return tf;
    }
View Full Code Here


public class ButtonTabIndex extends TestBase {

    @Override
    protected void setup() {
        TextField tf1 = new TextField("Tab index 0");
        tf1.setTabIndex(0);
        TextField tf2 = new TextField("Tab index -1, focused initially");
        tf2.setTabIndex(-1);
        tf2.focus();
        addComponent(tf1);
        addComponent(tf2);

        addComponent(createButton(1));
        addComponent(createButton(5));
View Full Code Here

        return styles[++index % styles.length];
    }

    @Override
    protected void setup() {
        final TextField tf2 = new TextField("Updates width") {
            @Override
            public void attach() {
                super.attach();
                TestUtils
                        .injectCSS(
                                getUI(),
                                ".red { background:red;} "
                                        + ".green { background:green;} .blue { background:blue;} .cyan { background:cyan;} .magenta { background:magenta;}");
            }
        };
        tf2.setTextChangeEventMode(TextChangeEventMode.EAGER);
        tf2.addListener(new TextChangeListener() {
            @Override
            public void textChange(TextChangeEvent event) {
                tf2.setStyleName(getNextStyle());
            }

        });
        tf2.setImmediate(true);

        addComponent(tf2);
    }
View Full Code Here

                componentWithLongTooltip);

    }

    private TextField createIntegerTextField(String caption, int initialValue) {
        TextField tf = new TextField(caption);
        tf.setId(caption);
        tf.setConverter(Integer.class);
        tf.setImmediate(true);
        tf.setConvertedValue(initialValue);
        // makes TB3 tests simpler - no "null" added when clearing a field
        tf.setNullRepresentation("");
        return tf;
    }
View Full Code Here

        String captions[] = new String[] { "TextField with caption", null };
        Resource icons[] = new Resource[] {
                new ThemeResource("icons/16/document-delete.png"), null };
        boolean required[] = new boolean[] { true, false };
        TextField fields[][] = new TextField[captions.length][icons.length];
        for (int caption = 0; caption < captions.length; caption++) {
            for (int icon = 0; icon < icons.length; icon++) {
                for (int req = 0; req < required.length; req++) {
                    TextField tf = createTextFieldWithError(captions[caption],
                            icons[icon], required[req]);

                    fields[caption][icon] = tf;
                    if (componentWidth != null) {
                        tf.setWidth(componentWidth);
                        tf.setValue(tf.getValue() + " w:" + componentWidth);
                    }

                    if (componentHeight != null) {
                        tf.setHeight(componentWidth);
                        tf.setValue(tf.getValue() + " h:" + componentHeight);
                    }

                    newLayout.addComponent(tf);

                    if (align) {
View Full Code Here

    //
    // }

    private static TextField createTextFieldWithError(String caption,
            Resource icon, boolean required) {
        TextField tf = new TextField();
        tf.setCaption(caption);
        tf.setIcon(icon);
        tf.setRequired(required);
        tf.setComponentError(new UserError("Test error message"));
        return tf;
    }
View Full Code Here

    @Override
    public void setup() {

        GridLayout gl = new GridLayout(2, 2);
        gl.setSizeFull();
        TextField f1 = createField();
        TextField f2 = createField();
        TextField f3 = createField();
        TextField f4 = createField();
        gl.addComponent(f1);
        gl.addComponent(f2);
        gl.addComponent(f3);
        gl.addComponent(f4);
View Full Code Here

        getLayout().addComponent(gl);

    }

    private TextField createField() {
        final TextField field = new TextField();
        field.setDescription("Tooltip " + Integer.toString(tooltipCount++)
                + ": " + LoremIpsum.get(1000));
        return field;
    }
View Full Code Here

        GridLayout gl;

        private IntrWindow(LegacyApplication app) {

            this.app = app;
            tf = new TextField("Echo thingie");
            tf.setImmediate(true);
            tf.addListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(ValueChangeEvent event) {
                    IntrWindow.this.showNotification((String) event
View Full Code Here

        table.setColumnFooter(COLUMN1_PROPERTY_ID, "fuu");
        // table.setColumnFooter(COLUMN2_PROPERTY_ID, "bar");
        table.setColumnFooter(COLUMN3_PROPERTY_ID, "fuubar");

        final TextField columnField = new TextField(
                "ProperyId of clicked column");
        columnField.setId("ClickedColumn");

        // Add a footer click listener
        table.addListener(new Table.FooterClickListener() {
            @Override
            public void footerClick(FooterClickEvent event) {
                columnField.setValue(String.valueOf(event.getPropertyId()));
                log.log("Clicked on footer: " + event.getPropertyId());
            }
        });

        CheckBox immediateCheckbox = new CheckBox("Immediate");
View Full Code Here

TOP

Related Classes of com.vaadin.ui.TextField

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.