src/Tools/jEdit/src/plugin.scala
changeset 44577 96b6388d06c4
parent 44574 24444588fddd
child 44580 3bc9a215a56d
     1.1 --- a/src/Tools/jEdit/src/plugin.scala	Mon Aug 29 22:10:08 2011 +0200
     1.2 +++ b/src/Tools/jEdit/src/plugin.scala	Tue Aug 30 11:43:47 2011 +0200
     1.3 @@ -10,23 +10,20 @@
     1.4  import isabelle._
     1.5  
     1.6  import java.lang.System
     1.7 -import java.io.{File, FileInputStream, IOException}
     1.8  import java.awt.Font
     1.9  import javax.swing.JOptionPane
    1.10 -import javax.swing.text.Segment
    1.11  
    1.12  import scala.collection.mutable
    1.13  import scala.swing.ComboBox
    1.14  import scala.util.Sorting
    1.15  
    1.16  import org.gjt.sp.jedit.{jEdit, GUIUtilities, EBMessage, EBPlugin,
    1.17 -  Buffer, EditPane, MiscUtilities, ServiceManager, View}
    1.18 +  Buffer, EditPane, ServiceManager, View}
    1.19  import org.gjt.sp.jedit.buffer.JEditBuffer
    1.20  import org.gjt.sp.jedit.textarea.{JEditTextArea, TextArea}
    1.21  import org.gjt.sp.jedit.syntax.{Token => JEditToken, ModeProvider}
    1.22  import org.gjt.sp.jedit.msg.{EditorStarted, BufferUpdate, EditPaneUpdate, PropertiesChanged}
    1.23  import org.gjt.sp.jedit.gui.DockableWindowManager
    1.24 -import org.gjt.sp.jedit.io.{VFS, FileVFS, VFSManager}
    1.25  
    1.26  import org.gjt.sp.util.SyntaxUtilities
    1.27  import org.gjt.sp.util.Log
    1.28 @@ -347,52 +344,9 @@
    1.29  
    1.30  class Plugin extends EBPlugin
    1.31  {
    1.32 -  /* theory files via editor document model */
    1.33 -
    1.34 -  val thy_load = new Thy_Load
    1.35 -  {
    1.36 -    private var loaded_theories: Set[String] = Set()
    1.37 -
    1.38 -    def register_thy(thy_name: String)
    1.39 -    {
    1.40 -      synchronized { loaded_theories += thy_name }
    1.41 -    }
    1.42 -    def is_loaded(thy_name: String): Boolean =
    1.43 -      synchronized { loaded_theories.contains(thy_name) }
    1.44 +  /* theory files */
    1.45  
    1.46 -    def append(master_dir: String, source_path: Path): String =
    1.47 -    {
    1.48 -      val path = source_path.expand
    1.49 -      if (path.is_absolute) Isabelle_System.platform_path(path)
    1.50 -      else {
    1.51 -        val vfs = VFSManager.getVFSForPath(master_dir)
    1.52 -        if (vfs.isInstanceOf[FileVFS])
    1.53 -          MiscUtilities.resolveSymlinks(
    1.54 -            vfs.constructPath(master_dir, Isabelle_System.platform_path(path)))
    1.55 -        else vfs.constructPath(master_dir, Isabelle_System.standard_path(path))
    1.56 -      }
    1.57 -    }
    1.58 -
    1.59 -    def check_thy(node_name: String): Thy_Header =
    1.60 -    {
    1.61 -      Swing_Thread.now {
    1.62 -        Isabelle.jedit_buffers().find(buffer => Isabelle.buffer_name(buffer) == node_name) match {
    1.63 -          case Some(buffer) =>
    1.64 -            Isabelle.buffer_lock(buffer) {
    1.65 -              val text = new Segment
    1.66 -              buffer.getText(0, buffer.getLength, text)
    1.67 -              Some(Thy_Header.read(text))
    1.68 -            }
    1.69 -          case None => None
    1.70 -        }
    1.71 -      } getOrElse {
    1.72 -        val file = new File(node_name)  // FIXME load URL via jEdit VFS (!?)
    1.73 -        if (!file.exists || !file.isFile) error("No such file: " + quote(file.toString))
    1.74 -        Thy_Header.read(file)
    1.75 -      }
    1.76 -    }
    1.77 -  }
    1.78 -
    1.79 +  val thy_load = new JEdit_Thy_Load
    1.80    val thy_info = new Thy_Info(thy_load)
    1.81  
    1.82    private lazy val delay_load =