Search in sources :

Example 1 with JobSearchResultProcessor

use of org.talend.repository.ui.dialog.JobSearchResultProcessor in project tdi-studio-se by Talend.

the class ComponentSearcher method run.

public void run() {
    final List<IRepositoryViewObject> found = new ArrayList<IRepositoryViewObject>();
    IRunnableWithProgress op = new IRunnableWithProgress() {

        @Override
        public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            search(monitor, componentName, found);
        }
    };
    try {
        new ProgressMonitorDialog(shell).run(true, true, op);
    } catch (Exception e) {
    // ignore me
    }
    if (found.size() > 0) {
        Display.getDefault().syncExec(new Runnable() {

            @Override
            public void run() {
                final RepositoryReviewDialog dialog = new RepositoryReviewDialog(shell, new JobSearchResultProcessor(found), ERepositoryObjectType.PROCESS);
                if (dialog.open() == RepositoryReviewDialog.OK) {
                    RepositoryNode result = dialog.getResult();
                    openEditorOperation(result);
                }
            }
        });
    } else {
        MessageDialog.openInformation(shell, Messages.getString("ComponentSearcher.searchResult", componentName), //$NON-NLS-1$//$NON-NLS-2$
        Messages.getString("ComponentSearcher.noJobsFound"));
    }
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) ArrayList(java.util.ArrayList) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) JobSearchResultProcessor(org.talend.repository.ui.dialog.JobSearchResultProcessor) RepositoryNode(org.talend.repository.model.RepositoryNode) RepositoryReviewDialog(org.talend.repository.ui.dialog.RepositoryReviewDialog) PartInitException(org.eclipse.ui.PartInitException) InvocationTargetException(java.lang.reflect.InvocationTargetException) PersistenceException(org.talend.commons.exception.PersistenceException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)1 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)1 PartInitException (org.eclipse.ui.PartInitException)1 PersistenceException (org.talend.commons.exception.PersistenceException)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1 JobSearchResultProcessor (org.talend.repository.ui.dialog.JobSearchResultProcessor)1 RepositoryReviewDialog (org.talend.repository.ui.dialog.RepositoryReviewDialog)1