persistent session-panel.selection;
authorwenzelm
Fri Sep 24 14:47:01 2010 +0200 (2010-09-24)
changeset 396384293ce5b07fb
parent 39637 cc3452317b5f
child 39681 2f9b6d2cf13d
persistent session-panel.selection;
src/Tools/jEdit/src/jedit/session_dockable.scala
     1.1 --- a/src/Tools/jEdit/src/jedit/session_dockable.scala	Fri Sep 24 14:14:21 2010 +0200
     1.2 +++ b/src/Tools/jEdit/src/jedit/session_dockable.scala	Fri Sep 24 14:47:01 2010 +0200
     1.3 @@ -12,7 +12,7 @@
     1.4  import scala.actors.Actor._
     1.5  import scala.swing.{FlowPanel, Button, TextArea, Label, ScrollPane, TabbedPane,
     1.6    Component, Swing}
     1.7 -import scala.swing.event.ButtonClicked
     1.8 +import scala.swing.event.{ButtonClicked, SelectionChanged}
     1.9  
    1.10  import java.awt.BorderLayout
    1.11  
    1.12 @@ -32,6 +32,17 @@
    1.13    private val tabs = new TabbedPane {
    1.14      pages += new TabbedPane.Page("README", Component.wrap(readme))
    1.15      pages += new TabbedPane.Page("System log", new ScrollPane(syslog))
    1.16 +
    1.17 +    selection.index =
    1.18 +    {
    1.19 +      val index = Isabelle.Int_Property("session-panel.selection", 0)
    1.20 +      if (index >= pages.length) 0 else index
    1.21 +    }
    1.22 +    listenTo(selection)
    1.23 +    reactions += {
    1.24 +      case SelectionChanged(_) =>
    1.25 +        Isabelle.Int_Property("session-panel.selection") = selection.index
    1.26 +    }
    1.27    }
    1.28  
    1.29    set_content(tabs)