Search in sources :

Example 81 with WizardDialog

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

the class CreateRouteResourceAction method doRun.

@Override
protected void doRun() {
    IRepositoryNode node = null;
    NewRouteResourceWizard wizard = null;
    ISelection selection = getSelection();
    if (selection == null) {
        return;
    }
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    node = (IRepositoryNode) obj;
    IRepositoryService service = DesignerPlugin.getDefault().getRepositoryService();
    IPath path = service.getRepositoryPath(node);
    if (RepositoryConstants.isSystemFolder(path.toString())) {
        // Not allowed to create in system folder.
        return;
    }
    wizard = new NewRouteResourceWizard(path);
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
    int open = dlg.open();
    if (open == Window.OK) {
        RouteResourceItem item = wizard.getItem();
        IWorkbenchPage page = getActivePage();
        RouteResourceEditorUtil.openEditor(page, null, item);
    }
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) IPath(org.eclipse.core.runtime.IPath) RouteResourceItem(org.talend.camel.core.model.camelProperties.RouteResourceItem) ISelection(org.eclipse.jface.viewers.ISelection) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) NewRouteResourceWizard(org.talend.designer.camel.resource.ui.wizards.NewRouteResourceWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IRepositoryService(org.talend.repository.model.IRepositoryService)

Example 82 with WizardDialog

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

the class CreateDocumentationAction method doRun.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
protected void doRun() {
    DocumentationCreateWizard docWizard = new DocumentationCreateWizard(PlatformUI.getWorkbench(), getPath());
    WizardDialog dlg = new WizardDialog(Display.getCurrent().getActiveShell(), docWizard);
    dlg.open();
    RepositoryNode node = (RepositoryNode) ((IStructuredSelection) getSelection()).getFirstElement();
}
Also used : DocumentationCreateWizard(org.talend.metadata.managment.ui.wizard.documentation.DocumentationCreateWizard) RepositoryNode(org.talend.repository.model.RepositoryNode) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 83 with WizardDialog

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

the class GenerateDocAsHTMLAction method doRun.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
protected void doRun() {
    GenerateDocAsHTMLWizard processWizard = new GenerateDocAsHTMLWizard();
    IWorkbench workbench = getWorkbench();
    processWizard.setWindowTitle(GENERATE_DOC_AS_HTML);
    processWizard.init(workbench, (IStructuredSelection) this.getSelection());
    Shell activeShell = Display.getCurrent().getActiveShell();
    WizardDialog dialog = new WizardDialog(activeShell, processWizard);
    dialog.open();
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Shell(org.eclipse.swt.widgets.Shell) GenerateDocAsHTMLWizard(org.talend.designer.documentation.generation.wizards.GenerateDocAsHTMLWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 84 with WizardDialog

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

the class ExportItemAction method doRun.

@Override
protected void doRun() {
    if (toolbarAction) {
        this.setWorkbenchPart(null);
    }
    IRepositoryView repositoryView = getViewPart();
    if (repositoryView != null && repositoryView.getViewer() instanceof TreeViewer) {
        ((TreeViewer) repositoryView.getViewer()).getTree().setFocus();
    }
    ExportItemWizard wizard = new ExportItemWizard((repositoryView != null ? repositoryView.getViewSite().getId() : null));
    IWorkbench workbench = getWorkbench();
    wizard.setWindowTitle(EXPORT_ITEM);
    if (!toolbarAction) {
        wizard.init(workbench, (IStructuredSelection) this.getSelection());
    } else {
        if (repositoryView != null) {
            IStructuredSelection selection = (IStructuredSelection) repositoryView.getViewer().getSelection();
            wizard.init(workbench, selection);
        }
    }
    Shell activeShell = Display.getCurrent().getActiveShell();
    WizardDialog dialog = new WizardDialog(activeShell, wizard);
    dialog.open();
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Shell(org.eclipse.swt.widgets.Shell) TreeViewer(org.eclipse.jface.viewers.TreeViewer) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IRepositoryView(org.talend.repository.ui.views.IRepositoryView) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 85 with WizardDialog

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

the class ExportJobScriptAction method doRun.

@Override
protected void doRun() {
    JobScriptsExportWizard processWizard = new JobScriptsExportWizard();
    IWorkbench workbench = getWorkbench();
    processWizard.setWindowTitle(EXPORTJOBSCRIPTS);
    processWizard.init(workbench, (IStructuredSelection) this.getSelection());
    Shell activeShell = Display.getCurrent().getActiveShell();
    WizardDialog dialog = new WizardDialog(activeShell, processWizard);
    if (checkDirtyPart(workbench)) {
        MessageDialog messageDialog = new //$NON-NLS-1$
        MessageDialog(//$NON-NLS-1$
        new Shell(), //$NON-NLS-1$
        "", //$NON-NLS-1$
        null, //$NON-NLS-1$
        Messages.getString("ExportJobScriptAction.confirmMessage"), MessageDialog.CONFIRM, new String[] { Messages.getString("ExportJobScriptAction.confirmContiune"), IDialogConstants.CANCEL_LABEL }, //$NON-NLS-1$
        0);
        if (messageDialog.open() != 0) {
            // don't do anything
            return;
        }
    }
    dialog.setPageSize(830, 580);
    dialog.open();
    // collector
    IPreferenceStore preferenceStore = RepositoryPlugin.getDefault().getPreferenceStore();
    int num = preferenceStore.getInt(ExportJobTokenCollector.TOS_COUNT_JOB_EXPORTS.getPrefKey());
    preferenceStore.setValue(ExportJobTokenCollector.TOS_COUNT_JOB_EXPORTS.getPrefKey(), num + 1);
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) JobScriptsExportWizard(org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizard) Shell(org.eclipse.swt.widgets.Shell) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) 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