src/Tools/jEdit/src/isabelle_options.scala
author wenzelm
Tue, 11 Sep 2012 15:47:42 +0200
changeset 49270 e5d162d15867
parent 49250 332ab3748350
child 49271 b08f9d534a2a
permissions -rw-r--r--
some support to organize options in sections;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43282
5d294220ca43 moved sources -- eliminated Netbeans artifact of jedit package directory;
wenzelm
parents: 40850
diff changeset
     1
/*  Title:      Tools/jEdit/src/isabelle_options.scala
49246
248e66e8321f more systematic JEdit_Options.make_component;
wenzelm
parents: 49245
diff changeset
     2
    Author:     Makarius
36760
b82a698ef6c9 tuned headers;
wenzelm
parents: 34782
diff changeset
     3
b82a698ef6c9 tuned headers;
wenzelm
parents: 34782
diff changeset
     4
Editor pane for plugin options.
b82a698ef6c9 tuned headers;
wenzelm
parents: 34782
diff changeset
     5
*/
34407
aad6834ba380 added some headers and comments;
wenzelm
parents: 34318
diff changeset
     6
34318
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
     7
package isabelle.jedit
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
     8
34760
dc7f5e0d9d27 misc modernization of names;
wenzelm
parents: 34759
diff changeset
     9
40850
d804de9ac970 more abstract handling of Time properties;
wenzelm
parents: 40849
diff changeset
    10
import isabelle._
d804de9ac970 more abstract handling of Time properties;
wenzelm
parents: 40849
diff changeset
    11
34318
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    12
import org.gjt.sp.jedit.AbstractOptionPane
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    13
34468
9d4b4f290676 maintain Isabelle properties via object Isabelle.Property with apply/update methods;
wenzelm
parents: 34441
diff changeset
    14
34760
dc7f5e0d9d27 misc modernization of names;
wenzelm
parents: 34759
diff changeset
    15
class Isabelle_Options extends AbstractOptionPane("isabelle")
34617
8d2c49605685 simplified option pane: proper logic title, hardwired font path;
wenzelm
parents: 34506
diff changeset
    16
{
49270
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    17
  // FIXME avoid hard-wired stuff
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    18
  private val relevant_options =
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    19
    Set("jedit_logic", "jedit_auto_start", "jedit_relative_font_size", "jedit_tooltip_font_size",
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    20
      "jedit_tooltip_margin", "jedit_tooltip_dismiss_delay", "jedit_load_delay")
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    21
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    22
  private val components =
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    23
    Isabelle.options.make_components(List(Isabelle_Logic.logic_selector(false)), relevant_options)
34318
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    24
34617
8d2c49605685 simplified option pane: proper logic title, hardwired font path;
wenzelm
parents: 34506
diff changeset
    25
  override def _init()
8d2c49605685 simplified option pane: proper logic title, hardwired font path;
wenzelm
parents: 34506
diff changeset
    26
  {
49270
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    27
    for ((s, cs) <- components) {
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    28
      if (s == "") addSeparator() else addSeparator(s)
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    29
      cs.foreach(c => addComponent(c.title, c.peer))
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    30
    }
34318
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    31
  }
34617
8d2c49605685 simplified option pane: proper logic title, hardwired font path;
wenzelm
parents: 34506
diff changeset
    32
8d2c49605685 simplified option pane: proper logic title, hardwired font path;
wenzelm
parents: 34506
diff changeset
    33
  override def _save()
8d2c49605685 simplified option pane: proper logic title, hardwired font path;
wenzelm
parents: 34506
diff changeset
    34
  {
49270
e5d162d15867 some support to organize options in sections;
wenzelm
parents: 49250
diff changeset
    35
    for ((_, cs) <- components) cs.foreach(_.save())
34318
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    36
  }
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    37
}