Package org.eclipse.ui.actions

Examples of org.eclipse.ui.actions.CopyProjectOperation


      if (resourceData[0].getType() != IResource.PROJECT) {
        CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(mShell);
        operation.copyResources(resourceData, getNewParent());
      } else {
        for (IResource element : resourceData) {
            new CopyProjectOperation(mShell).copyProject((IProject) element);
        }
      }

      return;
    } else {
View Full Code Here


      if (resourceData[0].getType() != IResource.PROJECT) {
        CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(mShell);
        operation.copyResources(resourceData, getNewParent());
      } else {
        for (IResource element : resourceData) {
            new CopyProjectOperation(mShell).copyProject((IProject) element);
        }
      }

      return;
    } else {
View Full Code Here

        if (resourceData != null && resourceData.length > 0) {
            if (resourceData[0].getType() == IResource.PROJECT) {
                // enablement checks for all projects
                for (int i = 0; i < resourceData.length; i++) {
                    CopyProjectOperation operation = new CopyProjectOperation(this.shell);
                    operation.copyProject((IProject) resourceData[i]);
                }
            } else {
                // enablement should ensure that we always have access to a container
                IContainer container = getContainer();

                CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(this.shell);
                operation.copyResources(resourceData, container);
            }
            return;
        }

        // try a file transfer
        FileTransfer fileTransfer = FileTransfer.getInstance();
        String[] fileData = (String[]) clipboard.getContents(fileTransfer);

        if (fileData != null) {
            // enablement should ensure that we always have access to a container
            IContainer container = getContainer();

            CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(this.shell);
            operation.copyFiles(fileData, container);
            return;
        }

        //Now, at last, try a text transfer (create a new file with the contents).
        TextTransfer instance = TextTransfer.getInstance();
View Full Code Here

TOP

Related Classes of org.eclipse.ui.actions.CopyProjectOperation

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.