author | wenzelm |
Wed, 21 Nov 2012 14:07:35 +0100 | |
changeset 50147 | 8d2251b9a200 |
parent 50119 | 5c370a036de7 |
child 50190 | 0d7f0d8fd63b |
permissions | -rw-r--r-- |
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 | 2 |
Author: Makarius |
36760 | 3 |
|
4 |
Editor pane for plugin options. |
|
5 |
*/ |
|
34407 | 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 | 9 |
|
40850 | 10 |
import isabelle._ |
11 |
||
49271 | 12 |
import org.gjt.sp.jedit.{jEdit, AbstractOptionPane} |
34318
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 |
|
49354 | 15 |
abstract class Isabelle_Options(name: String) extends AbstractOptionPane(name) |
34617
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
16 |
{ |
49354 | 17 |
protected val components: List[(String, List[Option_Component])] |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
18 |
|
34617
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
19 |
override def _init() |
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
20 |
{ |
49271 | 21 |
val dummy_property = "options.isabelle.dummy" |
22 |
||
49270 | 23 |
for ((s, cs) <- components) { |
49271 | 24 |
if (s != "") { |
25 |
jEdit.setProperty(dummy_property, s) |
|
26 |
addSeparator(dummy_property) |
|
27 |
jEdit.setProperty(dummy_property, null) |
|
28 |
} |
|
49270 | 29 |
cs.foreach(c => addComponent(c.title, c.peer)) |
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 | 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 |
} |
49354 | 38 |
|
39 |
||
40 |
class Isabelle_Options1 extends Isabelle_Options("isabelle-general") |
|
41 |
{ |
|
42 |
// FIXME avoid hard-wired stuff |
|
43 |
private val relevant_options = |
|
49969
72216713733a
further attempts to cope with large files via option jedit_text_overview_limit;
wenzelm
parents:
49722
diff
changeset
|
44 |
Set("jedit_logic", "jedit_auto_start", "jedit_font_scale", "jedit_text_overview_limit", |
50117 | 45 |
"jedit_tooltip_font_scale", "jedit_tooltip_margin", "threads", "threads_trace", |
46 |
"parallel_proofs", "parallel_proofs_threshold", "editor_load_delay", |
|
50119
5c370a036de7
more generous tracing_limit, with explicit system option;
wenzelm
parents:
50117
diff
changeset
|
47 |
"editor_input_delay", "editor_output_delay", "editor_reparse_limit", "editor_tracing_limit", |
5c370a036de7
more generous tracing_limit, with explicit system option;
wenzelm
parents:
50117
diff
changeset
|
48 |
"editor_update_delay") |
49354 | 49 |
|
50 |
relevant_options.foreach(Isabelle.options.value.check_name _) |
|
51 |
||
52 |
protected val components = |
|
53 |
Isabelle.options.make_components(List(Isabelle_Logic.logic_selector(false)), relevant_options) |
|
54 |
} |
|
55 |
||
56 |
||
57 |
class Isabelle_Options2 extends Isabelle_Options("isabelle-rendering") |
|
58 |
{ |
|
59 |
// FIXME avoid hard-wired stuff |
|
60 |
private val predefined = |
|
61 |
(for { |
|
62 |
(name, opt) <- Isabelle.options.value.options.toList |
|
49355 | 63 |
if (name.endsWith("_color") && opt.section == "Rendering of Document Content") |
49354 | 64 |
} yield Isabelle.options.make_color_component(opt)) |
65 |
||
66 |
assert(!predefined.isEmpty) |
|
67 |
||
68 |
protected val components = Isabelle.options.make_components(predefined, _ => false) |
|
69 |
} |
|
70 |