src/Pure/PIDE/editor.scala
author wenzelm
Tue Aug 11 17:00:16 2015 +0200 (2015-08-11 ago)
changeset 60893 3c8b9b4b577c
parent 56494 1b74abf064e1
child 61728 5f5ff1eab407
permissions -rw-r--r--
support hyperlinks with optional focus change;
no change of focus for debuffer position, to avoid visual glitches and keep panel active;
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@54461
    14
  def invoke(): Unit
wenzelm@52971
    15
  def current_context: Context
wenzelm@52971
    16
  def current_node(context: Context): Option[Document.Node.Name]
wenzelm@52978
    17
  def current_node_snapshot(context: Context): Option[Document.Snapshot]
wenzelm@52974
    18
  def node_snapshot(name: Document.Node.Name): Document.Snapshot
wenzelm@53844
    19
  def current_command(context: Context, snapshot: Document.Snapshot): Option[Command]
wenzelm@52977
    20
wenzelm@52977
    21
  def node_overlays(name: Document.Node.Name): Document.Node.Overlays
wenzelm@52977
    22
  def insert_overlay(command: Command, fn: String, args: List[String]): Unit
wenzelm@52977
    23
  def remove_overlay(command: Command, fn: String, args: List[String]): Unit
wenzelm@52980
    24
wenzelm@56494
    25
  abstract class Hyperlink {
wenzelm@56494
    26
    def external: Boolean
wenzelm@56494
    27
    def follow(context: Context): Unit
wenzelm@56494
    28
  }
wenzelm@52980
    29
  def hyperlink_command(
wenzelm@60893
    30
    focus: Boolean, snapshot: Document.Snapshot, command: Command, offset: Symbol.Offset = 0)
wenzelm@60893
    31
      : Option[Hyperlink]
wenzelm@52971
    32
}
wenzelm@52971
    33