Class StringPathValidator
java.lang.Object
com.inductiveautomation.ignition.designer.gui.validation.validators.StringPathValidator
Validates that the provided string satisfies the following conditions:
- Each path component is a legal resource name.
- Each intermediate path component corresponds to a folder resource (if it exists).
- The full path does not already exist in the project.
- The provided name predicate returns no error message.
-
Constructor Summary
ConstructorsConstructorDescriptionStringPathValidator(DesignerContext context, ResourcePath rootFolder, Function<StringPath, String> namePredicate, boolean allowDirectory) -
Method Summary
-
Constructor Details
-
StringPathValidator
public StringPathValidator(DesignerContext context, ResourcePath rootFolder, Function<StringPath, String> namePredicate, boolean allowDirectory) - Parameters:
namePredicate- This function allows users to specify additional validation logic. The function should return an error message if the name is invalid, or an empty string if the name is valid.allowDirectory- If true, the validator will allow the specification of paths with multiple segments (e.g. "FolderA/FolderB/FileName"). If false, only single-segment names are allowed.
-
-
Method Details