X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.utils.ui%2Fsrc%2Forg%2Fsimantics%2Futils%2Fui%2Fvalidators%2FDoubleValidator2.java;h=9a02cb1d3586da6ca4e545062ba0b491aba10e8f;hb=b3f5c0f18c4bd4f7014c029985aa53ff8c6a5372;hp=2738f2a43785a97222b75228eaed275036802549;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/validators/DoubleValidator2.java b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/validators/DoubleValidator2.java index 2738f2a43..9a02cb1d3 100644 --- a/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/validators/DoubleValidator2.java +++ b/bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/validators/DoubleValidator2.java @@ -1,36 +1,36 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.utils.ui.validators; - -import java.text.DecimalFormat; -import java.text.ParseException; - -import org.eclipse.jface.dialogs.IInputValidator; - -/** - * validates all doubles - * - * @author Toni Kalajainen - */ -public class DoubleValidator2 implements IInputValidator { - - public static DoubleValidator2 DOUBLE_VALIDATOR = new DoubleValidator2(); - - public String isValid(String newText) { - try { - DecimalFormat.getInstance().parse(newText); - return null; - } catch (ParseException e) { - return "\""+newText+"\" is not a numeric value";//;e.getMessage(); - } - } -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.utils.ui.validators; + +import java.text.DecimalFormat; +import java.text.ParseException; + +import org.eclipse.jface.dialogs.IInputValidator; + +/** + * validates all doubles + * + * @author Toni Kalajainen + */ +public class DoubleValidator2 implements IInputValidator { + + public static DoubleValidator2 DOUBLE_VALIDATOR = new DoubleValidator2(); + + public String isValid(String newText) { + try { + DecimalFormat.getInstance().parse(newText); + return null; + } catch (ParseException e) { + return "\""+newText+"\" is not a numeric value";//;e.getMessage(); + } + } +}