Examples of INewWizard


Examples of org.eclipse.ui.INewWizard

    /**
     * {@inheritDoc}
     */
    public void run()
    {
        INewWizard wizard = getWizard();

        wizard.init( window.getWorkbench(), ( IStructuredSelection ) window.getSelectionService().getSelection() );
        WizardDialog dialog = new WizardDialog( getShell(), wizard );
        dialog.setBlockOnOpen( true );
        dialog.create();
        dialog.open();
    }
View Full Code Here

Examples of org.eclipse.ui.INewWizard

    {
        Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();

        try
        {
            INewWizard wizard = createWizard();
            wizard.init(PlatformUI.getWorkbench(), getSelection());
            WizardDialog dialog = new WizardDialog(shell, wizard);
            int res = dialog.open();
            notifyResult(res == Window.OK);
        }
        catch (CoreException e)
View Full Code Here

Examples of org.eclipse.ui.INewWizard

     * @see org.eclipse.jface.action.IAction#run()
     */
    public void run() {
        // create instance of target wizard

        INewWizard wizard;
        try {
            wizard = (INewWizard) wizardElement.createWizard();
        } catch (CoreException e) {
            ErrorDialog.openError(window.getShell(), WorkbenchMessages.NewWizardShortcutAction_errorTitle,
                    WorkbenchMessages.NewWizardShortcutAction_errorMessage,
                    e.getStatus());
            return;
        }

        ISelection selection = window.getSelectionService().getSelection();
        IStructuredSelection selectionToPass = StructuredSelection.EMPTY;
        if (selection instanceof IStructuredSelection) {
            selectionToPass = wizardElement
                    .adaptedSelection((IStructuredSelection) selection);
        } else {
            // Build the selection from the IFile of the editor
            IWorkbenchPart part = window.getPartService().getActivePart();
            if (part instanceof IEditorPart) {
                IEditorInput input = ((IEditorPart) part).getEditorInput();
                Class fileClass = LegacyResourceSupport.getFileClass();
                if (input != null && fileClass != null) {
                    Object file = Util.getAdapter(input, fileClass);
                    if (file != null) {
                        selectionToPass = new StructuredSelection(file);
                    }
                }
            }
        }

        // even tho we MAY finish early without showing a dialog, prep the
    // wizard with a dialog and such in case it's logic requires it
    // - yes, it wastes a dialog but they are plentiful...
    wizard.init(window.getWorkbench(), selectionToPass);

        Shell parent = window.getShell();
        WizardDialog dialog = new WizardDialog(parent, wizard);
        dialog.create();
        Point defaultSize = dialog.getShell().getSize();
        dialog.getShell().setSize(
                Math.max(SIZING_WIZARD_WIDTH, defaultSize.x),
                Math.max(SIZING_WIZARD_HEIGHT, defaultSize.y));
        window.getWorkbench().getHelpSystem().setHelp(dialog.getShell(),
        IWorkbenchHelpContextIds.NEW_WIZARD_SHORTCUT);
       
        // if the wizard can finish early and doesn't have any pages, just finish it.
        if (wizardElement.canFinishEarly() && !wizardElement.hasPages()) {
      wizard.performFinish();
      dialog.close();
    } else {
      dialog.open();
    }
    }
View Full Code Here

Examples of org.eclipse.ui.INewWizard

    /**
     * {@inheritDoc}
     */
    public void run()
    {
        INewWizard wizard = getWizard();

        wizard.init( window.getWorkbench(), ( IStructuredSelection ) window.getSelectionService().getSelection() );
        WizardDialog dialog = new WizardDialog( getShell(), wizard );
        dialog.setBlockOnOpen( true );
        dialog.create();
        dialog.open();
    }
View Full Code Here

Examples of org.eclipse.ui.INewWizard

  }

  public void run() {
    Shell shell = WorkbenchUtilities.getActiveWorkbenchShell();
    try {
      INewWizard wizard = createWizard();
      wizard.init(PlatformUI.getWorkbench(), currentSelection);
      WizardDialog dialog = new WizardDialog(shell, wizard);
      dialog.create();
      dialog.open();
    } catch (CoreException e) {
      WizardsPlugin.getDefault().log(e);
View Full Code Here

Examples of org.eclipse.ui.INewWizard

  public void run(String[] params, ICheatSheetManager manager) {

    if ((params != null) && (params.length > 0)) {
      IWorkbench workbench = PlatformUI.getWorkbench();
      INewWizard wizard = getWizard(params[0]);
      wizard.init(workbench, new StructuredSelection());
      WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getShell(), wizard);
      dialog.create();
      dialog.open();
View Full Code Here

Examples of org.eclipse.ui.INewWizard

    this.shell = shell;
  }
 
  @Override
  public void run() {
    INewWizard wizard = new NewRooProjectWizard();
    wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
    WizardDialog dialog = new WizardDialog(shell, wizard);
    dialog.open();
  }
View Full Code Here

Examples of org.eclipse.ui.INewWizard

   * Processes configuration wizard dialog.
   * @param project the project.
   * @return the return code of the dialog.
   */
  public static int processConfigWizardDialog(IProject project) {
    INewWizard wizard = new ReviewIdNewWizard(project);
    wizard.init(workbench, null);
    // Instantiates the wizard container with the wizard and opens it
    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
    WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
    dialog.create();
    return dialog.open();
View Full Code Here

Examples of org.eclipse.ui.INewWizard

      if (result == WizardDialog.CANCEL) {
        return WizardDialog.CANCEL;
      }
    }
   
    INewWizard wizard = new ReviewIdSelectionWizard(reviewPhaseNameKey, project,
                                                    isMultipleChoiceEnabled);
    IWorkbench workbench = PlatformUI.getWorkbench();
    wizard.init(workbench, null);
    // Instantiates the wizard container with the wizard and opens it
    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
    WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
    dialog.create();
    return dialog.open();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.