public void saveAsNewScript() {
        final SQLNavigatorContext context = new SQLNavigatorContext(getDataSourceContainer(), getExecutionContext());
        final IDocument document = getDocument();

        if (document == null) {
            return;
        }

        try {
            final IFile script = SQLEditorUtils.createNewScript(getProject(), null, context);
            final byte[] contents = document.get().getBytes(ResourcesPlugin.getEncoding());
            script.setContents(new ByteArrayInputStream(contents), IResource.FORCE, new NullProgressMonitor());

            final FileEditorInput input = new FileEditorInput(script);
            EditorUtils.setInputDataSource(input, context);
            setInput(input);
        } catch (Exception e) {
            DBWorkbench.getPlatformUI().showError("File save", "Can't save as new script file", e);
        }
    }
Build and update icon and title
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java