author | wenzelm |
Thu, 10 Nov 2011 22:39:32 +0100 | |
changeset 45446 | d29d73117b73 |
parent 44699 | 5199ee17c7d7 |
child 49245 | cb70157293c0 |
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 |
{ |
44044
919e2bde7202
workaround for Java 1.7 where javax.swing.JComboBox<E> is generic;
wenzelm
parents:
43282
diff
changeset
|
30 |
addComponent(Isabelle.Property("logic.title"), |
919e2bde7202
workaround for Java 1.7 where javax.swing.JComboBox<E> is generic;
wenzelm
parents:
43282
diff
changeset
|
31 |
logic_selector.peer.asInstanceOf[java.awt.Component]) |
34782
fcd6a41326a6
refined treatment of default logic concerning property and GUI;
wenzelm
parents:
34781
diff
changeset
|
32 |
|
39734 | 33 |
addComponent(Isabelle.Property("auto-start.title"), auto_start.peer) |
34 |
auto_start.selected = Isabelle.Boolean_Property("auto-start") |
|
35 |
||
36 |
relative_font_size.setValue(Isabelle.Int_Property("relative-font-size", 100)) |
|
37 |
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
|
38 |
|
39734 | 39 |
tooltip_font_size.setValue(Isabelle.Int_Property("tooltip-font-size", 10)) |
40 |
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
|
41 |
|
40339 | 42 |
tooltip_margin.setValue(Isabelle.Int_Property("tooltip-margin", 40)) |
43 |
addComponent(Isabelle.Property("tooltip-margin.title"), tooltip_margin) |
|
44 |
||
40849 | 45 |
tooltip_dismiss_delay.setValue( |
40850 | 46 |
Isabelle.Time_Property("tooltip-dismiss-delay", Time.seconds(8.0)).ms.toInt) |
39734 | 47 |
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
|
48 |
} |
34617
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
49 |
|
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
50 |
override def _save() |
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
51 |
{ |
39734 | 52 |
Isabelle.Property("logic") = logic_selector.selection.item.name |
53 |
||
54 |
Isabelle.Boolean_Property("auto-start") = auto_start.selected |
|
34617
8d2c49605685
simplified option pane: proper logic title, hardwired font path;
wenzelm
parents:
34506
diff
changeset
|
55 |
|
36814
dc85664dbf6d
support Isabelle plugin properties with defaults;
wenzelm
parents:
36760
diff
changeset
|
56 |
Isabelle.Int_Property("relative-font-size") = |
dc85664dbf6d
support Isabelle plugin properties with defaults;
wenzelm
parents:
36760
diff
changeset
|
57 |
relative_font_size.getValue().asInstanceOf[Int] |
37201
8517a650cfdc
control tooltip font via Swing HTML, with tooltip-font-size property;
wenzelm
parents:
36817
diff
changeset
|
58 |
|
8517a650cfdc
control tooltip font via Swing HTML, with tooltip-font-size property;
wenzelm
parents:
36817
diff
changeset
|
59 |
Isabelle.Int_Property("tooltip-font-size") = |
8517a650cfdc
control tooltip font via Swing HTML, with tooltip-font-size property;
wenzelm
parents:
36817
diff
changeset
|
60 |
tooltip_font_size.getValue().asInstanceOf[Int] |
38854
eb6a35be18ca
Isabelle/jEdit property for global tooltip dismiss delay;
wenzelm
parents:
37203
diff
changeset
|
61 |
|
40339 | 62 |
Isabelle.Int_Property("tooltip-margin") = |
63 |
tooltip_margin.getValue().asInstanceOf[Int] |
|
64 |
||
40850 | 65 |
Isabelle.Time_Property("tooltip-dismiss-delay") = |
44699
5199ee17c7d7
property "tooltip-dismiss-delay" is edited in ms, not seconds;
wenzelm
parents:
44044
diff
changeset
|
66 |
Time.ms(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
|
67 |
} |
c13e168a8ae6
original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff
changeset
|
68 |
} |