void (@NotNull ProgressIndicator indicator) { indicator.setText("Welcome!"); for (int each = 0; each < 1000; each++) { indicator.setText(getProcessName(each)); indicator.setFraction(each / 1000.0); TimeoutUtil.sleep(100); indicator.checkCanceled(); indicator.setText2("Bla bla bla"); } }