Bug 38734 [Navigator] PasteAction should get clipboard contents only when needed
build 20030605 PasteAction.updateSelection checks whether there is a valid paste target after getting the clipboard contents. The paste target check does not involve the clipboard content and should therefore be done earlier, before reading the clipboard. The method also reads the FileTransfer data from the clipboard to check if the paste action should be enabled if there is no resource data. It does not actually use the file data. The new Clipboard.getAvailableTypes API should be used instead.
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/navigator/PasteAction.java
}
		}
	}
	return false;
}
/**
 * Implementation of method defined on <code>IAction</code>.
 */
public void run() {
	
	ResourceTransfer resTransfer = ResourceTransfer.getInstance();
	IResource[] resourceData = (IResource[])clipboard.getContents(resTransfer);
	
	if (resourceData != null && resourceData.length > 0) {
		if (resourceData[0].getType() == IResource.PROJECT) {
			
			for (int i = 0; i < resourceData.length; i++) {
				CopyProjectOperation operation = new CopyProjectOperation(this.shell);
				operation.copyProject((IProject) resourceData[i]);
			}
		} else {
			
			IContainer container = getContainer();
				
			CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation(this.shell);
			operation.copyResources(resourceData, container);
		}
		return;
	}