Search in sources :

Example 71 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.

the class ImportDemoProjectItemsAction method run.

@Override
public void run() {
    final List<DemoProjectBean> demoProjectList = ImportProjectsUtilities.getAllDemoProjects();
    ImportDemoProjectItemsWizard demoProjectWizard = new ImportDemoProjectItemsWizard(demoProjectList);
    WizardDialog dialog = new WizardDialog(shell, demoProjectWizard);
    dialog.open();
}
Also used : WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 72 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project tesb-studio-se by Talend.

the class CreateCamelBean method doRun.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
protected void doRun() {
    // RepositoryNode codeNode = getViewPart().getRoot().getChildren().get(4);
    // RepositoryNode routineNode = codeNode.getChildren().get(0);
    RepositoryNode beanNode = getCurrentRepositoryNode();
    if (isToolbar()) {
        if (beanNode != null && beanNode.getContentType() != CamelRepositoryNodeType.repositoryBeansType) {
            beanNode = null;
        }
        if (beanNode == null) {
            beanNode = getRepositoryNodeForDefault(CamelRepositoryNodeType.repositoryBeansType);
        }
    }
    RepositoryNode node = null;
    IPath path = null;
    if (!isToolbar()) {
        ISelection selection = getSelection();
        Object obj = ((IStructuredSelection) selection).getFirstElement();
        node = (RepositoryNode) obj;
        path = RepositoryNodeUtilities.getPath(node);
    }
    CamelNewBeanWizard beanWizard = new CamelNewBeanWizard(path);
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), beanWizard);
    if (dlg.open() == Window.OK) {
        try {
            openBeanEditor(beanWizard.getBean(), false);
        } catch (PartInitException e) {
            MessageBoxExceptionHandler.process(e);
        } catch (SystemException e) {
            MessageBoxExceptionHandler.process(e);
        }
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) SystemException(org.talend.commons.exception.SystemException) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) CamelNewBeanWizard(org.talend.camel.designer.ui.wizards.CamelNewBeanWizard) PartInitException(org.eclipse.ui.PartInitException) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 73 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project tesb-studio-se by Talend.

the class CreateCamelProcess method doRun.

@Override
protected void doRun() {
    final CamelNewProcessWizard processWizard;
    if (isToolbar()) {
        processWizard = new CamelNewProcessWizard(null);
    } else {
        ISelection selection = getSelection();
        if (selection == null) {
            return;
        }
        Object obj = ((IStructuredSelection) selection).getFirstElement();
        IRepositoryService service = DesignerPlugin.getDefault().getRepositoryService();
        IPath path = service.getRepositoryPath((IRepositoryNode) obj);
        if (RepositoryConstants.isSystemFolder(path.toString())) {
            // Not allowed to create in system folder.
            return;
        }
        processWizard = new CamelNewProcessWizard(path);
    }
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), processWizard);
    if (dlg.open() == Window.OK) {
        if (processWizard.getProcess() == null) {
            return;
        }
        try {
            openEditor(processWizard.getProcess());
        } catch (PartInitException e) {
            ExceptionHandler.process(e);
        } catch (PersistenceException e) {
            MessageBoxExceptionHandler.process(e);
        }
    }
}
Also used : CamelNewProcessWizard(org.talend.camel.designer.ui.wizards.CamelNewProcessWizard) IPath(org.eclipse.core.runtime.IPath) ISelection(org.eclipse.jface.viewers.ISelection) PersistenceException(org.talend.commons.exception.PersistenceException) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PartInitException(org.eclipse.ui.PartInitException) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IRepositoryService(org.talend.repository.model.IRepositoryService)

Example 74 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.

the class CreateRoutineAction method doRun.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
protected void doRun() {
    // RepositoryNode codeNode = getViewPart().getRoot().getChildren().get(4);
    // RepositoryNode routineNode = codeNode.getChildren().get(0);
    RepositoryNode routineNode = getCurrentRepositoryNode();
    if (isToolbar()) {
        if (routineNode != null && routineNode.getContentType() != ERepositoryObjectType.ROUTINES) {
            routineNode = null;
        }
        if (routineNode == null) {
            routineNode = getRepositoryNodeForDefault(ERepositoryObjectType.ROUTINES);
        }
    }
    RepositoryNode node = null;
    IPath path = null;
    if (!isToolbar()) {
        ISelection selection = getSelection();
        Object obj = ((IStructuredSelection) selection).getFirstElement();
        node = (RepositoryNode) obj;
        path = RepositoryNodeUtilities.getPath(node);
    }
    NewRoutineWizard routineWizard = new NewRoutineWizard(path);
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), routineWizard);
    if (dlg.open() == Window.OK) {
        try {
            openRoutineEditor(routineWizard.getRoutine(), false);
        } catch (PartInitException e) {
            MessageBoxExceptionHandler.process(e);
        } catch (SystemException e) {
            MessageBoxExceptionHandler.process(e);
        }
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) SystemException(org.talend.commons.exception.SystemException) ISelection(org.eclipse.jface.viewers.ISelection) NewRoutineWizard(org.talend.repository.ui.wizards.routines.NewRoutineWizard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PartInitException(org.eclipse.ui.PartInitException) RepositoryNode(org.talend.repository.model.RepositoryNode) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 75 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project tdi-studio-se by Talend.

the class CreateJSONAction method doRun.

@Override
protected void doRun() {
    if (repositoryNode == null) {
        repositoryNode = getCurrentRepositoryNode();
    }
    if (isToolbar()) {
        if (repositoryNode != null && repositoryNode.getContentType() != JSONRepositoryNodeType.JSON) {
            repositoryNode = null;
        }
        if (repositoryNode == null) {
            repositoryNode = getRepositoryNodeForDefault(JSONRepositoryNodeType.JSON);
        }
    }
    WizardDialog wizardDialog = null;
    JSONWizard jsonWizard = null;
    try {
        if (isToolbar()) {
            init(repositoryNode);
            jsonWizard = new JSONWizard(PlatformUI.getWorkbench(), creation, repositoryNode, getExistingNames());
            // hdfs.setToolBar(true);
            wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), jsonWizard);
        } else {
            jsonWizard = new JSONWizard(PlatformUI.getWorkbench(), creation, repositoryNode, getExistingNames());
            wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), jsonWizard);
        }
        wizardDialog.setPageSize(WIZARD_WIDTH, WIZARD_HEIGHT);
        wizardDialog.create();
        wizardDialog.open();
    } finally {
        if (jsonWizard != null) {
            jsonWizard.deleteTemFile();
        }
    }
}
Also used : JSONWizard(org.talend.repository.json.ui.wizards.JSONWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

WizardDialog (org.eclipse.jface.wizard.WizardDialog)115 ISelection (org.eclipse.jface.viewers.ISelection)26 Shell (org.eclipse.swt.widgets.Shell)26 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)25 IWorkbench (org.eclipse.ui.IWorkbench)14 IRepositoryNode (org.talend.repository.model.IRepositoryNode)13 RepositoryNode (org.talend.repository.model.RepositoryNode)13 IPath (org.eclipse.core.runtime.IPath)12 IStatus (org.eclipse.core.runtime.IStatus)10 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)10 IFile (org.eclipse.core.resources.IFile)9 Status (org.eclipse.core.runtime.Status)7 PartInitException (org.eclipse.ui.PartInitException)7 ArrayList (java.util.ArrayList)6 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)6 Composite (org.eclipse.swt.widgets.Composite)6 CoreException (org.eclipse.core.runtime.CoreException)5 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)5 File (java.io.File)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)4