Search in sources :

Example 36 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project bndtools by bndtools.

the class RepositoryBundleSelectionPart method doAdd.

private void doAdd() {
    try {
        RepoBundleSelectionWizard wizard = createBundleSelectionWizard(getBundles());
        if (wizard != null) {
            WizardDialog dialog = new WizardDialog(getSection().getShell(), wizard);
            if (dialog.open() == Window.OK) {
                setBundles(wizard.getSelectedBundles());
                markDirty();
            }
        }
    } catch (Exception e) {
        ErrorDialog.openError(getSection().getShell(), "Error", null, new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error opening bundle resolver wizard.", e));
    }
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) RepoBundleSelectionWizard(bndtools.wizards.repo.RepoBundleSelectionWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog) URISyntaxException(java.net.URISyntaxException)

Example 37 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class ModelCreation method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    Shell activeShell = HandlerUtil.getActiveShell(event);
    NewModelWizard wizard = getModelCreationWizard();
    IWorkbench workbench = PlatformUI.getWorkbench();
    IStructuredSelection selection = (IStructuredSelection) workbench.getActiveWorkbenchWindow().getSelectionService().getSelection();
    wizard.init(workbench, selection);
    WizardDialog dialog = new WizardDialog(activeShell, wizard);
    dialog.open();
    return null;
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Shell(org.eclipse.swt.widgets.Shell) NewModelWizard(org.palladiosimulator.editors.sirius.ui.wizard.model.NewModelWizard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 38 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project Palladio-Editors-Sirius by PalladioSimulator.

the class PalladioProjectCreation method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    Shell activeShell = HandlerUtil.getActiveShell(event);
    NewPalladioProjectWizard wizard = new NewPalladioProjectWizard();
    IWorkbench workbench = PlatformUI.getWorkbench();
    IStructuredSelection selection = (IStructuredSelection) workbench.getActiveWorkbenchWindow().getSelectionService().getSelection();
    wizard.init(workbench, selection);
    WizardDialog dialog = new WizardDialog(activeShell, wizard);
    dialog.open();
    return null;
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Shell(org.eclipse.swt.widgets.Shell) NewPalladioProjectWizard(org.palladiosimulator.editors.sirius.ui.wizard.project.NewPalladioProjectWizard) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Example 39 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project xtext-xtend by eclipse.

the class CreateXtendTypeQuickfixes method newXtendInterfaceQuickfix.

protected void newXtendInterfaceQuickfix(final String typeName, final String explicitPackage, final XtextResource resource, Issue issue, IssueResolutionAcceptor issueResolutionAcceptor) {
    String packageDescription = getPackageDescription(explicitPackage);
    issueResolutionAcceptor.accept(issue, "Create Xtend interface '" + typeName + "'" + packageDescription, "Opens the new Xtend interface wizard to create the type '" + typeName + "'" + packageDescription, "xtend_file.png", new IModification() {

        @Override
        public void apply(/* @Nullable */
        IModificationContext context) throws Exception {
            runAsyncInDisplayThread(new Runnable() {

                @Override
                public void run() {
                    NewElementWizard newXtendInterfaceWizard = newXtendInterfaceWizardProvider.get();
                    WizardDialog dialog = createWizardDialog(newXtendInterfaceWizard);
                    NewXtendInterfaceWizardPage page = (NewXtendInterfaceWizardPage) newXtendInterfaceWizard.getStartingPage();
                    configureWizardPage(page, resource.getURI(), typeName, explicitPackage);
                    dialog.open();
                }
            });
        }
    });
}
Also used : NewElementWizard(org.eclipse.jdt.internal.ui.wizards.NewElementWizard) IModificationContext(org.eclipse.xtext.ui.editor.model.edit.IModificationContext) NewXtendInterfaceWizardPage(org.eclipse.xtend.ide.wizards.NewXtendInterfaceWizardPage) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IModification(org.eclipse.xtext.ui.editor.model.edit.IModification)

Example 40 with WizardDialog

use of org.eclipse.jface.wizard.WizardDialog in project xtext-xtend by eclipse.

the class CreateXtendTypeQuickfixes method newXtendClassQuickfix.

protected void newXtendClassQuickfix(final String typeName, final String explicitPackage, final XtextResource resource, Issue issue, IssueResolutionAcceptor issueResolutionAcceptor) {
    String packageDescription = getPackageDescription(explicitPackage);
    issueResolutionAcceptor.accept(issue, "Create Xtend class '" + typeName + "'" + packageDescription, "Opens the new Xtend class wizard to create the type '" + typeName + "'" + packageDescription, "xtend_file.png", new IModification() {

        @Override
        public void apply(/* @Nullable */
        IModificationContext context) throws Exception {
            runAsyncInDisplayThread(new Runnable() {

                @Override
                public void run() {
                    NewElementWizard newXtendClassWizard = newXtendClassWizardProvider.get();
                    WizardDialog dialog = createWizardDialog(newXtendClassWizard);
                    NewXtendClassWizardPage page = (NewXtendClassWizardPage) newXtendClassWizard.getStartingPage();
                    configureWizardPage(page, resource.getURI(), typeName, explicitPackage);
                    dialog.open();
                }
            });
        }
    });
}
Also used : NewElementWizard(org.eclipse.jdt.internal.ui.wizards.NewElementWizard) NewXtendClassWizardPage(org.eclipse.xtend.ide.wizards.NewXtendClassWizardPage) IModificationContext(org.eclipse.xtext.ui.editor.model.edit.IModificationContext) WizardDialog(org.eclipse.jface.wizard.WizardDialog) IModification(org.eclipse.xtext.ui.editor.model.edit.IModification)

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