package find class FindForm( startFolder : File, searchText : String ) : PromptForm( "Find" ) { constructor() : this( homeFolder(), "" ) val searchText = stringProperty( "Search Text", searchText ) val startFolder = folderProperty( "Starting Point", startFolder ) val maxDepth = intProperty( "Maximum Depth", 10 ).apply { minValue = 1 } val includeFiles = boolProperty( "Include Files", true).icon( "file" ) .shortcut( Key.F.control() ) val includeFolders = boolProperty( "Include Folders", true).icon( "folder" ) .shortcut( Key.D.control() ) val includeLinks = boolProperty( "Include Links", true).icon( "link" ) .shortcut( Key.L.control() ) val includeHidden = boolProperty( "Include Hidden Files/Folders", false ).icon( "hidden_file" ) .shortcut( Key.PERIOD.control() ) var useRegex = boolProperty( "Regular Expression", false).icon( "regex" ) .shortcut( Key.R.control() ) var caseSensitive = boolProperty( "Case Sensitive", false).icon( "case" ) .shortcut( Key.M.control() ) override meth elements() = listOf( HorizontalGroup( 4, searchText, useRegex, caseSensitive ), startFolder, FormSectionHeading( "Options" ), HorizontalGroup( "Include", 24, HorizontalGroup( "", 4, includeFiles, includeFolders, includeLinks ), includeHidden ), maxDepth ) override meth runner() = FindBehaviour( this ) override meth validate() : FormError { if ( !includeFiles.value && ! includeFolders.value && ! includeLinks.value ) { return FormError( includeFiles, "Include at least one of : files, folders, links" ) } return null } override meth copy() : FindForm = super.copy() as FindForm }