diff --git a/services/web/client/source/class/qxapp/component/widget/NodeExposed.js b/services/web/client/source/class/qxapp/component/widget/NodeExposed.js index 91bcb98cf3e..58915373b2d 100644 --- a/services/web/client/source/class/qxapp/component/widget/NodeExposed.js +++ b/services/web/client/source/class/qxapp/component/widget/NodeExposed.js @@ -25,11 +25,19 @@ qx.Class.define("qxapp.component.widget.NodeExposed", { }); let atom = new qx.ui.basic.Atom().set({ - label: nodeModel.getLabel() + "'s outputs", - center : true, + rich: true, + center: true, draggable: true, droppable: true }); + atom.getChildControl("label").set({ + textAlign: "center" + }); + nodeModel.bind("label", atom, "label", { + converter: function(data) { + return data + "'s
outputs"; + } + }); this._add(atom, { flex: 1 diff --git a/services/web/client/source/class/qxapp/component/widget/NodeInput.js b/services/web/client/source/class/qxapp/component/widget/NodeInput.js index c3a991aadfd..8e44a5d26dd 100644 --- a/services/web/client/source/class/qxapp/component/widget/NodeInput.js +++ b/services/web/client/source/class/qxapp/component/widget/NodeInput.js @@ -15,6 +15,8 @@ qx.Class.define("qxapp.component.widget.NodeInput", { extend: qx.ui.core.Widget, construct: function(nodeModel) { + this.setNodeModel(nodeModel); + this.base(); let nodeInputLayout = new qx.ui.layout.VBox(10); @@ -25,11 +27,11 @@ qx.Class.define("qxapp.component.widget.NodeInput", { }); let atom = new qx.ui.basic.Atom().set({ - label: nodeModel.getLabel(), center: true, draggable: true, droppable: true }); + nodeModel.bind("label", atom, "label"); const title16Font = qx.bom.Font.fromConfig(qxapp.theme.Font.fonts["title-16"]); atom.getChildControl("label").set({ font: title16Font @@ -38,8 +40,6 @@ qx.Class.define("qxapp.component.widget.NodeInput", { this._add(atom, { flex: 1 }); - - this.setNodeModel(nodeModel); }, properties: { diff --git a/services/web/client/source/class/qxapp/component/widget/NodePorts.js b/services/web/client/source/class/qxapp/component/widget/NodePorts.js index 66b28571483..e6f7cae08d0 100644 --- a/services/web/client/source/class/qxapp/component/widget/NodePorts.js +++ b/services/web/client/source/class/qxapp/component/widget/NodePorts.js @@ -26,11 +26,12 @@ qx.Class.define("qxapp.component.widget.NodePorts", { }); const title16Font = qx.bom.Font.fromConfig(qxapp.theme.Font.fonts["title-16"]); - let label = new qx.ui.basic.Label(nodeModel.getLabel()).set({ + let label = new qx.ui.basic.Label().set({ font: title16Font, alignX: "center", alignY: "middle" }); + nodeModel.bind("label", label, "value"); this._add(label); this.setIsInputModel(isInputModel); diff --git a/services/web/client/source/class/qxapp/component/widget/TreeTool.js b/services/web/client/source/class/qxapp/component/widget/TreeTool.js index d2b868cd3d7..06dee66ec4f 100644 --- a/services/web/client/source/class/qxapp/component/widget/TreeTool.js +++ b/services/web/client/source/class/qxapp/component/widget/TreeTool.js @@ -31,9 +31,11 @@ qx.Class.define("qxapp.component.widget.TreeTool", { let treeItemRenamer = new qxapp.component.widget.TreeItemRenamer(selectedItem); treeItemRenamer.addListener("LabelChanged", e => { - let data = e.getData(); - data["nodeId"] = selectedItem.getNodeId(); - this.fireDataEvent("NodeLabelChanged", data); + const data = e.getData(); + const newLabel = data.newLabel; + const nodeId = selectedItem.getNodeId(); + let nodeModel = this.getWorkbenchModel().getNodeModel(nodeId); + nodeModel.setLabel(newLabel); }, this); const bounds = this.getLayoutParent().getBounds(); treeItemRenamer.moveTo(bounds.left+100, bounds.top+150); @@ -43,8 +45,7 @@ qx.Class.define("qxapp.component.widget.TreeTool", { }, events: { - "NodeDoubleClicked": "qx.event.type.Data", - "NodeLabelChanged": "qx.event.type.Data" + "NodeDoubleClicked": "qx.event.type.Data" }, properties: { diff --git a/services/web/client/source/class/qxapp/component/workbench/NodeBase.js b/services/web/client/source/class/qxapp/component/workbench/NodeBase.js index 5297b29581d..c5e22da01aa 100644 --- a/services/web/client/source/class/qxapp/component/workbench/NodeBase.js +++ b/services/web/client/source/class/qxapp/component/workbench/NodeBase.js @@ -96,13 +96,13 @@ qx.Class.define("qxapp.component.workbench.NodeBase", { populateNodeLayout: function() { const nodeModel = this.getNodeModel(); - const metaData = nodeModel.getMetaData(); - this.setCaption(nodeModel.getLabel()); + nodeModel.bind("label", this, "caption"); if (nodeModel.isContainer()) { this.setIcon("@FontAwesome5Solid/folder-open/14"); } this.__inputPort = {}; this.__outputPort = {}; + const metaData = nodeModel.getMetaData(); if (metaData) { this.__createUIPorts(true, metaData.inputs); this.__createUIPorts(false, metaData.outputs); diff --git a/services/web/client/source/class/qxapp/data/model/NodeModel.js b/services/web/client/source/class/qxapp/data/model/NodeModel.js index 715bd52bb11..3992f74100e 100644 --- a/services/web/client/source/class/qxapp/data/model/NodeModel.js +++ b/services/web/client/source/class/qxapp/data/model/NodeModel.js @@ -74,7 +74,8 @@ qx.Class.define("qxapp.data.model.NodeModel", { label: { check: "String", - nullable: true + nullable: true, + event: "changeLabel" }, propsWidget: { diff --git a/services/web/client/source/class/qxapp/data/model/ProjectModel.js b/services/web/client/source/class/qxapp/data/model/ProjectModel.js index d7952c8df38..00d0e1a8b01 100644 --- a/services/web/client/source/class/qxapp/data/model/ProjectModel.js +++ b/services/web/client/source/class/qxapp/data/model/ProjectModel.js @@ -36,6 +36,7 @@ qx.Class.define("qxapp.data.model.ProjectModel", { check: "String", nullable: false, init: "New Project", + event: "changeName", apply : "__applyName" }, diff --git a/services/web/client/source/class/qxapp/data/model/WorkbenchModel.js b/services/web/client/source/class/qxapp/data/model/WorkbenchModel.js index 401ecedf50a..40b1db32ec4 100644 --- a/services/web/client/source/class/qxapp/data/model/WorkbenchModel.js +++ b/services/web/client/source/class/qxapp/data/model/WorkbenchModel.js @@ -52,38 +52,22 @@ qx.Class.define("qxapp.data.model.WorkbenchModel", { return nodes; }, - getPath: function(nodeId) { - let pathWithIds = this.getPathWithId(nodeId); - let nodePath = []; - for (let i=0; i").set({ font: navBarLabelFont }); diff --git a/services/web/client/source/class/qxapp/desktop/PrjEditor.js b/services/web/client/source/class/qxapp/desktop/PrjEditor.js index ad994d7ecaf..98a5a9f001a 100644 --- a/services/web/client/source/class/qxapp/desktop/PrjEditor.js +++ b/services/web/client/source/class/qxapp/desktop/PrjEditor.js @@ -115,15 +115,6 @@ qx.Class.define("qxapp.desktop.PrjEditor", { this.nodeSelected(nodeId); }, this); }); - - this.__treeView.addListener("NodeLabelChanged", function(e) { - const data = e.getData(); - const nodeId = data.nodeId; - const newLabel = data.newLabel; - - let nodeModel = this.getProjectModel().getWorkbenchModel().getNodeModel(nodeId); - nodeModel.setLabel(newLabel); - }, this); }, nodeSelected: function(nodeId) { @@ -199,8 +190,9 @@ qx.Class.define("qxapp.desktop.PrjEditor", { } this.__mainPanel.setMainView(widget); - let nodePath = this.getProjectModel().getWorkbenchModel().getPathWithId(nodeId); - this.fireDataEvent("ChangeMainViewCaption", nodePath); + + let nodesPath = this.getProjectModel().getWorkbenchModel().getPathIds(nodeId); + this.fireDataEvent("ChangeMainViewCaption", nodesPath); }, showInExtraView: function(widget) {