src/Pure/PIDE/editor.scala
author wenzelm
Tue, 11 Aug 2015 17:00:16 +0200
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;

/*  Title:      Pure/PIDE/editor.scala
    Author:     Makarius

General editor operations.
*/

package isabelle


abstract class Editor[Context]
{
  def session: Session
  def flush(): Unit
  def invoke(): Unit
  def current_context: Context
  def current_node(context: Context): Option[Document.Node.Name]
  def current_node_snapshot(context: Context): Option[Document.Snapshot]
  def node_snapshot(name: Document.Node.Name): Document.Snapshot
  def current_command(context: Context, snapshot: Document.Snapshot): Option[Command]

  def node_overlays(name: Document.Node.Name): Document.Node.Overlays
  def insert_overlay(command: Command, fn: String, args: List[String]): Unit
  def remove_overlay(command: Command, fn: String, args: List[String]): Unit

  abstract class Hyperlink {
    def external: Boolean
    def follow(context: Context): Unit
  }
  def hyperlink_command(
    focus: Boolean, snapshot: Document.Snapshot, command: Command, offset: Symbol.Offset = 0)
      : Option[Hyperlink]
}