obsolete;
authorwenzelm
Mon Dec 07 23:00:30 2009 +0100 (2009-12-07)
changeset 34754e8bb3052f3cb
parent 34753 dd8bdcb7dcba
child 34755 bc255171994b
obsolete;
src/Tools/jEdit/src/jedit/StateViewDockable.scala
src/Tools/jEdit/src/renderer/UserAgent.scala
     1.1 --- a/src/Tools/jEdit/src/jedit/StateViewDockable.scala	Mon Dec 07 22:59:48 2009 +0100
     1.2 +++ b/src/Tools/jEdit/src/jedit/StateViewDockable.scala	Mon Dec 07 23:00:30 2009 +0100
     1.3 @@ -7,7 +7,6 @@
     1.4  
     1.5  package isabelle.jedit
     1.6  
     1.7 -import isabelle.renderer.UserAgent
     1.8  import isabelle.XML
     1.9  
    1.10  import java.io.StringReader
     2.1 --- a/src/Tools/jEdit/src/renderer/UserAgent.scala	Mon Dec 07 22:59:48 2009 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,75 +0,0 @@
     2.4 -/*
     2.5 - * XML/CSS rendering -- user agent
     2.6 - *
     2.7 - * @author Fabian Immler, TU Munich
     2.8 - * @author Johannes Hölzl, TU Munich
     2.9 - */
    2.10 -
    2.11 -package isabelle.renderer
    2.12 -
    2.13 -import isabelle.jedit.Isabelle
    2.14 -
    2.15 -import scala.io.Source
    2.16 -
    2.17 -import java.io.{InputStream, ByteArrayInputStream, FileInputStream}
    2.18 -
    2.19 -import org.xhtmlrenderer.swing.NaiveUserAgent
    2.20 -import org.xhtmlrenderer.resource.CSSResource
    2.21 -
    2.22 -
    2.23 -object UserAgent
    2.24 -{
    2.25 -  val base_URL = "file://localhost/dummy/"
    2.26 -
    2.27 -  private val style = base_URL + "style"
    2.28 -  private val isabelle_css = base_URL + "isabelle.css"
    2.29 -  private val isabelle_user_css = base_URL + "isabelle_user.css"
    2.30 -  private val stylesheet = """
    2.31 -@import "isabelle.css";
    2.32 -@import 'isabelle_user.css';
    2.33 -
    2.34 -messages, message {
    2.35 -  display: block;
    2.36 -  white-space: pre-wrap;
    2.37 -  font-family: Isabelle;
    2.38 -}
    2.39 -""" 
    2.40 -}
    2.41 -
    2.42 -class UserAgent extends NaiveUserAgent
    2.43 -{
    2.44 -  private def string_content(text: String): Array[Byte] =
    2.45 -    text.getBytes(Isabelle_System.charset)
    2.46 -  
    2.47 -  private def try_file_content(name: String): Array[Byte] =
    2.48 -  {
    2.49 -    val file = Isabelle.system.platform_file(name)
    2.50 -    val text =
    2.51 -      if (file.exists) Source.fromFile(file).mkString
    2.52 -      else ""
    2.53 -    string_content(text)
    2.54 -  }
    2.55 -
    2.56 -  private def CSS(content: Array[Byte]): CSSResource =
    2.57 -    new CSSResource(new ByteArrayInputStream(content))
    2.58 -
    2.59 -  private val stylesheet = string_content(UserAgent.stylesheet)
    2.60 -  private val isabelle_css = try_file_content("~~/lib/html/isabelle.css")
    2.61 -  private val isabelle_user_css = try_file_content("$ISABELLE_HOME_USER/etc/isabelle.css")
    2.62 -
    2.63 -  override def getCSSResource(uri: String): CSSResource =
    2.64 -  {
    2.65 -    uri match {
    2.66 -      case UserAgent.style => CSS(stylesheet)
    2.67 -      case UserAgent.isabelle_css => CSS(isabelle_css)
    2.68 -      case UserAgent.isabelle_user_css => CSS(isabelle_user_css)
    2.69 -      case _ =>
    2.70 -        val stream = resolveAndOpenStream(uri)
    2.71 -        val resource = new CSSResource(stream)
    2.72 -        if (stream == null)
    2.73 -          resource.getResourceInputSource().setByteStream(
    2.74 -            new ByteArrayInputStream(Array()))
    2.75 -        resource
    2.76 -    }
    2.77 -  }
    2.78 -}
    2.79 \ No newline at end of file