Package com.vaadin.ui

Examples of com.vaadin.ui.AbstractTextField$TextChangeEventImpl


        cursorPosition.setValue("?");
        addComponent(new Button("Force position update"));
    }

    public void addListener(AbstractField newField) {
        AbstractTextField newTextField = (AbstractTextField) newField;
        newTextField.setTextChangeEventMode(TextChangeEventMode.EAGER);

        newTextField.addListener(new TextChangeListener() {
            @Override
            public void textChange(TextChangeEvent event) {
                AbstractTextField component = (AbstractTextField) event
                        .getComponent();
                cursorPosition.setValue(String.valueOf(component
                        .getCursorPosition()));
            }
        });
    }
View Full Code Here


    protected void setup() {
        TestUtils.injectCSS(getMainWindow(),
                ".v-textfield-focus, .v-textarea-focus { "
                        + " background: #E8F0FF !important }");

        AbstractTextField field = new TextField();
        field.setDebugId("test-textfield");
        field.setInputPrompt("Enter at least 3 characters");
        field.addListener(listener);
        addComponent(field);

        field = new TextArea();
        field.setDebugId("test-textarea");
        field.setInputPrompt("Enter at least 3 characters");
        field.addListener(listener);
        addComponent(field);

    }
View Full Code Here

    }

    @Override
    public void textChange(TextChangeEvent event) {
        AbstractTextField tf = (AbstractTextField) event.getComponent();
        log("TextChangeEvent: text='" + event.getText() + "', cursor position="
                + event.getCursorPosition() + " (field cursor pos: "
                + tf.getCursorPosition() + ")");

    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.AbstractTextField$TextChangeEventImpl

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.