void (ContentManager contentManager, ServiceView mainView, Collection<? extends ServiceViewContributor<?>> contributors, List<ServiceViewState> viewStates) { myModel.getInvoker().invokeLater(() -> { Map<String, ServiceViewContributor<?>> contributorsMap = FactoryMap.create(className -> { for (ServiceViewContributor<?> contributor : contributors) { if (className.equals(contributor.getClass().getName())) { return contributor; } } return null; }); List<ServiceViewFilter> filters = new ArrayList<>(); List<Pair<ServiceViewModel, ServiceViewState>> loadedModels = new ArrayList<>(); ServiceViewModel toSelect = null; for (ServiceViewState viewState : viewStates) { ServiceViewFilter parentFilter = mainView.getModel().getFilter(); if (viewState.parentView >= 0 && viewState.parentView < filters.size()) { parentFilter = filters.get(viewState.parentView); } ServiceViewFilter filter = parentFilter; ServiceViewModel viewModel = ServiceViewModel.loadModel(viewState, myModel, myModelFilter, parentFilter, contributorsMap); if (viewModel != null) { loadedModels.add(Pair.create(viewModel, viewState)); if (viewState.isSelected) { toSelect = viewModel; } filter = viewModel.getFilter(); } filters.add(filter); } if (!loadedModels.isEmpty()) { ServiceViewModel modelToSelect = toSelect; AppUIExecutor.onUiThread().expireWith(contentManager).submit(() -> { for (Pair<ServiceViewModel, ServiceViewState> pair : loadedModels) { extract(contentManager, pair.first, pair.second, false); } selectContentByModel(contentManager, modelToSelect); }); } }); }