Beispiel #1
0
 protected void reloadChildren(DBRProgressMonitor monitor) throws DBException {
   DBNDatabaseNode[] oldChildren;
   synchronized (this) {
     if (childNodes == null) {
       // Nothing to reload
       return;
     }
     oldChildren = Arrays.copyOf(childNodes, childNodes.length);
   }
   List<DBNDatabaseNode> newChildren = new ArrayList<>();
   loadChildren(monitor, getMeta(), oldChildren, newChildren);
   synchronized (this) {
     childNodes = newChildren.toArray(new DBNDatabaseNode[newChildren.size()]);
   }
 }
Beispiel #2
0
 @Override
 public DBNDatabaseNode[] getChildren(DBRProgressMonitor monitor) throws DBException {
   if (childNodes == null && allowsChildren()) {
     if (this.initializeNode(monitor, null)) {
       final List<DBNDatabaseNode> tmpList = new ArrayList<>();
       loadChildren(monitor, getMeta(), null, tmpList);
       if (!monitor.isCanceled()) {
         if (tmpList.isEmpty()) {
           this.childNodes = EMPTY_NODES;
         } else {
           this.childNodes = tmpList.toArray(new DBNDatabaseNode[tmpList.size()]);
         }
         this.afterChildRead();
       }
     }
   }
   return childNodes;
 }