Пример #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");
 }
Пример #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);
     }
   }
 }
Пример #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);
   }
 }
Пример #4
0
 @Override
 void dispose(boolean reflect) {
   clearChildren(reflect);
   super.dispose(reflect);
 }