コード例 #1
0
 private synchronized void reload() {
   if (!initialized) {
     executorService.submit(
         () -> {
           if (!super.getChildren().isEmpty()) {
             Platform.runLater(super.getChildren()::clear);
           }
           List<ShareNotificationMessage> removedShares = new LinkedList<>();
           for (ShareNotificationMessage message : notifications.getNotifications()) {
             try {
               final TreeItem<BoxObject> item = itemFromNotification(message);
               Platform.runLater(() -> super.getChildren().add(item));
             } catch (QblStorageNotFound e) {
               removedShares.add(message);
             } catch (Exception e) {
               logger.error("failed to load FM", e);
             }
           }
           for (ShareNotificationMessage message : removedShares) {
             notifications.remove(message);
           }
         });
     initialized = true;
   }
 }