*/
public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
XMLInputSource input;
if (!(editorInput instanceof IFileEditorInput))
throw new PartInitException(Messages.getString("MultiPageEditor.invalidInputClass")); //$NON-NLS-1$
fileNeedingContext = file = ((IFileEditorInput) editorInput).getFile();
String filePathName = file.getLocation().toOSString();
try {
input = new XMLInputSource(filePathName);
} catch (IOException e) {
String m = Messages.getFormattedString("MultiPageEditor.IOError", //$NON-NLS-1$
new String[] { AbstractSection.maybeShortenFileName(filePathName) })
+ Messages.getString("MultiPageEditor.10") + getMessagesToRootCause(e); //$NON-NLS-1$
// skip showing a message because the partInitException
// shows it
throw new PartInitException(m);
}
super.init(site, editorInput); // to allow other editors to get site and editorInput
// leaves isBadXML set, if it can't parse but isn't throwing
isContextLoaded = false;
try {
parseSource(input, filePathName);
} catch (MultilevelCancel e) {
throw new PartInitException("Operation Cancelled");
}
isContextLoaded = true;
// super.init(site, editorInput);