src/Tools/jEdit/src/tree_text_area.scala
changeset 81323 33fbf90fbc1d
parent 81320 f0fccb521124
child 81325 458e9e3b356e
equal deleted inserted replaced
81322:0521e65af41e 81323:33fbf90fbc1d
    10 import isabelle._
    10 import isabelle._
    11 
    11 
    12 import java.awt.Dimension
    12 import java.awt.Dimension
    13 import java.awt.event.{ComponentEvent, ComponentAdapter, FocusAdapter, FocusEvent,
    13 import java.awt.event.{ComponentEvent, ComponentAdapter, FocusAdapter, FocusEvent,
    14   MouseEvent, MouseAdapter}
    14   MouseEvent, MouseAdapter}
    15 import javax.swing.{JTree, JComponent}
    15 import javax.swing.JComponent
    16 import javax.swing.tree.{DefaultMutableTreeNode, DefaultTreeModel}
    16 import javax.swing.tree.{DefaultMutableTreeNode, DefaultTreeModel}
    17 import javax.swing.event.TreeSelectionEvent
    17 import javax.swing.event.TreeSelectionEvent
    18 
    18 
    19 import scala.swing.{Component, ScrollPane, SplitPane, Orientation}
    19 import scala.swing.{Component, ScrollPane, SplitPane, Orientation}
    20 import scala.swing.event.ButtonClicked
    20 import scala.swing.event.ButtonClicked
    27 
    27 
    28 
    28 
    29   /* tree view */
    29   /* tree view */
    30 
    30 
    31   val root: DefaultMutableTreeNode = new DefaultMutableTreeNode(root_name)
    31   val root: DefaultMutableTreeNode = new DefaultMutableTreeNode(root_name)
    32   val tree: JTree = GUI.init_tree(root, single_selection_mode = true)
    32   val tree: Tree_View = new Tree_View(root, single_selection_mode = true)
    33 
    33 
    34   def get_tree_selection[A](which: PartialFunction[AnyRef, A]): Option[A] =
    34   def get_tree_selection[A](which: PartialFunction[AnyRef, A]): Option[A] =
    35     tree.getLastSelectedPathComponent match {
    35     tree.getLastSelectedPathComponent match {
    36       case node: DefaultMutableTreeNode =>
    36       case node: DefaultMutableTreeNode =>
    37         val obj = node.getUserObject
    37         val obj = node.getUserObject