Skip to content

Tree: Should treePathToPath handle null? And how? #4

Open
@Sciss

Description

@Sciss

The documentation says

/**
 * Implicitly converts javax.swing.tree.TreePath objects to Tree.Path[A] lists recognised in Scala Swing.  
 * TreePaths will include the underlying JTree's hidden root node, which is omitted for Tree.Paths.
 */
implicit def treePathToPath(tp: jst.TreePath): Path[A] = model treePathToPath tp

And treePathToPath maps null to null. Since as I understand, the Scala version drops root from the path, we cannot use Path.empty here, right?

Then I suggest that getClosestPathForLocation should return an Option[Path[A]] instead of a nullable Path[A].

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions