public String getSelectedNodeStringifiedValue() { NoSqlTreeNode lastSelectedResultNode = (NoSqlTreeNode) resultTableView.getTree().getLastSelectedPathComponent(); if (lastSelectedResultNode == null) { lastSelectedResultNode = (NoSqlTreeNode) resultTableView.getTree().getModel().getRoot(); } NodeDescriptor userObject = lastSelectedResultNode.getDescriptor(); if (userObject instanceof MongoResultDescriptor) { return stringifyResult(lastSelectedResultNode); } return userObject.toString(); }
private DBObject getSelectedMongoDocument() { TreeTableTree tree = resultTableView.getTree(); NoSqlTreeNode treeNode = (NoSqlTreeNode) tree.getLastSelectedPathComponent(); if (treeNode == null) { return null; } NodeDescriptor descriptor = treeNode.getDescriptor(); if (descriptor instanceof MongoKeyValueDescriptor) { MongoKeyValueDescriptor keyValueDescriptor = (MongoKeyValueDescriptor) descriptor; if (StringUtils.equals(keyValueDescriptor.getKey(), "_id")) { return mongoDocumentOperations.getMongoDocument(keyValueDescriptor.getValue()); } } return null; }
public boolean isSelectedNodeId() { if (resultTableView == null) { return false; } TreeTableTree tree = resultTableView.getTree(); NoSqlTreeNode treeNode = (NoSqlTreeNode) tree.getLastSelectedPathComponent(); if (treeNode == null) { return false; } NodeDescriptor descriptor = treeNode.getDescriptor(); if (descriptor instanceof MongoKeyValueDescriptor) { MongoKeyValueDescriptor keyValueDescriptor = (MongoKeyValueDescriptor) descriptor; return StringUtils.equals(keyValueDescriptor.getKey(), "_id"); } return false; }
void collapseAll() { TreeTableTree tree = resultTableView.getTree(); TreeUtil.collapseAll(tree, 1); }
void expandAll() { TreeUtil.expandAll(resultTableView.getTree()); }