use of org.fagu.fmv.cli.utils.Printer in project fmv by f-agu.
the class Append method getConcatExecutable.
// ********************************************
/**
* @return
*/
private ConcatExecutable getConcatExecutable() {
Executable currentExecutable = environnement.getCurrentExecutable();
if (currentExecutable != null && currentExecutable instanceof ConcatExecutable) {
return (ConcatExecutable) currentExecutable;
}
List<ConcatExecutable> execs = BaseIdentifiable.stream(project).filter(id -> id instanceof ConcatExecutable).map(id -> (ConcatExecutable) id).collect(Collectors.toList());
int size = execs.size();
if (size == 0) {
return new ConcatExecutable(project);
}
if (size == 1) {
return execs.get(0);
}
Printer printer = getPrinter();
printer.println("Too many executable.");
printer.println("List all executables: execlist");
printer.println("And select one: toexecutable <id>");
return null;
}
Aggregations