@Override
    public void init(IEditorSite site, final IEditorInput input)
        throws PartInitException
    {
        boolean reset = getEditorInput() != null;
        setSite(site);
        if (!(input instanceof IPathEditorInput)) {
            throw new PartInitException("Editor Input is not a file");
        }
        setInput(input);
        if (reset) {
            loadBinaryContent();
        } else {
            // when opening an external file the workbench (Eclipse 3.1) calls HexEditorActionBarContributor.
            // MyStatusLineContributionItem.fill() before HexEditorActionBarContributor.setActiveEditor()
            // but we need an editor to fill the status bar.
            site.setSelectionProvider(this);

            ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
        }
    }
@see org.eclipse.ui.part.EditorPart#doSaveAs()
plugins/org.jkiss.dbeaver.ui.editors.hex/src/org/jkiss/dbeaver/ui/editors/binary/BinaryEditor.java