void (@Nullable ProgressIndicator modalityProgress) { if (isRunning()) { throwInvalidState("setModalityProgress() must not be called on already running indicator"); } myModalityProgress = modalityProgress; setModalityState(modalityProgress); }