Search in sources :

Example 46 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project knime-core by knime.

the class NewKnimeWorkflowAction method run.

/**
 * Invoke the Import wizards selection Wizard.
 */
@Override
public void run() {
    if (m_workbenchWindow == null) {
        // action has been disposed
        return;
    }
    NewProjectWizard wizard = new NewProjectWizard();
    IStructuredSelection selectionToPass;
    // get the current workbench selection
    ISelection workbenchSelection = m_workbenchWindow.getSelectionService().getSelection();
    if (workbenchSelection instanceof IStructuredSelection) {
        selectionToPass = (IStructuredSelection) workbenchSelection;
    } else {
        selectionToPass = StructuredSelection.EMPTY;
    }
    wizard.init(m_workbenchWindow.getWorkbench(), selectionToPass);
    Shell parent = m_workbenchWindow.getShell();
    WizardDialog dialog = new WizardDialog(parent, wizard);
    dialog.create();
    dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT);
    dialog.open();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) NewProjectWizard(org.knime.workbench.ui.wizards.project.NewProjectWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 47 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project knime-core by knime.

the class ImportKnimeWorkflowAction method run.

/**
 * Invoke the Import wizards selection Wizard.
 */
@Override
public void run() {
    WorkflowImportWizard wizard = new WorkflowImportWizard();
    WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
    IStructuredSelection selectionToPass;
    // get the current workbench selection
    ISelection workbenchSelection = m_workbenchWindow.getSelectionService().getSelection();
    if (workbenchSelection instanceof IStructuredSelection) {
        selectionToPass = (IStructuredSelection) workbenchSelection;
        if (selectionToPass.size() == 1) {
            Object o = selectionToPass.getFirstElement();
            if (o instanceof IContainer) {
                wizard.setInitialDestination((IContainer) o);
            }
        }
    }
    dialog.open();
}
Also used : WorkflowImportWizard(org.knime.workbench.ui.wizards.imports.WorkflowImportWizard) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IContainer(org.eclipse.core.resources.IContainer) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 48 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project knime-core by knime.

the class CreateWorkflowGroupAction method run.

/**
 * {@inheritDoc}
 */
@Override
public void run() {
    NewWorkflowGroupProjectWizard wizard = new NewWorkflowGroupProjectWizard();
    IWorkbench workbench = PlatformUI.getWorkbench();
    ISelection selection = workbench.getActiveWorkbenchWindow().getSelectionService().getSelection();
    if (selection instanceof IStructuredSelection) {
        wizard.init(workbench, (IStructuredSelection) selection);
    }
    WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
    dialog.open();
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) ISelection(org.eclipse.jface.viewers.ISelection) NewWorkflowGroupProjectWizard(org.knime.workbench.ui.wizards.workflowgroup.NewWorkflowGroupProjectWizard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 49 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project knime-core by knime.

the class ExportKnimeWorkflowAction method run.

/**
 * Invoke the Import wizards selection Wizard.
 */
@Override
public void run() {
    IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (workbenchWindow == null) {
        // action has been disposed
        return;
    }
    WorkflowExportWizard wizard = new WorkflowExportWizard();
    IStructuredSelection selectionToPass;
    // get the current workbench selection
    ISelection workbenchSelection = workbenchWindow.getSelectionService().getSelection();
    if (workbenchSelection instanceof IStructuredSelection) {
        selectionToPass = (IStructuredSelection) workbenchSelection;
    } else {
        selectionToPass = StructuredSelection.EMPTY;
    }
    wizard.init(workbenchWindow.getWorkbench(), selectionToPass);
    Shell parent = workbenchWindow.getShell();
    WizardDialog dialog = new WizardDialog(parent, wizard);
    dialog.create();
    dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT);
    dialog.open();
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) Shell(org.eclipse.swt.widgets.Shell) WorkflowExportWizard(org.knime.workbench.ui.wizards.export.WorkflowExportWizard) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 50 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project eclipse-pmd by acanda.

the class PMDPropertyPageController method addRuleSetConfiguration.

public void addRuleSetConfiguration(final Shell shell) {
    final AddRuleSetConfigurationWizard wizard = new AddRuleSetConfigurationWizard(project);
    final WizardDialog dialog = new WizardDialog(shell, wizard);
    dialog.setPageSize(300, SWT.DEFAULT);
    final int result = dialog.open();
    if (result == Window.OK && wizard.getRuleSetModel() != null) {
        final RuleSetViewModel viewModel = toViewModel(wizard.getRuleSetModel(), project);
        model.addRuleSet(viewModel);
        final HashSet<RuleSetViewModel> activeConfigs = new HashSet<>(model.getActiveRuleSets());
        activeConfigs.add(viewModel);
        model.setActiveRuleSets(activeConfigs);
    }
}
Also used : RuleSetViewModel(ch.acanda.eclipse.pmd.properties.PMDPropertyPageViewModel.RuleSetViewModel) AddRuleSetConfigurationWizard(ch.acanda.eclipse.pmd.wizard.AddRuleSetConfigurationWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog) HashSet(java.util.HashSet)

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