/** * Obtains the scheduling rule from the appropriate factory for a charset change operation. */ @Override public ISchedulingRule charsetRule(IResource resource) { if (resource.getType() == IResource.ROOT) return null; return factoryFor(resource).charsetRule(resource); }
/** * Obtains the scheduling rule from the appropriate factory for a charset change operation. */ @Override public ISchedulingRule charsetRule(IResource resource) { if (resource.getType() == IResource.ROOT) return null; return factoryFor(resource).charsetRule(resource); }
/** * Obtains the scheduling rule from the appropriate factory for a charset change operation. */ @Override public ISchedulingRule charsetRule(IResource resource) { if (resource.getType() == IResource.ROOT) return null; return factoryFor(resource).charsetRule(resource); }
@Override public void setCharset(String newCharset, IProgressMonitor monitor) throws CoreException { monitor = Policy.monitorFor(monitor); try { String message = NLS.bind(Messages.resources_settingCharset, getFullPath()); monitor.beginTask(message, Policy.totalWork); // need to get the project as a scheduling rule because we might be creating a new folder/file to // hold the project settings final ISchedulingRule rule = workspace.getRuleFactory().charsetRule(this); try { workspace.prepareOperation(rule, monitor); ResourceInfo info = getResourceInfo(false, false); checkAccessible(getFlags(info)); workspace.beginOperation(true); workspace.getCharsetManager().setCharsetFor(getFullPath(), newCharset); info = getResourceInfo(false, true); info.incrementCharsetGenerationCount(); monitor.worked(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 setCharset(String newCharset, IProgressMonitor monitor) throws CoreException { monitor = Policy.monitorFor(monitor); try { String message = NLS.bind(Messages.resources_settingCharset, getFullPath()); monitor.beginTask(message, Policy.totalWork); // need to get the project as a scheduling rule because we might be creating a new folder/file to // hold the project settings final ISchedulingRule rule = workspace.getRuleFactory().charsetRule(this); try { workspace.prepareOperation(rule, monitor); ResourceInfo info = getResourceInfo(false, false); checkAccessible(getFlags(info)); workspace.beginOperation(true); workspace.getCharsetManager().setCharsetFor(getFullPath(), newCharset); info = getResourceInfo(false, true); info.incrementCharsetGenerationCount(); monitor.worked(Policy.opWork); } catch (OperationCanceledException e) { workspace.getWorkManager().operationCanceled(); throw e; } finally { workspace.endOperation(rule, true); } } finally { monitor.done(); } }
@Override public void setCharset(String newCharset, IProgressMonitor monitor) throws CoreException { monitor = Policy.monitorFor(monitor); try { String message = NLS.bind(Messages.resources_settingCharset, getFullPath()); monitor.beginTask(message, Policy.totalWork); // need to get the project as a scheduling rule because we might be creating a new folder/file to // hold the project settings final ISchedulingRule rule = workspace.getRuleFactory().charsetRule(this); try { workspace.prepareOperation(rule, monitor); ResourceInfo info = getResourceInfo(false, false); checkAccessible(getFlags(info)); workspace.beginOperation(true); workspace.getCharsetManager().setCharsetFor(getFullPath(), newCharset); info = getResourceInfo(false, true); info.incrementCharsetGenerationCount(); monitor.worked(Policy.opWork); } catch (OperationCanceledException e) { workspace.getWorkManager().operationCanceled(); throw e; } finally { workspace.endOperation(rule, true, Policy.subMonitorFor(monitor, Policy.endOpWork)); } } finally { monitor.done(); } }
rule = new MultiRule(new ISchedulingRule[] {rule, factory.charsetRule(destResource)});
/** * Compute a scheduling rule for creating resources. * * @return a scheduling rule appropriate for creating the resources * specified in the resource descriptions */ protected ISchedulingRule computeCreateSchedulingRule() { ISchedulingRule[] ruleArray = new ISchedulingRule[resourceDescriptions.length * 3]; for (int i = 0; i < resourceDescriptions.length; i++) { if (resourceDescriptions[i] != null) { IResource resource = resourceDescriptions[i] .createResourceHandle(); // Need a rule for creating... ruleArray[i * 3] = getWorkspaceRuleFactory().createRule( resource); // ...and modifying ruleArray[i * 3 + 1] = getWorkspaceRuleFactory().modifyRule( resource); // ...and changing the charset ruleArray[i * 3 + 2] = getWorkspaceRuleFactory().charsetRule( resource); } } return MultiRule.combine(ruleArray); }
rule = new MultiRule(new ISchedulingRule[] {rule, factory.charsetRule(destResource)});
rule = new MultiRule(new ISchedulingRule[] {rule, factory.charsetRule(destResource)});
rule = new MultiRule(new ISchedulingRule[] {rule, factory.charsetRule(destResource)});
rule = new MultiRule(new ISchedulingRule[] {rule, factory.charsetRule(destResource)});
rule = new MultiRule(new ISchedulingRule[] {rule, factory.charsetRule(destResource)});
final ISchedulingRule rule = workspace.getRuleFactory().charsetRule(this); try { workspace.prepareOperation(rule, monitor);
final ISchedulingRule rule = workspace.getRuleFactory().charsetRule(this); try { workspace.prepareOperation(rule, monitor);
final ISchedulingRule rule = workspace.getRuleFactory().charsetRule(this); try { workspace.prepareOperation(rule, monitor);