src/Tools/jEdit/src/jedit/results_dockable.scala
author wenzelm
Tue, 08 Dec 2009 20:14:08 +0100
changeset 34765 63ba7f0931e2
parent 34760 dc7f5e0d9d27
child 34768 d8d321af1478
permissions -rw-r--r--
generic HTML_Panel -- specific Results_Dockable;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34408
ad7b6c4813c8 added some headers and comments;
wenzelm
parents: 34406
diff changeset
     1
/*
34765
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
     2
 * Dockable window with result message output
34408
ad7b6c4813c8 added some headers and comments;
wenzelm
parents: 34406
diff changeset
     3
 *
34765
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
     4
 * @author Makarius
34408
ad7b6c4813c8 added some headers and comments;
wenzelm
parents: 34406
diff changeset
     5
 */
ad7b6c4813c8 added some headers and comments;
wenzelm
parents: 34406
diff changeset
     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
dc7f5e0d9d27 misc modernization of names;
wenzelm
parents: 34759
diff changeset
     9
34765
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    10
import isabelle.proofdocument.HTML_Panel
34318
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    11
34765
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    12
import scala.io.Source
34760
dc7f5e0d9d27 misc modernization of names;
wenzelm
parents: 34759
diff changeset
    13
import scala.swing.{BorderPanel, Component}
dc7f5e0d9d27 misc modernization of names;
wenzelm
parents: 34759
diff changeset
    14
34765
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    15
import java.awt.Dimension
34748
a2ed621f5f52 reduced logging;
wenzelm
parents: 34747
diff changeset
    16
34318
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    17
import org.gjt.sp.jedit.View
34424
c880492754d0 setPreferredSize for floating dockables;
wenzelm
parents: 34408
diff changeset
    18
import org.gjt.sp.jedit.gui.DockableWindowManager
34745
83b553bd3fa3 basic setup for Cobra HTML renderer;
wenzelm
parents: 34669
diff changeset
    19
34318
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    20
34765
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    21
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    22
class Results_Dockable(view: View, position: String) extends BorderPanel
34760
dc7f5e0d9d27 misc modernization of names;
wenzelm
parents: 34759
diff changeset
    23
{
34428
d69fd18f37f9 basic setup of anti-aliasing, according to jEdit property;
wenzelm
parents: 34424
diff changeset
    24
  // outer panel
34760
dc7f5e0d9d27 misc modernization of names;
wenzelm
parents: 34759
diff changeset
    25
34424
c880492754d0 setPreferredSize for floating dockables;
wenzelm
parents: 34408
diff changeset
    26
  if (position == DockableWindowManager.FLOATING)
34760
dc7f5e0d9d27 misc modernization of names;
wenzelm
parents: 34759
diff changeset
    27
    preferredSize = new Dimension(500, 250)
34406
f81cd75ae331 restructured: independent provers in different buffers
immler@in.tum.de
parents: 34397
diff changeset
    28
34748
a2ed621f5f52 reduced logging;
wenzelm
parents: 34747
diff changeset
    29
34745
83b553bd3fa3 basic setup for Cobra HTML renderer;
wenzelm
parents: 34669
diff changeset
    30
  // HTML panel
83b553bd3fa3 basic setup for Cobra HTML renderer;
wenzelm
parents: 34669
diff changeset
    31
34765
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    32
  val html_panel = new HTML_Panel(Isabelle.system, Isabelle.Int_Property("font-size"))
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    33
  add(Component.wrap(html_panel), BorderPanel.Position.Center)
34428
d69fd18f37f9 basic setup of anti-aliasing, according to jEdit property;
wenzelm
parents: 34424
diff changeset
    34
34669
73727c7eec64 state_update global in Plugin
immler@in.tum.de
parents: 34552
diff changeset
    35
  Isabelle.plugin.state_update += (cmd => {
73727c7eec64 state_update global in Plugin
immler@in.tum.de
parents: 34552
diff changeset
    36
    val theory_view = Isabelle.prover_setup(view.getBuffer).get.theory_view
34765
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    37
    val body =
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    38
      if (cmd == null) Nil  // FIXME ??
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    39
      else cmd.results(theory_view.current_document)
63ba7f0931e2 generic HTML_Panel -- specific Results_Dockable;
wenzelm
parents: 34760
diff changeset
    40
    html_panel.render(body)
34669
73727c7eec64 state_update global in Plugin
immler@in.tum.de
parents: 34552
diff changeset
    41
  })
34318
c13e168a8ae6 original sources from Johannes Hölzl a48e0c6ab1aea77c52d596f7efc007a543d3d10c with minor modifications of directory layout;
wenzelm
parents:
diff changeset
    42
}