@NotNull public DBPDataSourceContainer getDataSourceContainer() { for (DBNNode p = getParentNode(); p != null; p = p.getParentNode()) { if (p instanceof DBNDataSource) { return ((DBNDataSource) p).getDataSourceContainer(); } } throw new IllegalStateException("No parent datasource node"); }
protected void clearChildren(boolean reflect) { DBNDatabaseNode[] childrenCopy; synchronized (this) { childrenCopy = childNodes == null ? null : Arrays.copyOf(childNodes, childNodes.length); childNodes = null; } if (childrenCopy != null) { for (DBNNode child : childrenCopy) { child.dispose(reflect); } } }
void removeChildItem(DBSObject object) { DBNNode childNode = null; synchronized (this) { if (!ArrayUtils.isEmpty(childNodes)) { for (int i = 0; i < childNodes.length; i++) { final DBNDatabaseNode child = childNodes[i]; if (child.getObject() == object) { childNode = child; childNodes = ArrayUtils.remove(DBNDatabaseNode.class, childNodes, i); break; } } } } if (childNode != null) { childNode.dispose(true); } }
@Override void dispose(boolean reflect) { clearChildren(reflect); super.dispose(reflect); }