Package javafx.scene.control

Examples of javafx.scene.control.TextField.textProperty()


    public DisposableNode createNode(final PropertyElementController<T> controller) {
        final TextField textBox = new TextField();
        final ChangeListener textBoxListener = createTextBoxListener(controller, textBox);
        textBox.textProperty().addListener(textBoxListener);
        if (controller.getValue() != null) {
            textBox.textProperty().setValue(formatProvider.getFormat(controller.getElement()).format(controller.getValue()));
        }
        final ChangeListener controllerListener = createControllerListener(textBox, controller);
        controller.addListener(controllerListener);

        // TODO Try/Catch will be removed once 2.0.2 is released (http://javafx-jira.kenai.com/browse/RT-17280)
View Full Code Here


        }

        return new DisposableNodeWrapper(textBox, new Callback<Node, Void>() {
            public Void call(Node node) {
                controller.removeListener(controllerListener);
                textBox.textProperty().removeListener(textBoxListener);
                return null;
            }
        });
    }
View Full Code Here

        final TextField text = new TextField();
        String value = controller.getValue();
        if (value != null) {
            text.setText(value);
        }
        text.textProperty().addListener(new ChangeListener<String>() {
            public void changed(ObservableValue<? extends String> observableValue, String s, String s1) {
                controller.setValue(s1);
            }
        });
        controller.addListener(new ChangeListener<String>() {
View Full Code Here

    protected ObjectProperty<T> numberProperty = new SimpleObjectProperty<T>();

    public Node createNode(final ElementController<T> controller) {
        final TextField textBox = new TextField();
        textBox.textProperty().addListener(new ChangeListener<String>() {

            public void changed(ObservableValue<? extends String> observableValue, String s, String s1) {
                if (textBox.getText().trim().length() > 0) {
                    try {
                        Number parsed = parse(textBox.getText());
View Full Code Here

                        e.printStackTrace();
                    }
                }
            }
        });
        textBox.textProperty().setValue(getFormat().format(controller.getValue()));
        controller.addListener(new ChangeListener() {
            public void changed(ObservableValue observableValue, Object o, Object o1) {
                textBox.textProperty().setValue(getFormat().format(controller.getValue()));
            }
        });
View Full Code Here

            }
        });
        textBox.textProperty().setValue(getFormat().format(controller.getValue()));
        controller.addListener(new ChangeListener() {
            public void changed(ObservableValue observableValue, Object o, Object o1) {
                textBox.textProperty().setValue(getFormat().format(controller.getValue()));
            }
        });
        numberProperty.addListener(new ChangeListener<T>() {
            public void changed(ObservableValue<? extends T> observableValue, T t, T t1) {
                controller.setValue(t1);
View Full Code Here

*/
public class TextFieldFactory implements Callback<Void, FXFormNode> {

    public FXFormNode call(Void aVoid) {
        final TextField textField = new TextField();
        return new FXFormNodeWrapper(textField, textField.textProperty());
    }

}
View Full Code Here

        final ChangeListener textPropertyListener = new ChangeListener<String>() {
            public void changed(ObservableValue<? extends String> observableValue, String s, String s1) {
                controller.setValue(s1);
            }
        };
        text.textProperty().addListener(textPropertyListener);
        final ChangeListener<String> controllerListener = new ChangeListener<String>() {
            public void changed(ObservableValue<? extends String> observableValue, String s, String s1) {
                if (s1 != null) {
                    if (!text.getText().equals(s1)) {
                        text.setText(s1);
View Full Code Here

            }
        };
        controller.addListener(controllerListener);
        return new DisposableNodeWrapper(text, new Callback<Node, Void>() {
            public Void call(Node node) {
                text.textProperty().removeListener(textPropertyListener);
                controller.removeListener(controllerListener);
                return null;
            }
        });
    }
View Full Code Here

    }

    public DisposableNode createNode(final PropertyElementController<T> controller) {
        final TextField textBox = new TextField();
        final ChangeListener textBoxListener = createTextBoxListener(controller, textBox);
        textBox.textProperty().addListener(textBoxListener);
        if (controller.getValue() != null) {
            textBox.textProperty().setValue(formatProvider.getFormat(controller.getElement()).format(controller.getValue()));
        }
        final ChangeListener controllerListener = createControllerListener(textBox, controller);
        controller.addListener(controllerListener);
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.