use of com.helospark.tactview.ui.javafx.menu.SelectableMenuContribution in project tactview by helospark.
the class DefaultEditMenuItemConfiguration method selectClipsUnderPlayheadMenuItem.
@Bean
@Order(1803)
public SelectableMenuContribution selectClipsUnderPlayheadMenuItem(SelectedNodeRepository selectedNodeRepository, TimelineManagerAccessor timelineManager, UiTimelineManager uiTimelineManager) {
return new DefaultMenuContribution(List.of(EDIT_ROOT, SELECT_ROOT, "Clips under playhead"), event -> {
TimelinePosition position = uiTimelineManager.getCurrentPosition();
List<String> newSelectedClips = timelineManager.getAllClipIds().stream().flatMap(a -> timelineManager.findClipById(a).stream()).filter(a -> a.getInterval().intersects(TimelineInterval.ofPoint(position))).map(a -> a.getId()).collect(Collectors.toList());
selectedNodeRepository.addSelectedClips(newSelectedClips);
});
}
Aggregations