Is it possible to edit a textblock of a node after create? Here is what I have tried (see three commented out attempts below:
function createNode(location) {
var newNode = {text: "test", fields:[{name:"", isUnderline:false}], location: location};
var model = fileDiagram.model;
fileDiagram.commit(function() {
node = model.addNodeData(newNode);
});
var node = fileDiagram.findNodeForData(newNode);
node.isSelected = true;
// ATTEMPT 1: code to try to edit the node on creation
// fileDiagram.commandHandler.doKeyDown("q");
// fileDiagram.commandHandler.editTextBlock(node.findObject("ENTITY_TYPE"));
// ATTEMPT 2
// fileDiagram.toolManager.textEditingTool.textBlock = node;
// fileDiagram.toolManager.textEditingTool.doActivate();
// ATTEMPT 3
// fileDiagram.toolManager.textEditingTool.textBlock = node.findObject("ENTITY_TYPE");
// fileDiagram.toolManager.textEditingTool.doStart();
}
I have also swapped doStart and doActivate between attempts 2 and 3. Thanks in advance for your help.