[Editor] Enable opening multiple SQL scripts in tabs
This commit is contained in:
@@ -20,6 +20,8 @@ class TablesListView : View() {
|
||||
|
||||
private var database: SQLDatabase? = null
|
||||
|
||||
private var index = 0
|
||||
|
||||
private val treeView = treeview<SQLElement> {
|
||||
isShowRoot = false
|
||||
|
||||
@@ -39,7 +41,7 @@ class TablesListView : View() {
|
||||
button("SQL Script", graphic = FontIcon("fa-code")) {
|
||||
action {
|
||||
mainController.openScript(
|
||||
fsNode = InMemoryStringFileNode("Script", "sql", "SELECT * FROM myTable;"),
|
||||
fsNode = InMemoryStringFileNode("Script ${++index}", "sql", ""),
|
||||
execute = { code -> databaseService.run { executeScript(code, this) } },
|
||||
saveable = false
|
||||
)
|
||||
|
||||
@@ -14,8 +14,8 @@ class InMemoryStringFileNode(name: String, extension: String, val content: Strin
|
||||
override val nameWithoutExtensionProperty = name.toProperty()
|
||||
override val nameWithoutExtension by nameWithoutExtensionProperty
|
||||
|
||||
override val absolutePathProperty = "".toProperty()
|
||||
override val absolutePath by absolutePathProperty
|
||||
override val absolutePathProperty = nameProperty
|
||||
override val absolutePath = name
|
||||
|
||||
override val type = FileType.FILE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user