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