TuPrologIDEBuilder

data class TuPrologIDEBuilder(val stage: Stage, var title: String = "tuProlog IDE", var icon: Image = TUPROLOG_LOGO, var onClose: () -> Boolean = { showExitConfirmationDialog(title) }, var onAbout: () -> Unit = { showAboutDialog(title, Info.VERSION) }, var stylesheets: List<String> = listOf(JAVA_KEYWORDS_LIGHT, LIGHT_CODE_AREA), var customLibraries: List<Library> = emptyList(), var customTabs: List<CustomTab> = emptyList())

Fluent entry point for embedding the tuProlog IDE window into a host JavaFX javafx.application.Application: build one (typically as TuPrologIDEBuilder(stage)), customize it via the title/icon/onClose/onAbout/ stylesheets/customLibrar(y|ies)/customTab(s) fluent setters, then call show to load the FXML view, wire it to a fresh TuPrologIDEModel (via TuPrologIDEController), and display stage.

NOTE (customTabs): If a CustomTab.tab has a Tab.id that is already existing in the IDE, it substitutes the existing Tab instead of being added to the tab list.

Example:

class MyIDE : Application() {
override fun start(stage: Stage) {
TuPrologIDEBuilder(stage)
.title("My Prolog IDE")
.customLibrary(MyLibrary)
.show()
}
}

Constructors

Link copied to clipboard
constructor(stage: Stage, title: String = "tuProlog IDE", icon: Image = TUPROLOG_LOGO, onClose: () -> Boolean = { showExitConfirmationDialog(title) }, onAbout: () -> Unit = { showAboutDialog(title, Info.VERSION) }, stylesheets: List<String> = listOf(JAVA_KEYWORDS_LIGHT, LIGHT_CODE_AREA), customLibraries: List<Library> = emptyList(), customTabs: List<CustomTab> = emptyList())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Extra Library instances loaded into the IDE's solver in addition to the built-in ones (see TuPrologIDEModel.customizeSolver).

Link copied to clipboard

Extra tabs (and their model wiring) added to the IDE's side tab pane; see CustomTab and the note above.

Link copied to clipboard
var icon: Image

The window icon, and the image shown in the default "about" dialog (see showAboutDialog).

Link copied to clipboard
var onAbout: () -> Unit

Invoked when the user selects the "about" menu entry. Defaults to showing an informational dialog.

Link copied to clipboard
var onClose: () -> Boolean

Invoked when the user requests to close the window; returning false cancels the close. Defaults to a confirmation dialog.

Link copied to clipboard
val stage: Stage

The JavaFX Stage the IDE window will be rendered onto by show.

Link copied to clipboard

CSS stylesheet URLs (see Resources) applied to the IDE's javafx.scene.Scene.

Link copied to clipboard

The window title, and the subject used by the default onClose/onAbout dialogs.

Functions

Link copied to clipboard
Link copied to clipboard

Appends customLibrary to customLibraries.

Link copied to clipboard

Appends customTab to customTabs.

Appends tab to customTabs with a no-op ModelConfigurator.

fun customTab(tab: Tab, modelConfigurator: ModelConfigurator): TuPrologIDEBuilder

Appends a CustomTab pairing tab with modelConfigurator to customTabs.

Link copied to clipboard
Link copied to clipboard
fun icon(icon: Image): TuPrologIDEBuilder
Link copied to clipboard
fun onAbout(onAbout: () -> Unit): TuPrologIDEBuilder
Link copied to clipboard
fun onClose(onClose: () -> Boolean): TuPrologIDEBuilder
Link copied to clipboard
fun show()

Loads the IDE's FXML view onto stage, installs a fresh TuPrologIDEController wired to it, applies title/icon/stylesheets/onClose/onAbout, adds every customTabs entry (see TuPrologIDEController.addTab), loads every customLibraries entry into the controller's TuPrologIDEModel (see TuPrologIDEModel.customizeSolver), runs each CustomTab's ModelConfigurator, and finally shows stage.

Link copied to clipboard

Appends stylesheet to stylesheets.

Link copied to clipboard
Link copied to clipboard