diff --git a/src/main/java/com/zestedesavoir/zestwriter/view/com/MdTreeCell.java b/src/main/java/com/zestedesavoir/zestwriter/view/com/MdTreeCell.java index 6735e4136..261a5d9df 100644 --- a/src/main/java/com/zestedesavoir/zestwriter/view/com/MdTreeCell.java +++ b/src/main/java/com/zestedesavoir/zestwriter/view/com/MdTreeCell.java @@ -196,7 +196,8 @@ private void initContextMenu(ContentNode item) { File extFile = new File(extract.getFilePath()); FunctionTreeFactory.performCreateNewFile(extFile); saveManifestJson(); - index.openContent(content); + // add visual node + getTreeItem().getChildren().add(getTreeItem().getChildren().size()-1, FunctionTreeFactory.buildChild(new TreeItem<>((ContentNode) extract))); } }); @@ -229,7 +230,8 @@ private void initContextMenu(ContentNode item) { dirFile.mkdir(); } saveManifestJson(); - index.openContent(content); + // refresh visual + getTreeItem().getChildren().add(getTreeItem().getChildren().size()-1, FunctionTreeFactory.buildChild(new TreeItem<>((ContentNode) container))); } }); @@ -266,7 +268,8 @@ private void initContextMenu(ContentNode item) { ((Content) index.getSummary().getRoot().getValue()).setLicence(paramContent.get("licence").toString()); baseFilePath = ((Content) index.getSummary().getRoot().getValue()).getBasePath(); saveManifestJson(); - index.openContent(content); + // refresh visual + index.getSummary().refresh(); } } catch (Exception e) { logger.error(e.getMessage(), e); @@ -340,6 +343,7 @@ private void initContextMenu(ContentNode item) { currentNode.getChildren().forEach(x -> parentNode.getChildren().add(x)); parentNode.getChildren().remove(currentNode); saveManifestJson(); + // resfresh visual index.openContent(content); });