/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2010, 2011 Association for Decentralized Information Management in\r
* Industry THTH ry.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
package org.simantics.sysdyn.ui.properties;\r
\r
\r
-import org.eclipse.jface.dialogs.IInputValidator;\r
import org.eclipse.jface.layout.GridDataFactory;\r
import org.eclipse.jface.layout.GridLayoutFactory;\r
import org.eclipse.swt.SWT;\r
import org.simantics.sysdyn.ui.properties.widgets.factories.DoublePropertyModifier;\r
import org.simantics.sysdyn.ui.properties.widgets.factories.VariableNamePropertyModifier;\r
import org.simantics.sysdyn.ui.properties.widgets.factories.VariableNameValidator;\r
+import org.simantics.utils.ui.validators.DoubleValidator;\r
\r
+/**\r
+ * Properties for input variables: Name, default value, isOutput\r
+ * \r
+ * @author Teemu Lempinen\r
+ *\r
+ */\r
public class InputVariableTab extends LabelPropertyTabContributor {\r
\r
\r
\r
new IsOutputWidget(composite, support, SWT.NULL);\r
}\r
-\r
- private class DoubleValidator implements IInputValidator {\r
-\r
- @Override\r
- public String isValid(String newText) {\r
- for(int i = 0; i < newText.length(); i++){\r
- if(!Character.isDigit(newText.charAt(i))){\r
- if(newText.charAt(i) != '.') {\r
- return "Invalid character '" + newText.charAt(i) + "'";\r
- } else if(newText.indexOf('.') != newText.lastIndexOf('.')) {\r
- return "There can be only one '.'";\r
- }\r
- }\r
- }\r
- return null;\r
- }\r
- }\r
}\r