src/Tools/jEdit/src/base_plugin.scala
author wenzelm
Fri, 15 Nov 2024 13:31:36 +0100
changeset 81448 9b2e13b3ee43
parent 75393 87ebf5a50283
permissions -rw-r--r--
more rebust mechanics of refresh (see also 82110cbcf9a1 and 2d9b6e32632d): painter.getFontRenderContext might be in undefined state (notably on macOS due to display scaling);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73891
diff changeset
     1
/*  Title:      Tools/jEdit/src/base_plugin.scala
66457
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
     2
    Author:     Makarius
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
     3
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
     4
Isabelle base environment for jEdit.
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
     5
*/
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
     6
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73891
diff changeset
     7
package isabelle.jedit
66457
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
     8
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
     9
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
    10
import isabelle._
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
    11
66603
f6a1274be674 tuned signature -- avoid warning during jEdit startup;
wenzelm
parents: 66602
diff changeset
    12
import org.gjt.sp.jedit.{EBMessage, Debug, EBPlugin}
66555
39257f39c7da more robust: fall-back for SyntaxUtilities.StyleExtender when Isabelle plugin is unloaded;
wenzelm
parents: 66457
diff changeset
    13
import org.gjt.sp.util.SyntaxUtilities
66457
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
    14
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
    15
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 73987
diff changeset
    16
class Base_Plugin extends EBPlugin {
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 73987
diff changeset
    17
  override def start(): Unit = {
73891
6c9044f04756 clarified modules (again): services require full Isabelle/Scala environment;
wenzelm
parents: 73890
diff changeset
    18
    Isabelle_System.init()
66555
39257f39c7da more robust: fall-back for SyntaxUtilities.StyleExtender when Isabelle plugin is unloaded;
wenzelm
parents: 66457
diff changeset
    19
73110
c87ca43ebd3b avoid rescaled fonts, e.g. dockable buttons on Windows L&F after opening a new view;
wenzelm
parents: 73076
diff changeset
    20
    GUI.use_isabelle_fonts()
c87ca43ebd3b avoid rescaled fonts, e.g. dockable buttons on Windows L&F after opening a new view;
wenzelm
parents: 73076
diff changeset
    21
66593
d389714a8aaa clarified startup sequence;
wenzelm
parents: 66590
diff changeset
    22
    Debug.DISABLE_SEARCH_DIALOG_POOL = true
d389714a8aaa clarified startup sequence;
wenzelm
parents: 66590
diff changeset
    23
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73891
diff changeset
    24
    Syntax_Style.set_extender(Syntax_Style.Base_Extender)
66457
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
    25
  }
66590
8e1aac4eed11 more robust;
wenzelm
parents: 66555
diff changeset
    26
75393
87ebf5a50283 clarified formatting, for the sake of scala3;
wenzelm
parents: 73987
diff changeset
    27
  override def stop(): Unit = {
73987
fc363a3b690a build.props for isabelle.jar, including isabelle.jedit;
wenzelm
parents: 73891
diff changeset
    28
    Syntax_Style.set_extender(new SyntaxUtilities.StyleExtender)
66590
8e1aac4eed11 more robust;
wenzelm
parents: 66555
diff changeset
    29
  }
66603
f6a1274be674 tuned signature -- avoid warning during jEdit startup;
wenzelm
parents: 66602
diff changeset
    30
73340
0ffcad1f6130 tuned --- fewer warnings;
wenzelm
parents: 73110
diff changeset
    31
  override def handleMessage(message: EBMessage): Unit = {}
66457
9098c36abd1a separate base plugin for important services that should be always available, despite startup errors of the main plugin;
wenzelm
parents:
diff changeset
    32
}