@Nullable
        public static EditorFileInfo getFromEditor(@Nullable IEditorInput input) {
            if (input != null) {
                IFile projectFile = EditorUtils.getFileFromInput(input);
                if (projectFile != null) {
                    return new EditorProjectFileInfo(projectFile);
                } else {
                    File platformFile = EditorUtils.getLocalFileFromInput(input);
                    if (platformFile != null) {
                        return new EditorPlatformFileInfo(platformFile);
                    } else {
                        return null;
                    }
                }
            } else {
                return null;
            }
        }
A {@link IResource}'s session property to distinguish between persisted and newly created resources.
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditorUtils.java