Search in sources :

Example 1 with OpenJobSelectionDialog

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

the class OpenJobAction method run.

@Override
public void run() {
    List<ERepositoryObjectType> repObjectTypes = new ArrayList<ERepositoryObjectType>();
    repObjectTypes.add(ERepositoryObjectType.PROCESS);
    if (PluginChecker.isStormPluginLoader()) {
        repObjectTypes.add(ERepositoryObjectType.PROCESS_STORM);
    }
    if (PluginChecker.isMapReducePluginLoader()) {
        repObjectTypes.add(ERepositoryObjectType.PROCESS_MR);
    }
    final OpenJobSelectionDialog dialog = new OpenJobSelectionDialog(window.getShell(), repObjectTypes);
    if (dialog.open() == RepositoryReviewDialog.OK) {
        EditProcess editProcess = new EditProcess() {

            /*
                 * (non-Javadoc)
                 * 
                 * @see org.talend.repository.ui.actions.AContextualAction#getSelection()
                 */
            @Override
            public ISelection getSelection() {
                return new StructuredSelection(dialog.getResult());
            }
        };
        editProcess.run();
    }
}
Also used : OpenJobSelectionDialog(org.talend.repository.ui.dialog.OpenJobSelectionDialog) ArrayList(java.util.ArrayList) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType)

Aggregations

ArrayList (java.util.ArrayList)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)1 OpenJobSelectionDialog (org.talend.repository.ui.dialog.OpenJobSelectionDialog)1