src/Tools/jEdit/src/jedit/isabelle_options.scala
changeset 34760 dc7f5e0d9d27
parent 34759 bfea7839d9e1
child 34781 6c2372c4aefb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/Tools/jEdit/src/jedit/isabelle_options.scala	Tue Dec 08 16:30:20 2009 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +/*
     1.5 + * Editor pane for plugin options
     1.6 + *
     1.7 + * @author Johannes Hölzl, TU Munich
     1.8 + */
     1.9 +
    1.10 +package isabelle.jedit
    1.11 +
    1.12 +
    1.13 +import javax.swing.{JComboBox, JSpinner}
    1.14 +
    1.15 +import org.gjt.sp.jedit.AbstractOptionPane
    1.16 +
    1.17 +
    1.18 +class Isabelle_Options extends AbstractOptionPane("isabelle")
    1.19 +{
    1.20 +  private val logic_name = new JComboBox()
    1.21 +  private val font_size = new JSpinner()
    1.22 +
    1.23 +  override def _init()
    1.24 +  {
    1.25 +    addComponent(Isabelle.Property("logic.title"), {
    1.26 +      for (name <- Isabelle.system.find_logics()) {
    1.27 +        logic_name.addItem(name)
    1.28 +        if (name == Isabelle.Property("logic"))
    1.29 +          logic_name.setSelectedItem(name)
    1.30 +      }
    1.31 +      logic_name
    1.32 +    })
    1.33 +    addComponent(Isabelle.Property("font-size.title"), {
    1.34 +      font_size.setValue(Isabelle.Int_Property("font-size"))
    1.35 +      font_size
    1.36 +    })
    1.37 +  }
    1.38 +
    1.39 +  override def _save()
    1.40 +  {
    1.41 +    val logic = logic_name.getSelectedItem.asInstanceOf[String]
    1.42 +    Isabelle.Property("logic") = logic
    1.43 +
    1.44 +    val size = font_size.getValue().asInstanceOf[Int]
    1.45 +    Isabelle.Int_Property("font-size") = size
    1.46 +  }
    1.47 +}