use of org.aquarius.cicada.workbench.job.ParseMovieJob in project cicada by aquariusStudio.
the class ParseMovieAction method run.
/**
* {@inheritDoc}}
*/
@Override
public void run() {
if (this.window != null) {
IInputValidator validator = new UrlInputValidator();
String content = ClipboardUtil.getStringFromClipboard();
if (StringUtils.isNotBlank(validator.isValid(content))) {
content = "";
}
DownloadExternalUrlDialog dialog = new DownloadExternalUrlDialog(this.window.getShell(), Messages.ParseMovieAction_DownloadDialogTitle, Messages.ParseMovieAction_DownloadDialogMessage, content, validator);
if (dialog.open() == Dialog.OK) {
String[] urlStrings = StringUtil.toLines(dialog.getValue());
List<String> urlStringList = CollectionUtil.removeDuplicated(urlStrings);
ParseMovieJob job = new ParseMovieJob(Messages.ParseMovieAction_ParseMovie, dialog.isDirectDownload(), urlStringList);
job.setUser(true);
job.schedule();
}
}
}
Aggregations