@Test public void testGetSearchableElements() { final List<DMNSearchableElement> elements = index .getSearchableElements() .stream() .sorted(Comparator.comparing(DMNSearchableElement::getText)) .collect(Collectors.toList()); assertEquals(5, elements.size()); assertEquals(drgElement1String, elements.get(0).getText()); assertEquals(drgElement2String, elements.get(1).getText()); assertEquals(drgElement3String, elements.get(2).getText()); assertEquals(textAnnotation1String, elements.get(3).getText()); assertEquals(textAnnotation2String, elements.get(4).getText()); elements.get(0).onFound().execute(); elements.get(1).onFound().execute(); elements.get(2).onFound().execute(); elements.get(3).onFound().execute(); elements.get(4).onFound().execute(); verify(canvasSelectionEvent, times(5)).fire(any(CanvasSelectionEvent.class)); verify(canvasFocusedSelectionEvent, times(5)).fire(any(CanvasFocusedShapeEvent.class)); }
@Override public List<DMNSearchableElement> getSearchableElements() { return graphUtils .getNodeStream() .map(this::makeElement) .filter(Objects::nonNull) .collect(Collectors.toList()); }
DMNGraphSubIndex implements DMNSubIndex { @Override public List<DMNSearchableElement> getSearchableElements() { return graphUtils .getNodeStream() .map(this::makeElement) .filter(Objects::nonNull) .collect(Collectors.toList()); } }
DMNGraphSubIndex implements DMNSubIndex { @Override public List<DMNSearchableElement> getSearchableElements() { return graphUtils .getNodeStream() .map(this::makeElement) .filter(Objects::nonNull) .collect(Collectors.toList()); } @Inject  DMNGraphSubIndex(final DMNGraphUtils graphUtils,
                            final Event<CanvasSelectionEvent> canvasSelectionEvent,
                            final Event<CanvasFocusedShapeEvent> canvasFocusedSelectionEvent,
                            final Event<CanvasClearSelectionEvent> canvasClearSelectionEventEvent,
                            final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent); }
DMNGraphSubIndex implements DMNSubIndex { @Override public List<DMNSearchableElement> getSearchableElements() { return graphUtils .getNodeStream() .map(this::makeElement) .filter(Objects::nonNull) .collect(Collectors.toList()); } @Inject  DMNGraphSubIndex(final DMNGraphUtils graphUtils,
                            final Event<CanvasSelectionEvent> canvasSelectionEvent,
                            final Event<CanvasFocusedShapeEvent> canvasFocusedSelectionEvent,
                            final Event<CanvasClearSelectionEvent> canvasClearSelectionEventEvent,
                            final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent); @Override List<DMNSearchableElement> getSearchableElements(); @Override void onNoResultsFound(); }
DMNGraphSubIndex implements DMNSubIndex { @Override public List<DMNSearchableElement> getSearchableElements() { return graphUtils .getNodeStream() .map(this::makeElement) .filter(Objects::nonNull) .collect(Collectors.toList()); } @Inject  DMNGraphSubIndex(final DMNGraphUtils graphUtils,
                            final Event<CanvasSelectionEvent> canvasSelectionEvent,
                            final Event<CanvasFocusedShapeEvent> canvasFocusedSelectionEvent,
                            final Event<CanvasClearSelectionEvent> canvasClearSelectionEventEvent,
                            final Event<DomainObjectSelectionEvent> domainObjectSelectionEvent); @Override List<DMNSearchableElement> getSearchableElements(); @Override void onNoResultsFound();  }