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