Package com.zaranux.os.client.filesystem.ui

Examples of com.zaranux.os.client.filesystem.ui.DirectoryNode


  private RemoteFilesystemTreeData(File[] files)
  {
    setModelType(TreeModelType.CHILDREN);
    TreeNode hiddenRoot = new TreeNode();
    setRoot(hiddenRoot);
    DirectoryNode fsRemoteRoot = new DirectoryNode(new File("/"));

    add(fsRemoteRoot, hiddenRoot);

    if(files != null)
    {
      for(File file:files)
      {

        String path = file.getAbsolutePath();
       
        if(path.startsWith("/"))
          path = path.substring(1);
        if(path.startsWith("@"))
        {
          path = "@/" + path.substring(1);
        }
       
        String[] segments = path.split("/");
        DirectoryNode parent = fsRemoteRoot;
        if(segments != null)
        {
          String pathName = "";
          for(int i =0; i< segments.length; i++) // String segment:segments)
          {
            if(!segments[i].equals(""))
            {
              if(!(i == 1 && segments[0].equals("@")))
                pathName += "/";
              pathName += segments[i];
              DirectoryNode child = new DirectoryNode(new File(pathName));
              add(child,parent);
              this.openFolder(parent);
              parent = child;
            }
          }
View Full Code Here


  private LocalFilesystemTreeData()
  {
    setModelType(TreeModelType.CHILDREN);
    TreeNode hiddenRoot = new TreeNode();
    setRoot(hiddenRoot);
    DirectoryNode fsLocalRoot = new DirectoryNode(new File("file:///"));
    add(fsLocalRoot, hiddenRoot);
  }
View Full Code Here

TOP

Related Classes of com.zaranux.os.client.filesystem.ui.DirectoryNode

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.