Example #1
0
 @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");
 }
Example #2
0
 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);
     }
   }
 }
Example #3
0
 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);
   }
 }
Example #4
0
 @Override
 void dispose(boolean reflect) {
   clearChildren(reflect);
   super.dispose(reflect);
 }