src/Pure/PIDE/editor.scala
author wenzelm
Mon Aug 12 17:11:27 2013 +0200 (2013-08-12 ago)
changeset 52980 28f59ca8ce78
parent 52978 37fbb3fde380
child 53844 71f103629327
permissions -rw-r--r--
manage hyperlinks via PIDE editor interface;
wenzelm@52971
     1
/*  Title:      Pure/PIDE/editor.scala
wenzelm@52971
     2
    Author:     Makarius
wenzelm@52971
     3
wenzelm@52971
     4
General editor operations.
wenzelm@52971
     5
*/
wenzelm@52971
     6
wenzelm@52971
     7
package isabelle
wenzelm@52971
     8
wenzelm@52971
     9
wenzelm@52971
    10
abstract class Editor[Context]
wenzelm@52971
    11
{
wenzelm@52971
    12
  def session: Session
wenzelm@52974
    13
  def flush(): Unit
wenzelm@52971
    14
  def current_context: Context
wenzelm@52971
    15
  def current_node(context: Context): Option[Document.Node.Name]
wenzelm@52978
    16
  def current_node_snapshot(context: Context): Option[Document.Snapshot]
wenzelm@52974
    17
  def node_snapshot(name: Document.Node.Name): Document.Snapshot
wenzelm@52971
    18
  def current_command(context: Context, snapshot: Document.Snapshot): Option[(Command, Text.Offset)]
wenzelm@52977
    19
wenzelm@52977
    20
  def node_overlays(name: Document.Node.Name): Document.Node.Overlays
wenzelm@52977
    21
  def insert_overlay(command: Command, fn: String, args: List[String]): Unit
wenzelm@52977
    22
  def remove_overlay(command: Command, fn: String, args: List[String]): Unit
wenzelm@52980
    23
wenzelm@52980
    24
  abstract class Hyperlink { def follow(context: Context): Unit }
wenzelm@52980
    25
  def hyperlink_file(file_name: String, line: Int = 0, column: Int = 0): Hyperlink
wenzelm@52980
    26
  def hyperlink_command(
wenzelm@52980
    27
    snapshot: Document.Snapshot, command: Command, offset: Text.Offset = 0): Option[Hyperlink]
wenzelm@52971
    28
}
wenzelm@52971
    29