Example #1
0
    public void addFile(final Path child) {
      checkCleanupLoading();

      // Util.getHeaderSafeHtml( images.file(), child.getFileName() )
      final TreeItem newFile = parent.addItem(TreeItem.Type.ITEM, child.getFileName());
      newFile.setUserObject(child);
    }
Example #2
0
    public void addDirectory(final Path child) {
      checkCleanupLoading();

      // Util.getHeaderSafeHtml( images.openedFolder(), child.getFileName() )
      final TreeItem newDirectory = parent.addItem(TreeItem.Type.FOLDER, child.getFileName());
      newDirectory.addItem(TreeItem.Type.LOADING, LAZY_LOAD);
      newDirectory.setUserObject(child);
    }
Example #3
0
 private void checkCleanupLoading() {
   if (parent.getChild(0) != null && parent.getChild(0).getUserObject() == null) {
     parent.getChild(0).remove();
   }
 }
Example #4
0
 private boolean needsLoading(final TreeItem item) {
   return item.getChildCount() == 1 && LAZY_LOAD.equals(item.getChild(0).getText());
 }