TuPrologIDEController

class TuPrologIDEController : Initializable

The FXML controller (TuPrologIDEView.fxml) backing the main tuProlog IDE window: it owns a private TuPrologIDEModel (created via TuPrologIDEModel.of) and, in initialize, subscribes to every one of its onXxx event streams to keep the file tabs, solutions list, stdout/stderr panes, operators/flags/libraries tables, and static/dynamic knowledge base views up to date; conversely, every @FXML-annotated method reacts to a widget event by calling into the model (e.g. onNextButtonPressed calls TuPrologIDEModel.solve/ TuPrologIDEModel.next). It implements the model/view separation described in TuPrologIDEModel's KDoc.

Instances of this class are normally created by javafx.fxml.FXMLLoader (as done by TuPrologIDEBuilder.show), not directly; customizeModel, addTab, setOnClose, and setOnAbout are the hooks a host application uses (through TuPrologIDEBuilder) to extend the wired-up controller.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addTab(tab: Tab)

Adds a Tab to the UI. If a Tab with the same Tab.id as tab is already present, it gets substituted.

Link copied to clipboard

Runs setup against this controller's private TuPrologIDEModel, e.g. to load extra libraries or subscribe to events.

Link copied to clipboard
open override fun initialize(location: URL, resources: ResourceBundle?)

Wires every widget declared by TuPrologIDEView.fxml to the private TuPrologIDEModel's event streams, creates the model's first (empty, temporary) file via TuPrologIDEModel.newFile, and resets the solver via TuPrologIDEModel.reset. Called once by the javafx.fxml.FXMLLoader after injecting the @FXML fields.

Link copied to clipboard
fun onAbout(e: ActionEvent)
Link copied to clipboard
fun onActionPerformedOnQuery(e: ActionEvent)
Link copied to clipboard
fun onCloseFilePressed(e: ActionEvent)
Link copied to clipboard
fun onCopyPressed(e: ActionEvent)
Link copied to clipboard
fun onCutPressed(e: ActionEvent)
Link copied to clipboard
fun onDeletePressed(e: ActionEvent)
Link copied to clipboard
fun onKeyPressedOnCurrentFile(e: KeyEvent)
Link copied to clipboard
fun onKeyTypedOnCurrentFile(e: KeyEvent)
Link copied to clipboard
fun onKeyTypedOnQuery(e: KeyEvent)
Link copied to clipboard
fun onMouseClickedOnCurrentFile(e: MouseEvent)
Link copied to clipboard
fun onNewFilePressed(e: ActionEvent)
Link copied to clipboard
fun onNextAllButtonPressed(e: ActionEvent)
Link copied to clipboard
fun onNextButtonPressed(e: ActionEvent)
Link copied to clipboard
fun onOpenFilePressed(e: ActionEvent)
Link copied to clipboard
fun onPastePressed(e: ActionEvent)
Link copied to clipboard
fun onQuitRequested(e: ActionEvent)
Link copied to clipboard
fun onRedoPressed(e: ActionEvent)
Link copied to clipboard
fun onReloadFilePressed(e: ActionEvent)
Link copied to clipboard
fun onResetButtonPressed(e: ActionEvent)
Link copied to clipboard
fun onSaveFileAsPressed(e: ActionEvent)
Link copied to clipboard
fun onSaveFilePressed(e: ActionEvent)
Link copied to clipboard
fun onSelectAllPressed(e: ActionEvent)
Link copied to clipboard
fun onSettingsPressed(e: ActionEvent)
Link copied to clipboard
fun onStdinChanged(e: KeyEvent)
Link copied to clipboard
fun onStopButtonPressed(e: ActionEvent)
Link copied to clipboard
fun onTabSelectionChanged(e: Event)
Link copied to clipboard
fun onUndoPressed(e: ActionEvent)
Link copied to clipboard
fun onUnselectAllPressed(e: ActionEvent)
Link copied to clipboard
fun setOnAbout(onAbout: () -> Unit)

Replaces the handler invoked when the user selects the "about" menu entry.

Link copied to clipboard
fun setOnClose(onClose: () -> Unit)

Replaces the handler invoked when the user requests to close the window (wired to the "quit" menu entry).