void (@Nullable WatchNodeImpl node) { WatchNodeImpl messageNode; int index = node != null ? myChildren.indexOf(node) : -1; if (index == -1) { int selectedIndex = myChildren.indexOf(ArrayUtil.getFirstElement(myTree.getSelectedNodes(WatchNodeImpl.class, null))); int targetIndex = selectedIndex == - 1 ? myChildren.size() : selectedIndex + 1; messageNode = new WatchNodeImpl(myTree, this, XExpressionImpl.EMPTY_EXPRESSION, (XStackFrame)null); myChildren.add(targetIndex, messageNode); fireNodeInserted(targetIndex); getTree().setSelectionRows(ArrayUtilRt.EMPTY_INT_ARRAY); } else { messageNode = node; } new WatchInplaceEditor(this, myWatchesView, messageNode, node).show(); }