diff --git a/src/main/kotlin/io/github/inductiveautomation/kindling/utils/Swing.kt b/src/main/kotlin/io/github/inductiveautomation/kindling/utils/Swing.kt index db0ac52b..e4cd6ea7 100644 --- a/src/main/kotlin/io/github/inductiveautomation/kindling/utils/Swing.kt +++ b/src/main/kotlin/io/github/inductiveautomation/kindling/utils/Swing.kt @@ -61,8 +61,6 @@ import javax.swing.text.Document import javax.swing.tree.DefaultTreeCellRenderer import javax.swing.tree.TreeCellRenderer import javax.swing.tree.TreeNode -import kotlin.io.path.extension -import kotlin.io.path.isDirectory import kotlin.reflect.KClass import kotlin.reflect.safeCast import kotlin.time.Duration.Companion.milliseconds @@ -326,15 +324,17 @@ class ReifiedJXTable( class FileFilter( private val description: String, - private val predicate: (path: Path) -> Boolean, + private val predicate: (file: File) -> Boolean, ) : SwingFileFilter(), FileFilter { - constructor(description: String, extensions: List) : this(description, { path -> path.extension in extensions }) + constructor(description: String, extensions: List) : this(description, { file -> file.extension in extensions }) fun accept(path: Path): Boolean { - return path.isDirectory() || predicate(path) + return accept(path.toFile()) } - override fun accept(file: File): Boolean = accept(file.toPath()) + override fun accept(file: File): Boolean { + return file.isDirectory || predicate(file) + } override fun getDescription(): String = description }