IResourceRuleFactory ruleFactory= ResourcesPlugin.getWorkspace().getRuleFactory(); if (file == null || !file.exists()) return ruleFactory.createRule(file); else return ruleFactory.modifyRule(file);
return computeSchedulingRule(file);
	protected DocumentProviderOperation createSaveOperation(final Object element, final IDocument document, final boolean overwrite) throws CoreException {		final FileInfo info= getFileInfo(element);		if (info instanceof CompilationUnitInfo) {			return new DocumentProviderOperation() {				/*				 * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#execute(org.eclipse.core.runtime.IProgressMonitor)				 */				protected void execute(IProgressMonitor monitor) throws CoreException {					commitWorkingCopy(monitor, element, (CompilationUnitInfo) info, overwrite);				}				/*				 * @see org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation#getSchedulingRule()				 */				public ISchedulingRule getSchedulingRule() {					if (info.fElement instanceof IFileEditorInput) {						IFile file= ((IFileEditorInput) info.fElement).getFile();						IResourceRuleFactory ruleFactory= ResourcesPlugin.getWorkspace().getRuleFactory();						if (file == null || !file.exists())							return ruleFactory.createRule(file);						else							return ruleFactory.modifyRule(file);					} else						return null;				}			};		}		return null;	}