Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.eclipse.xtext.ui.editor.info;
 
 
 import  org.eclipse.ui.IEditorInput;

Author(s):
Michael Clay
Jan Koehnlein
	public Resource createResource(IEditorInput editorInput) {
		if (editorInput instanceof ResourceWorkingCopyFileEditorInput) {
else {
			return super.createResource(editorInput);
		}
	}
		try {
			ResourceSet resourceSet = getResourceSet(editorInput.getFile());
			Resource workingCopy = resourceSet.createResource(editorInput.getResource().getURI());
			InputStream inputStream = editorInput.getFile().getContents();
			try {
				workingCopy.load(inputStream, Collections.singletonMap(.editorInput.getEncoding()));
finally {
				inputStream.close();
			}
			return workingCopy;
catch (Exception exc) {
			throw new IllegalStateException(exc);
		}
	}
New to GrepCode? Check out our FAQ X