author | wenzelm |
Wed, 01 Dec 2010 21:07:50 +0100 | |
changeset 40849 | 09270033330e |
parent 40339 | 088e5adca5ad |
child 40850 | d804de9ac970 |
permissions | -rw-r--r-- |
36760 | 1 |
/* Title: Tools/jEdit/src/jedit/isabelle_options.scala |
2 |
Author: Johannes Hölzl, TU Munich |
|
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 |
|
39518 | 10 |
import javax.swing.JSpinner |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
11 |
|
39734 | 12 |
import scala.swing.CheckBox |
13 |
||
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
14 |
import org.gjt.sp.jedit.AbstractOptionPane |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
15 |
|
34468
9d4b4f290676
maintain Isabelle properties via object Isabelle.Property with apply/update methods;
wenzelm
parents:
34441
diff
changeset
|
16 |
|
34760 | 17 |
class Isabelle_Options extends AbstractOptionPane("isabelle") |
34617
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
18 |
{ |
39517 | 19 |
private val logic_selector = Isabelle.logic_selector(Isabelle.Property("logic")) |
39734 | 20 |
private val auto_start = new CheckBox() |
36814
dc85664dbf6d
support Isabelle plugin properties with defaults;
wenzelm
parents:
36760
diff
changeset
|
21 |
private val relative_font_size = new JSpinner() |
37201
8517a650cfdc
control tooltip font via Swing HTML, with tooltip-font-size property;
wenzelm
parents:
36817
diff
changeset
|
22 |
private val tooltip_font_size = new JSpinner() |
40339 | 23 |
private val tooltip_margin = new JSpinner() |
38854
eb6a35be18ca
Isabelle/jEdit property for global tooltip dismiss delay;
wenzelm
parents:
37203
diff
changeset
|
24 |
private val tooltip_dismiss_delay = new JSpinner() |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
25 |
|
34617
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
26 |
override def _init() |
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
27 |
{ |
39517 | 28 |
addComponent(Isabelle.Property("logic.title"), logic_selector.peer) |
34782
fcd6a41326a6
refined treatment of default logic concerning property and GUI;
wenzelm
parents:
34781
diff
changeset
|
29 |
|
39734 | 30 |
addComponent(Isabelle.Property("auto-start.title"), auto_start.peer) |
31 |
auto_start.selected = Isabelle.Boolean_Property("auto-start") |
|
32 |
||
33 |
relative_font_size.setValue(Isabelle.Int_Property("relative-font-size", 100)) |
|
34 |
addComponent(Isabelle.Property("relative-font-size.title"), relative_font_size) |
|
37201
8517a650cfdc
control tooltip font via Swing HTML, with tooltip-font-size property;
wenzelm
parents:
36817
diff
changeset
|
35 |
|
39734 | 36 |
tooltip_font_size.setValue(Isabelle.Int_Property("tooltip-font-size", 10)) |
37 |
addComponent(Isabelle.Property("tooltip-font-size.title"), tooltip_font_size) |
|
38854
eb6a35be18ca
Isabelle/jEdit property for global tooltip dismiss delay;
wenzelm
parents:
37203
diff
changeset
|
38 |
|
40339 | 39 |
tooltip_margin.setValue(Isabelle.Int_Property("tooltip-margin", 40)) |
40 |
addComponent(Isabelle.Property("tooltip-margin.title"), tooltip_margin) |
|
41 |
||
40849 | 42 |
tooltip_dismiss_delay.setValue( |
43 |
(Isabelle.Double_Property("tooltip-dismiss-delay", 8.0) * 1000) round) |
|
39734 | 44 |
addComponent(Isabelle.Property("tooltip-dismiss-delay.title"), tooltip_dismiss_delay) |
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
45 |
} |
34617
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
46 |
|
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
47 |
override def _save() |
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
48 |
{ |
39734 | 49 |
Isabelle.Property("logic") = logic_selector.selection.item.name |
50 |
||
51 |
Isabelle.Boolean_Property("auto-start") = auto_start.selected |
|
34617
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
52 |
|
36814
dc85664dbf6d
support Isabelle plugin properties with defaults;
wenzelm
parents:
36760
diff
changeset
|
53 |
Isabelle.Int_Property("relative-font-size") = |
dc85664dbf6d
support Isabelle plugin properties with defaults;
wenzelm
parents:
36760
diff
changeset
|
54 |
relative_font_size.getValue().asInstanceOf[Int] |
37201
8517a650cfdc
control tooltip font via Swing HTML, with tooltip-font-size property;
wenzelm
parents:
36817
diff
changeset
|
55 |
|
8517a650cfdc
control tooltip font via Swing HTML, with tooltip-font-size property;
wenzelm
parents:
36817
diff
changeset
|
56 |
Isabelle.Int_Property("tooltip-font-size") = |
8517a650cfdc
control tooltip font via Swing HTML, with tooltip-font-size property;
wenzelm
parents:
36817
diff
changeset
|
57 |
tooltip_font_size.getValue().asInstanceOf[Int] |
38854
eb6a35be18ca
Isabelle/jEdit property for global tooltip dismiss delay;
wenzelm
parents:
37203
diff
changeset
|
58 |
|
40339 | 59 |
Isabelle.Int_Property("tooltip-margin") = |
60 |
tooltip_margin.getValue().asInstanceOf[Int] |
|
61 |
||
40849 | 62 |
Isabelle.Double_Property("tooltip-dismiss-delay") = |
63 |
tooltip_dismiss_delay.getValue().asInstanceOf[Int].toDouble / 1000 |
|
34318
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
64 |
} |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
65 |
} |