use of com.helospark.tactview.ui.javafx.repository.CopyPasteRepository in project tactview by helospark.
the class StandardClipContextMenuChainItemConfiguration method deleteAllEffectsMenuItem.
@Bean
@Order(102)
public ClipContextMenuChainItem deleteAllEffectsMenuItem(CopyPasteRepository copyPasteRepository, UiCommandInterpreterService commandInterpreter, TimelineManagerAccessor timelineManager) {
return alwaysSupportedContextMenuItem(request -> {
MenuItem deleteEffectsFromClipMenuItem = new MenuItem("Delete all effects");
deleteEffectsFromClipMenuItem.setOnAction(e -> {
List<RemoveEffectCommand> removeEffectsCommand = request.getPrimaryClip().getEffects().stream().map(effect -> new RemoveEffectCommand(timelineManager, effect.getId())).collect(Collectors.toList());
commandInterpreter.sendWithResult(new CompositeCommand(removeEffectsCommand));
});
if (request.getPrimaryClip().getEffects().isEmpty()) {
deleteEffectsFromClipMenuItem.setDisable(true);
}
return deleteEffectsFromClipMenuItem;
});
}
Aggregations