package be.iminds.ilabt.jfed.experimenter_gui.util.ui;

import javafx.scene.control.TextField;

/**
 * User: twalcari
 * Date: 1/20/14
 * Time: 5:05 PM
 */
public class NumericTextField extends TextField {


    @Override
    public void replaceText(int start, int end, String text) {
        if (text.matches("[0-9\\.,]*")) {
            super.replaceText(start, end, text);
        }
    }

    @Override
    public void replaceSelection(String text) {
        if (text.matches("[0-9\\.,]*")) {
            super.replaceSelection(text);
        }
    }
}
