You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by jo...@apache.org on 2021/05/10 07:11:37 UTC
[isis] branch ISIS-2505_Catch_Up_With_Demo_Examples updated
(f045b1d -> 0e5904f)
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a change to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git.
from f045b1d PlantUML JSON diagrams can be opened via History -> Details -> Diagram
new 63273bd convert (Diagram) Dialog to Tab
new 4e913a4 fix import
new f6adc4e convert xml to json for plantuml json diagram
new 82b526b fix test expectation from String to Char
new 249bbc7 allow maximize/minimize in Dialog and use maximize to pin (diagram) dialog as tab
new a64d892 rename MapPanel to SvgPanel
new f5ae1e8 allow an icon menu with dialogs
new bf18fba ui package content restructured
new 82f0adc ui package content restructured, LayoutDiagram added, cleanup
new 8077f54 uuid passed on to RoTab
new 0ffdeb0 SVG passed (instead of UUID), functionality moved to UiManager, diagram xTimes in RoTab
new 0e5904f single diagram in RoTab, scrollbars to be added yet
The 12 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
gradle/wrapper/gradle-wrapper.properties | 5 +
incubator/clients/kroviz/build.gradle.kts | 1 +
.../kotlin/org/apache/isis/client/kroviz/App.kt | 3 +-
.../org/apache/isis/client/kroviz/core/Session.kt | 2 +-
.../kroviz/core/aggregator/ActionDispatcher.kt | 4 +-
.../kroviz/core/aggregator/AggregatorWithLayout.kt | 2 +-
.../kroviz/core/aggregator/BaseAggregator.kt | 2 +-
.../core/aggregator/DomainTypesAggregator.kt | 2 +-
.../kroviz/core/aggregator/DownloadDispatcher.kt | 2 +-
.../kroviz/core/aggregator/ErrorDispatcher.kt | 2 +-
.../kroviz/core/aggregator/ListAggregator.kt | 2 +-
.../kroviz/core/aggregator/NavigationDispatcher.kt | 2 +-
.../kroviz/core/aggregator/ObjectAggregator.kt | 4 +-
.../client/kroviz/core/aggregator/SvgDispatcher.kt | 6 +-
.../kroviz/core/aggregator/UndefinedDispatcher.kt | 2 +-
.../isis/client/kroviz/core/event/EventStore.kt | 18 +-
.../isis/client/kroviz/core/event/LogEntry.kt | 11 +-
.../kroviz/core/event/ResourceSpecification.kt | 2 +-
.../client/kroviz/core/event/RoXmlHttpRequest.kt | 4 +-
.../isis/client/kroviz/handler/BaseHandler.kt | 2 +-
.../client/kroviz/handler/DomainTypesHandler.kt | 4 +-
.../isis/client/kroviz/ui/builder/ColBuilder.kt | 2 +-
.../client/kroviz/ui/builder/FieldSetBuilder.kt | 6 +-
.../isis/client/kroviz/ui/builder/LayoutBuilder.kt | 2 +-
.../isis/client/kroviz/ui/builder/RowBuilder.kt | 4 +-
.../isis/client/kroviz/ui/builder/TabBuilder.kt | 2 +-
.../client/kroviz/ui/builder/TabGroupBuilder.kt | 2 +-
.../client/kroviz/ui/{kv => chart}/ChartFactory.kt | 3 +-
.../client/kroviz/ui/{kv => chart}/ChartModel.kt | 2 +-
.../kroviz/ui/{kv => chart}/EventChartModel.kt | 2 +-
.../ui/{samples => chart}/SampleChartModel.kt | 4 +-
.../client/kroviz/ui/{kv => core}/ColumnFactory.kt | 2 +-
.../client/kroviz/ui/{kv => core}/Constants.kt | 3 +-
.../client/kroviz/ui/{ => core}/Displayable.kt | 2 +-
.../isis/client/kroviz/ui/{ => core}/FormItem.kt | 2 +-
.../kroviz/ui/{kv => core}/FormPanelFactory.kt | 19 +-
.../client/kroviz/ui/{kv => core}/MenuFactory.kt | 4 +-
.../isis/client/kroviz/ui/{kv => core}/RoApp.kt | 7 +-
.../isis/client/kroviz/ui/{kv => core}/RoDialog.kt | 34 +-
.../client/kroviz/ui/{kv => core}/RoDisplay.kt | 3 +-
.../client/kroviz/ui/{kv => core}/RoIconBar.kt | 12 +-
.../client/kroviz/ui/{kv => core}/RoMenuBar.kt | 15 +-
.../client/kroviz/ui/{kv => core}/RoStatusBar.kt | 8 +-
.../isis/client/kroviz/ui/{kv => core}/RoTable.kt | 2 +-
.../isis/client/kroviz/ui/{kv => core}/RoView.kt | 7 +-
.../client/kroviz/ui/{kv => core}/UiManager.kt | 45 ++-
.../ui/{Command.kt => diagram/LayoutDiagram.kt} | 25 +-
.../client/kroviz/ui/{ => diagram}/PumlBuilder.kt | 4 +-
.../client/kroviz/ui/{ => diagram}/UmlDiagram.kt | 2 +-
.../isis/client/kroviz/ui/{kv => dialog}/About.kt | 6 +-
.../kroviz/ui/{kv => dialog}/ActionPrompt.kt | 6 +-
.../client/kroviz/ui/{ => dialog}/BrowserWindow.kt | 5 +-
.../isis/client/kroviz/ui/{ => dialog}/Command.kt | 2 +-
.../client/kroviz/ui/{ => dialog}/DiagramDialog.kt | 58 ++-
.../kroviz/ui/{ => dialog}/DownloadDialog.kt | 5 +-
.../client/kroviz/ui/{ => dialog}/ErrorDialog.kt | 5 +-
.../kroviz/ui/{ => dialog}/EventExportDialog.kt | 5 +-
.../kroviz/ui/{ => dialog}/EventLogDetail.kt | 23 +-
.../client/kroviz/ui/{ => dialog}/FileDialog.kt | 5 +-
.../client/kroviz/ui/{kv => dialog}/LoginPrompt.kt | 7 +-
.../kroviz/ui/{ => dialog}/NotificationDialog.kt | 7 +-
.../kroviz/ui/{samples => dialog}/SvgInline.kt | 7 +-
.../kroviz/ui/{ => dialog}/UndefinedDialog.kt | 5 +-
.../apache/isis/client/kroviz/ui/kv/RoTabPanel.kt | 50 ---
.../ui/kv/{ => override}/RoManagerBootstrap.kt | 2 +-
.../isis/client/kroviz/ui/kv/override/RoTab.kt | 210 ++++++++++
.../client/kroviz/ui/kv/override/RoTabPanel.kt | 442 +++++++++++++++++++++
.../client/kroviz/ui/kv/{ => override}/RoWindow.kt | 74 +++-
.../kroviz/ui/{kv => panel}/DropdownSearch.kt | 16 +-
.../client/kroviz/ui/{kv => panel}/EventChart.kt | 3 +-
.../kroviz/ui/{kv => panel}/EventLogTable.kt | 5 +-
.../kroviz/ui/{kv => panel}/EventLogTableMgr.kt | 10 +-
.../client/kroviz/ui/{samples => panel}/GeoMap.kt | 6 +-
.../kroviz/ui/{samples => panel}/PlantumlPanel.kt | 2 +-
.../client/kroviz/ui/{samples => panel}/SvgMap.kt | 2 +-
.../ui/{kv/MapPanel.kt => panel/SvgPanel.kt} | 4 +-
.../org/apache/isis/client/kroviz/utils/DomUtil.kt | 22 +-
.../apache/isis/client/kroviz/utils/IconManager.kt | 132 +++---
.../client/kroviz/utils/ScalableVectorGraphic.kt | 19 +-
.../org/apache/isis/client/kroviz/utils/UUID.kt | 6 +-
.../apache/isis/client/kroviz/utils/UmlUtils.kt | 2 +-
.../apache/isis/client/kroviz/utils/XmlHelper.kt | 10 +-
.../{ui/Displayable.kt => utils/XmlToJson.kt} | 11 +-
.../apache/isis/client/kroviz/IntegrationTest.kt | 4 +-
.../client/kroviz/core/event/EventStoreTest.kt | 6 +-
.../kroviz/snapshots/ResponseRegressionTest.kt | 4 +-
.../isis/client/kroviz/snapshots/TestRequest.kt | 3 +-
.../apache/isis/client/kroviz/snapshots/sample.xml | 245 ++++++++++++
.../isis/client/kroviz/ui/PumlBuilderTest.kt | 3 +-
.../isis/client/kroviz/util/XmlHelperTest.kt} | 25 +-
90 files changed, 1422 insertions(+), 349 deletions(-)
create mode 100644 gradle/wrapper/gradle-wrapper.properties
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => chart}/ChartFactory.kt (91%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => chart}/ChartModel.kt (95%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => chart}/EventChartModel.kt (98%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{samples => chart}/SampleChartModel.kt (95%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/ColumnFactory.kt (99%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/Constants.kt (93%)
copy incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => core}/Displayable.kt (95%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => core}/FormItem.kt (97%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/FormPanelFactory.kt (95%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/MenuFactory.kt (99%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/RoApp.kt (88%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/RoDialog.kt (87%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/RoDisplay.kt (95%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/RoIconBar.kt (94%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/RoMenuBar.kt (89%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/RoStatusBar.kt (94%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/RoTable.kt (98%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/RoView.kt (92%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => core}/UiManager.kt (81%)
copy incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{Command.kt => diagram/LayoutDiagram.kt} (61%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => diagram}/PumlBuilder.kt (97%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => diagram}/UmlDiagram.kt (97%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => dialog}/About.kt (93%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => dialog}/ActionPrompt.kt (95%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/BrowserWindow.kt (88%)
copy incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/Command.kt (96%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/DiagramDialog.kt (52%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/DownloadDialog.kt (89%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/ErrorDialog.kt (92%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/EventExportDialog.kt (97%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/EventLogDetail.kt (77%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/FileDialog.kt (91%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => dialog}/LoginPrompt.kt (92%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/NotificationDialog.kt (86%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{samples => dialog}/SvgInline.kt (91%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{ => dialog}/UndefinedDialog.kt (92%)
delete mode 100644 incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoTabPanel.kt
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/{ => override}/RoManagerBootstrap.kt (97%)
create mode 100644 incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt
create mode 100644 incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/{ => override}/RoWindow.kt (88%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => panel}/DropdownSearch.kt (94%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => panel}/EventChart.kt (96%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => panel}/EventLogTable.kt (96%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv => panel}/EventLogTableMgr.kt (86%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{samples => panel}/GeoMap.kt (94%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{samples => panel}/PlantumlPanel.kt (97%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{samples => panel}/SvgMap.kt (99%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/{kv/MapPanel.kt => panel/SvgPanel.kt} (95%)
rename incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/{ui/Displayable.kt => utils/XmlToJson.kt} (82%)
create mode 100644 incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/sample.xml
rename incubator/clients/kroviz/src/{main/kotlin/org/apache/isis/client/kroviz/ui/Command.kt => test/kotlin/org/apache/isis/client/kroviz/util/XmlHelperTest.kt} (62%)
[isis] 09/12: ui package content restructured, LayoutDiagram added,
cleanup
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 82f0adca0bac964b01e5124efc6c3a6ab0ed6e29
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Fri May 7 12:17:14 2021 +0200
ui package content restructured, LayoutDiagram added, cleanup
---
.../client/kroviz/ui/builder/FieldSetBuilder.kt | 2 +-
.../kroviz/ui/{panel => core}/FormPanelFactory.kt | 4 +--
.../apache/isis/client/kroviz/ui/core/RoDialog.kt | 1 -
.../isis/client/kroviz/ui/core/RoStatusBar.kt | 2 +-
.../isis/client/kroviz/ui/diagram/LayoutDiagram.kt | 42 ++++++++++++++++++++++
.../kroviz/ui/{uml => diagram}/PumlBuilder.kt | 2 +-
.../kroviz/ui/{uml => diagram}/UmlDiagram.kt | 2 +-
.../isis/client/kroviz/ui/dialog/EventLogDetail.kt | 2 +-
.../client/kroviz/ui/panel/EventLogTableMgr.kt | 2 +-
.../isis/client/kroviz/ui/PumlBuilderTest.kt | 2 +-
10 files changed, 51 insertions(+), 10 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt
index abfa17a..f3e1601 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt
@@ -22,7 +22,7 @@ import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.TypeMapper
import org.apache.isis.client.kroviz.to.bs3.FieldSet
import org.apache.isis.client.kroviz.ui.core.FormItem
-import org.apache.isis.client.kroviz.ui.panel.FormPanelFactory
+import org.apache.isis.client.kroviz.ui.core.FormPanelFactory
import org.apache.isis.client.kroviz.ui.core.RoDisplay
import io.kvision.form.FormPanel
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/FormPanelFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormPanelFactory.kt
similarity index 98%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/FormPanelFactory.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormPanelFactory.kt
index 9d66407..d93a3c0 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/FormPanelFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormPanelFactory.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.panel
+package org.apache.isis.client.kroviz.ui.core
import io.kvision.core.Component
import io.kvision.core.Overflow
@@ -42,7 +42,7 @@ import io.kvision.utils.auto
import io.kvision.utils.perc
import io.kvision.utils.px
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.panel.SvgPanel
import org.apache.isis.client.kroviz.utils.DateHelper
import org.apache.isis.client.kroviz.utils.UUID
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
index 5861921..8b299c8 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
@@ -31,7 +31,6 @@ import io.kvision.utils.perc
import org.apache.isis.client.kroviz.to.ValueType
import org.apache.isis.client.kroviz.ui.dialog.Command
import org.apache.isis.client.kroviz.ui.dialog.DiagramDialog
-import org.apache.isis.client.kroviz.ui.panel.FormPanelFactory
import org.apache.isis.client.kroviz.ui.kv.override.RoWindow
import org.apache.isis.client.kroviz.utils.Direction
import org.apache.isis.client.kroviz.utils.IconManager
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt
index 5c46fbf..3f5397a 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt
@@ -23,7 +23,7 @@ import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.core.model.DiagramDM
import org.apache.isis.client.kroviz.ui.dialog.DiagramDialog
import org.apache.isis.client.kroviz.ui.dialog.NotificationDialog
-import org.apache.isis.client.kroviz.ui.uml.UmlDiagram
+import org.apache.isis.client.kroviz.ui.diagram.UmlDiagram
import org.apache.isis.client.kroviz.utils.IconManager
import io.kvision.core.*
import io.kvision.html.Button
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/diagram/LayoutDiagram.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/diagram/LayoutDiagram.kt
new file mode 100644
index 0000000..a5d001b
--- /dev/null
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/diagram/LayoutDiagram.kt
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.client.kroviz.ui.diagram
+
+object LayoutDiagram {
+
+ @Deprecated("pass in as arg")
+ val sampleCode = "@startsalt\n" +
+ "{#\n" +
+ ". | Column 2 | Column 3\n" +
+ "Row header 1 | value 1 | value 2\n" +
+ "Row header 2 | A long cell | *\n" +
+ "}\n" +
+ "@endsalt"
+
+ fun build(json: String): String {
+ var pumlCode = sampleCode
+ return pumlCode
+ }
+
+ private fun buildRow(): String {
+ val span = 1
+ return ""
+ }
+
+}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/PumlBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/diagram/PumlBuilder.kt
similarity index 98%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/PumlBuilder.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/diagram/PumlBuilder.kt
index c83ae51..7ccd8c5 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/PumlBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/diagram/PumlBuilder.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.uml
+package org.apache.isis.client.kroviz.ui.diagram
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.core.event.LogEntry
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/UmlDiagram.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/diagram/UmlDiagram.kt
similarity index 97%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/UmlDiagram.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/diagram/UmlDiagram.kt
index d172fa2..c87c7f9 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/UmlDiagram.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/diagram/UmlDiagram.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.uml
+package org.apache.isis.client.kroviz.ui.diagram
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.core.model.DiagramDM
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventLogDetail.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventLogDetail.kt
index ca6209f..c4abe76 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventLogDetail.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventLogDetail.kt
@@ -21,7 +21,7 @@ package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.ValueType
import org.apache.isis.client.kroviz.ui.core.FormItem
-import org.apache.isis.client.kroviz.ui.uml.PumlBuilder
+import org.apache.isis.client.kroviz.ui.diagram.PumlBuilder
import org.apache.isis.client.kroviz.ui.core.Constants
import org.apache.isis.client.kroviz.ui.core.RoDialog
import org.apache.isis.client.kroviz.utils.Utils
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTableMgr.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTableMgr.kt
index 46b7401..2d5080ed 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTableMgr.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTableMgr.kt
@@ -22,7 +22,7 @@ package org.apache.isis.client.kroviz.ui.panel
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.ui.dialog.DiagramDialog
import org.apache.isis.client.kroviz.ui.dialog.EventExportDialog
-import org.apache.isis.client.kroviz.ui.uml.UmlDiagram
+import org.apache.isis.client.kroviz.ui.diagram.UmlDiagram
import org.apache.isis.client.kroviz.ui.chart.ChartFactory
import org.apache.isis.client.kroviz.ui.core.UiManager
import org.apache.isis.client.kroviz.utils.IconManager
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilderTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilderTest.kt
index cce28e2..39bd3ad 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilderTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilderTest.kt
@@ -28,7 +28,7 @@ import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.*
import org.apache.isis.client.kroviz.to.DomainType
import org.apache.isis.client.kroviz.to.Method
import org.apache.isis.client.kroviz.ui.core.UiManager
-import org.apache.isis.client.kroviz.ui.uml.PumlBuilder
+import org.apache.isis.client.kroviz.ui.diagram.PumlBuilder
import kotlin.test.*
class PumlBuilderTest {
[isis] 05/12: allow maximize/minimize in Dialog and use maximize to
pin (diagram) dialog as tab
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 249bbc73c79388b888d360ae2b184b3311aecef9
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Wed Apr 28 12:37:33 2021 +0200
allow maximize/minimize in Dialog and use maximize to pin (diagram) dialog as tab
---
.../apache/isis/client/kroviz/ui/DiagramDialog.kt | 7 +++++-
.../apache/isis/client/kroviz/ui/kv/RoDialog.kt | 27 +++++++++++++++-------
.../apache/isis/client/kroviz/ui/kv/RoWindow.kt | 4 ++--
3 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
index 359280b..d5ce68e 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
@@ -53,6 +53,11 @@ class DiagramDialog(
}
override fun execute() {
+ pin()
+ // dialog.close()
+ }
+
+ private fun pin() {
val newImage = getDiagram()
val newCallBack = buildNewPanel()
DomUtil.replaceWith(newCallBack, newImage)
@@ -61,7 +66,7 @@ class DiagramDialog(
private fun getDiagram(): ScalableVectorGraphic {
val logEntry = EventStore.findBy(callBack as UUID)
val svgStr = logEntry.getResponse()
- console.log("[DiagramDialog.execute]")
+ console.log("[DiagramDialog.getDiagram]")
console.log(svgStr)
return ScalableVectorGraphic(svgStr)
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDialog.kt
index 4989a40..81c1d75 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDialog.kt
@@ -18,14 +18,6 @@
*/
package org.apache.isis.client.kroviz.ui.kv
-import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.Command
-import org.apache.isis.client.kroviz.ui.DiagramDialog
-import org.apache.isis.client.kroviz.ui.Displayable
-import org.apache.isis.client.kroviz.ui.FormItem
-import org.apache.isis.client.kroviz.utils.Direction
-import org.apache.isis.client.kroviz.utils.IconManager
-import org.apache.isis.client.kroviz.utils.Point
import io.kvision.core.CssSize
import io.kvision.core.JustifyContent
import io.kvision.core.UNIT
@@ -36,6 +28,14 @@ import io.kvision.html.ButtonStyle
import io.kvision.panel.HPanel
import io.kvision.panel.vPanel
import io.kvision.utils.perc
+import org.apache.isis.client.kroviz.to.ValueType
+import org.apache.isis.client.kroviz.ui.Command
+import org.apache.isis.client.kroviz.ui.DiagramDialog
+import org.apache.isis.client.kroviz.ui.Displayable
+import org.apache.isis.client.kroviz.ui.FormItem
+import org.apache.isis.client.kroviz.utils.Direction
+import org.apache.isis.client.kroviz.utils.IconManager
+import org.apache.isis.client.kroviz.utils.Point
class RoDialog(
caption: String,
@@ -136,4 +136,15 @@ class RoDialog(
return scalable != null
}
+ override fun toggleMaximize() {
+ execute()
+ }
+
+ /**
+ * Minimize or restore the window size.
+ */
+ override fun toggleMinimize() {
+ //TODO put Dialog to lower right message box
+ }
+
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt
index 66f1777..1a1dc51 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt
@@ -61,8 +61,8 @@ open class RoWindow(
isResizable: Boolean = true,
isDraggable: Boolean = true,
closeButton: Boolean = false,
- maximizeButton: Boolean = false,
- minimizeButton: Boolean = false,
+ maximizeButton: Boolean = true,
+ minimizeButton: Boolean = true,
icon: String? = null,
classes: Set<String> = setOf(),
init: (RoWindow.() -> Unit)? = null
[isis] 12/12: single diagram in RoTab, scrollbars to be added yet
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 0e5904f6941f297c9d953f5d2f12723233f30c74
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Mon May 10 09:11:09 2021 +0200
single diagram in RoTab, scrollbars to be added yet
---
.../kotlin/org/apache/isis/client/kroviz/utils/DomUtil.kt | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/DomUtil.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/DomUtil.kt
index 6506d9c..b59bcbc 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/DomUtil.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/DomUtil.kt
@@ -18,9 +18,9 @@
*/
package org.apache.isis.client.kroviz.utils
+import kotlinx.browser.document
import org.w3c.dom.Document
import org.w3c.dom.Element
-import kotlinx.browser.document
external fun encodeURIComponent(encodedURI: String): String
@@ -32,7 +32,17 @@ object DomUtil {
fun appendTo(svg: ScalableVectorGraphic) {
val uuid = svg.uuid!!
val svgCode = svg.data
- appendTo(uuid, svgCode)
+ if (!hasChildren(uuid))
+ appendTo(uuid, svgCode)
+ }
+
+ private fun hasChildren(uuid: UUID): Boolean {
+ val element = getById(uuid.value)
+ return if (element == null) {
+ false
+ } else {
+ element.childElementCount > 0
+ }
}
fun appendTo(uuid: UUID, svgCode: String) {
[isis] 04/12: fix test expectation from String to Char
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 82b526b82a62f5688e47f2047a2c1022fbc78f71
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Mon Apr 26 17:41:04 2021 +0200
fix test expectation from String to Char
---
gradle/wrapper/gradle-wrapper.properties | 5 +
.../apache/isis/client/kroviz/snapshots/sample.xml | 245 +++++++++++++++++++++
.../isis/client/kroviz/util/XmlHelperTest.kt | 6 +-
3 files changed, 253 insertions(+), 3 deletions(-)
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..bb8b2fc
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/sample.xml b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/sample.xml
new file mode 100644
index 0000000..c50a196
--- /dev/null
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/sample.xml
@@ -0,0 +1,245 @@
+<bs3:grid xmlns:cpt="http://isis.apache.org/applib/layout/component"
+ xmlns:lnk="http://isis.apache.org/applib/layout/links"
+ xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3">
+ <bs3:row>
+ <bs3:col span="12" unreferencedActions="true">
+ <cpt:domainObject bookmarking="AS_ROOT">
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/element</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K
+ </lnk:href>
+ <lnk:type>application/json;profile="urn:org.restfulobjects:repr-types/object"</lnk:type>
+ </cpt:link>
+ </cpt:domainObject>
+ <cpt:action bookmarking="NEVER" cssClassFa="far fa-fw fa-circle" cssClassFaPosition="LEFT" id="clearHints">
+ <cpt:named>Clear Hints</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/action</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/actions/clearHints
+ </lnk:href>
+ <lnk:type>application/json;profile="urn:org.restfulobjects:repr-types/object-action"</lnk:type>
+ </cpt:link>
+ </cpt:action>
+ <cpt:action bookmarking="NEVER" cssClassFa="fa fa-fw fa-bolt" cssClassFaPosition="LEFT" id="recentCommands">
+ <cpt:named>Recent Commands</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/action</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/actions/recentCommands
+ </lnk:href>
+ <lnk:type>application/json;profile="urn:org.restfulobjects:repr-types/object-action"</lnk:type>
+ </cpt:link>
+ </cpt:action>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="4">
+ <bs3:row>
+ <bs3:col span="12">
+ <bs3:tabGroup>
+ <bs3:tab name="Identity">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Identity" id="identity"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ <bs3:tab name="Other">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Other" id="other" unreferencedProperties="true">
+ <cpt:property id="address" labelPosition="LEFT" typicalLength="25">
+ <cpt:named>Address</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/property</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/properties/address
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-property"
+ </lnk:type>
+ </cpt:link>
+ </cpt:property>
+ <cpt:property id="latitude" labelPosition="LEFT" typicalLength="25">
+ <cpt:named>Latitude</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/property</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/properties/latitude
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-property"
+ </lnk:type>
+ </cpt:link>
+ </cpt:property>
+ <cpt:property id="longitude" labelPosition="LEFT" typicalLength="25">
+ <cpt:named>Longitude</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/property</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/properties/longitude
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-property"
+ </lnk:type>
+ </cpt:link>
+ </cpt:property>
+ <cpt:property id="zoom" labelPosition="LEFT" typicalLength="9">
+ <cpt:named>Zoom</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/property</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/properties/zoom
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-property"
+ </lnk:type>
+ </cpt:link>
+ </cpt:property>
+ <cpt:property hidden="ALL_TABLES" id="description" labelPosition="NONE">
+ <cpt:named>Description</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/property</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/properties/description
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-property"
+ </lnk:type>
+ </cpt:link>
+ </cpt:property>
+ <cpt:property hidden="ALL_TABLES" id="sources" labelPosition="NONE">
+ <cpt:named>Sources</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/property</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/properties/sources
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-property"
+ </lnk:type>
+ </cpt:link>
+ </cpt:property>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ <bs3:tab name="Metadata">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Metadata" id="metadata">
+ <cpt:action id="downloadLayoutXml" position="PANEL_DROPDOWN">
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/action</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/actions/downloadLayoutXml
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-action"
+ </lnk:type>
+ </cpt:link>
+ </cpt:action>
+ <cpt:action id="downloadMetamodelXml" position="PANEL_DROPDOWN">
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/action</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/actions/downloadMetamodelXml
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-action"
+ </lnk:type>
+ </cpt:link>
+ </cpt:action>
+ <cpt:action id="inspectMetamodel" position="PANEL_DROPDOWN">
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/action</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/actions/inspectMetamodel
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-action"
+ </lnk:type>
+ </cpt:link>
+ </cpt:action>
+ <cpt:action id="openRestApi" position="PANEL_DROPDOWN">
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/action</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/actions/openRestApi
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-action"
+ </lnk:type>
+ </cpt:link>
+ </cpt:action>
+ <cpt:action id="rebuildMetamodel" position="PANEL_DROPDOWN">
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/action</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/actions/rebuildMetamodel
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-action"
+ </lnk:type>
+ </cpt:link>
+ </cpt:action>
+ <cpt:property hidden="ALL_TABLES" id="objectType" typicalLength="25">
+ <cpt:named>Object Type</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/property</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/properties/objectType
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-property"
+ </lnk:type>
+ </cpt:link>
+ </cpt:property>
+ <cpt:property hidden="ALL_TABLES" id="objectIdentifier" typicalLength="25">
+ <cpt:named>Object Identifier</cpt:named>
+ <cpt:link>
+ <lnk:rel>urn:org.restfulobjects:rels/property</lnk:rel>
+ <lnk:method>GET</lnk:method>
+ <lnk:href>
+ http://localhost:8080/restful/objects/demo.CustomUiVm/PADw_eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04IiBzdGFuZGFsb25lPSJ5ZXMiPz4KPGRlbW8uQ3VzdG9tVWlWbT4KICAgIDxhZGRyZXNzPk1hbHZlcm4sIFVLPC9hZGRyZXNzPgogICAgPGxhdGl0dWRlPjUyLjE5ODk0NDwvbGF0aXR1ZGU-CiAgICA8bG9uZ2l0dWRlPi0yLjI0MjY1NzEwNzkxMzA4ODY8L2xvbmdpdHVkZT4KICAgIDx6b29tPjE0PC96b29tPgo8L2RlbW8uQ3VzdG9tVWlWbT4K/properties/objectIdentifier
+ </lnk:href>
+ <lnk:type>
+ application/json;profile="urn:org.restfulobjects:repr-types/object-property"
+ </lnk:type>
+ </cpt:link>
+ </cpt:property>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ </bs3:tabGroup>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Details" id="details"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:col>
+ <bs3:col span="8">
+ <bs3:tabGroup unreferencedCollections="true"/>
+ </bs3:col>
+ </bs3:row>
+</bs3:grid>
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/util/XmlHelperTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/util/XmlHelperTest.kt
index 9d3c6a7..188e1bb 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/util/XmlHelperTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/util/XmlHelperTest.kt
@@ -30,10 +30,10 @@ class XmlHelperTest {
//given
val xmlStr = TAB_LAYOUT_XML.str
//when
- val jsonStr = XmlHelper.xml2json(xmlStr)
+ val jsonStr = XmlHelper.xml2json(xmlStr).trim()
// then
- assertEquals("{", jsonStr.first())
- assertEquals("}", jsonStr.last())
+ assertEquals('{', jsonStr.first())
+ assertEquals('}', jsonStr.last())
}
[isis] 02/12: fix import
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 4e913a435279e038e1ca60dd2b7994116a07f6b6
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Sat Apr 24 13:45:44 2021 +0200
fix import
---
.../kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt | 1 +
.../org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt | 12 +++++-------
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
index 8f94f15..4ca34fb 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
@@ -60,6 +60,7 @@ class DiagramDialog(
newFormItems.add(newFi)
val panel = FormPanelFactory(newFormItems)
UiManager.add("Diagram", panel)
+ // Timing critical: Panel has to be added first, then extract from old location.
val uuid = callBack as UUID
val oldElement = DomUtil.getById(uuid.value)!!
val oldStr = oldElement.innerHTML
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
index 19bf7ed..fac5df6 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
@@ -18,10 +18,6 @@
*/
package org.apache.isis.client.kroviz.ui.kv
-import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.FormItem
-import org.apache.isis.client.kroviz.utils.DateHelper
-import org.apache.isis.client.kroviz.utils.UUID
import io.kvision.core.Component
import io.kvision.core.Overflow
import io.kvision.core.StringPair
@@ -43,10 +39,13 @@ import io.kvision.html.Image
import io.kvision.html.image
import io.kvision.panel.VPanel
import io.kvision.panel.vPanel
-import io.kvision.require
import io.kvision.utils.auto
import io.kvision.utils.perc
import io.kvision.utils.px
+import org.apache.isis.client.kroviz.to.ValueType
+import org.apache.isis.client.kroviz.ui.FormItem
+import org.apache.isis.client.kroviz.utils.DateHelper
+import org.apache.isis.client.kroviz.utils.UUID
class FormPanelFactory(items: List<FormItem>) : VPanel() {
@@ -166,8 +165,7 @@ class FormPanelFactory(items: List<FormItem>) : VPanel() {
// TODO passing url as string does not work:
// require resolves string to url and `compiles` it into the binary
// working with remote resources allows to me more dynamic
- image(
- require("img/kroviz-logo.svg"))
+ //image(require("img/kroviz-logo.svg"))
}
else -> {
}
[isis] 06/12: rename MapPanel to SvgPanel
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit a64d8924ba41789d0ecde2d969fd1ce58c18d051
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Wed Apr 28 12:38:58 2021 +0200
rename MapPanel to SvgPanel
---
.../org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt | 4 ++--
.../kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt | 4 ++--
.../org/apache/isis/client/kroviz/ui/kv/{MapPanel.kt => SvgPanel.kt} | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
index 13bb28f..9c57c79 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
@@ -19,7 +19,7 @@
package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.ui.kv.MapPanel
+import org.apache.isis.client.kroviz.ui.kv.SvgPanel
import org.apache.isis.client.kroviz.utils.DomUtil
import org.apache.isis.client.kroviz.utils.UUID
@@ -29,7 +29,7 @@ class SvgDispatcher(val callBack: Any) : BaseAggregator() {
val response = logEntry.response
when (callBack) {
is UUID -> DomUtil.appendTo(callBack, response)
- is MapPanel -> callBack.renderSvg(response)
+ is SvgPanel -> callBack.renderSvg(response)
else -> {
}
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
index d3adff9..4c5ef32 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
@@ -193,8 +193,8 @@ class FormPanelFactory(items: List<FormItem>) : VPanel() {
return panel
}
- private fun createSvgMap(fi: FormItem): MapPanel {
- val panel = MapPanel()
+ private fun createSvgMap(fi: FormItem): SvgPanel {
+ val panel = SvgPanel()
panel.height = 100.perc
panel.width = 100.perc
fi.callBack = panel
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MapPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/SvgPanel.kt
similarity index 98%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MapPanel.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/SvgPanel.kt
index d6ac302..a0612be 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MapPanel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/SvgPanel.kt
@@ -24,7 +24,7 @@ import io.kvision.maps.*
import io.kvision.panel.HPanel
import io.kvision.utils.pc
-class MapPanel : HPanel() {
+class SvgPanel : HPanel() {
val map: Maps = maps(0, 0, 11, baseLayerProvider = BaseLayerProvider.EMPTY, crs = CRS.Simple) {
width = 100.pc
[isis] 07/12: allow an icon menu with dialogs
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit f5ae1e871aa92a198dd87d80212eda6eaedb4901
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Fri Apr 30 16:43:04 2021 +0200
allow an icon menu with dialogs
---
.../apache/isis/client/kroviz/ui/DiagramDialog.kt | 16 +++--
.../apache/isis/client/kroviz/ui/kv/Constants.kt | 1 +
.../apache/isis/client/kroviz/ui/kv/MenuFactory.kt | 2 +-
.../apache/isis/client/kroviz/ui/kv/RoWindow.kt | 72 ++++++++++++++++++----
.../apache/isis/client/kroviz/utils/XmlHelper.kt | 9 +--
5 files changed, 76 insertions(+), 24 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
index d5ce68e..6428dcf 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
@@ -18,11 +18,10 @@
*/
package org.apache.isis.client.kroviz.ui
+import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.FormPanelFactory
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.kv.*
import org.apache.isis.client.kroviz.utils.*
class DiagramDialog(
@@ -58,9 +57,14 @@ class DiagramDialog(
}
private fun pin() {
- val newImage = getDiagram()
- val newCallBack = buildNewPanel()
- DomUtil.replaceWith(newCallBack, newImage)
+// val newImage = getDiagram()
+// val newCallBack = buildNewPanel()
+// DomUtil.replaceWith(newCallBack, newImage)
+ val logEntry = EventStore.findBy(callBack as UUID)
+ val svgStr = logEntry.getResponse()
+ val panel = SvgPanel()
+ panel.renderSvg(svgStr)
+ UiManager.add("Diagram", panel)
}
private fun getDiagram(): ScalableVectorGraphic {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/Constants.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/Constants.kt
index 42f6764..e94a8e0 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/Constants.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/Constants.kt
@@ -22,6 +22,7 @@ object Constants {
const val stdMimeType = "text/plain"
const val svgMimeType = "image/svg+xml"
+ const val xmlMimeType = "application/xml"
const val calcHeight = "calc(100vh - 88px)"
const val actionSeparator = "\n"
const val subTypeJson = "json"
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MenuFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MenuFactory.kt
index 3356b32..99a49a4 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MenuFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MenuFactory.kt
@@ -132,7 +132,7 @@ object MenuFactory {
return null
}
- private fun buildActionLink(
+ fun buildActionLink(
label: String,
menuTitle: String): KvisionHtmlLink {
val actionTitle = Utils.deCamel(label)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt
index 1a1dc51..f8d1ba8 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt
@@ -18,21 +18,24 @@
*/
package org.apache.isis.client.kroviz.ui.kv
-/* (!) copied from io.kvision.window.Window in order to make Dialogs transparent on move */
+/* (!) copied from io.kvision.window.Window in order to make
+* Dialogs transparent on move
+* add a dd menu to the icon
+* */
import com.github.snabbdom.VNode
-import org.w3c.dom.events.Event
-import org.w3c.dom.events.MouseEvent
import io.kvision.core.*
-import io.kvision.html.Icon
-import io.kvision.html.TAG
-import io.kvision.html.Tag
+import io.kvision.dropdown.DropDown
+import io.kvision.dropdown.separator
+import io.kvision.html.*
import io.kvision.modal.CloseIcon
import io.kvision.panel.SimplePanel
import io.kvision.utils.obj
import io.kvision.utils.px
import io.kvision.window.MaximizeIcon
import io.kvision.window.MinimizeIcon
+import org.w3c.dom.events.Event
+import org.w3c.dom.events.MouseEvent
internal const val DEFAULT_Z_INDEX = 900
internal const val WINDOW_HEADER_HEIGHT = 40
@@ -78,6 +81,7 @@ open class RoWindow(
captionTag.content = value
checkHeaderVisibility()
}
+
/**
* Window content width.
*/
@@ -86,6 +90,7 @@ open class RoWindow(
set(value) {
width = value
}
+
/**
* Window content height.
*/
@@ -94,6 +99,7 @@ open class RoWindow(
set(value) {
content.height = value
}
+
/**
* Window content height.
*/
@@ -102,14 +108,17 @@ open class RoWindow(
set(value) {
content.overflow = value
}
+
/**
* Determines if the window is resizable.
*/
var isResizable by refreshOnUpdate(isResizable) { checkIsResizable() }
+
/**
* Determines if the window is draggable.
*/
var isDraggable by refreshOnUpdate(isDraggable) { checkIsDraggable(); checkHeaderVisibility() }
+
/**
* Determines if Close button is visible.
*/
@@ -119,6 +128,7 @@ open class RoWindow(
closeIcon.visible = value
checkHeaderVisibility()
}
+
/**
* Determines if Maximize button is visible.
*/
@@ -128,6 +138,7 @@ open class RoWindow(
maximizeIcon.visible = value
checkHeaderVisibility()
}
+
/**
* Determines if Maximize button is visible.
*/
@@ -137,6 +148,7 @@ open class RoWindow(
minimizeIcon.visible = value
checkHeaderVisibility()
}
+
/**
* Window icon.
*/
@@ -160,13 +172,25 @@ open class RoWindow(
private val closeIcon = CloseIcon()
private val maximizeIcon = MaximizeIcon()
private val minimizeIcon = MinimizeIcon()
- private val captionTag = Tag(TAG.H5, caption, classes = setOf("modal-title"))
+ private val captionTag = Tag(TAG.H5, caption, classes = setOf("modal-title")).apply {
+ alignSelf = AlignItems.START
+ }
private val iconsContainer = SimplePanel(setOf("kv-window-icons-container"))
- private val windowIcon = Icon(icon ?: "").apply {
- addCssClass("window-icon")
- visible = (icon != null && icon != "")
+
+ /* private val windowIcon = Icon(icon ?: "").apply {
+ addCssClass("window-icon")
+ visible = (icon != null && icon != "")
+ } */
+ private val windowIcon = DropDown(
+ text = "",
+ icon = icon,
+ style = ButtonStyle.LIGHT).apply {
+ marginLeft = CssSize(-16, UNIT.px)
+ marginTop = CssSize(-1, UNIT.px)
+ background = Background(color = Color.name(Col.WHITE))
}
+
private var isResizeEvent = false
init {
@@ -179,8 +203,17 @@ open class RoWindow(
width = contentWidth
@Suppress("LeakingThis")
zIndex = ++zIndexCounter
+ amendMenu(windowIcon)
+ header.add(windowIcon)
+ windowIcon.setEventListener<Icon> {
+ click = { _ ->
+ console.log("[RoWindow.windowIcon.click]")
+ }
+ mousedown = { e ->
+ e.stopPropagation()
+ }
+ }
header.add(captionTag)
- captionTag.add(windowIcon)
header.add(iconsContainer)
minimizeIcon.visible = minimizeButton
minimizeIcon.setEventListener<MinimizeIcon> {
@@ -410,9 +443,26 @@ open class RoWindow(
open fun toggleMinimize() {
}
+ //TODO pass in menu in constructor?
+ fun amendMenu(
+ dd: DropDown) {
+ dd.separator()
+
+// val saveLink = tObject.links.first()
+ val saveAction = MenuFactory.buildActionLink(
+ label = "save",
+ menuTitle = "save")
+ saveAction.onClick {
+// RoXmlHttpRequest().invoke(saveLink)
+ }
+ dd.add(saveAction)
+ }
+
+
companion object {
internal var counter = 0
internal var zIndexCounter = DEFAULT_Z_INDEX
}
+
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt
index 122a35d..712c778 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt
@@ -18,6 +18,7 @@
*/
package org.apache.isis.client.kroviz.utils
+import org.apache.isis.client.kroviz.ui.kv.Constants
import org.w3c.dom.Document
import org.w3c.dom.Node
import org.w3c.dom.asList
@@ -44,7 +45,7 @@ object XmlHelper {
fun parseXml(xmlStr: String): Document {
val p = DOMParser()
- return p.parseFromString(xmlStr, "application/xml")
+ return p.parseFromString(xmlStr, Constants.xmlMimeType)
}
// Adopted from @link https://stackoverflow.com/questions/376373/pretty-printing-xml-with-javascript
@@ -73,12 +74,8 @@ object XmlHelper {
}
fun xml2json(xml: String): String {
- console.log("[XmlHelper.xml2json]")
val json = XmlToJson.parseString(xml)
- console.log(json)
- val jsonStr = JSON.stringify(json)
- console.log(jsonStr)
- return jsonStr
+ return JSON.stringify(json)
}
}
[isis] 03/12: convert xml to json for plantuml json diagram
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit f6adc4e60aeb464dc59b6c0d66d343b2510e7569
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Mon Apr 26 17:29:53 2021 +0200
convert xml to json for plantuml json diagram
---
incubator/clients/kroviz/build.gradle.kts | 1 +
.../kotlin/org/apache/isis/client/kroviz/App.kt | 1 -
.../client/kroviz/core/aggregator/SvgDispatcher.kt | 2 +-
.../isis/client/kroviz/core/event/EventStore.kt | 7 +++
.../apache/isis/client/kroviz/ui/DiagramDialog.kt | 60 ++++++++++++----------
.../apache/isis/client/kroviz/ui/EventLogDetail.kt | 15 ++++--
.../isis/client/kroviz/ui/kv/FormPanelFactory.kt | 1 -
.../client/kroviz/utils/ScalableVectorGraphic.kt | 15 ++++++
.../apache/isis/client/kroviz/utils/XmlHelper.kt | 11 +++-
.../SvgDispatcher.kt => utils/XmlToJson.kt} | 23 +++------
.../isis/client/kroviz/snapshots/TestRequest.kt | 1 -
.../isis/client/kroviz/util/XmlHelperTest.kt} | 30 ++++++-----
12 files changed, 99 insertions(+), 68 deletions(-)
diff --git a/incubator/clients/kroviz/build.gradle.kts b/incubator/clients/kroviz/build.gradle.kts
index 2858b5e..a2c2e47 100644
--- a/incubator/clients/kroviz/build.gradle.kts
+++ b/incubator/clients/kroviz/build.gradle.kts
@@ -88,6 +88,7 @@ kotlin {
implementation("io.kvision:kvision-pace:$kvisionVersion")
implementation("io.kvision:kvision-moment:$kvisionVersion")
implementation("io.kvision:kvision-maps:$kvisionVersion")
+ implementation(npm("xmltojson", "1.3.5", false))
}
sourceSets["test"].dependencies {
implementation(kotlin("test-js"))
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/App.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/App.kt
index 8e8dad6..3162eb9 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/App.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/App.kt
@@ -31,7 +31,6 @@ class App : Application() {
init {
require("css/kroviz.css")
-// require("lodash")
}
override fun start() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
index 380952e..13bb28f 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
@@ -23,7 +23,7 @@ import org.apache.isis.client.kroviz.ui.kv.MapPanel
import org.apache.isis.client.kroviz.utils.DomUtil
import org.apache.isis.client.kroviz.utils.UUID
-class SvgDispatcher(private val callBack: Any) : BaseAggregator() {
+class SvgDispatcher(val callBack: Any) : BaseAggregator() {
override fun update(logEntry: LogEntry, subType: String) {
val response = logEntry.response
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
index bfed6aa..4e72a2b 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
@@ -24,6 +24,8 @@ import org.apache.isis.client.kroviz.to.mb.Menubars
import org.apache.isis.client.kroviz.ui.kv.UiManager
import io.kvision.panel.SimplePanel
import io.kvision.state.observableListOf
+import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
+import org.apache.isis.client.kroviz.utils.UUID
/**
* Keeps a log of remote invocations and the responses.
@@ -126,6 +128,11 @@ object EventStore {
return log.firstOrNull { it.getAggregator() == aggregator }
}
+ fun findBy(uuid: UUID): LogEntry {
+ return log.first { it.getAggregator() is SvgDispatcher
+ && (it.getAggregator() as SvgDispatcher).callBack == uuid }
+ }
+
fun findMenuBars(): LogEntry? {
return log.firstOrNull() {
it.obj is Menubars
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
index 4ca34fb..359280b 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
@@ -18,6 +18,7 @@
*/
package org.apache.isis.client.kroviz.ui
+import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.to.ValueType
import org.apache.isis.client.kroviz.ui.kv.FormPanelFactory
import org.apache.isis.client.kroviz.ui.kv.RoDialog
@@ -25,8 +26,8 @@ import org.apache.isis.client.kroviz.ui.kv.UiManager
import org.apache.isis.client.kroviz.utils.*
class DiagramDialog(
- var label: String,
- private var pumlCode: String
+ var label: String,
+ private var pumlCode: String
) : Command() {
private var callBack: Any = UUID()
@@ -35,8 +36,6 @@ class DiagramDialog(
fun open() {
dialog.open()
- console.log("[DiagramDialog.open]")
- console.log(pumlCode)
UmlUtils.generateJsonDiagram(pumlCode, callBack)
}
@@ -45,40 +44,47 @@ class DiagramDialog(
formItems.add(fi)
dialog = RoDialog(
- widthPerc = 80,
- caption = "Diagram",
- items = formItems,
- command = this,
- defaultAction = "Pin"
+ widthPerc = 80,
+ caption = "Diagram",
+ items = formItems,
+ command = this,
+ defaultAction = "Pin"
)
}
override fun execute() {
- val newFormItems = mutableListOf<FormItem>()
- val newCallBack = UUID()
- val newFi = FormItem("svg", ValueType.SVG_INLINE, callBack = newCallBack)
- newFormItems.add(newFi)
- val panel = FormPanelFactory(newFormItems)
- UiManager.add("Diagram", panel)
- // Timing critical: Panel has to be added first, then extract from old location.
- val uuid = callBack as UUID
- val oldElement = DomUtil.getById(uuid.value)!!
- val oldStr = oldElement.innerHTML
- val newImage = ScalableVectorGraphic(oldStr)
+ val newImage = getDiagram()
+ val newCallBack = buildNewPanel()
DomUtil.replaceWith(newCallBack, newImage)
}
+ private fun getDiagram(): ScalableVectorGraphic {
+ val logEntry = EventStore.findBy(callBack as UUID)
+ val svgStr = logEntry.getResponse()
+ console.log("[DiagramDialog.execute]")
+ console.log(svgStr)
+ return ScalableVectorGraphic(svgStr)
+ }
+
+ private fun buildNewPanel() : UUID {
+ val newUuid = UUID()
+ val formItems = mutableListOf<FormItem>()
+ val newFi = FormItem("svg", ValueType.SVG_INLINE, callBack = newUuid)
+ formItems.add(newFi)
+ val panel = FormPanelFactory(formItems)
+ console.log(panel)
+ UiManager.add("Diagram", panel)
+ return newUuid
+ }
+
@Deprecated("use leaflet/svg")
fun scale(direction: Direction) {
- val uuid = callBack as UUID
- val oldElement = DomUtil.getById(uuid.value)!!
- val oldStr = oldElement.innerHTML
- val newImage = ScalableVectorGraphic(oldStr)
+ val svg = getDiagram()
when (direction) {
- Direction.UP -> newImage.scaleUp()
- Direction.DOWN -> newImage.scaleDown()
+ Direction.UP -> svg.scaleUp()
+ Direction.DOWN -> svg.scaleDown()
}
- DomUtil.replaceWith(uuid, newImage)
+ DomUtil.replaceWith(callBack as UUID, svg)
}
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventLogDetail.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventLogDetail.kt
index 533442c..97aee27 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventLogDetail.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventLogDetail.kt
@@ -35,7 +35,7 @@ class EventLogDetail(val logEntry: LogEntry) : Command() {
var responseStr = logEntry.response
if (logEntry.subType == Constants.subTypeJson) {
responseStr = Utils.format(responseStr)
- } else {
+ } else {
responseStr = XmlHelper.formatXml(responseStr)
}
formItems.add(FormItem("Response", ValueType.TEXT_AREA, responseStr, 10))
@@ -56,11 +56,16 @@ class EventLogDetail(val logEntry: LogEntry) : Command() {
override fun execute() {
- if (logEntry.subType != Constants.subTypeXml) {
- val responseStr = logEntry.response
- val pumlCode = PumlBuilder().asJsonDiagram(responseStr)
- DiagramDialog("Json Diagram", pumlCode).open()
+ val str = logEntry.response
+ val json = when {
+ str.startsWith("<") -> {
+ XmlHelper.xml2json(str)
+ }
+ str.startsWith("{") -> str
+ else -> "{}"
}
+ val pumlCode = PumlBuilder().asJsonDiagram(json)
+ DiagramDialog("Response Diagram", pumlCode).open()
}
fun executeConsole() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
index fac5df6..d3adff9 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
@@ -36,7 +36,6 @@ import io.kvision.form.time.dateTime
import io.kvision.html.Div
import io.kvision.html.Iframe
import io.kvision.html.Image
-import io.kvision.html.image
import io.kvision.panel.VPanel
import io.kvision.panel.vPanel
import io.kvision.utils.auto
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt
index 811ecf7..9fd4931 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt
@@ -20,14 +20,19 @@ package org.apache.isis.client.kroviz.utils
import org.apache.isis.client.kroviz.ui.kv.Constants
import org.w3c.dom.Document
+import org.w3c.dom.Image
import org.w3c.dom.parsing.DOMParser
import org.w3c.dom.svg.SVGSVGElement
+import org.w3c.dom.url.URL
+import org.w3c.files.Blob
+import org.w3c.files.BlobPropertyBag
enum class Direction(val id: String) {
UP("UP"),
DOWN("DOWN")
}
+// see: https://vecta.io/blog/best-way-to-embed-svg
class ScalableVectorGraphic(val data: String) {
var document: Document = DOMParser().parseFromString(data, Constants.svgMimeType)
@@ -85,4 +90,14 @@ class ScalableVectorGraphic(val data: String) {
class ViewBox(val x: Int, val y: Int, var width: Int, var height: Int)
+ fun asImage(): Image {
+ val byteArray = data.encodeToByteArray().asDynamic()
+ val options = BlobPropertyBag("image/svg+xml;charset=utf-8")
+ val svgBlob = Blob(byteArray, options)
+ val objectURL = URL.createObjectURL(svgBlob)
+ val image = Image()
+ image.src = objectURL
+ return image
+ }
+
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt
index 0dd8fe8..122a35d 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt
@@ -69,7 +69,16 @@ object XmlHelper {
formatted += padding + node + "\r\n"
pad += indent
}
- return formatted.substring(1, formatted.length - 3);
+ return formatted.substring(0, formatted.length - 2);
+ }
+
+ fun xml2json(xml: String): String {
+ console.log("[XmlHelper.xml2json]")
+ val json = XmlToJson.parseString(xml)
+ console.log(json)
+ val jsonStr = JSON.stringify(json)
+ console.log(jsonStr)
+ return jsonStr
}
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlToJson.kt
similarity index 56%
copy from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
copy to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlToJson.kt
index 380952e..fe2e926 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlToJson.kt
@@ -16,23 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.core.aggregator
+package org.apache.isis.client.kroviz.utils
-import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.ui.kv.MapPanel
-import org.apache.isis.client.kroviz.utils.DomUtil
-import org.apache.isis.client.kroviz.utils.UUID
-
-class SvgDispatcher(private val callBack: Any) : BaseAggregator() {
-
- override fun update(logEntry: LogEntry, subType: String) {
- val response = logEntry.response
- when (callBack) {
- is UUID -> DomUtil.appendTo(callBack, response)
- is MapPanel -> callBack.renderSvg(response)
- else -> {
- }
- }
- }
+import org.w3c.dom.Document
+@JsModule("xmltojson")
+@JsNonModule
+external object XmlToJson {
+ fun parseString(xml: String): String
}
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/TestRequest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/TestRequest.kt
index 5bdf293..513671c 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/TestRequest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/TestRequest.kt
@@ -2,7 +2,6 @@ package org.apache.isis.client.kroviz.snapshots
import kotlinx.browser.window
import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.asDeferred
import kotlinx.coroutines.await
import org.apache.isis.client.kroviz.IntegrationTest
import org.apache.isis.client.kroviz.to.Link
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/util/XmlHelperTest.kt
similarity index 57%
copy from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
copy to incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/util/XmlHelperTest.kt
index 380952e..9d3c6a7 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/util/XmlHelperTest.kt
@@ -16,23 +16,25 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.core.aggregator
+package org.apache.isis.client.kroviz.util
-import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.ui.kv.MapPanel
-import org.apache.isis.client.kroviz.utils.DomUtil
-import org.apache.isis.client.kroviz.utils.UUID
+import org.apache.isis.client.kroviz.snapshots.demo2_0_0.TAB_LAYOUT_XML
+import org.apache.isis.client.kroviz.utils.XmlHelper
+import kotlin.test.Test
+import kotlin.test.assertEquals
-class SvgDispatcher(private val callBack: Any) : BaseAggregator() {
+class XmlHelperTest {
- override fun update(logEntry: LogEntry, subType: String) {
- val response = logEntry.response
- when (callBack) {
- is UUID -> DomUtil.appendTo(callBack, response)
- is MapPanel -> callBack.renderSvg(response)
- else -> {
- }
- }
+ @Test
+ fun testXml2Json() {
+ //given
+ val xmlStr = TAB_LAYOUT_XML.str
+ //when
+ val jsonStr = XmlHelper.xml2json(xmlStr)
+ // then
+ assertEquals("{", jsonStr.first())
+ assertEquals("}", jsonStr.last())
}
+
}
[isis] 10/12: uuid passed on to RoTab
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 8077f5495c6bf73d826440074ab7469acfefabfe
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Fri May 7 12:59:06 2021 +0200
uuid passed on to RoTab
---
.../isis/client/kroviz/core/event/EventStore.kt | 24 ++++++++++-----
.../isis/client/kroviz/core/event/LogEntry.kt | 2 ++
.../apache/isis/client/kroviz/ui/core/RoView.kt | 7 +++--
.../apache/isis/client/kroviz/ui/core/UiManager.kt | 24 +++++++++------
.../isis/client/kroviz/ui/dialog/DiagramDialog.kt | 36 ++++++++++------------
.../isis/client/kroviz/ui/kv/override/RoTab.kt | 36 +++++++++++++++++-----
.../client/kroviz/ui/kv/override/RoTabPanel.kt | 11 +++++--
.../client/kroviz/utils/ScalableVectorGraphic.kt | 2 +-
.../org/apache/isis/client/kroviz/utils/UUID.kt | 6 +++-
.../client/kroviz/core/event/EventStoreTest.kt | 4 +--
10 files changed, 101 insertions(+), 51 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
index 31ec377..128d4e3 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
@@ -18,13 +18,14 @@
*/
package org.apache.isis.client.kroviz.core.event
+import io.kvision.panel.SimplePanel
+import io.kvision.state.observableListOf
import org.apache.isis.client.kroviz.core.aggregator.BaseAggregator
+import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.mb.Menubars
import org.apache.isis.client.kroviz.ui.core.UiManager
-import io.kvision.panel.SimplePanel
-import io.kvision.state.observableListOf
-import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
+import org.apache.isis.client.kroviz.utils.ScalableVectorGraphic
import org.apache.isis.client.kroviz.utils.UUID
/**
@@ -65,9 +66,10 @@ object EventStore {
updateStatus(entry)
}
- fun addView(title: String, aggregator: BaseAggregator, panel: SimplePanel) {
+ fun addView(title: String, aggregator: BaseAggregator, panel: SimplePanel, obj: Any?) {
val entry = LogEntry(title = title, aggregator = aggregator)
entry.obj = panel
+ // entry.obj = obj
log(entry)
updateStatus(entry)
}
@@ -128,9 +130,17 @@ object EventStore {
return log.firstOrNull { it.getAggregator() == aggregator }
}
- fun findBy(uuid: UUID): LogEntry {
- return log.first { it.getAggregator() is SvgDispatcher
- && (it.getAggregator() as SvgDispatcher).callBack == uuid }
+ fun findByDispatcher(uuid: UUID): LogEntry {
+ return log.first {
+ it.getAggregator() is SvgDispatcher
+ && (it.getAggregator() as SvgDispatcher).callBack == uuid
+ }
+ }
+
+ fun findByView(uuid: UUID): LogEntry? {
+ return log.firstOrNull() {
+ (it.obj is ScalableVectorGraphic) && ((it.obj as ScalableVectorGraphic).uuid == uuid)
+ }
}
fun findMenuBars(): LogEntry? {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
index 44046af..6b51b47 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
@@ -25,7 +25,9 @@ import org.apache.isis.client.kroviz.core.aggregator.BaseAggregator
import org.apache.isis.client.kroviz.to.TransferObject
import org.apache.isis.client.kroviz.ui.core.Constants
import org.apache.isis.client.kroviz.ui.core.UiManager
+import org.apache.isis.client.kroviz.utils.UUID
import org.apache.isis.client.kroviz.utils.Utils.removeHexCode
+import org.apache.isis.client.kroviz.utils.XmlHelper
import kotlin.js.Date
// use color codes from css instead?
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
index 802d1c9..fc21346 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
@@ -24,6 +24,7 @@ import io.kvision.core.Component
import io.kvision.core.addBsBorder
import io.kvision.panel.SimplePanel
import org.apache.isis.client.kroviz.ui.kv.override.RoTabPanel
+import org.apache.isis.client.kroviz.utils.UUID
/**
* Area between menu bar at the top and the status bar at the bottom.
@@ -36,7 +37,8 @@ object RoView {
fun addTab(
title: String,
- panel: Component) {
+ panel: Component,
+ uuid: UUID?) {
panel.addBsBorder(BsBorder.BORDER)
val index = tabPanel.findTab(title)
if (index != null) {
@@ -53,7 +55,8 @@ object RoView {
panel,
icon,
image = null,
- closable = true)
+ closable = true,
+ uuid = uuid)
tabPanel.activeIndex = tabCount
tabCount += 1
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
index f9f7b81..6ca4ec1 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
@@ -18,6 +18,10 @@
*/
package org.apache.isis.client.kroviz.ui.core
+import io.kvision.core.Widget
+import io.kvision.dropdown.ContextMenu
+import io.kvision.panel.SimplePanel
+import io.kvision.utils.ESC_KEY
import kotlinx.browser.window
import org.apache.isis.client.kroviz.core.Session
import org.apache.isis.client.kroviz.core.aggregator.BaseAggregator
@@ -31,12 +35,10 @@ import org.apache.isis.client.kroviz.core.model.ObjectDM
import org.apache.isis.client.kroviz.to.Relation
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.mb.Menubars
+import org.apache.isis.client.kroviz.utils.ScalableVectorGraphic
+import org.apache.isis.client.kroviz.utils.UUID
import org.apache.isis.client.kroviz.utils.Utils
import org.w3c.dom.events.KeyboardEvent
-import io.kvision.core.Widget
-import io.kvision.dropdown.ContextMenu
-import io.kvision.panel.SimplePanel
-import io.kvision.utils.ESC_KEY
/**
* Single point of contact for view components consisting of:
@@ -49,7 +51,7 @@ object UiManager {
private var session: Session? = null
private val popups = mutableListOf<Widget>()
- private val settings = mutableMapOf<String,Any>()
+ private val settings = mutableMapOf<String, Any>()
init {
window.addEventListener("keydown", fun(event) {
@@ -76,9 +78,13 @@ object UiManager {
return null
}
- fun add(title: String, panel: SimplePanel, aggregator: BaseAggregator = UndefinedDispatcher()) {
- RoView.addTab(title, panel)
- EventStore.addView(title, aggregator, panel)
+ fun add(title: String, panel: SimplePanel, obj: Any? = null, aggregator: BaseAggregator = UndefinedDispatcher()) {
+ var uuid: UUID? = null
+ if (obj is ScalableVectorGraphic) {
+ uuid = obj.uuid
+ }
+ RoView.addTab(title, panel, uuid)
+ EventStore.addView(title, aggregator, panel, obj)
}
fun closeView(tab: SimplePanel) {
@@ -106,7 +112,7 @@ object UiManager {
val displayable = aggregator.dpm
val title: String = Utils.extractTitle(displayable.title)
val panel = RoTable(displayable as ListDM)
- add(title, panel, aggregator)
+ add(title, panel, null, aggregator)
displayable.isRendered = true
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt
index e419ec9..64514bd 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt
@@ -18,13 +18,10 @@
*/
package org.apache.isis.client.kroviz.ui.dialog
+import io.kvision.panel.VPanel
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.core.FormItem
-import org.apache.isis.client.kroviz.ui.core.MenuFactory
-import org.apache.isis.client.kroviz.ui.core.RoDialog
-import org.apache.isis.client.kroviz.ui.core.UiManager
-import org.apache.isis.client.kroviz.ui.panel.FormPanelFactory
+import org.apache.isis.client.kroviz.ui.core.*
import org.apache.isis.client.kroviz.utils.*
import io.kvision.html.Link as KvisionHtmlLink
@@ -61,32 +58,33 @@ class DiagramDialog(
}
private fun pin() {
- val newImage = getDiagram()
- val newCallBack = buildNewPanel()
- DomUtil.replaceWith(newCallBack, newImage)
+ val newUuid = UUID()
+ val newSvg= getDiagram(newUuid)
+ val panel = buildNewPanel(newUuid)
+ console.log("[DD.pin]")
+ console.log(panel)
+ console.log(panel.panel!!.getChildren().first())
+ UiManager.add("Diagram", panel, newSvg)
+ DomUtil.replaceWith(newUuid, newSvg)
dialog.close()
}
- private fun getDiagram(): ScalableVectorGraphic {
- val logEntry = EventStore.findBy(callBack as UUID)
+ private fun getDiagram(newUuid:UUID?): ScalableVectorGraphic {
+ val logEntry = EventStore.findByDispatcher(callBack as UUID)
val svgStr = logEntry.getResponse()
- return ScalableVectorGraphic(svgStr)
+ return ScalableVectorGraphic(svgStr, newUuid)
}
- private fun buildNewPanel(): UUID {
- val newUuid = UUID()
+ private fun buildNewPanel(newUuid: UUID): FormPanelFactory {
val formItems = mutableListOf<FormItem>()
val newFi = FormItem("svg", ValueType.SVG_INLINE, callBack = newUuid)
formItems.add(newFi)
- val panel = FormPanelFactory(formItems)
- console.log(panel)
- UiManager.add("Diagram", panel)
- return newUuid
+ return FormPanelFactory(formItems)
}
@Deprecated("use leaflet/svg")
fun scale(direction: Direction) {
- val svg = getDiagram()
+ val svg = getDiagram(null)
when (direction) {
Direction.UP -> svg.scaleUp()
Direction.DOWN -> svg.scaleDown()
@@ -97,7 +95,7 @@ class DiagramDialog(
fun buildMenu(): List<KvisionHtmlLink> {
val menu = mutableListOf<KvisionHtmlLink>()
val action = MenuFactory.buildActionLink(
- label = "pin",
+ label = "Pin",
menuTitle = "pin")
action.onClick {
pin()
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt
index 967b3a9..d3d1fd7 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt
@@ -36,6 +36,10 @@ import io.kvision.routing.RoutingManager
import io.kvision.state.ObservableState
import io.kvision.state.bind
import io.kvision.utils.obj
+import org.apache.isis.client.kroviz.core.event.EventStore
+import org.apache.isis.client.kroviz.utils.DomUtil
+import org.apache.isis.client.kroviz.utils.ScalableVectorGraphic
+import org.apache.isis.client.kroviz.utils.UUID
/**
* The single Tab component inside the TabPanel container.
@@ -49,8 +53,12 @@ import io.kvision.utils.obj
* @param init an initializer extension function
*/
open class RoTab(
- label: String? = null, icon: String? = null,
- image: ResString? = null, closable: Boolean = false, val route: String? = null,
+ label: String? = null,
+ icon: String? = null,
+ image: ResString? = null,
+ closable: Boolean = false,
+ val route: String? = null,
+ val uuid: UUID? = null,
init: (RoTab.() -> Unit)? = null
) : Tag(TAG.LI, classes = setOf("nav-item")) {
@@ -61,16 +69,28 @@ open class RoTab(
image: ResString? = null,
closable: Boolean = false,
route: String? = null,
+ uuid: UUID? = null,
init: (RoTab.() -> Unit)? = null
- ) : this(label, icon, image, closable, route, init) {
+ ) : this(label, icon, image, closable, route, uuid, init) {
@Suppress("LeakingThis")
add(child)
}
- override fun focus() {
- console.log("[RT.focus]")
- if (getElementJQuery()?.attr("tabindex") == undefined) getElementJQuery()?.attr("tabindex", "-1")
- super.focus()
+ override fun render(): VNode {
+ if (uuid != null) {
+ console.log("[RT.render]")
+ console.log(uuid)
+ val logEntry = EventStore.findByView(uuid)
+ if (logEntry != null) {
+ val svgStr = logEntry.getResponse()
+ console.log(svgStr)
+ val newImage = ScalableVectorGraphic(svgStr)
+ val uuid = UUID(this.id!!)
+ console.log(uuid)
+ DomUtil.replaceWith(uuid, newImage)
+ }
+ }
+ return super.render()
}
/**
@@ -185,7 +205,7 @@ fun RoTabPanel.tab(
image: ResString? = null, closable: Boolean = false, route: String? = null,
init: (RoTab.() -> Unit)? = null
): RoTab {
- val tab = RoTab(label, icon, image, closable, route, init)
+ val tab = RoTab(label, icon, image, closable, route, null, init)
this.add(tab)
return tab
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
index 4183743..2611087 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
@@ -35,6 +35,7 @@ import io.kvision.utils.obj
import io.kvision.utils.perc
import io.kvision.utils.set
import org.apache.isis.client.kroviz.ui.core.RoView
+import org.apache.isis.client.kroviz.utils.UUID
/**
* Tab position.
@@ -142,6 +143,11 @@ open class RoTabPanel(
init?.invoke(this)
}
+ override fun render(): VNode {
+ return render("div", childrenVNodes())
+ }
+
+
private fun calculateSideClasses(): Pair<String, String> {
return when (sideTabSize) {
SideTabSize.SIZE_1 -> Pair("col-sm-1", "col-sm-11")
@@ -315,9 +321,10 @@ open class RoTabPanel(
*/
open fun addTab(
title: String, panel: Component, icon: String? = null,
- image: ResString? = null, closable: Boolean = false, route: String? = null
+ image: ResString? = null, closable: Boolean = false, route: String? = null,
+ uuid: UUID? = null
): RoTabPanel {
- addTab(RoTab(title, panel, icon, image, closable, route))
+ addTab(RoTab(title, panel, icon, image, closable, route, uuid))
refresh()
return this
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt
index e686613..9d9d37e 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt
@@ -33,7 +33,7 @@ enum class Direction(val id: String) {
}
// see: https://vecta.io/blog/best-way-to-embed-svg
-class ScalableVectorGraphic(val data: String) {
+class ScalableVectorGraphic(val data: String, val uuid:UUID? = null) {
var document: Document = DOMParser().parseFromString(data, Constants.svgMimeType)
private var root: SVGSVGElement
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UUID.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UUID.kt
index 2617019..4461e3f 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UUID.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UUID.kt
@@ -21,7 +21,7 @@ package org.apache.isis.client.kroviz.utils
import kotlin.random.Random
class UUID() {
- val value: String
+ var value: String
// Returns a 36-character string in the form
// XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
@@ -39,6 +39,10 @@ class UUID() {
value = "$s1-$s2-$s3-$s4-$s5"
}
+ constructor(string: String) : this() {
+ value = string
+ }
+
@OptIn(kotlin.ExperimentalUnsignedTypes::class)
fun ByteArray.toHexString() = asUByteArray().joinToString("") {
it.toString(16).padStart(2, '0')
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/core/event/EventStoreTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/core/event/EventStoreTest.kt
index ce5c914..5544b15 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/core/event/EventStoreTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/core/event/EventStoreTest.kt
@@ -116,9 +116,9 @@ class EventStoreTest : IntegrationTest() {
// construct list with urls
EventStore.add(h1Spec)
- EventStore.addView(i1, agg, VPanel())
+ EventStore.addView(i1, agg, VPanel(), null)
EventStore.add(h2Spec)
- EventStore.addView(i2, agg, VPanel())
+ EventStore.addView(i2, agg, VPanel(), null)
val le1 = EventStore.find(h1Spec)!!
assertEquals(h1, le1.url) //1
[isis] 08/12: ui package content restructured
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit bf18fba416b123c7daabb8f80562067b563df9f5
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Wed May 5 21:52:47 2021 +0200
ui package content restructured
---
.../kotlin/org/apache/isis/client/kroviz/App.kt | 2 +-
.../org/apache/isis/client/kroviz/core/Session.kt | 2 +-
.../kroviz/core/aggregator/ActionDispatcher.kt | 4 +-
.../kroviz/core/aggregator/AggregatorWithLayout.kt | 2 +-
.../kroviz/core/aggregator/BaseAggregator.kt | 2 +-
.../core/aggregator/DomainTypesAggregator.kt | 2 +-
.../kroviz/core/aggregator/DownloadDispatcher.kt | 2 +-
.../kroviz/core/aggregator/ErrorDispatcher.kt | 2 +-
.../kroviz/core/aggregator/ListAggregator.kt | 2 +-
.../kroviz/core/aggregator/NavigationDispatcher.kt | 2 +-
.../kroviz/core/aggregator/ObjectAggregator.kt | 4 +-
.../client/kroviz/core/aggregator/SvgDispatcher.kt | 2 +-
.../kroviz/core/aggregator/UndefinedDispatcher.kt | 2 +-
.../isis/client/kroviz/core/event/EventStore.kt | 2 +-
.../isis/client/kroviz/core/event/LogEntry.kt | 4 +-
.../kroviz/core/event/ResourceSpecification.kt | 2 +-
.../client/kroviz/core/event/RoXmlHttpRequest.kt | 4 +-
.../isis/client/kroviz/handler/BaseHandler.kt | 2 +-
.../client/kroviz/handler/DomainTypesHandler.kt | 4 +-
.../isis/client/kroviz/ui/builder/ColBuilder.kt | 2 +-
.../client/kroviz/ui/builder/FieldSetBuilder.kt | 6 +-
.../isis/client/kroviz/ui/builder/LayoutBuilder.kt | 2 +-
.../isis/client/kroviz/ui/builder/RowBuilder.kt | 4 +-
.../isis/client/kroviz/ui/builder/TabBuilder.kt | 2 +-
.../client/kroviz/ui/builder/TabGroupBuilder.kt | 2 +-
.../client/kroviz/ui/{kv => chart}/ChartFactory.kt | 3 +-
.../client/kroviz/ui/{kv => chart}/ChartModel.kt | 2 +-
.../kroviz/ui/{kv => chart}/EventChartModel.kt | 2 +-
.../ui/{samples => chart}/SampleChartModel.kt | 4 +-
.../client/kroviz/ui/{kv => core}/ColumnFactory.kt | 2 +-
.../client/kroviz/ui/{kv => core}/Constants.kt | 2 +-
.../client/kroviz/ui/{ => core}/Displayable.kt | 2 +-
.../isis/client/kroviz/ui/{ => core}/FormItem.kt | 2 +-
.../client/kroviz/ui/{kv => core}/MenuFactory.kt | 2 +-
.../isis/client/kroviz/ui/{kv => core}/RoApp.kt | 7 +-
.../isis/client/kroviz/ui/{kv => core}/RoDialog.kt | 16 +-
.../client/kroviz/ui/{kv => core}/RoDisplay.kt | 3 +-
.../client/kroviz/ui/{kv => core}/RoIconBar.kt | 12 +-
.../client/kroviz/ui/{kv => core}/RoMenuBar.kt | 15 +-
.../client/kroviz/ui/{kv => core}/RoStatusBar.kt | 8 +-
.../isis/client/kroviz/ui/{kv => core}/RoTable.kt | 2 +-
.../isis/client/kroviz/ui/{kv => core}/RoView.kt | 5 +-
.../client/kroviz/ui/{kv => core}/UiManager.kt | 4 +-
.../isis/client/kroviz/ui/{kv => dialog}/About.kt | 6 +-
.../kroviz/ui/{kv => dialog}/ActionPrompt.kt | 6 +-
.../client/kroviz/ui/{ => dialog}/BrowserWindow.kt | 5 +-
.../isis/client/kroviz/ui/{ => dialog}/Command.kt | 2 +-
.../client/kroviz/ui/{ => dialog}/DiagramDialog.kt | 42 +-
.../kroviz/ui/{ => dialog}/DownloadDialog.kt | 5 +-
.../client/kroviz/ui/{ => dialog}/ErrorDialog.kt | 5 +-
.../kroviz/ui/{ => dialog}/EventExportDialog.kt | 5 +-
.../kroviz/ui/{ => dialog}/EventLogDetail.kt | 8 +-
.../client/kroviz/ui/{ => dialog}/FileDialog.kt | 5 +-
.../client/kroviz/ui/{kv => dialog}/LoginPrompt.kt | 7 +-
.../kroviz/ui/{ => dialog}/NotificationDialog.kt | 7 +-
.../kroviz/ui/{samples => dialog}/SvgInline.kt | 7 +-
.../kroviz/ui/{ => dialog}/UndefinedDialog.kt | 5 +-
.../apache/isis/client/kroviz/ui/kv/RoTabPanel.kt | 50 ---
.../ui/kv/{ => override}/RoManagerBootstrap.kt | 2 +-
.../isis/client/kroviz/ui/kv/override/RoTab.kt | 204 ++++++++++
.../client/kroviz/ui/kv/override/RoTabPanel.kt | 437 +++++++++++++++++++++
.../client/kroviz/ui/kv/{ => override}/RoWindow.kt | 64 +--
.../kroviz/ui/{kv => panel}/DropdownSearch.kt | 16 +-
.../client/kroviz/ui/{kv => panel}/EventChart.kt | 3 +-
.../kroviz/ui/{kv => panel}/EventLogTable.kt | 5 +-
.../kroviz/ui/{kv => panel}/EventLogTableMgr.kt | 10 +-
.../kroviz/ui/{kv => panel}/FormPanelFactory.kt | 4 +-
.../client/kroviz/ui/{samples => panel}/GeoMap.kt | 6 +-
.../kroviz/ui/{samples => panel}/PlantumlPanel.kt | 2 +-
.../client/kroviz/ui/{samples => panel}/SvgMap.kt | 2 +-
.../client/kroviz/ui/{kv => panel}/SvgPanel.kt | 2 +-
.../isis/client/kroviz/ui/{ => uml}/PumlBuilder.kt | 4 +-
.../isis/client/kroviz/ui/{ => uml}/UmlDiagram.kt | 2 +-
.../client/kroviz/utils/ScalableVectorGraphic.kt | 2 +-
.../apache/isis/client/kroviz/utils/UmlUtils.kt | 2 +-
.../apache/isis/client/kroviz/utils/XmlHelper.kt | 2 +-
.../apache/isis/client/kroviz/IntegrationTest.kt | 4 +-
.../client/kroviz/core/event/EventStoreTest.kt | 2 +-
.../kroviz/snapshots/ResponseRegressionTest.kt | 4 +-
.../isis/client/kroviz/snapshots/TestRequest.kt | 2 +-
.../isis/client/kroviz/ui/PumlBuilderTest.kt | 3 +-
81 files changed, 867 insertions(+), 241 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/App.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/App.kt
index 3162eb9..34a3976 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/App.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/App.kt
@@ -18,7 +18,7 @@
*/
package org.apache.isis.client.kroviz
-import org.apache.isis.client.kroviz.ui.kv.RoApp
+import org.apache.isis.client.kroviz.ui.core.RoApp
import io.kvision.Application
import io.kvision.pace.Pace
import io.kvision.panel.root
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/Session.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/Session.kt
index 58b9bd4..c8f98f4 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/Session.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/Session.kt
@@ -18,7 +18,7 @@
*/
package org.apache.isis.client.kroviz.core
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.UiManager
/**
* Keep track of connected server.
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ActionDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ActionDispatcher.kt
index 8dd7121..e1fc669 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ActionDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ActionDispatcher.kt
@@ -20,8 +20,8 @@ package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.*
-import org.apache.isis.client.kroviz.ui.kv.ActionPrompt
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.dialog.ActionPrompt
+import org.apache.isis.client.kroviz.ui.core.Constants
import org.apache.isis.client.kroviz.utils.Point
import org.apache.isis.client.kroviz.utils.Utils
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/AggregatorWithLayout.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/AggregatorWithLayout.kt
index ec26351..1b1901b 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/AggregatorWithLayout.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/AggregatorWithLayout.kt
@@ -4,7 +4,7 @@ import org.apache.isis.client.kroviz.core.model.DisplayModelWithLayout
import org.apache.isis.client.kroviz.layout.Layout
import org.apache.isis.client.kroviz.to.Represention
import org.apache.isis.client.kroviz.to.TObject
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.core.Constants
abstract class AggregatorWithLayout : BaseAggregator() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/BaseAggregator.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/BaseAggregator.kt
index 8815925..7c3b47b 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/BaseAggregator.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/BaseAggregator.kt
@@ -23,7 +23,7 @@ import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
import org.apache.isis.client.kroviz.core.model.DisplayModel
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.TObject
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.core.Constants
/**
* An Aggregator:
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/DomainTypesAggregator.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/DomainTypesAggregator.kt
index c76554a..2f0f8b4 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/DomainTypesAggregator.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/DomainTypesAggregator.kt
@@ -21,7 +21,7 @@ package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.core.model.DiagramDM
import org.apache.isis.client.kroviz.to.*
-import org.apache.isis.client.kroviz.ui.kv.RoStatusBar
+import org.apache.isis.client.kroviz.ui.core.RoStatusBar
class DomainTypesAggregator(val url: String) : BaseAggregator() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/DownloadDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/DownloadDispatcher.kt
index df70276..48fe1f6 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/DownloadDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/DownloadDispatcher.kt
@@ -19,7 +19,7 @@
package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.ui.FileDialog
+import org.apache.isis.client.kroviz.ui.dialog.FileDialog
class DownloadDispatcher(val actionTitle: String) : BaseAggregator() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
index 5e1864d..89ccc28 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ErrorDispatcher.kt
@@ -22,7 +22,7 @@ import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.core.event.ResourceSpecification
import org.apache.isis.client.kroviz.to.HttpError
-import org.apache.isis.client.kroviz.ui.ErrorDialog
+import org.apache.isis.client.kroviz.ui.dialog.ErrorDialog
class ErrorDispatcher : BaseAggregator() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ListAggregator.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ListAggregator.kt
index 04dd84f..e7c9363 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ListAggregator.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ListAggregator.kt
@@ -24,7 +24,7 @@ import org.apache.isis.client.kroviz.core.model.ListDM
import org.apache.isis.client.kroviz.layout.Layout
import org.apache.isis.client.kroviz.to.*
import org.apache.isis.client.kroviz.to.bs3.Grid
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.UiManager
/** sequence of operations:
* (0) list
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/NavigationDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/NavigationDispatcher.kt
index 0d73aa1..cf03840 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/NavigationDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/NavigationDispatcher.kt
@@ -20,7 +20,7 @@ package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.mb.Menubars
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.UiManager
class NavigationDispatcher() : BaseAggregator() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ObjectAggregator.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ObjectAggregator.kt
index 8791686..0143747 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ObjectAggregator.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/ObjectAggregator.kt
@@ -23,8 +23,8 @@ import org.apache.isis.client.kroviz.core.model.ObjectDM
import org.apache.isis.client.kroviz.layout.Layout
import org.apache.isis.client.kroviz.to.*
import org.apache.isis.client.kroviz.to.bs3.Grid
-import org.apache.isis.client.kroviz.ui.ErrorDialog
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.dialog.ErrorDialog
+import org.apache.isis.client.kroviz.ui.core.UiManager
/** sequence of operations:
* (0) Menu Action User clicks BasicTypes.String -> handled by ActionDispatcher
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
index 9c57c79..0f65e88 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/SvgDispatcher.kt
@@ -19,7 +19,7 @@
package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.ui.kv.SvgPanel
+import org.apache.isis.client.kroviz.ui.panel.SvgPanel
import org.apache.isis.client.kroviz.utils.DomUtil
import org.apache.isis.client.kroviz.utils.UUID
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/UndefinedDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/UndefinedDispatcher.kt
index afcf993..d2ea778 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/UndefinedDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/UndefinedDispatcher.kt
@@ -19,7 +19,7 @@
package org.apache.isis.client.kroviz.core.aggregator
import org.apache.isis.client.kroviz.core.event.LogEntry
-import org.apache.isis.client.kroviz.ui.UndefinedDialog
+import org.apache.isis.client.kroviz.ui.dialog.UndefinedDialog
class UndefinedDispatcher : BaseAggregator() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
index 4e72a2b..31ec377 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
@@ -21,7 +21,7 @@ package org.apache.isis.client.kroviz.core.event
import org.apache.isis.client.kroviz.core.aggregator.BaseAggregator
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.mb.Menubars
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.UiManager
import io.kvision.panel.SimplePanel
import io.kvision.state.observableListOf
import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
index 269d626..44046af 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
@@ -23,8 +23,8 @@ import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
import org.apache.isis.client.kroviz.core.aggregator.BaseAggregator
import org.apache.isis.client.kroviz.to.TransferObject
-import org.apache.isis.client.kroviz.ui.kv.Constants
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.Constants
+import org.apache.isis.client.kroviz.ui.core.UiManager
import org.apache.isis.client.kroviz.utils.Utils.removeHexCode
import kotlin.js.Date
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ResourceSpecification.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ResourceSpecification.kt
index 5b13cd8..e5eadd5 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ResourceSpecification.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ResourceSpecification.kt
@@ -18,7 +18,7 @@
*/
package org.apache.isis.client.kroviz.core.event
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.core.Constants
import org.apache.isis.client.kroviz.utils.Utils
class ResourceSpecification(
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
index 34350cc..3065402 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
@@ -24,8 +24,8 @@ import org.apache.isis.client.kroviz.handler.ResponseHandler
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.Method
import org.apache.isis.client.kroviz.to.TObject
-import org.apache.isis.client.kroviz.ui.kv.Constants
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.Constants
+import org.apache.isis.client.kroviz.ui.core.UiManager
import org.apache.isis.client.kroviz.utils.Utils
import org.w3c.xhr.XMLHttpRequest
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/BaseHandler.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/BaseHandler.kt
index 2a8a856..38c1a40 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/BaseHandler.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/BaseHandler.kt
@@ -20,7 +20,7 @@ package org.apache.isis.client.kroviz.handler
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.TransferObject
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.core.Constants
/**
* Handle responses to XmlHttpRequests asynchronously,
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/DomainTypesHandler.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/DomainTypesHandler.kt
index f31cf1e..8e3ca73 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/DomainTypesHandler.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/DomainTypesHandler.kt
@@ -22,11 +22,11 @@ import kotlinx.serialization.json.Json
import org.apache.isis.client.kroviz.core.aggregator.DomainTypesAggregator
import org.apache.isis.client.kroviz.to.DomainTypes
import org.apache.isis.client.kroviz.to.TransferObject
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.UiManager
class DomainTypesHandler : org.apache.isis.client.kroviz.handler.BaseHandler() {
-
+
override fun parse(response: String): TransferObject {
return Json.decodeFromString(DomainTypes.serializer(), response)
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/ColBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/ColBuilder.kt
index 37db5ff..85054c4 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/ColBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/ColBuilder.kt
@@ -20,7 +20,7 @@ package org.apache.isis.client.kroviz.ui.builder
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.Col
-import org.apache.isis.client.kroviz.ui.kv.RoDisplay
+import org.apache.isis.client.kroviz.ui.core.RoDisplay
import io.kvision.core.*
import io.kvision.core.FlexWrap
import io.kvision.panel.*
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt
index 14f2462..abfa17a 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/FieldSetBuilder.kt
@@ -21,9 +21,9 @@ package org.apache.isis.client.kroviz.ui.builder
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.TypeMapper
import org.apache.isis.client.kroviz.to.bs3.FieldSet
-import org.apache.isis.client.kroviz.ui.FormItem
-import org.apache.isis.client.kroviz.ui.kv.FormPanelFactory
-import org.apache.isis.client.kroviz.ui.kv.RoDisplay
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.panel.FormPanelFactory
+import org.apache.isis.client.kroviz.ui.core.RoDisplay
import io.kvision.form.FormPanel
class FieldSetBuilder {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/LayoutBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/LayoutBuilder.kt
index 313eb97..bcef92f 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/LayoutBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/LayoutBuilder.kt
@@ -20,7 +20,7 @@ package org.apache.isis.client.kroviz.ui.builder
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.Grid
-import org.apache.isis.client.kroviz.ui.kv.RoDisplay
+import org.apache.isis.client.kroviz.ui.core.RoDisplay
import io.kvision.core.CssSize
import io.kvision.core.UNIT
import io.kvision.panel.VPanel
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RowBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RowBuilder.kt
index aae7ee0..1ca17ab 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RowBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/RowBuilder.kt
@@ -20,8 +20,8 @@ package org.apache.isis.client.kroviz.ui.builder
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.Row
-import org.apache.isis.client.kroviz.ui.kv.MenuFactory
-import org.apache.isis.client.kroviz.ui.kv.RoDisplay
+import org.apache.isis.client.kroviz.ui.core.MenuFactory
+import org.apache.isis.client.kroviz.ui.core.RoDisplay
import io.kvision.core.*
import io.kvision.core.FlexWrap
import io.kvision.panel.*
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabBuilder.kt
index b5157ce..f529c31 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabBuilder.kt
@@ -20,7 +20,7 @@ package org.apache.isis.client.kroviz.ui.builder
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.Tab
-import org.apache.isis.client.kroviz.ui.kv.RoDisplay
+import org.apache.isis.client.kroviz.ui.core.RoDisplay
import io.kvision.core.Component
import io.kvision.core.CssSize
import io.kvision.core.UNIT
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabGroupBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabGroupBuilder.kt
index 3eadad5..4c61b12 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabGroupBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/builder/TabGroupBuilder.kt
@@ -20,7 +20,7 @@ package org.apache.isis.client.kroviz.ui.builder
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.bs3.TabGroup
-import org.apache.isis.client.kroviz.ui.kv.RoDisplay
+import org.apache.isis.client.kroviz.ui.core.RoDisplay
import io.kvision.core.Component
import io.kvision.core.CssSize
import io.kvision.core.UNIT
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ChartFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/ChartFactory.kt
similarity index 91%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ChartFactory.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/ChartFactory.kt
index aa01ab2..99fa4c6 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ChartFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/ChartFactory.kt
@@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.chart
import org.apache.isis.client.kroviz.core.event.LogEntry
+import org.apache.isis.client.kroviz.ui.panel.EventChart
class ChartFactory {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ChartModel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/ChartModel.kt
similarity index 95%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ChartModel.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/ChartModel.kt
index 006a0e1..50e271a 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ChartModel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/ChartModel.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.chart
import io.kvision.chart.DataSets
import io.kvision.core.Color
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChartModel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/EventChartModel.kt
similarity index 98%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChartModel.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/EventChartModel.kt
index e9c1f15..5efcbe6 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChartModel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/EventChartModel.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.chart
import org.apache.isis.client.kroviz.core.event.LogEntry
import io.kvision.chart.DataSets
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/SampleChartModel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/SampleChartModel.kt
similarity index 95%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/SampleChartModel.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/SampleChartModel.kt
index 8ba7e53..517aa6e 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/SampleChartModel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/chart/SampleChartModel.kt
@@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.samples
+package org.apache.isis.client.kroviz.ui.chart
-import org.apache.isis.client.kroviz.ui.kv.ChartModel
+import org.apache.isis.client.kroviz.ui.chart.ChartModel
import io.kvision.chart.DataSets
import io.kvision.core.Color
import io.kvision.i18n.I18n
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ColumnFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/ColumnFactory.kt
similarity index 99%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ColumnFactory.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/ColumnFactory.kt
index 9891c57..3cce9e9 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ColumnFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/ColumnFactory.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.core.model.Exposer
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/Constants.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Constants.kt
similarity index 96%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/Constants.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Constants.kt
index e94a8e0..8cb4e8c 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/Constants.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Constants.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
object Constants {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/Displayable.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Displayable.kt
similarity index 95%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/Displayable.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Displayable.kt
index b09af47..c66f228 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/Displayable.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/Displayable.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.core
interface Displayable {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/FormItem.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormItem.kt
similarity index 97%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/FormItem.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormItem.kt
index d9f47c4..f4ec776 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/FormItem.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormItem.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.core
import org.apache.isis.client.kroviz.to.Member
import org.apache.isis.client.kroviz.to.ValueType
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MenuFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/MenuFactory.kt
similarity index 99%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MenuFactory.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/MenuFactory.kt
index 99a49a4..a1c0f4c 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/MenuFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/MenuFactory.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoApp.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoApp.kt
similarity index 88%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoApp.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoApp.kt
index bc13bc9..067db26 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoApp.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoApp.kt
@@ -16,18 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
+import io.kvision.core.CssSize
+import io.kvision.core.UNIT
import io.kvision.panel.HPanel
import io.kvision.panel.SimplePanel
-import io.kvision.utils.perc
object RoApp : SimplePanel() {
init {
this.add(RoMenuBar.navbar)
val view = HPanel(classes = setOf("main")) {
- width = 100.perc
+ width = CssSize(100, UNIT.perc)
}
view.add(RoIconBar.panel)
view.add(RoView.tabPanel)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
similarity index 90%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDialog.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
index 81c1d75..5861921 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDialog.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import io.kvision.core.CssSize
import io.kvision.core.JustifyContent
@@ -29,13 +29,14 @@ import io.kvision.panel.HPanel
import io.kvision.panel.vPanel
import io.kvision.utils.perc
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.Command
-import org.apache.isis.client.kroviz.ui.DiagramDialog
-import org.apache.isis.client.kroviz.ui.Displayable
-import org.apache.isis.client.kroviz.ui.FormItem
+import org.apache.isis.client.kroviz.ui.dialog.Command
+import org.apache.isis.client.kroviz.ui.dialog.DiagramDialog
+import org.apache.isis.client.kroviz.ui.panel.FormPanelFactory
+import org.apache.isis.client.kroviz.ui.kv.override.RoWindow
import org.apache.isis.client.kroviz.utils.Direction
import org.apache.isis.client.kroviz.utils.IconManager
import org.apache.isis.client.kroviz.utils.Point
+import io.kvision.html.Link as KvisionHtmlLink
class RoDialog(
caption: String,
@@ -43,8 +44,9 @@ class RoDialog(
val command: Command,
defaultAction: String = "OK",
widthPerc: Int = 30,
- heightPerc: Int = 100) :
- Displayable, RoWindow(caption = caption, closeButton = true) {
+ heightPerc: Int = 100,
+ menu: List<KvisionHtmlLink>? = null) :
+ Displayable, RoWindow(caption = caption, closeButton = true, menu = menu) {
private val okButton = Button(
text = defaultAction,
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDisplay.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDisplay.kt
similarity index 95%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDisplay.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDisplay.kt
index 2dc18d5..0774216 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoDisplay.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoDisplay.kt
@@ -16,11 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import org.apache.isis.client.kroviz.core.model.ObjectDM
import org.apache.isis.client.kroviz.to.TObject
-import org.apache.isis.client.kroviz.ui.Displayable
import org.apache.isis.client.kroviz.ui.builder.LayoutBuilder
import io.kvision.core.CssSize
import io.kvision.core.FontStyle
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoIconBar.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoIconBar.kt
similarity index 94%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoIconBar.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoIconBar.kt
index 667dd56..9320245 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoIconBar.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoIconBar.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import kotlinx.browser.document
import kotlinx.dom.removeClass
@@ -24,7 +24,7 @@ import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.core.event.ResourceSpecification
import org.apache.isis.client.kroviz.core.model.Exposer
import org.apache.isis.client.kroviz.to.TObject
-import org.apache.isis.client.kroviz.ui.kv.MenuFactory.buildForTitle
+import org.apache.isis.client.kroviz.ui.core.MenuFactory.buildForTitle
import org.apache.isis.client.kroviz.utils.IconManager
import org.apache.isis.client.kroviz.utils.Utils
import io.kvision.core.CssSize
@@ -44,15 +44,15 @@ object RoIconBar : SimplePanel() {
init {
panel.addCssClass("icon-bar")
panel.title = "Drop objects, factories, or actions here"
- this.add(createDeleteIcon())
+ add(createDeleteIcon())
panel.setDropTargetData(Constants.stdMimeType) { id ->
when {
Utils.isUrl(id!!) ->
- this.add(createObjectIcon(id)!!)
+ add(createObjectIcon(id)!!)
id.contains(Constants.actionSeparator) ->
- this.add(createActionIcon(id))
+ add(createActionIcon(id))
else ->
- this.add(createFactoryIcon(id))
+ add(createFactoryIcon(id))
}
}
hide()
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoMenuBar.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoMenuBar.kt
similarity index 89%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoMenuBar.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoMenuBar.kt
index deff983..c7c4565 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoMenuBar.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoMenuBar.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import io.kvision.core.CssSize
import io.kvision.core.UNIT
@@ -31,10 +31,15 @@ import io.kvision.panel.vPanel
import kotlinx.browser.window
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.to.mb.Menubars
-import org.apache.isis.client.kroviz.ui.samples.GeoMap
-import org.apache.isis.client.kroviz.ui.samples.SampleChartModel
-import org.apache.isis.client.kroviz.ui.samples.SvgInline
-import org.apache.isis.client.kroviz.ui.samples.SvgMap
+import org.apache.isis.client.kroviz.ui.panel.DropdownSearch
+import org.apache.isis.client.kroviz.ui.dialog.About
+import org.apache.isis.client.kroviz.ui.dialog.LoginPrompt
+import org.apache.isis.client.kroviz.ui.panel.GeoMap
+import org.apache.isis.client.kroviz.ui.chart.SampleChartModel
+import org.apache.isis.client.kroviz.ui.dialog.SvgInline
+import org.apache.isis.client.kroviz.ui.panel.EventChart
+import org.apache.isis.client.kroviz.ui.panel.EventLogTable
+import org.apache.isis.client.kroviz.ui.panel.SvgMap
import org.apache.isis.client.kroviz.utils.IconManager
import org.apache.isis.client.kroviz.utils.Point
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoStatusBar.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt
similarity index 94%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoStatusBar.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt
index c0e79d0..5c46fbf 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoStatusBar.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoStatusBar.kt
@@ -16,14 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import org.apache.isis.client.kroviz.core.event.EventState
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.core.model.DiagramDM
-import org.apache.isis.client.kroviz.ui.DiagramDialog
-import org.apache.isis.client.kroviz.ui.NotificationDialog
-import org.apache.isis.client.kroviz.ui.UmlDiagram
+import org.apache.isis.client.kroviz.ui.dialog.DiagramDialog
+import org.apache.isis.client.kroviz.ui.dialog.NotificationDialog
+import org.apache.isis.client.kroviz.ui.uml.UmlDiagram
import org.apache.isis.client.kroviz.utils.IconManager
import io.kvision.core.*
import io.kvision.html.Button
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoTable.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoTable.kt
similarity index 98%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoTable.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoTable.kt
index 71285e6..c28c64d 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoTable.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoTable.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import org.apache.isis.client.kroviz.core.model.Exposer
import org.apache.isis.client.kroviz.core.model.ListDM
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoView.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
similarity index 92%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoView.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
index 8152a45..802d1c9 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoView.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
@@ -16,13 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import org.apache.isis.client.kroviz.utils.IconManager
import io.kvision.core.BsBorder
import io.kvision.core.Component
import io.kvision.core.addBsBorder
import io.kvision.panel.SimplePanel
+import org.apache.isis.client.kroviz.ui.kv.override.RoTabPanel
/**
* Area between menu bar at the top and the status bar at the bottom.
@@ -63,10 +64,12 @@ object RoView {
}
fun findActive(): SimplePanel? {
+ console.log("[RV.findActive]")
val index = tabPanel.activeIndex
if (index > 0) {
val tabs = tabPanel.getTabs()
val tab = tabs.get(index) as SimplePanel
+ console.log(tab)
return (tab)
}
return null
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/UiManager.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
similarity index 98%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/UiManager.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
index fdb6718..f9f7b81 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/UiManager.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.core
import kotlinx.browser.window
import org.apache.isis.client.kroviz.core.Session
@@ -82,6 +82,8 @@ object UiManager {
}
fun closeView(tab: SimplePanel) {
+ console.log("[UM.closeView]")
+ console.log(tab)
val tt = tab.title
if (tt != null) {
EventStore.closeView(tt)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/About.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/About.kt
similarity index 93%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/About.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/About.kt
index fe79cbc..dd354fe 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/About.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/About.kt
@@ -17,11 +17,11 @@
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.Command
-import org.apache.isis.client.kroviz.ui.FormItem
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.RoDialog
import org.apache.isis.client.kroviz.utils.UUID
class About : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ActionPrompt.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ActionPrompt.kt
similarity index 95%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ActionPrompt.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ActionPrompt.kt
index 687da2a..26353fa 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/ActionPrompt.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ActionPrompt.kt
@@ -16,19 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.to.Action
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.Parameter
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.Command
-import org.apache.isis.client.kroviz.ui.FormItem
+import org.apache.isis.client.kroviz.ui.core.FormItem
import org.apache.isis.client.kroviz.utils.Point
import org.apache.isis.client.kroviz.utils.Utils
import io.kvision.core.StringPair
import io.kvision.form.select.SimpleSelect
import io.kvision.form.text.TextArea
+import org.apache.isis.client.kroviz.ui.core.RoDialog
class ActionPrompt(val action: Action) : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/BrowserWindow.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/BrowserWindow.kt
similarity index 88%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/BrowserWindow.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/BrowserWindow.kt
index 7dce413..cb17990 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/BrowserWindow.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/BrowserWindow.kt
@@ -16,10 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.RoDialog
class BrowserWindow(val url: String) : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/Command.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/Command.kt
similarity index 96%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/Command.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/Command.kt
index 8f47ab7..a1ec9bb 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/Command.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/Command.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.aggregator.ActionDispatcher
import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt
similarity index 72%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt
index 6428dcf..e419ec9 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt
@@ -16,13 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
-import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.*
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.MenuFactory
+import org.apache.isis.client.kroviz.ui.core.RoDialog
+import org.apache.isis.client.kroviz.ui.core.UiManager
+import org.apache.isis.client.kroviz.ui.panel.FormPanelFactory
import org.apache.isis.client.kroviz.utils.*
+import io.kvision.html.Link as KvisionHtmlLink
class DiagramDialog(
var label: String,
@@ -47,35 +51,29 @@ class DiagramDialog(
caption = "Diagram",
items = formItems,
command = this,
- defaultAction = "Pin"
+ defaultAction = "Pin",
+ menu = buildMenu()
)
}
override fun execute() {
pin()
- // dialog.close()
}
private fun pin() {
-// val newImage = getDiagram()
-// val newCallBack = buildNewPanel()
-// DomUtil.replaceWith(newCallBack, newImage)
- val logEntry = EventStore.findBy(callBack as UUID)
- val svgStr = logEntry.getResponse()
- val panel = SvgPanel()
- panel.renderSvg(svgStr)
- UiManager.add("Diagram", panel)
+ val newImage = getDiagram()
+ val newCallBack = buildNewPanel()
+ DomUtil.replaceWith(newCallBack, newImage)
+ dialog.close()
}
private fun getDiagram(): ScalableVectorGraphic {
val logEntry = EventStore.findBy(callBack as UUID)
val svgStr = logEntry.getResponse()
- console.log("[DiagramDialog.getDiagram]")
- console.log(svgStr)
return ScalableVectorGraphic(svgStr)
}
- private fun buildNewPanel() : UUID {
+ private fun buildNewPanel(): UUID {
val newUuid = UUID()
val formItems = mutableListOf<FormItem>()
val newFi = FormItem("svg", ValueType.SVG_INLINE, callBack = newUuid)
@@ -96,4 +94,16 @@ class DiagramDialog(
DomUtil.replaceWith(callBack as UUID, svg)
}
+ fun buildMenu(): List<KvisionHtmlLink> {
+ val menu = mutableListOf<KvisionHtmlLink>()
+ val action = MenuFactory.buildActionLink(
+ label = "pin",
+ menuTitle = "pin")
+ action.onClick {
+ pin()
+ }
+ menu.add(action)
+ return menu
+ }
+
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DownloadDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DownloadDialog.kt
similarity index 89%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DownloadDialog.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DownloadDialog.kt
index 5feb57f..9e38e2a 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DownloadDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DownloadDialog.kt
@@ -17,10 +17,11 @@
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.RoDialog
import org.apache.isis.client.kroviz.utils.DomUtil
class DownloadDialog(val fileName:String, val content:String) : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/ErrorDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ErrorDialog.kt
similarity index 92%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/ErrorDialog.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ErrorDialog.kt
index 85d5418..9ced7b1 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/ErrorDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ErrorDialog.kt
@@ -16,12 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.HttpError
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.RoDialog
class ErrorDialog(val logEntry: LogEntry) : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventExportDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventExportDialog.kt
similarity index 97%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventExportDialog.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventExportDialog.kt
index 5a0ac39..54f5c95 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventExportDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventExportDialog.kt
@@ -16,16 +16,17 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.event.EventState
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.core.event.ReplayEvent
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
+import org.apache.isis.client.kroviz.ui.core.RoDialog
import io.kvision.core.StringPair
import io.kvision.form.select.SimpleSelect
+import org.apache.isis.client.kroviz.ui.core.FormItem
class EventExportDialog() : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventLogDetail.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventLogDetail.kt
similarity index 90%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventLogDetail.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventLogDetail.kt
index 97aee27..ca6209f 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/EventLogDetail.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/EventLogDetail.kt
@@ -16,12 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.Constants
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.uml.PumlBuilder
+import org.apache.isis.client.kroviz.ui.core.Constants
+import org.apache.isis.client.kroviz.ui.core.RoDialog
import org.apache.isis.client.kroviz.utils.Utils
import org.apache.isis.client.kroviz.utils.XmlHelper
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/FileDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/FileDialog.kt
similarity index 91%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/FileDialog.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/FileDialog.kt
index 279df5d..d566d3a 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/FileDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/FileDialog.kt
@@ -16,12 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.ResultValue
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.RoDialog
class FileDialog(val logEntry: LogEntry) : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/LoginPrompt.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/LoginPrompt.kt
similarity index 92%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/LoginPrompt.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/LoginPrompt.kt
index 427019d..c7d87da 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/LoginPrompt.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/LoginPrompt.kt
@@ -16,15 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.Command
-import org.apache.isis.client.kroviz.ui.FormItem
+import org.apache.isis.client.kroviz.ui.core.FormItem
import org.apache.isis.client.kroviz.utils.Point
import io.kvision.form.text.Password
import io.kvision.form.text.Text
+import org.apache.isis.client.kroviz.ui.core.RoDialog
+import org.apache.isis.client.kroviz.ui.core.UiManager
class LoginPrompt : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/NotificationDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/NotificationDialog.kt
similarity index 86%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/NotificationDialog.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/NotificationDialog.kt
index 8cfbce3..9ad3793 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/NotificationDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/NotificationDialog.kt
@@ -16,11 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
-import org.apache.isis.client.kroviz.ui.kv.RoStatusBar
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.RoDialog
+import org.apache.isis.client.kroviz.ui.core.RoStatusBar
class NotificationDialog(val message: String) : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/SvgInline.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/SvgInline.kt
similarity index 91%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/SvgInline.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/SvgInline.kt
index 733117c..beafdfe 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/SvgInline.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/SvgInline.kt
@@ -17,16 +17,15 @@
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.samples
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.Method
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.Command
-import org.apache.isis.client.kroviz.ui.FormItem
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.RoDialog
import org.apache.isis.client.kroviz.utils.UUID
class SvgInline : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/UndefinedDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/UndefinedDialog.kt
similarity index 92%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/UndefinedDialog.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/UndefinedDialog.kt
index 3f8d9d6..d29c7ab 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/UndefinedDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/UndefinedDialog.kt
@@ -16,11 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.dialog
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.kv.RoDialog
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.RoDialog
class UndefinedDialog(val logEntry: LogEntry) : Command() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoTabPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoTabPanel.kt
deleted file mode 100644
index 10f58dd..0000000
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoTabPanel.kt
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.client.kroviz.ui.kv
-
-import io.kvision.core.CssSize
-import io.kvision.core.UNIT
-import io.kvision.panel.SimplePanel
-import io.kvision.panel.TabPanel
-import io.kvision.panel.VPanel
-import io.kvision.utils.perc
-
-class RoTabPanel : TabPanel() {
-
- init {
- width = 100.perc
- marginTop = CssSize(40, UNIT.px)
- }
-
- override fun removeTab(index: Int): TabPanel {
- val tab = getTabs().get(index)
- RoView.removeTab(tab as SimplePanel)
- return super.removeTab(index)
- }
-
- fun findTab(title: String): Int? {
- getTabs().forEachIndexed { index, component ->
- if ((component is VPanel) && (component.title == title)) {
- return index
- }
- }
- return null
- }
-
-}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoManagerBootstrap.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoManagerBootstrap.kt
similarity index 97%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoManagerBootstrap.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoManagerBootstrap.kt
index 0ee7389..853e1bc 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoManagerBootstrap.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoManagerBootstrap.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.kv.override
/* (!) copied from kvision KVManagerBootstrap in order to make Dialogs transparent on move */
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt
new file mode 100644
index 0000000..967b3a9
--- /dev/null
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt
@@ -0,0 +1,204 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.client.kroviz.ui.kv.override
+
+/**
+ * Copied from Tab in order to:
+ * * add IconMenu
+ * * recreate svg from LogEntry on focus
+ */
+
+import com.github.snabbdom.VNode
+import io.kvision.core.Component
+import io.kvision.core.ResString
+import io.kvision.core.onClick
+import io.kvision.html.Icon
+import io.kvision.html.Link
+import io.kvision.html.TAG
+import io.kvision.html.Tag
+import io.kvision.routing.RoutingManager
+import io.kvision.state.ObservableState
+import io.kvision.state.bind
+import io.kvision.utils.obj
+
+/**
+ * The single Tab component inside the TabPanel container.
+ *
+ * @constructor
+ * @param label label of the tab
+ * @param icon icon of the tab
+ * @param image image of the tab
+ * @param closable determines if this tab is closable
+ * @param route JavaScript route to activate given tab
+ * @param init an initializer extension function
+ */
+open class RoTab(
+ label: String? = null, icon: String? = null,
+ image: ResString? = null, closable: Boolean = false, val route: String? = null,
+ init: (RoTab.() -> Unit)? = null
+) : Tag(TAG.LI, classes = setOf("nav-item")) {
+
+ constructor(
+ label: String? = null,
+ child: Component,
+ icon: String? = null,
+ image: ResString? = null,
+ closable: Boolean = false,
+ route: String? = null,
+ init: (RoTab.() -> Unit)? = null
+ ) : this(label, icon, image, closable, route, init) {
+ @Suppress("LeakingThis")
+ add(child)
+ }
+
+ override fun focus() {
+ console.log("[RT.focus]")
+ if (getElementJQuery()?.attr("tabindex") == undefined) getElementJQuery()?.attr("tabindex", "-1")
+ super.focus()
+ }
+
+ /**
+ * The label of the tab.
+ */
+ var label
+ get() = link.label.ifBlank { null }
+ set(value) {
+ link.label = value ?: ""
+ }
+
+ /**
+ * The icon of the tab.
+ */
+ var icon
+ get() = link.icon
+ set(value) {
+ link.icon = value
+ }
+
+ /**
+ * The image of the tab.
+ */
+ var image
+ get() = link.image
+ set(value) {
+ link.image = value
+ }
+
+ /**
+ * Determines if this tab is closable.
+ */
+ var closable
+ get() = closeIcon.visible
+ set(value) {
+ closeIcon.visible = value
+ }
+
+ internal val closeIcon = Icon("fas fa-times").apply {
+ addCssClass("kv-tab-close")
+ visible = closable
+ setEventListener<Icon> {
+ click = { e ->
+ val tabPanel = (this@RoTab.parent as? RoTabPanelNav)?.tabPanel
+ val actIndex = tabPanel?.getTabIndex(this@RoTab) ?: -1
+ e.asDynamic().data = actIndex
+ @Suppress("UnsafeCastFromDynamic")
+ val event = org.w3c.dom.CustomEvent("tabClosing", obj { detail = e; cancelable = true })
+ if (tabPanel?.getElement()?.dispatchEvent(event) != false) {
+ tabPanel?.removeTab(actIndex)
+ @Suppress("UnsafeCastFromDynamic")
+ val closed = org.w3c.dom.CustomEvent("tabClosed", obj { detail = e })
+ tabPanel?.getElement()?.dispatchEvent(closed)
+ }
+ e.stopPropagation()
+ }
+ }
+ }
+
+ /**
+ * A link component within the tab.
+ */
+ val link = Link(label ?: "", "#", icon, image, classes = setOf("nav-link")).apply {
+ add(this@RoTab.closeIcon)
+ }
+
+ internal val tabId = counter++
+
+ protected val routingHandler = { _: Any ->
+ (this@RoTab.parent as? RoTabPanelNav)?.tabPanel?.activeTab = this
+ }
+
+ init {
+ addPrivate(link)
+ onClick { e ->
+ (this@RoTab.parent as? RoTabPanelNav)?.tabPanel?.activeTab = this
+ e.preventDefault()
+ if (route != null) {
+ RoutingManager.getRouter().kvNavigate(route)
+ }
+ }
+ if (route != null) RoutingManager.getRouter().kvOn(route, routingHandler)
+ @Suppress("LeakingThis")
+ init?.invoke(this)
+ }
+
+ override fun setDragDropData(format: String, data: String) {
+ link.setDragDropData(format, data)
+ }
+
+ override fun childrenVNodes(): Array<VNode> {
+ return (privateChildren).filter { it.visible }.map { it.renderVNode() }.toTypedArray()
+ }
+
+ override fun dispose() {
+ super.dispose()
+ if (route != null) RoutingManager.getRouter().kvOff(routingHandler)
+ }
+
+ companion object {
+ internal var counter = 0
+ }
+}
+
+/**
+ * DSL builder extension function.
+ *
+ * It takes the same parameters as the constructor of the built component.
+ */
+fun RoTabPanel.tab(
+ label: String? = null, icon: String? = null,
+ image: ResString? = null, closable: Boolean = false, route: String? = null,
+ init: (RoTab.() -> Unit)? = null
+): RoTab {
+ val tab = RoTab(label, icon, image, closable, route, init)
+ this.add(tab)
+ return tab
+}
+
+/**
+ * DSL builder extension function for observable state.
+ *
+ * It takes the same parameters as the constructor of the built component.
+ */
+fun <S> RoTabPanel.tab(
+ state: ObservableState<S>,
+ label: String? = null, icon: String? = null,
+ image: ResString? = null, closable: Boolean = false, route: String? = null,
+ init: (RoTab.(S) -> Unit)
+) = tab(label, icon, image, closable, route).bind(state, true, init)
+
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
new file mode 100644
index 0000000..4183743
--- /dev/null
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
@@ -0,0 +1,437 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.client.kroviz.ui.kv.override
+
+/**
+ * Copied from TabPanel in order to:
+ * * add IconMenu to (Ro)Tab
+ * * recreate svg from LogEntry on focus
+ */
+
+import com.github.snabbdom.VNode
+import io.kvision.core.*
+import io.kvision.panel.SimplePanel
+import io.kvision.panel.VPanel
+import io.kvision.routing.RoutingManager
+import io.kvision.state.ObservableState
+import io.kvision.state.bind
+import io.kvision.utils.obj
+import io.kvision.utils.perc
+import io.kvision.utils.set
+import org.apache.isis.client.kroviz.ui.core.RoView
+
+/**
+ * Tab position.
+ */
+enum class TabPosition {
+ TOP,
+ LEFT,
+ RIGHT
+}
+
+/**
+ * Left or right tab size.
+ */
+enum class SideTabSize {
+ SIZE_1,
+ SIZE_2,
+ SIZE_3,
+ SIZE_4,
+ SIZE_5,
+ SIZE_6
+}
+
+/**
+ * The container rendering its children as tabs.
+ *
+ * It supports activating children by a JavaScript route.
+ *
+ * @constructor
+ * @param tabPosition tab position
+ * @param sideTabSize side tab size
+ * @param scrollableTabs determines if tabs are scrollable (default: false)
+ * @param draggableTabs determines if tabs are draggable (default: false)
+ * @param classes a set of CSS class names
+ * @param init an initializer extension function
+ */
+@Suppress("LeakingThis")
+open class RoTabPanel(
+ private val tabPosition: TabPosition = TabPosition.TOP,
+ private val sideTabSize: SideTabSize = SideTabSize.SIZE_3,
+ val scrollableTabs: Boolean = false,
+ val draggableTabs: Boolean = false,
+ classes: Set<String> = setOf(),
+ init: (RoTabPanel.() -> Unit)? = null
+) : SimplePanel(classes) {
+
+ private val navClasses = when (tabPosition) {
+ TabPosition.TOP -> if (scrollableTabs) setOf("nav", "nav-tabs", "tabs-top") else setOf("nav", "nav-tabs")
+ TabPosition.LEFT -> setOf("nav", "nav-tabs", "tabs-left", "flex-column")
+ TabPosition.RIGHT -> setOf("nav", "nav-tabs", "tabs-right", "flex-column")
+ }
+
+ internal val tabs = mutableListOf<RoTab>()
+
+ private val nav = RoTabPanelNav(this, navClasses)
+ private val content = RoTabPanelContent(this)
+
+ /**
+ * The index of the active tab.
+ */
+ var activeIndex: Int = -1
+ set(value) {
+ if (value >= -1 && value < tabs.size) {
+ field = value
+ tabs.forEach {
+ it.link.removeCssClass("active")
+ }
+ tabs.getOrNull(value)?.link?.addCssClass("active")
+ @Suppress("UnsafeCastFromDynamic")
+ this.dispatchEvent("tabChange", obj { detail = obj { data = value } })
+ }
+ }
+
+ /**
+ * The active tab.
+ */
+ var activeTab: RoTab?
+ get() = tabs.getOrNull(activeIndex)
+ set(value) {
+ activeIndex = value?.let { tabs.indexOf(value) } ?: -1
+ }
+
+ init {
+ width = 100.perc
+ marginTop = CssSize(40, UNIT.px)
+ when (tabPosition) {
+ TabPosition.TOP -> {
+ this.addPrivate(nav)
+ this.addPrivate(content)
+ }
+ TabPosition.LEFT -> {
+ this.addSurroundingCssClass("container-fluid")
+ this.addCssClass("row")
+ val sizes = calculateSideClasses()
+ this.addPrivate(WidgetWrapper(nav, setOf(sizes.first, "pl-0", "pr-0")))
+ this.addPrivate(WidgetWrapper(content, setOf(sizes.second, "pl-0", "pr-0")))
+ }
+ TabPosition.RIGHT -> {
+ this.addSurroundingCssClass("container-fluid")
+ this.addCssClass("row")
+ val sizes = calculateSideClasses()
+ this.addPrivate(WidgetWrapper(content, setOf(sizes.second, "pl-0", "pr-0")))
+ this.addPrivate(WidgetWrapper(nav, setOf(sizes.first, "pl-0", "pr-0")))
+ }
+ }
+ init?.invoke(this)
+ }
+
+ private fun calculateSideClasses(): Pair<String, String> {
+ return when (sideTabSize) {
+ SideTabSize.SIZE_1 -> Pair("col-sm-1", "col-sm-11")
+ SideTabSize.SIZE_2 -> Pair("col-sm-2", "col-sm-10")
+ SideTabSize.SIZE_3 -> Pair("col-sm-3", "col-sm-9")
+ SideTabSize.SIZE_4 -> Pair("col-sm-4", "col-sm-8")
+ SideTabSize.SIZE_5 -> Pair("col-sm-5", "col-sm-7")
+ SideTabSize.SIZE_6 -> Pair("col-sm-6", "col-sm-6")
+ }
+ }
+
+ /**
+ * Returns the number of tabs.
+ */
+ open fun getSize(): Int {
+ return tabs.size
+ }
+
+ /**
+ * Returns the list of tabs.
+ */
+ open fun getTabs(): List<RoTab> {
+ return tabs
+ }
+
+ /**
+ * Get the Tab component by index.
+ * @param index the index of a Tab
+ */
+ open fun getTab(index: Int): RoTab? {
+ return tabs.getOrNull(index)
+ }
+
+ /**
+ * Get the index of the given tab.
+ * @param tab a Tab component
+ */
+ open fun getTabIndex(tab: RoTab): Int {
+ return tabs.indexOf(tab)
+ }
+
+ /**
+ * Removes tab at given index.
+ * @param index the index of the tab
+ */
+ open fun removeTab(index: Int): RoTabPanel {
+ val tab = getTabs().get(index)
+ RoView.removeTab(tab as SimplePanel)
+
+ getTab(index)?.let {
+ removeTab(it)
+ refresh()
+ }
+ return this
+ }
+
+ /**
+ * Find the tab which contains the given component.
+ * @param component a component
+ */
+ open fun findTabWithComponent(component: Component): RoTab? {
+ return tabs.find { it.getChildren().contains(component) }
+ }
+
+ /**
+ * Move the tab to a different position.
+ * @param fromIndex source tab index
+ * @param toIndex destination tab index
+ */
+ open fun moveTab(fromIndex: Int, toIndex: Int) {
+ tabs.getOrNull(fromIndex)?.let {
+ tabs.remove(it)
+ tabs.add(toIndex, it)
+ if (activeIndex == fromIndex) {
+ activeIndex = toIndex
+ } else if (activeIndex in (fromIndex + 1)..toIndex) {
+ activeIndex--
+ } else if (activeIndex in toIndex until fromIndex) {
+ activeIndex++
+ }
+ refresh()
+ }
+ }
+
+ /**
+ * Add new Tab component.
+ * @param tab a Tab component
+ * @param position tab position
+ */
+ protected open fun addTab(tab: RoTab, position: Int? = null) {
+ tab.parent = nav
+ if (position == null) {
+ tabs.add(tab)
+ } else {
+ tabs.add(position, tab)
+ }
+ if (tabs.size == 1) {
+ tab.link.addCssClass("active")
+ activeIndex = 0
+ }
+ if (draggableTabs) {
+ tab.setDragDropData("text/plain", tab.tabId.toString())
+ tab.setDropTargetData("text/plain") { data ->
+ val toIdx = getTabIndex(tab)
+ data?.toIntOrNull()?.let { tabId ->
+ tabs.find { it.tabId == tabId }?.let {
+ val fromIdx = getTabIndex(it)
+ moveTab(fromIdx, toIdx)
+ }
+ }
+ }
+ }
+ if (tab.route != null) {
+ RoutingManager.getRouter().kvResolve()
+ }
+ }
+
+ /**
+ * Add new child component.
+ * @param child a child component
+ * @param position tab position
+ */
+ protected open fun addChild(child: Component, position: Int? = null) {
+ if (child is RoTab) {
+ addTab(child, position)
+ } else {
+ addTab(RoTab("", child), position)
+ }
+ }
+
+ /**
+ * Delete the given Tab component.
+ * @param tab a Tab component
+ */
+ protected open fun removeTab(tab: RoTab) {
+ val index = tabs.indexOf(tab)
+ if (index >= 0) {
+ tabs.remove(tab)
+ tab.parent = null
+ if (activeIndex >= tabs.size) {
+ activeIndex = tabs.size - 1
+ } else if (activeIndex > index) {
+ activeIndex--
+ } else if (activeIndex == index) {
+ activeIndex = activeIndex
+ }
+ }
+ }
+
+ override fun add(child: Component): RoTabPanel {
+ addChild(child)
+ refresh()
+ return this
+ }
+
+ override fun add(position: Int, child: Component): RoTabPanel {
+ addChild(child, position)
+ refresh()
+ return this
+ }
+
+ /**
+ * Creates and adds new tab component.
+ * @param title title of the tab
+ * @param panel child component
+ * @param icon icon of the tab
+ * @param image image of the tab
+ * @param closable determines if this tab is closable
+ * @param route JavaScript route to activate given child
+ * @return current container
+ */
+ open fun addTab(
+ title: String, panel: Component, icon: String? = null,
+ image: ResString? = null, closable: Boolean = false, route: String? = null
+ ): RoTabPanel {
+ addTab(RoTab(title, panel, icon, image, closable, route))
+ refresh()
+ return this
+ }
+
+ override fun addAll(children: List<Component>): RoTabPanel {
+ children.forEach(::addChild)
+ refresh()
+ return this
+ }
+
+ override fun remove(child: Component): RoTabPanel {
+ if (child is RoTab) {
+ removeTab(child)
+ refresh()
+ } else {
+ findTabWithComponent(child)?.let {
+ removeTab(it)
+ refresh()
+ }
+ }
+ return this
+ }
+
+ override fun removeAt(position: Int): RoTabPanel {
+ if (position >= 0 && position < tabs.size) {
+ val tab = tabs.removeAt(position)
+ tab.parent = null
+ if (activeIndex >= tabs.size) {
+ activeIndex = tabs.size - 1
+ } else if (activeIndex > position) {
+ activeIndex--
+ } else if (activeIndex == position) {
+ activeIndex = activeIndex
+ }
+ }
+ return this
+ }
+
+ override fun removeAll(): RoTabPanel {
+ tabs.forEach { removeTab(it) }
+ return this
+ }
+
+ override fun disposeAll(): RoTabPanel {
+ tabs.forEach { it.dispose() }
+ removeAll()
+ return this
+ }
+
+ fun findTab(title: String): Int? {
+ getTabs().forEachIndexed { index, component ->
+ if ((component is VPanel) && (component.title == title)) {
+ return index
+ }
+ }
+ return null
+ }
+
+}
+
+/**
+ * DSL builder extension function.
+ *
+ * It takes the same parameters as the constructor of the built component.
+ */
+fun Container.tabPanel(
+ tabPosition: TabPosition = TabPosition.TOP,
+ sideTabSize: SideTabSize = SideTabSize.SIZE_3,
+ scrollableTabs: Boolean = false,
+ draggableTabs: Boolean = false,
+ classes: Set<String>? = null,
+ className: String? = null,
+ init: (RoTabPanel.() -> Unit)? = null
+): RoTabPanel {
+ val tabPanel = RoTabPanel(tabPosition, sideTabSize, scrollableTabs, draggableTabs, classes ?: className.set, init)
+ this.add(tabPanel)
+ return tabPanel
+}
+
+/**
+ * DSL builder extension function for observable state.
+ *
+ * It takes the same parameters as the constructor of the built component.
+ */
+fun <S> Container.tabPanel(
+ state: ObservableState<S>,
+ tabPosition: TabPosition = TabPosition.TOP,
+ sideTabSize: SideTabSize = SideTabSize.SIZE_3,
+ scrollableTabs: Boolean = false,
+ draggableTabs: Boolean = false,
+ classes: Set<String>? = null,
+ className: String? = null,
+ init: (RoTabPanel.(S) -> Unit)
+) = tabPanel(tabPosition, sideTabSize, scrollableTabs, draggableTabs, classes, className).bind(state, true, init)
+
+
+internal class RoTabPanelNav(internal val tabPanel: RoTabPanel, classes: Set<String>) : SimplePanel(classes) {
+
+ override fun render(): VNode {
+ return render("ul", childrenVNodes())
+ }
+
+ override fun childrenVNodes(): Array<VNode> {
+ return tabPanel.tabs.filter { it.visible }.map { it.renderVNode() }.toTypedArray()
+ }
+
+}
+
+internal class RoTabPanelContent(private val tabPanel: RoTabPanel) : SimplePanel() {
+
+ override fun childrenVNodes(): Array<VNode> {
+ return tabPanel.tabs.getOrNull(tabPanel.activeIndex)?.getChildren()?.map { it.renderVNode() }?.toTypedArray()
+ ?: emptyArray()
+ }
+
+}
+
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoWindow.kt
similarity index 91%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoWindow.kt
index f8d1ba8..5f5d1f1 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/RoWindow.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoWindow.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.kv.override
/* (!) copied from io.kvision.window.Window in order to make
* Dialogs transparent on move
@@ -26,7 +26,6 @@ package org.apache.isis.client.kroviz.ui.kv
import com.github.snabbdom.VNode
import io.kvision.core.*
import io.kvision.dropdown.DropDown
-import io.kvision.dropdown.separator
import io.kvision.html.*
import io.kvision.modal.CloseIcon
import io.kvision.panel.SimplePanel
@@ -36,6 +35,7 @@ import io.kvision.window.MaximizeIcon
import io.kvision.window.MinimizeIcon
import org.w3c.dom.events.Event
import org.w3c.dom.events.MouseEvent
+import io.kvision.html.Link as KvisionHtmlLink
internal const val DEFAULT_Z_INDEX = 900
internal const val WINDOW_HEADER_HEIGHT = 40
@@ -68,6 +68,7 @@ open class RoWindow(
minimizeButton: Boolean = true,
icon: String? = null,
classes: Set<String> = setOf(),
+ menu: List<KvisionHtmlLink>? = null,
init: (RoWindow.() -> Unit)? = null
) :
SimplePanel(classes + setOf("modal-content", "kv-window")) {
@@ -177,13 +178,14 @@ open class RoWindow(
}
private val iconsContainer = SimplePanel(setOf("kv-window-icons-container"))
- /* private val windowIcon = Icon(icon ?: "").apply {
- addCssClass("window-icon")
- visible = (icon != null && icon != "")
- } */
- private val windowIcon = DropDown(
+ private val windowIcon = Icon(icon ?: "").apply {
+ addCssClass("window-icon")
+ visible = (icon != null && icon != "")
+ }
+
+ private val windowButton = DropDown(
text = "",
- icon = icon,
+ icon = windowIcon.icon,
style = ButtonStyle.LIGHT).apply {
marginLeft = CssSize(-16, UNIT.px)
marginTop = CssSize(-1, UNIT.px)
@@ -203,14 +205,29 @@ open class RoWindow(
width = contentWidth
@Suppress("LeakingThis")
zIndex = ++zIndexCounter
- amendMenu(windowIcon)
- header.add(windowIcon)
- windowIcon.setEventListener<Icon> {
- click = { _ ->
- console.log("[RoWindow.windowIcon.click]")
+ if (menu == null) {
+ header.add(windowIcon)
+ } else {
+ val windowButton = DropDown(
+ text = "",
+ icon = icon,
+ style = ButtonStyle.LIGHT).apply {
+ marginLeft = CssSize(-16, UNIT.px)
+ marginTop = CssSize(-1, UNIT.px)
+// background = Background(color = Color.name(Col.WHITE))
+ addBsBgColor(BsBgColor.TRANSPARENT)
}
- mousedown = { e ->
- e.stopPropagation()
+ menu.forEach { m ->
+ windowButton.add(m)
+ }
+ header.add(windowButton)
+ windowButton.setEventListener<Icon> {
+ click = { _ ->
+ console.log("[RoWindow.windowButton.click]")
+ }
+ mousedown = { e ->
+ e.stopPropagation()
+ }
}
}
header.add(captionTag)
@@ -328,7 +345,6 @@ open class RoWindow(
)
}
-
private fun checkIsResizable() {
checkResizablEventHandler()
if (isResizable) {
@@ -443,22 +459,6 @@ open class RoWindow(
open fun toggleMinimize() {
}
- //TODO pass in menu in constructor?
- fun amendMenu(
- dd: DropDown) {
- dd.separator()
-
-// val saveLink = tObject.links.first()
- val saveAction = MenuFactory.buildActionLink(
- label = "save",
- menuTitle = "save")
- saveAction.onClick {
-// RoXmlHttpRequest().invoke(saveLink)
- }
- dd.add(saveAction)
- }
-
-
companion object {
internal var counter = 0
internal var zIndexCounter = DEFAULT_Z_INDEX
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/DropdownSearch.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt
similarity index 94%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/DropdownSearch.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt
index 6d14451..a933d42 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/DropdownSearch.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt
@@ -16,18 +16,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.panel
-import kotlinx.coroutines.delay
-import kotlinx.serialization.Serializable
import io.kvision.form.formPanel
import io.kvision.form.select.AjaxOptions
import io.kvision.form.select.Select
-import io.kvision.utils.obj
-import io.kvision.utils.px
import io.kvision.panel.SimplePanel
+import io.kvision.utils.obj
import io.kvision.utils.pc
-import kotlin.js.Date
+import io.kvision.utils.px
+import kotlinx.serialization.Serializable
@Serializable
data class Form(
@@ -37,6 +35,7 @@ data class Form(
class DropdownSearch() : SimplePanel() {
val cachedValues = listOf("1" to "About", "2" to "Base", "3" to "Blog", "4" to "Contact", "5" to "Custom", "6" to "Support", "7" to "Tools")
+
init {
this.marginTop = 10.px
this.marginLeft = 40.px
@@ -47,7 +46,8 @@ class DropdownSearch() : SimplePanel() {
options = cachedValues,
label = "Dropdown search with in-memory values"
).apply {
- liveSearch = true}
+ liveSearch = true
+ }
)
add(Form::ajaxselect, Select(label = "Dropdown search on remote data source").apply {
emptyOption = true
@@ -67,4 +67,4 @@ class DropdownSearch() : SimplePanel() {
})
}
}
-}
\ No newline at end of file
+}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChart.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventChart.kt
similarity index 96%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChart.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventChart.kt
index 7a29a99..2865a9a 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventChart.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventChart.kt
@@ -16,13 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.panel
import io.kvision.chart.*
import io.kvision.panel.SimplePanel
import io.kvision.utils.obj
import io.kvision.utils.px
import io.kvision.utils.pc
+import org.apache.isis.client.kroviz.ui.chart.ChartModel
//IMPROVE https://github.com/datavisyn/chartjs-chart-box-and-violin-plot
class EventChart(model: ChartModel) : SimplePanel() {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventLogTable.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt
similarity index 96%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventLogTable.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt
index da1945a..338c7e2 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventLogTable.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.panel
import io.kvision.core.*
import io.kvision.html.Button
@@ -28,7 +28,8 @@ import io.kvision.utils.obj
import io.kvision.utils.px
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.TObject
-import org.apache.isis.client.kroviz.ui.EventLogDetail
+import org.apache.isis.client.kroviz.ui.core.Constants
+import org.apache.isis.client.kroviz.ui.dialog.EventLogDetail
class EventLogTable(val model: List<LogEntry>) : VPanel() {
val tabulator: Tabulator<LogEntry>
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventLogTableMgr.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTableMgr.kt
similarity index 86%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventLogTableMgr.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTableMgr.kt
index 95cd5d7..46b7401 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/EventLogTableMgr.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTableMgr.kt
@@ -17,12 +17,14 @@
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.panel
import org.apache.isis.client.kroviz.core.event.EventStore
-import org.apache.isis.client.kroviz.ui.DiagramDialog
-import org.apache.isis.client.kroviz.ui.EventExportDialog
-import org.apache.isis.client.kroviz.ui.UmlDiagram
+import org.apache.isis.client.kroviz.ui.dialog.DiagramDialog
+import org.apache.isis.client.kroviz.ui.dialog.EventExportDialog
+import org.apache.isis.client.kroviz.ui.uml.UmlDiagram
+import org.apache.isis.client.kroviz.ui.chart.ChartFactory
+import org.apache.isis.client.kroviz.ui.core.UiManager
import org.apache.isis.client.kroviz.utils.IconManager
class EventLogTableMgr {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/FormPanelFactory.kt
similarity index 98%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/FormPanelFactory.kt
index 4c5ef32..9d66407 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/FormPanelFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/FormPanelFactory.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.panel
import io.kvision.core.Component
import io.kvision.core.Overflow
@@ -42,7 +42,7 @@ import io.kvision.utils.auto
import io.kvision.utils.perc
import io.kvision.utils.px
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.FormItem
+import org.apache.isis.client.kroviz.ui.core.FormItem
import org.apache.isis.client.kroviz.utils.DateHelper
import org.apache.isis.client.kroviz.utils.UUID
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/GeoMap.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/GeoMap.kt
similarity index 94%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/GeoMap.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/GeoMap.kt
index 64b7564..e92a122 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/GeoMap.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/GeoMap.kt
@@ -16,10 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.samples
+package org.apache.isis.client.kroviz.ui.panel
-import org.apache.isis.client.kroviz.ui.kv.Constants
-import org.apache.isis.client.kroviz.ui.kv.RoIconBar
+import org.apache.isis.client.kroviz.ui.core.Constants
+import org.apache.isis.client.kroviz.ui.core.RoIconBar
import org.apache.isis.client.kroviz.utils.IconManager
import io.kvision.core.CssSize
import io.kvision.core.UNIT
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/PlantumlPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/PlantumlPanel.kt
similarity index 97%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/PlantumlPanel.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/PlantumlPanel.kt
index d54e486..65da659 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/PlantumlPanel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/PlantumlPanel.kt
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.samples
+package org.apache.isis.client.kroviz.ui.panel
import org.apache.isis.client.kroviz.utils.UmlUtils
import io.kvision.core.CssSize
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/SvgMap.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgMap.kt
similarity index 99%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/SvgMap.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgMap.kt
index 9e53156..29a6f12 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/samples/SvgMap.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgMap.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.samples
+package org.apache.isis.client.kroviz.ui.panel
import org.apache.isis.client.kroviz.utils.ScalableVectorGraphic
import io.kvision.maps.*
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/SvgPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgPanel.kt
similarity index 97%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/SvgPanel.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgPanel.kt
index a0612be..dd5564c 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/SvgPanel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgPanel.kt
@@ -17,7 +17,7 @@
* under the License.
*/
-package org.apache.isis.client.kroviz.ui.kv
+package org.apache.isis.client.kroviz.ui.panel
import org.apache.isis.client.kroviz.utils.ScalableVectorGraphic
import io.kvision.maps.*
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilder.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/PumlBuilder.kt
similarity index 97%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilder.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/PumlBuilder.kt
index c619916..c83ae51 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilder.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/PumlBuilder.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.uml
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.core.event.LogEntry
@@ -27,7 +27,7 @@ import org.apache.isis.client.kroviz.to.DomainType
import org.apache.isis.client.kroviz.to.HasLinks
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.Relation
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.UiManager
class PumlBuilder {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/UmlDiagram.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/UmlDiagram.kt
similarity index 97%
rename from incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/UmlDiagram.kt
rename to incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/UmlDiagram.kt
index 9a7b054..d172fa2 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/UmlDiagram.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/uml/UmlDiagram.kt
@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.client.kroviz.ui
+package org.apache.isis.client.kroviz.ui.uml
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.core.model.DiagramDM
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt
index 9fd4931..e686613 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/ScalableVectorGraphic.kt
@@ -18,7 +18,7 @@
*/
package org.apache.isis.client.kroviz.utils
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.core.Constants
import org.w3c.dom.Document
import org.w3c.dom.Image
import org.w3c.dom.parsing.DOMParser
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UmlUtils.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UmlUtils.kt
index c0283b5..6c83f37 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UmlUtils.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/UmlUtils.kt
@@ -23,7 +23,7 @@ import org.apache.isis.client.kroviz.core.event.RoXmlHttpRequest
import org.apache.isis.client.kroviz.to.Argument
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.Method
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.core.Constants
object UmlUtils {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt
index 712c778..e22db8c 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/XmlHelper.kt
@@ -18,7 +18,7 @@
*/
package org.apache.isis.client.kroviz.utils
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.core.Constants
import org.w3c.dom.Document
import org.w3c.dom.Node
import org.w3c.dom.asList
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/IntegrationTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/IntegrationTest.kt
index 77383d5..8e15ff0 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/IntegrationTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/IntegrationTest.kt
@@ -28,8 +28,8 @@ import org.apache.isis.client.kroviz.core.event.ResourceSpecification
import org.apache.isis.client.kroviz.handler.ResponseHandler
import org.apache.isis.client.kroviz.snapshots.Response
import org.apache.isis.client.kroviz.to.Method
-import org.apache.isis.client.kroviz.ui.kv.Constants
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.Constants
+import org.apache.isis.client.kroviz.ui.core.UiManager
import org.apache.isis.client.kroviz.utils.XmlHelper
import org.w3c.xhr.XMLHttpRequest
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/core/event/EventStoreTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/core/event/EventStoreTest.kt
index 6a9b46e..ce5c914 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/core/event/EventStoreTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/core/event/EventStoreTest.kt
@@ -23,7 +23,7 @@ import org.apache.isis.client.kroviz.core.aggregator.ListAggregator
import org.apache.isis.client.kroviz.core.aggregator.ObjectAggregator
import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.*
import org.apache.isis.client.kroviz.to.Method
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.core.Constants
import org.apache.isis.client.kroviz.utils.XmlHelper
import io.kvision.panel.VPanel
import kotlin.test.*
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/ResponseRegressionTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/ResponseRegressionTest.kt
index 1e36240..ad104b1 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/ResponseRegressionTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/ResponseRegressionTest.kt
@@ -22,10 +22,8 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import org.apache.isis.client.kroviz.snapshots.demo2_0_0.Response2Handler
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.Method
-import org.apache.isis.client.kroviz.ui.kv.UiManager
-import org.w3c.workers.Client
+import org.apache.isis.client.kroviz.ui.core.UiManager
import kotlin.test.BeforeTest
-import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/TestRequest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/TestRequest.kt
index 513671c..45303f1 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/TestRequest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/snapshots/TestRequest.kt
@@ -5,7 +5,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.await
import org.apache.isis.client.kroviz.IntegrationTest
import org.apache.isis.client.kroviz.to.Link
-import org.apache.isis.client.kroviz.ui.kv.Constants
+import org.apache.isis.client.kroviz.ui.core.Constants
import org.w3c.fetch.Response
import kotlin.js.Promise
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilderTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilderTest.kt
index 9082886..cce28e2 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilderTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/ui/PumlBuilderTest.kt
@@ -27,7 +27,8 @@ import org.apache.isis.client.kroviz.snapshots.Response
import org.apache.isis.client.kroviz.snapshots.simpleapp1_16_0.*
import org.apache.isis.client.kroviz.to.DomainType
import org.apache.isis.client.kroviz.to.Method
-import org.apache.isis.client.kroviz.ui.kv.UiManager
+import org.apache.isis.client.kroviz.ui.core.UiManager
+import org.apache.isis.client.kroviz.ui.uml.PumlBuilder
import kotlin.test.*
class PumlBuilderTest {
[isis] 11/12: SVG passed (instead of UUID),
functionality moved to UiManager, diagram xTimes in RoTab
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 0ffdeb0a15cf3eff0b5558fbe53500ae6ac93005
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Mon May 10 08:47:11 2021 +0200
SVG passed (instead of UUID), functionality moved to UiManager, diagram xTimes in RoTab
---
.../isis/client/kroviz/core/event/EventStore.kt | 11 ++----
.../isis/client/kroviz/core/event/LogEntry.kt | 9 +++--
.../apache/isis/client/kroviz/ui/core/RoView.kt | 9 ++---
.../apache/isis/client/kroviz/ui/core/UiManager.kt | 41 +++++++++++++++++-----
.../isis/client/kroviz/ui/dialog/DiagramDialog.kt | 31 ++++++----------
.../isis/client/kroviz/ui/kv/override/RoTab.kt | 24 +++----------
.../client/kroviz/ui/kv/override/RoTabPanel.kt | 6 ++--
.../org/apache/isis/client/kroviz/utils/DomUtil.kt | 10 ++++--
8 files changed, 69 insertions(+), 72 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
index 128d4e3..510c7a5 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
@@ -66,10 +66,9 @@ object EventStore {
updateStatus(entry)
}
- fun addView(title: String, aggregator: BaseAggregator, panel: SimplePanel, obj: Any?) {
+ fun addView(title: String, aggregator: BaseAggregator, panel: SimplePanel) {
val entry = LogEntry(title = title, aggregator = aggregator)
- entry.obj = panel
- // entry.obj = obj
+ entry.panel = panel
log(entry)
updateStatus(entry)
}
@@ -137,12 +136,6 @@ object EventStore {
}
}
- fun findByView(uuid: UUID): LogEntry? {
- return log.firstOrNull() {
- (it.obj is ScalableVectorGraphic) && ((it.obj as ScalableVectorGraphic).uuid == uuid)
- }
- }
-
fun findMenuBars(): LogEntry? {
return log.firstOrNull() {
it.obj is Menubars
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
index 6b51b47..3db0788 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
@@ -19,15 +19,14 @@
package org.apache.isis.client.kroviz.core.event
import io.kvision.html.ButtonStyle
+import io.kvision.panel.SimplePanel
import kotlinx.serialization.Contextual
import kotlinx.serialization.Serializable
import org.apache.isis.client.kroviz.core.aggregator.BaseAggregator
import org.apache.isis.client.kroviz.to.TransferObject
import org.apache.isis.client.kroviz.ui.core.Constants
import org.apache.isis.client.kroviz.ui.core.UiManager
-import org.apache.isis.client.kroviz.utils.UUID
import org.apache.isis.client.kroviz.utils.Utils.removeHexCode
-import org.apache.isis.client.kroviz.utils.XmlHelper
import kotlin.js.Date
// use color codes from css instead?
@@ -63,7 +62,8 @@ data class LogEntry(
init {
state = EventState.RUNNING
title = url // stripHostPort(url)
- requestLength = request?.length ?: 0 // if this is simplyfied to request.length, Tabulator.js goes in ERROR and EventLogTable shows no entries
+ requestLength = request?.length
+ ?: 0 // if this is simplyfied to request.length, Tabulator.js goes in ERROR and EventLogTable shows no entries
}
@Contextual
@@ -85,6 +85,9 @@ data class LogEntry(
@Contextual
var obj: Any? = null
+ @Contextual
+ var panel: SimplePanel? = null
+
// alternative constructor for UI events (eg. from user interaction)
@JsName("secondaryConstructor")
constructor(title: String, aggregator: BaseAggregator) : this("", "", "") {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
index fc21346..a95cd4e 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoView.kt
@@ -18,13 +18,12 @@
*/
package org.apache.isis.client.kroviz.ui.core
-import org.apache.isis.client.kroviz.utils.IconManager
import io.kvision.core.BsBorder
import io.kvision.core.Component
import io.kvision.core.addBsBorder
import io.kvision.panel.SimplePanel
import org.apache.isis.client.kroviz.ui.kv.override.RoTabPanel
-import org.apache.isis.client.kroviz.utils.UUID
+import org.apache.isis.client.kroviz.utils.IconManager
/**
* Area between menu bar at the top and the status bar at the bottom.
@@ -37,8 +36,7 @@ object RoView {
fun addTab(
title: String,
- panel: Component,
- uuid: UUID?) {
+ panel: Component) {
panel.addBsBorder(BsBorder.BORDER)
val index = tabPanel.findTab(title)
if (index != null) {
@@ -55,8 +53,7 @@ object RoView {
panel,
icon,
image = null,
- closable = true,
- uuid = uuid)
+ closable = true)
tabPanel.activeIndex = tabCount
tabCount += 1
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
index 6ca4ec1..4585a77 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/UiManager.kt
@@ -34,7 +34,10 @@ import org.apache.isis.client.kroviz.core.model.ListDM
import org.apache.isis.client.kroviz.core.model.ObjectDM
import org.apache.isis.client.kroviz.to.Relation
import org.apache.isis.client.kroviz.to.TObject
+import org.apache.isis.client.kroviz.to.ValueType
import org.apache.isis.client.kroviz.to.mb.Menubars
+import org.apache.isis.client.kroviz.ui.kv.override.RoTab
+import org.apache.isis.client.kroviz.utils.DomUtil
import org.apache.isis.client.kroviz.utils.ScalableVectorGraphic
import org.apache.isis.client.kroviz.utils.UUID
import org.apache.isis.client.kroviz.utils.Utils
@@ -78,13 +81,35 @@ object UiManager {
return null
}
- fun add(title: String, panel: SimplePanel, obj: Any? = null, aggregator: BaseAggregator = UndefinedDispatcher()) {
- var uuid: UUID? = null
- if (obj is ScalableVectorGraphic) {
- uuid = obj.uuid
- }
- RoView.addTab(title, panel, uuid)
- EventStore.addView(title, aggregator, panel, obj)
+ fun add(title: String, panel: SimplePanel, aggregator: BaseAggregator = UndefinedDispatcher()) {
+ RoView.addTab(title, panel)
+ EventStore.addView(title, aggregator, panel)
+ }
+
+ /**
+ * SVG code added to Tabs disappears after a refresh, therefore an SVG object (code, uuid)
+ * is added as attribute to the tab in order to being able to recreate it on refresh.
+ */
+ fun addSvg(title: String, svgCode: String) {
+ val uuid = UUID()
+ DomUtil.appendTo(uuid, svgCode)
+
+ val panel = buildSvgPanel(uuid)
+ RoView.addTab(title, panel)
+ val tab = RoView.findActive()!! as RoTab
+
+ val svg = ScalableVectorGraphic(svgCode, uuid)
+ tab.svg = svg
+
+ val aggregator: BaseAggregator = UndefinedDispatcher()
+ EventStore.addView(title, aggregator, panel)
+ }
+
+ private fun buildSvgPanel(uuid: UUID): FormPanelFactory {
+ val formItems = mutableListOf<FormItem>()
+ val newFi = FormItem("svg", ValueType.SVG_INLINE, callBack = uuid)
+ formItems.add(newFi)
+ return FormPanelFactory(formItems)
}
fun closeView(tab: SimplePanel) {
@@ -112,7 +137,7 @@ object UiManager {
val displayable = aggregator.dpm
val title: String = Utils.extractTitle(displayable.title)
val panel = RoTable(displayable as ListDM)
- add(title, panel, null, aggregator)
+ add(title, panel, aggregator)
displayable.isRendered = true
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt
index 64514bd..810affd 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/DiagramDialog.kt
@@ -18,10 +18,12 @@
*/
package org.apache.isis.client.kroviz.ui.dialog
-import io.kvision.panel.VPanel
import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.to.ValueType
-import org.apache.isis.client.kroviz.ui.core.*
+import org.apache.isis.client.kroviz.ui.core.FormItem
+import org.apache.isis.client.kroviz.ui.core.MenuFactory
+import org.apache.isis.client.kroviz.ui.core.RoDialog
+import org.apache.isis.client.kroviz.ui.core.UiManager
import org.apache.isis.client.kroviz.utils.*
import io.kvision.html.Link as KvisionHtmlLink
@@ -58,33 +60,20 @@ class DiagramDialog(
}
private fun pin() {
- val newUuid = UUID()
- val newSvg= getDiagram(newUuid)
- val panel = buildNewPanel(newUuid)
- console.log("[DD.pin]")
- console.log(panel)
- console.log(panel.panel!!.getChildren().first())
- UiManager.add("Diagram", panel, newSvg)
- DomUtil.replaceWith(newUuid, newSvg)
+ val svgCode = getDiagramCode()
+ UiManager.addSvg("Diagram", svgCode)
dialog.close()
}
- private fun getDiagram(newUuid:UUID?): ScalableVectorGraphic {
+ private fun getDiagramCode(): String {
val logEntry = EventStore.findByDispatcher(callBack as UUID)
- val svgStr = logEntry.getResponse()
- return ScalableVectorGraphic(svgStr, newUuid)
- }
-
- private fun buildNewPanel(newUuid: UUID): FormPanelFactory {
- val formItems = mutableListOf<FormItem>()
- val newFi = FormItem("svg", ValueType.SVG_INLINE, callBack = newUuid)
- formItems.add(newFi)
- return FormPanelFactory(formItems)
+ return logEntry.getResponse()
}
@Deprecated("use leaflet/svg")
fun scale(direction: Direction) {
- val svg = getDiagram(null)
+ val svgCode = getDiagramCode()
+ val svg = ScalableVectorGraphic(svgCode)
when (direction) {
Direction.UP -> svg.scaleUp()
Direction.DOWN -> svg.scaleDown()
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt
index d3d1fd7..4b017d2 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTab.kt
@@ -36,10 +36,8 @@ import io.kvision.routing.RoutingManager
import io.kvision.state.ObservableState
import io.kvision.state.bind
import io.kvision.utils.obj
-import org.apache.isis.client.kroviz.core.event.EventStore
import org.apache.isis.client.kroviz.utils.DomUtil
import org.apache.isis.client.kroviz.utils.ScalableVectorGraphic
-import org.apache.isis.client.kroviz.utils.UUID
/**
* The single Tab component inside the TabPanel container.
@@ -58,7 +56,6 @@ open class RoTab(
image: ResString? = null,
closable: Boolean = false,
val route: String? = null,
- val uuid: UUID? = null,
init: (RoTab.() -> Unit)? = null
) : Tag(TAG.LI, classes = setOf("nav-item")) {
@@ -69,27 +66,16 @@ open class RoTab(
image: ResString? = null,
closable: Boolean = false,
route: String? = null,
- uuid: UUID? = null,
init: (RoTab.() -> Unit)? = null
- ) : this(label, icon, image, closable, route, uuid, init) {
+ ) : this(label, icon, image, closable, route, init) {
@Suppress("LeakingThis")
add(child)
}
+ var svg: ScalableVectorGraphic? = null
+
override fun render(): VNode {
- if (uuid != null) {
- console.log("[RT.render]")
- console.log(uuid)
- val logEntry = EventStore.findByView(uuid)
- if (logEntry != null) {
- val svgStr = logEntry.getResponse()
- console.log(svgStr)
- val newImage = ScalableVectorGraphic(svgStr)
- val uuid = UUID(this.id!!)
- console.log(uuid)
- DomUtil.replaceWith(uuid, newImage)
- }
- }
+ if (svg != null) DomUtil.appendTo(svg!!)
return super.render()
}
@@ -205,7 +191,7 @@ fun RoTabPanel.tab(
image: ResString? = null, closable: Boolean = false, route: String? = null,
init: (RoTab.() -> Unit)? = null
): RoTab {
- val tab = RoTab(label, icon, image, closable, route, null, init)
+ val tab = RoTab(label, icon, image, closable, route, init)
this.add(tab)
return tab
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
index 2611087..7a44259 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
@@ -35,7 +35,6 @@ import io.kvision.utils.obj
import io.kvision.utils.perc
import io.kvision.utils.set
import org.apache.isis.client.kroviz.ui.core.RoView
-import org.apache.isis.client.kroviz.utils.UUID
/**
* Tab position.
@@ -321,10 +320,9 @@ open class RoTabPanel(
*/
open fun addTab(
title: String, panel: Component, icon: String? = null,
- image: ResString? = null, closable: Boolean = false, route: String? = null,
- uuid: UUID? = null
+ image: ResString? = null, closable: Boolean = false, route: String? = null
): RoTabPanel {
- addTab(RoTab(title, panel, icon, image, closable, route, uuid))
+ addTab(RoTab(title, panel, icon, image, closable, route))
refresh()
return this
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/DomUtil.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/DomUtil.kt
index 2d000c9..6506d9c 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/DomUtil.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/DomUtil.kt
@@ -29,8 +29,14 @@ external fun encodeURIComponent(encodedURI: String): String
*/
object DomUtil {
- fun appendTo(uuid: UUID, response: String) {
- val svgDoc = ScalableVectorGraphic(response).document
+ fun appendTo(svg: ScalableVectorGraphic) {
+ val uuid = svg.uuid!!
+ val svgCode = svg.data
+ appendTo(uuid, svgCode)
+ }
+
+ fun appendTo(uuid: UUID, svgCode: String) {
+ val svgDoc = ScalableVectorGraphic(svgCode).document
append(uuid, svgDoc, false)
}
[isis] 01/12: convert (Diagram) Dialog to Tab
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-2505_Catch_Up_With_Demo_Examples
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 63273bd88a94af7a00eb4ea7c5a7e29f6e0c78ee
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Fri Apr 23 18:50:18 2021 +0200
convert (Diagram) Dialog to Tab
---
.../apache/isis/client/kroviz/ui/DiagramDialog.kt | 31 ++++-
.../apache/isis/client/kroviz/utils/IconManager.kt | 132 +++++++++++----------
2 files changed, 92 insertions(+), 71 deletions(-)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
index 6f49e7a..8f94f15 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/DiagramDialog.kt
@@ -19,12 +19,15 @@
package org.apache.isis.client.kroviz.ui
import org.apache.isis.client.kroviz.to.ValueType
+import org.apache.isis.client.kroviz.ui.kv.FormPanelFactory
import org.apache.isis.client.kroviz.ui.kv.RoDialog
+import org.apache.isis.client.kroviz.ui.kv.UiManager
import org.apache.isis.client.kroviz.utils.*
class DiagramDialog(
- var label: String,
- private var pumlCode: String) : Command() {
+ var label: String,
+ private var pumlCode: String
+) : Command() {
private var callBack: Any = UUID()
private var dialog: RoDialog
@@ -42,10 +45,26 @@ class DiagramDialog(
formItems.add(fi)
dialog = RoDialog(
- widthPerc = 80,
- caption = "Diagram",
- items = formItems,
- command = this)
+ widthPerc = 80,
+ caption = "Diagram",
+ items = formItems,
+ command = this,
+ defaultAction = "Pin"
+ )
+ }
+
+ override fun execute() {
+ val newFormItems = mutableListOf<FormItem>()
+ val newCallBack = UUID()
+ val newFi = FormItem("svg", ValueType.SVG_INLINE, callBack = newCallBack)
+ newFormItems.add(newFi)
+ val panel = FormPanelFactory(newFormItems)
+ UiManager.add("Diagram", panel)
+ val uuid = callBack as UUID
+ val oldElement = DomUtil.getById(uuid.value)!!
+ val oldStr = oldElement.innerHTML
+ val newImage = ScalableVectorGraphic(oldStr)
+ DomUtil.replaceWith(newCallBack, newImage)
}
@Deprecated("use leaflet/svg")
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/IconManager.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/IconManager.kt
index 84f401a..62fa8bc 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/IconManager.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/IconManager.kt
@@ -30,71 +30,73 @@ object IconManager {
/* Merge with configuration values*/
private val word2Icon = mapOf(
- "About" to "info",
- "Actions" to "ellipsis-v",
- "All" to "asterisk",
- "Blobs" to "cloud",
- "Burger" to "bars",
- "Chart" to "magic",
- "Close" to "times",
- "Configuration" to "wrench",
- "Connect" to "plug",
- "Console" to "terminal",
- "Create" to "plus",
- "Debug" to "bug",
- "Delete" to "trash",
- "Details" to "info-circle",
- "Diagram" to "project-diagram",
- "Download" to "download",
- "Factory" to "industry",
- "Featured" to "keyboard",
- "Featured Types" to "keyboard",
- "Edit" to "pencil",
- "Error Handling" to "bug",
- "Error" to "bug",
- "Event" to "road",
- "Experimental" to "flask",
- "Export" to "file-export",
- "Facet" to "gem",
- "Find" to "search",
- "Hierarchy" to "sitemap",
- "History" to "history",
- "Hsql" to "database",
- "Isis" to "ankh",
- "JEE/CDI" to "jedi",
- "List" to "list",
- "Location" to "map-marker",
- "Log" to "history",
- "Manager" to "manager",
- "Map" to "map",
- "Me" to "user",
- "Notification" to "bell",
- "Notifications" to "bell",
- "Object" to "cube",
- "Objects" to "cubes",
- "OK" to "check",
- "Open" to "book",
- "Other" to "asterisk",
- "Primitives" to "hashtag",
- "Prototyping" to "object-group",
- "Queen" to "chess-queen",
- "Run" to "rocket",
- "Save" to "file",
- "Security" to "lock",
- "Simple" to "cubes",
- "Switch" to "power-off",
- "Target" to "bullseye",
- "Text" to "font",
- "Toast" to "bread-slice", //comment-alt-plus/minus/exclamation
- "Toolbar" to "step-backward",
- "Tooltips" to "comment-alt",
- "Temporals" to "clock",
- "Trees" to "tree",
- "Types" to "typewriter",
- "Undo" to "undo",
- "Unknown" to "question",
- "Visualize" to "eye",
- "Wikipedia" to "wikipedia-w")
+ "About" to "info",
+ "Actions" to "ellipsis-v",
+ "All" to "asterisk",
+ "Blobs" to "cloud",
+ "Burger" to "bars",
+ "Chart" to "magic",
+ "Close" to "times",
+ "Configuration" to "wrench",
+ "Connect" to "plug",
+ "Console" to "terminal",
+ "Create" to "plus",
+ "Debug" to "bug",
+ "Delete" to "trash",
+ "Details" to "info-circle",
+ "Diagram" to "project-diagram",
+ "Download" to "download",
+ "Factory" to "industry",
+ "Featured" to "keyboard",
+ "Featured Types" to "keyboard",
+ "Edit" to "pencil",
+ "Error Handling" to "bug",
+ "Error" to "bug",
+ "Event" to "road",
+ "Experimental" to "flask",
+ "Export" to "file-export",
+ "Facet" to "gem",
+ "Find" to "search",
+ "Hierarchy" to "sitemap",
+ "History" to "history",
+ "Hsql" to "database",
+ "Isis" to "ankh",
+ "JEE/CDI" to "jedi",
+ "List" to "list",
+ "Location" to "map-marker",
+ "Log" to "history",
+ "Manager" to "manager",
+ "Map" to "map",
+ "Me" to "user",
+ "Notification" to "bell",
+ "Notifications" to "bell",
+ "Object" to "cube",
+ "Objects" to "cubes",
+ "OK" to "check",
+ "Open" to "book",
+ "Other" to "asterisk",
+ "Pin" to "pin",
+ "Primitives" to "hashtag",
+ "Prototyping" to "object-group",
+ "Queen" to "chess-queen",
+ "Run" to "rocket",
+ "Save" to "file",
+ "Security" to "lock",
+ "Simple" to "cubes",
+ "Switch" to "power-off",
+ "Target" to "bullseye",
+ "Text" to "font",
+ "Toast" to "bread-slice", //comment-alt-plus/minus/exclamation
+ "Toolbar" to "step-backward",
+ "Tooltips" to "comment-alt",
+ "Temporals" to "clock",
+ "Trees" to "tree",
+ "Types" to "typewriter",
+ "Undo" to "undo",
+ "Unknown" to "question",
+ "Visualize" to "eye",
+ "Wikipedia" to "wikipedia-w"
+ )
fun find(query: String): String {
if (query.startsWith("fa")) return query