src/Tools/jEdit/src/jedit/StateViewDockable.scala
author immler@in.tum.de
Thu Dec 18 01:10:20 2008 +0100 (2008-12-18)
changeset 34406 f81cd75ae331
parent 34397 86daaf5db016
child 34408 ad7b6c4813c8
permissions -rw-r--r--
restructured: independent provers in different buffers
wenzelm@34318
     1
package isabelle.jedit
wenzelm@34318
     2
wenzelm@34318
     3
immler@34361
     4
import java.awt.BorderLayout
immler@34361
     5
import javax.swing.{ JButton, JPanel, JScrollPane }
wenzelm@34318
     6
wenzelm@34318
     7
import isabelle.IsabelleSystem.getenv
wenzelm@34318
     8
wenzelm@34318
     9
import org.xhtmlrenderer.simple.XHTMLPanel
wenzelm@34318
    10
import org.xhtmlrenderer.context.AWTFontResolver
wenzelm@34318
    11
wenzelm@34318
    12
import org.gjt.sp.jedit.View
wenzelm@34318
    13
wenzelm@34318
    14
class StateViewDockable(view : View, position : String) extends JPanel {
immler@34406
    15
  val panel = new XHTMLPanel(new UserAgent())
immler@34406
    16
  setLayout(new BorderLayout)
immler@34406
    17
immler@34406
    18
  //Copy-paste-support
immler@34406
    19
  private val cp = new SelectionActions
immler@34406
    20
  cp.install(panel)
immler@34361
    21
immler@34406
    22
  add(new JScrollPane(panel), BorderLayout.CENTER)
immler@34361
    23
immler@34406
    24
  private val fontResolver =
immler@34406
    25
    panel.getSharedContext.getFontResolver.asInstanceOf[AWTFontResolver]
immler@34406
    26
  if (Plugin.plugin.viewFont != null)
immler@34406
    27
    fontResolver.setFontMapping("Isabelle", Plugin.plugin.viewFont)
immler@34406
    28
immler@34406
    29
  Plugin.plugin.viewFontChanged.add(font => {
wenzelm@34318
    30
    if (Plugin.plugin.viewFont != null)
wenzelm@34318
    31
      fontResolver.setFontMapping("Isabelle", Plugin.plugin.viewFont)
wenzelm@34318
    32
immler@34406
    33
    panel.relayout()
immler@34406
    34
  })
immler@34406
    35
wenzelm@34318
    36
}