void (Project project, List<PyRequirement> requirements) { final PyPackageManagerUI.Listener listener = myListener == null ? new RunningPackagingTasksListener(myModule) : new RunningPackagingTasksListener(myModule) { @Override public void started() { super.started(); myListener.started(); } @Override public void finished(List<ExecutionException> exceptions) { super.finished(exceptions); myListener.finished(exceptions); } }; new PyPackageManagerUI(project, mySdk, listener).install(requirements, myExtraArgs); }