/** * Obtains the scheduling rule from the appropriate factories for a copy operation. */ @Override public ISchedulingRule copyRule(IResource source, IResource destination) { if (source.getType() == IResource.ROOT || destination.getType() == IResource.ROOT) return root; //source is not modified, destination is created return factoryFor(destination).copyRule(source, destination); }
/** * Obtains the scheduling rule from the appropriate factories for a copy operation. */ @Override public ISchedulingRule copyRule(IResource source, IResource destination) { if (source.getType() == IResource.ROOT || destination.getType() == IResource.ROOT) return root; //source is not modified, destination is created return factoryFor(destination).copyRule(source, destination); }
/** * Obtains the scheduling rule from the appropriate factories for a copy operation. */ @Override public ISchedulingRule copyRule(IResource source, IResource destination) { if (source.getType() == IResource.ROOT || destination.getType() == IResource.ROOT) return root; //source is not modified, destination is created return factoryFor(destination).copyRule(source, destination); }
rule = factory.moveRule(sourceResource, destResource); } else { rule = factory.copyRule(sourceResource, destResource);
rule = factory.moveRule(sourceResource, destResource); } else { rule = factory.copyRule(sourceResource, destResource);
rule = factory.moveRule(sourceResource, destResource); } else { rule = factory.copyRule(sourceResource, destResource);
rule = factory.moveRule(sourceResource, destResource); } else { rule = factory.copyRule(sourceResource, destResource);
rule = factory.moveRule(sourceResource, destResource); } else { rule = factory.copyRule(sourceResource, destResource);
rule = factory.moveRule(sourceResource, destResource); } else { rule = factory.copyRule(sourceResource, destResource);
@Override public void copy(IPath destination, int updateFlags, IProgressMonitor monitor) throws CoreException { try { monitor = Policy.monitorFor(monitor); String message = NLS.bind(Messages.resources_copying, getFullPath()); monitor.beginTask(message, Policy.totalWork); Policy.checkCanceled(monitor); destination = makePathAbsolute(destination); checkValidPath(destination, getType(), false); Resource destResource = workspace.newResource(destination, getType()); final ISchedulingRule rule = workspace.getRuleFactory().copyRule(this, destResource); try { workspace.prepareOperation(rule, monitor); // The following assert method throws CoreExceptions as stated in the IResource.copy API // and assert for programming errors. See checkCopyRequirements for more information. assertCopyRequirements(destination, getType(), updateFlags); workspace.beginOperation(true); getLocalManager().copy(this, destResource, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork)); } catch (OperationCanceledException e) { workspace.getWorkManager().operationCanceled(); throw e; } finally { workspace.endOperation(rule, true, Policy.subMonitorFor(monitor, Policy.endOpWork)); } } finally { monitor.done(); } }
@Override public void copy(IPath destination, int updateFlags, IProgressMonitor monitor) throws CoreException { try { monitor = Policy.monitorFor(monitor); String message = NLS.bind(Messages.resources_copying, getFullPath()); monitor.beginTask(message, Policy.totalWork); Policy.checkCanceled(monitor); destination = makePathAbsolute(destination); checkValidPath(destination, getType(), false); Resource destResource = workspace.newResource(destination, getType()); final ISchedulingRule rule = workspace.getRuleFactory().copyRule(this, destResource); try { workspace.prepareOperation(rule, monitor); // The following assert method throws CoreExceptions as stated in the IResource.copy API // and assert for programming errors. See checkCopyRequirements for more information. assertCopyRequirements(destination, getType(), updateFlags); workspace.beginOperation(true); getLocalManager().copy(this, destResource, updateFlags, Policy.subMonitorFor(monitor, Policy.opWork)); } catch (OperationCanceledException e) { workspace.getWorkManager().operationCanceled(); throw e; } finally { workspace.endOperation(rule, true, Policy.subMonitorFor(monitor, Policy.endOpWork)); } } finally { monitor.done(); } }
@Override public void copy(IPath destination, int updateFlags, IProgressMonitor monitor) throws CoreException { String message = NLS.bind(Messages.resources_copying, getFullPath()); SubMonitor progress = SubMonitor.convert(monitor, message, 100).checkCanceled(); destination = makePathAbsolute(destination); checkValidPath(destination, getType(), false); Resource destResource = workspace.newResource(destination, getType()); final ISchedulingRule rule = workspace.getRuleFactory().copyRule(this, destResource); try { workspace.prepareOperation(rule, progress.split(1)); // The following assert method throws CoreExceptions as stated in the IResource.copy API // and assert for programming errors. See checkCopyRequirements for more information. assertCopyRequirements(destination, getType(), updateFlags); workspace.beginOperation(true); getLocalManager().copy(this, destResource, updateFlags, progress.split(98)); } catch (OperationCanceledException e) { workspace.getWorkManager().operationCanceled(); throw e; } finally { workspace.endOperation(rule, true); } }
IPath destPath = new Path(destName).makeAbsolute(); Project destination = (Project) workspace.getRoot().getProject(destName); final ISchedulingRule rule = workspace.getRuleFactory().copyRule(this, destination); try { workspace.prepareOperation(rule, monitor);
IPath destPath = new Path(destName).makeAbsolute(); Project destination = (Project) workspace.getRoot().getProject(destName); final ISchedulingRule rule = workspace.getRuleFactory().copyRule(this, destination); try { workspace.prepareOperation(rule, monitor);
IPath destPath = new Path(destName).makeAbsolute(); Project destination = (Project) workspace.getRoot().getProject(destName); final ISchedulingRule rule = workspace.getRuleFactory().copyRule(this, destination); try { workspace.prepareOperation(rule, monitor);