Package org.eclipse.egit.ui.internal.repository.tree

Examples of org.eclipse.egit.ui.internal.repository.tree.FolderNode


      if (element instanceof FileNode) {
        FileNode fileNode = (FileNode) element;
        files.add(fileNode.getObject());
        nodeRepository = fileNode.getRepository();
      } else if (element instanceof FolderNode) {
        FolderNode folderNode = (FolderNode) element;
        files.add(folderNode.getObject());
        nodeRepository = folderNode.getRepository();
      } else {
        // Don't return input if selection is not file/folder
        return null;
      }
      if (repo == null)
View Full Code Here


          IPath relPath = fullPath.removeFirstSegments(workdirPath
              .segmentCount());
          for (String segment : relPath.segments()) {
            for (Object child : cp.getChildren(parentNode)) {
              if (child instanceof FolderNode) {
                FolderNode childFolder = (FolderNode) child;
                if (childFolder.getObject().getName().equals(
                    segment)) {
                  parentNode = childFolder;
                  break;
                }
              }
View Full Code Here

          return o1.compareTo(o2);
        }
      });
      for (File file : childFiles) {
        if (file.isDirectory()) {
          children.add(new FolderNode(node, repo, file));
        } else {
          children.add(new FileNode(node, repo, file));
        }
      }

      return children.toArray();
    }

    case FOLDER: {
      List<RepositoryTreeNode<File>> children = new ArrayList<RepositoryTreeNode<File>>();

      File parent = ((File) node.getObject());

      File[] childFiles = parent.listFiles();
      if (childFiles == null)
        return children.toArray();

      Arrays.sort(childFiles, new Comparator<File>() {
        public int compare(File o1, File o2) {
          if (o1.isDirectory()) {
            if (o2.isDirectory()) {
              return o1.compareTo(o2);
            }
            return -1;
          } else if (o2.isDirectory()) {
            return 1;
          }
          return o1.compareTo(o2);
        }
      });
      for (File file : childFiles) {
        if (file.isDirectory()) {
          children.add(new FolderNode(node, repo, file));
        } else {
          children.add(new FileNode(node, repo, file));
        }
      }
View Full Code Here

TOP

Related Classes of org.eclipse.egit.ui.internal.repository.tree.FolderNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.