def update_request(): Unit =
GUI_Thread.require { print_state.apply_query(Nil) }
def update(): Unit = {
GUI_Thread.require {}
PIDE.editor.current_node_snapshot(view) match { case Some(snapshot) =>
(PIDE.editor.current_command(view, snapshot), print_state.get_location) match { case (Some(command1), Some(command2)) if command1.id == command2.id => case _ => update_request()
} case None =>
}
}
/* auto update */
privatevar auto_update_enabled = true
privatedef auto_update(): Unit =
GUI_Thread.require { if (auto_update_enabled) update() }
/* controls */
privateval auto_update_button = new GUI.Check("Auto update", init = auto_update_enabled) {
tooltip = "Indicate automatic update following cursor movement" overridedef clicked(state: Boolean): Unit = {
auto_update_enabled = state
auto_update()
}
}
privateval auto_hovering_button = new JEdit_Options.auto_hovering.GUI
privateval update_button = new GUI.Button(GUI.Style_HTML.enclose_bold("Update")) {
tooltip = "Update display according to the command at cursor position" overridedef clicked(): Unit = update_request()
}
privateval locate_button = new GUI.Button("Locate") {
tooltip = "Locate printed command within source text" overridedef clicked(): Unit = print_state.locate_query()
}
privateval main =
Session.Consumer[Any](getClass.getName) { case _: Session.Global_Options =>
GUI_Thread.later {
output.handle_resize()
auto_hovering_button.load()
}
case changed: Session.Commands_Changed => if (changed.assignment) GUI_Thread.later { auto_update() }
case Session.Caret_Focus =>
GUI_Thread.later { auto_update() }
}
overridedef init(): Unit = {
PIDE.session.global_options += main
PIDE.session.commands_changed += main
PIDE.session.caret_focus += main
output.init()
print_state.activate()
auto_update()
}
overridedef exit(): Unit = {
print_state.deactivate()
PIDE.session.caret_focus -= main
PIDE.session.global_options -= main
PIDE.session.commands_changed -= main
output.exit()
}
}
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.