Package org.cfeclipse.cfml.views.explorer.vfs.view

Examples of org.cfeclipse.cfml.views.explorer.vfs.view.VFSView


      setImageDescriptor(icons.getDescriptor(CFPluginImages.ICON_COPY));

    }

    public void run() {
      VFSView theApp = (VFSView) _window;

      TableItem[] tableItems = theApp.getTable().getSelection();
      TreeItem[] treeItems = theApp.getTree().getSelection();

      // if no table items then use tree items
      boolean useTree = (tableItems.length == 0) ? true : false;
      int size = (useTree) ? treeItems.length : tableItems.length;
View Full Code Here


      setImageDescriptor(icons.getDescriptor(CFPluginImages.ICON_PASTE));
    }

    public void run() {
      // Get the destination folder from tree
      VFSView fVFSView = vfsView;

      TableItem[] tableItems = fVFSView.getTable().getSelection();
      TreeItem[] treeItems = fVFSView.getTree().getSelection();
      // if no table items then use tree items
      boolean useTree = (tableItems.length == 0) ? true : false;
      String destUri = null;
      String destConnectionId = null;
      int size = (useTree) ? treeItems.length : tableItems.length;
      if (useTree) {
        destUri = (String) treeItems[0].getData(VFSView.TREEITEMDATA_URI);
        destConnectionId = (String) treeItems[0].getData(VFSView.TREEITEMDATA_CONNECTIONID);
      } else {
        final FileObject destFile = ((FileObject) tableItems[0].getData(VFSView.TABLEITEMDATA_FILE));
        try {
          destUri = destFile.getURL().toString();
        } catch (FileSystemException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
        destConnectionId  = (String) tableItems[0].getData(VFSView.TABLEITEMDATA_CONNECTIONID);
      }

      // Source URIs from clipboard
      Clipboard clip = getClipboard();

      if (clip != null && destUri != null) {
        String tmp = (String) clip.getContents(TextTransfer.getInstance());
        String[] paths = tmp.split(" ");

        FileSystemManager fsManager = fVFSView.getFileSystemManager();

        try {
          // destination object
          FileObject targetFile = fVFSView.resolveURI(destUri, destConnectionId);

          VFSUtil.copyFiles(fsManager, paths, fVFSView.fConnections.get(fVFSView.fSourceConnectionId),
              targetFile, fVFSView.fConnections.get(destConnectionId));

          // refresh
          fVFSView.notifyRefreshFiles(new FileObject[] { targetFile });

        } catch (FileSystemException e) {
          VFSView.debug(e);
        }
      }
View Full Code Here

TOP

Related Classes of org.cfeclipse.cfml.views.explorer.vfs.view.VFSView

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.