private List<Component> getInfoPanelComponents() { final List<InfoPanelItemProvider> infoPanelItemProviders = findInfoPanelItems(); infoPanelItemProviders.add(selectionContextPanelItem); // manually add this, as it is not exposed via osgi infoPanelItemProviders.add(topologyProviderInfoPanelItem); // same here return m_transactionOperations.execute(ts -> { return infoPanelItemProviders.stream() .flatMap(provider -> { try { return provider.getContributions(m_graphContainer).stream(); } catch (Throwable t) { // See NMS-8394 LOG.error("An error occurred while retrieving the component from info panel item provider {}. " + "The component will not be displayed.", provider.getClass(), t); return null; } }) .filter(Objects::nonNull) .sorted() .map(this::wrap) .collect(Collectors.toList()); }); }
@Override public Collection<InfoPanelItem> getContributions(GraphContainer container) { return InfoPanelItemProvider.contributeIf( SimulationAwareStateMachineFactory.isInSimulationMode(container.getCriteria()), () -> new DefaultInfoPanelItem() .withOrder(Integer.MIN_VALUE) .withComponent(createComponent())); } }
private List<Component> getInfoPanelComponents() { final List<InfoPanelItemProvider> infoPanelItemProviders = findInfoPanelItems(); infoPanelItemProviders.add(selectionContextPanelItem); // manually add this, as it is not exposed via osgi infoPanelItemProviders.add(topologyProviderInfoPanelItem); // same here return m_transactionOperations.execute(ts -> { return infoPanelItemProviders.stream() .flatMap(provider -> { try { return provider.getContributions(m_graphContainer).stream(); } catch (Throwable t) { // See NMS-8394 LOG.error("An error occurred while retrieving the component from info panel item provider {}. " + "The component will not be displayed.", provider.getClass(), t); return null; } }) .filter(Objects::nonNull) .sorted() .map(this::wrap) .collect(Collectors.toList()); }); }