@Override
    protected void doSetInput(IEditorInput editorInput) throws CoreException {
        checkInputFileExistence(editorInput);
        try {
            super.doSetInput(editorInput);
        } catch (Throwable e) {
            // Something bad may happen. E.g. OutOfMemory error in case of too big input file.
            StringWriter out = new StringWriter();
            e.printStackTrace(new PrintWriter(out, true));
            editorInput = new StringEditorInput("Error", CommonUtils.truncateString(out.toString(), 10000), true, GeneralUtils.UTF8_ENCODING);
            try {
                super.doSetInput(editorInput);
            } catch (Throwable ex) {
                // Throw original error
                throw e;
            }
            log.error("Error loading input SQL file", e);
        }
        syntaxLoaded = false;
        IEditorInput finalEditorInput = editorInput;
        Runnable inputinitializer = new Runnable() {
            @Override
            public void run() {
                if (SQLEditor.this.isPartControlInitialized) {
                    accomplishEditorInputInitialization(finalEditorInput);
                } else {
                    UIExecutionQueue.queueExec(this);
                }
            }
        };

        UIExecutionQueue.queueExec(inputinitializer);

        setPartName(getEditorName());
        if (isNonPersistentEditor() && isDetectTitleImageFromInput()) {
            setTitleImage(DBeaverIcons.getImage(UIIcon.SQL_CONSOLE));
        }
        baseEditorImage = getTitleImage();
        editorImage = new Image(Display.getCurrent(), baseEditorImage, SWT.IMAGE_COPY);
    }
Obtain the add-in instance by its concrete type
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java