From 0690b7c180baae7aa35858c8f65bf5d1b0835c2a Mon Sep 17 00:00:00 2001 From: miettinen Date: Thu, 7 Mar 2013 11:32:41 +0000 Subject: [PATCH] Added name validation for other elements than variable, module, and enumeration. (refs #4138 #4146) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27026 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.sysdyn.ui/plugin.xml | 8 + .../ui/browser/nodes/EnumerationNode.java | 18 +- .../ui/browser/nodes/FunctionLibraryNode.java | 14 +- .../sysdyn/ui/browser/nodes/FunctionNode.java | 16 +- .../sysdyn/ui/browser/nodes/ModelNode.java | 10 +- .../sysdyn/ui/browser/nodes/ModuleNode.java | 22 +- .../ui/browser/nodes/ModuleTypeNode.java | 8 +- .../nodes/SharedFunctionLibraryNode.java | 23 ++ .../sysdyn/ui/browser/nodes/SheetNode.java | 8 +- .../sysdyn/ui/browser/nodes/VariableNode.java | 22 +- .../participant/SysdynCopyPasteStrategy.java | 4 +- .../ui/elements/HoverTextElementNoBounds.java | 12 +- .../ModelicaSourceViewerConfiguration.java | 130 ++++--- .../ui/properties/ConfigurationTab.java | 12 +- .../sysdyn/ui/properties/EnumerationTab.java | 4 +- .../sysdyn/ui/properties/EquationTab.java | 4 +- .../ui/properties/FunctionLibraryTab.java | 2 + .../sysdyn/ui/properties/FunctionTab.java | 2 + .../ui/properties/InputVariableTab.java | 4 +- .../sysdyn/ui/properties/ModuleTab.java | 2 + .../sysdyn/ui/properties/ModuleTypeTab.java | 2 + .../widgets/arrays/EnumerationIndexNode.java | 4 +- .../NameAndArrayRangeModifyListener.java | 12 +- .../ExpressionFieldConfiguration.java | 4 +- .../widgets/expressions/Function.java | 30 +- .../FunctionLibraryNameInputValidator.java | 52 +++ .../factories/FunctionNameInputValidator.java | 52 +++ .../factories/ModelNameInputValidator.java | 52 +++ .../ModuleTypeNameInputValidator.java | 52 +++ ...r.java => VariableNameInputValidator.java} | 40 +-- .../VariableNamePropertyModifier.java | 4 +- .../utils/FunctionLibraryNameValidator.java | 74 ++++ .../ui/utils/FunctionNameValidator.java | 70 ++++ .../sysdyn/ui/utils/ModelNameValidator.java | 56 +++ .../ui/utils/ModuleTypeNameValidator.java | 84 +++++ .../sysdyn/ui/utils/NameValidator.java | 335 ++++++++++++++++++ .../SharedFunctionLibraryNameValidator.java | 70 ++++ .../sysdyn/ui/utils/SheetNameValidator.java | 70 ++++ .../sysdyn/ui/utils/VariableNameUtils.java | 289 --------------- .../ui/utils/VariableNameValidator.java | 219 ++++++++++++ .../sysdyn/representation/Model.java | 24 ++ 41 files changed, 1470 insertions(+), 450 deletions(-) create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/FunctionLibraryNameInputValidator.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/FunctionNameInputValidator.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/ModelNameInputValidator.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/ModuleTypeNameInputValidator.java rename org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/factories/{VariableNameValidator.java => VariableNameInputValidator.java} (58%) create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/FunctionLibraryNameValidator.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/FunctionNameValidator.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ModelNameValidator.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/ModuleTypeNameValidator.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/NameValidator.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/SharedFunctionLibraryNameValidator.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/SheetNameValidator.java delete mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameUtils.java create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/utils/VariableNameValidator.java diff --git a/org.simantics.sysdyn.ui/plugin.xml b/org.simantics.sysdyn.ui/plugin.xml index c5c6a38c..d3a9e321 100644 --- a/org.simantics.sysdyn.ui/plugin.xml +++ b/org.simantics.sysdyn.ui/plugin.xml @@ -1418,6 +1418,14 @@ args="org.simantics.sysdyn.ui.browser.nodes.FunctionLibraryNode" property="org.simantics.sysdyn.ui.nodeClass"> + + + +