Search in sources :

Example 1 with ParseMovieJob

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();
        }
    }
}
Also used : ParseMovieJob(org.aquarius.cicada.workbench.job.ParseMovieJob) UrlInputValidator(org.aquarius.ui.validator.UrlInputValidator) DownloadExternalUrlDialog(org.aquarius.cicada.workbench.dialog.DownloadExternalUrlDialog) IInputValidator(org.eclipse.jface.dialogs.IInputValidator)

Aggregations

DownloadExternalUrlDialog (org.aquarius.cicada.workbench.dialog.DownloadExternalUrlDialog)1 ParseMovieJob (org.aquarius.cicada.workbench.job.ParseMovieJob)1 UrlInputValidator (org.aquarius.ui.validator.UrlInputValidator)1 IInputValidator (org.eclipse.jface.dialogs.IInputValidator)1