From 25251e64f9a7c467edee43ce384ffd4f975a8344 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Mon, 30 Oct 2017 22:05:17 +0300 Subject: [PATCH] Added info to storage view --- .../kotlin/inr/numass/viewer/StorageView.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/numass-viewer/src/main/kotlin/inr/numass/viewer/StorageView.kt b/numass-viewer/src/main/kotlin/inr/numass/viewer/StorageView.kt index 4d1b945e..cf868b7a 100644 --- a/numass-viewer/src/main/kotlin/inr/numass/viewer/StorageView.kt +++ b/numass-viewer/src/main/kotlin/inr/numass/viewer/StorageView.kt @@ -19,6 +19,7 @@ import javafx.beans.property.SimpleBooleanProperty import javafx.beans.property.SimpleObjectProperty import javafx.beans.property.SimpleStringProperty import javafx.geometry.Insets +import javafx.scene.control.ContextMenu import javafx.scene.control.TreeItem import javafx.scene.image.ImageView import javafx.scene.layout.Priority @@ -139,11 +140,27 @@ class StorageView(private val context: Context = Global.instance()) : View(title } } cellFormat { value -> + contextMenu = null when (value.content) { is Storage -> text = value.id is NumassSet -> { text = null graphic = checkbox(value.id, value.checkedProperty) + contextMenu = ContextMenu().apply { + item("Info") { + action { + openInternalBuilderWindow(title = "Info: ${value.id}", escapeClosesWindow = true) { + scrollpane { + textarea { + isEditable = false + isWrapText = true + text = value.content.meta.toString().replace(" ", "\n\t") + } + } + } + } + } + } } is NumassPoint -> { text = null