extract common code from LoadDocIntoCurrentTab and LoadModelIntoTab into UpdateUiForCurrentTab