Search in sources :

Example 1 with LinkClipsCommand

use of com.helospark.tactview.ui.javafx.commands.impl.LinkClipsCommand in project tactview by helospark.

the class LinkClipsChainItem method createMenu.

@Override
public MenuItem createMenu(ClipContextMenuChainItemRequest request) {
    List<String> linkedClipIds = request.getAllClips().stream().map(clip -> clip.getId()).collect(Collectors.toList());
    MenuItem linkClipsMenuItem = new MenuItem("Link");
    linkClipsMenuItem.setOnAction(e -> {
        LinkClipsCommand linkClipsCommand = new LinkClipsCommand(linkClipRepository, linkedClipIds);
        commandInterpreter.sendWithResult(linkClipsCommand);
    });
    return linkClipsMenuItem;
}
Also used : Order(com.helospark.lightdi.annotation.Order) Component(com.helospark.lightdi.annotation.Component) List(java.util.List) LinkClipRepository(com.helospark.tactview.core.timeline.LinkClipRepository) MenuItem(javafx.scene.control.MenuItem) UiCommandInterpreterService(com.helospark.tactview.ui.javafx.UiCommandInterpreterService) LinkClipsCommand(com.helospark.tactview.ui.javafx.commands.impl.LinkClipsCommand) Collectors(java.util.stream.Collectors) MenuItem(javafx.scene.control.MenuItem) LinkClipsCommand(com.helospark.tactview.ui.javafx.commands.impl.LinkClipsCommand)

Aggregations

Component (com.helospark.lightdi.annotation.Component)1 Order (com.helospark.lightdi.annotation.Order)1 LinkClipRepository (com.helospark.tactview.core.timeline.LinkClipRepository)1 UiCommandInterpreterService (com.helospark.tactview.ui.javafx.UiCommandInterpreterService)1 LinkClipsCommand (com.helospark.tactview.ui.javafx.commands.impl.LinkClipsCommand)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 MenuItem (javafx.scene.control.MenuItem)1