/** @generated */
 @Override
 public void run(IAction action) {
   TransactionalEditingDomain editingDomain =
       WorkspaceEditingDomainFactory.INSTANCE.createEditingDomain();
   ResourceSet resourceSet = editingDomain.getResourceSet();
   EObject diagramRoot = null;
   try {
     Resource resource = resourceSet.getResource(domainModelURI, true);
     diagramRoot = resource.getContents().get(0);
   } catch (WrappedException ex) {
     UMLDiagramEditorPlugin.getInstance()
         .logError("Unable to load resource: " + domainModelURI, ex); // $NON-NLS-1$
   }
   if (diagramRoot == null) {
     MessageDialog.openError(
         getShell(),
         Messages.InitDiagramFile_ResourceErrorDialogTitle,
         Messages.InitDiagramFile_ResourceErrorDialogMessage);
     return;
   }
   Wizard wizard = new UMLNewDiagramFileWizard(domainModelURI, diagramRoot, editingDomain);
   wizard.setWindowTitle(
       NLS.bind(Messages.InitDiagramFile_WizardTitle, ActivityDiagramEditPart.MODEL_ID));
   UMLDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); // $NON-NLS-1$
 }
 /** @generated */
 public void run(IAction action) {
   TransactionalEditingDomain editingDomain =
       GMFEditingDomainFactory.INSTANCE.createEditingDomain();
   Resource resource =
       AtomicDiagramEditorUtil.openModel(
           getShell(), Messages.InitDiagramFile_OpenModelFileDialogTitle, editingDomain);
   if (resource == null || resource.getContents().isEmpty()) {
     return;
   }
   EObject diagramRoot = (EObject) resource.getContents().get(0);
   Wizard wizard = new AtomicNewDiagramFileWizard(resource.getURI(), diagramRoot, editingDomain);
   wizard.setWindowTitle(NLS.bind(Messages.InitDiagramFile_WizardTitle, AGraphEditPart.MODEL_ID));
   AtomicDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); // $NON-NLS-1$
 }
  /*
   * (non-Javadoc)
   * @see org.eclipse.jface.wizard.Wizard#dispose()
   */
  @Override
  public void dispose() {

    if (this.page != null) this.page.releaseResources();

    super.dispose();
  }
  @Deprecated
  public void promptToAddQuery(TaskRepository taskRepository) {
    IPreferenceStore preferenceStore = TasksUiPlugin.getDefault().getPreferenceStore();
    if (!preferenceStore.getBoolean(PREF_ADD_QUERY)) {
      Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
      MessageDialogWithToggle messageDialog =
          MessageDialogWithToggle.openYesNoQuestion(
              shell,
              Messages.AddRepositoryAction_Add_new_query,
              Messages.AddRepositoryAction_Add_a_query_to_the_Task_List,
              Messages.AddRepositoryAction_Do_not_show_again,
              false,
              preferenceStore,
              PREF_ADD_QUERY);
      preferenceStore.setValue(PREF_ADD_QUERY, messageDialog.getToggleState());
      if (messageDialog.getReturnCode() == IDialogConstants.YES_ID) {
        AbstractRepositoryConnectorUi connectorUi =
            TasksUiPlugin.getConnectorUi(taskRepository.getConnectorKind());
        IWizard queryWizard = connectorUi.getQueryWizard(taskRepository, null);
        if (queryWizard instanceof Wizard) {
          ((Wizard) queryWizard).setForcePreviousAndNextButtons(true);
        }

        WizardDialog queryDialog = new WizardDialog(shell, queryWizard);
        queryDialog.create();
        queryDialog.setBlockOnOpen(true);
        queryDialog.open();
      }
    }
  }
 /** {@inheritDoc} */
 @Override
 public void dispose() {
   super.dispose();
   selectElementPage.dispose();
   representationWizardPage.dispose();
   airdFilePage.dispose();
 }
Exemplo n.º 6
0
  @Override
  public void addPages() {
    super.addPages();
    setWindowTitle(WINDOW_TITLE);
    addPage(
        new WizardPage(WIZARD_PAGE) {

          public void createControl(Composite parent) {
            setTitle(WIZARD_PAGE_TITLE);
            setDescription(WIZARD_PAGE_DESCRIPTION);
            Composite container = new Composite(parent, SWT.None);
            container.setLayout(new GridLayout());
            setControl(container);

            Label label = new Label(container, SWT.WRAP);
            GridData gd = new GridData();
            gd.widthHint = 500;
            label.setLayoutData(gd);

            label.setText(
                "BOY Symbol Images Library will be imported to your workspace. "
                    + NLS.bind(
                        "If there is already a project named \"{0}\" in your workspace,"
                            + "the import will fail. ",
                        InstallLibraryAction.PROJECT_NAME)
                    + "Please rename or delete it and import again.");
          }
        });
  }
 public void addPages(Wizard wizard) {
   WizardPage page = createPage(0, IHelpContextIds.TEMPLATE_WIN_PERF_COUNT);
   page.setTitle(HQDEMessages.WinPerfCountTemplate_title);
   page.setDescription(HQDEMessages.WinPerfCountTemplate_desc);
   wizard.addPage(page);
   markPagesAdded();
 }
 @Override
 public void setContainer(IWizardContainer wizardContainer) {
   super.setContainer(wizardContainer);
   if (wizardContainer != null && wizardContainer instanceof WizardDialog) {
     ((WizardDialog) getContainer()).addPageChangedListener((IPageChangedListener) this);
   }
 }
 @Override
 public void setContainer(IWizardContainer wizardContainer) {
   super.setContainer(wizardContainer);
   if (wizardContainer instanceof DynamicPathWizardDialog) {
     setDynamicWizardDialog((DynamicPathWizardDialog) wizardContainer);
   }
 }
 @Override
 public void addPages() {
   super.addPages();
   if (page == null) {
     IJavaElement selectedElement = getSelectedJavaElement(selection);
     String repoPath = null;
     IProject project = null;
     if (selectedElement != null) {
       project = selectedElement.getJavaProject().getProject();
       /*List<String> paths = getCeylonRepositories(project.getProject());
       if (paths!=null) {
           for (int i=paths.size()-1; i>=0; i--) {
               String path = paths.get(i);
               if (!path.startsWith("http://")) {
                   repoPath = path;
                   break;
               }
           }
       }*/
     }
     if (repoPath == null) repoPath = getDefaultRepositoryPath();
     page = new ExportModuleWizardPage(repoPath, project, selectedElement);
     // page.init(selection);
   }
   addPage(page);
 }
 public void addPages(Wizard wizard) {
   WizardPage page = createPage(0, IHelpContextIds.TEMPLATE_MULTI_PROCESS_METRICS);
   page.setTitle(HQDEMessages.MultiProcessMetricsTemplate_title);
   page.setDescription(HQDEMessages.MultiProcessMetricsTemplate_desc);
   wizard.addPage(page);
   markPagesAdded();
 }
Exemplo n.º 12
0
  /** @see Wizard#dispose() */
  @Override
  public void dispose() {
    if (getContainer() instanceof WizardDialog) {
      ((WizardDialog) getContainer()).removePageChangingListener(this);
    }

    super.dispose();
  }
Exemplo n.º 13
0
 @Override
 public void dispose() {
   // Dispose all temp data sources
   for (DataSourceDescriptor dataSource : infoMap.values()) {
     dataSource.dispose();
   }
   super.dispose();
 }
Exemplo n.º 14
0
  /**
   * Show the new token wizard. If the specified description is not null the wizard will be started
   * with the wizard page belonging to the specified description. Otherwise it will be started with
   * the token type page as starting page where the user can choose the type of the he wants to
   * create.
   *
   * @param tokenWizardId The ID of the token type that should be created or null.
   * @param forceWizardId
   * @param description Token description passed to the token specific wizard pages in order to
   *     allow initialisation for a predefined token type.
   * @return True if the token dialog was closed with status {@link Window#OK}.
   */
  public boolean showNewTokenWizard(
      final String tokenWizardId,
      final boolean forceWizardId,
      final IAuthenticationTokenDescription description) {
    URL imgUrl =
        Activator.getDefault().getBundle().getEntry("icons/wizban/newtoken_wiz.gif"); // $NON-NLS-1$

    Wizard wizard =
        new Wizard() {
          @Override
          public boolean performFinish() {
            return false;
          }

          @Override
          public void addPages() {
            List<String> filterList = null;
            if (tokenWizardId != null) {
              filterList = new LinkedList<String>();
              filterList.add(tokenWizardId);
            }
            ExtPointWizardSelectionListPage page =
                new ExtPointWizardSelectionListPage(
                    WIZARD_PAGE_NAME,
                    Extensions.AUTH_TOKEN_UI_POINT,
                    filterList,
                    forceWizardId,
                    Messages.getString(
                        "UIAuthTokenProvider.wizard_first_page_title"), //$NON-NLS-1$
                    Messages.getString(
                        "UIAuthTokenProvider.wizard_first_page_description"), //$NON-NLS-1$
                    Messages.getString("UIAuthTokenProvider.noTokenCreator")); // $NON-NLS-1$
            //        page.setPreselectedId( tokenWizardId, true );
            page.setInitData(description);
            page.setCheatSheetManager(cheatSheetManager);
            addPage(page);
          }
        };

    wizard.setNeedsProgressMonitor(true);
    wizard.setForcePreviousAndNextButtons(true);
    wizard.setWindowTitle(Messages.getString("UIAuthTokenProvider.wizard_title")); // $NON-NLS-1$
    wizard.setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(imgUrl));
    WizardDialog dialog = new WizardDialog(this.shell, wizard);
    return dialog.open() == Window.OK;
  }
Exemplo n.º 15
0
 /*
  * (non-Javadoc)
  *
  * @see org.eclipse.jface.wizard.IWizard#addPages()
  */
 @Override
 public void addPages() {
   super.addPages();
   mainPage = new ErlangProjectImportWizardPage(selection);
   addPage(mainPage);
   importIncludeAndSourceDirsPage = new ErlangProjectImportIncludeAndSourceDirsWizardPage();
   addPage(importIncludeAndSourceDirsPage);
 }
Exemplo n.º 16
0
 /** Gets called when the URI textfield changes to check the input for mistakes and trim it. */
 protected void dialogChanged() {
   String text = uriField.getText();
   text = text.trim();
   if (!text.endsWith(".ecore")) {
     setPageComplete(false);
   } else {
     setPageComplete(true);
     getNextPage();
   }
   if (!uriField.getText().matches(text)) {
     uriField.setText(text);
   }
   Wizard supWizard = (Wizard) wizard;
   supWizard.getContainer().updateButtons();
   if (getNextPage() != null) {
     getNextPage().setTreeInput(geteP());
   }
 }
Exemplo n.º 17
0
  /** @see Wizard#addPage(IWizardPage) */
  @Override
  public void addPage(IWizardPage page) {
    // collect main pages
    if (!configPages.containsValue(page)) {
      mainPages.add(page);
    }

    super.addPage(page);
  }
  @Override
  public void addPages() {
    super.addPages();
    ProvisioningUI ui = ProvisioningUI.getDefaultUI();

    licensePage =
        new AcceptLicensesWizardPage(ui.getLicenseManager(), new IInstallableUnit[0], null);
    licensePage.setWizard(this);
  }
Exemplo n.º 19
0
 @Override
 public void addPages() {
   // TODO Auto-generated method stub
   super.addPages();
   page = new WizardNewProjectCreationPage("From Scratch Project Wizard");
   page.setTitle("New Project");
   page.setDescription("Creates a new planner project");
   addPage(page);
 }
Exemplo n.º 20
0
 public void createPageControls(Composite pageContainer) {
   super.createPageControls(pageContainer);
   setWindowTitle("载入向导");
   Display.getDefault()
       .asyncExec(
           new Runnable() {
             public void run() {
               firstpage.init();
             }
           });
 }
Exemplo n.º 21
0
 /**
  * Runs the wizard in a dialog.
  *
  * @generated
  */
 public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
   IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin.getInstance().getDialogSettings();
   IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
   if (wizardDialogSettings == null) {
     wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
   }
   wizard.setDialogSettings(wizardDialogSettings);
   WizardDialog dialog = new WizardDialog(shell, wizard);
   dialog.create();
   dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
   dialog.open();
 }
Exemplo n.º 22
0
 @Override
 public void dispose() {
   super.dispose();
   // notify pages
   for (int i = 0; i < additionalPages.size(); i++) {
     try {
       ((IWizardPage) additionalPages.get(i)).dispose();
     } catch (Exception e) {
       Status status = new Status(IStatus.ERROR, Policy.JFACE, IStatus.ERROR, e.getMessage(), e);
       Policy.getLog().log(status);
     }
   }
 }
Exemplo n.º 23
0
  public void addPages() {
    super.addPages();

    if (ApplicationGIS.getActiveMap() == ApplicationGIS.NO_MAP) {
      return; // no pages no go!
    }
    page =
        new MapExportPage(
            Messages.ContextExportWizard_page_name,
            Messages.ContextExportWizard_page_title,
            ContextPlugin.getImageDescriptor(
                "icons/wizban/import_owscontext_wiz_gif")); //$NON-NLS-1$
    addPage(page);
  }
Exemplo n.º 24
0
    private IConversionContext setupwizard(IConversionContext context) {
      final SetUpProcessWizardPage convertPage = new SetUpProcessWizardPage(context);

      Wizard wiz =
          new Wizard() {
            // set
            @Override
            public boolean performFinish() {
              convertPage.populateContext();
              return true;
            }
          };

      wiz.setNeedsProgressMonitor(true);
      wiz.addPage(convertPage);
      final WizardDialog wd = new WizardDialog(getSite().getShell(), wiz);
      wd.setPageSize(new Point(900, 500));
      wd.create();
      context.setConversionScheme(ConversionScheme.PROCESS);

      if (wd.open() == WizardDialog.OK) return context;

      return null;
    }
 /**
  * Runs the wizard in a dialog.
  *
  * @generated
  */
 public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
   IDialogSettings pluginDialogSettings =
       edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part
           .StateMachine_MAVODiagramEditorPlugin.getInstance()
           .getDialogSettings();
   IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
   if (wizardDialogSettings == null) {
     wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
   }
   wizard.setDialogSettings(wizardDialogSettings);
   WizardDialog dialog = new WizardDialog(shell, wizard);
   dialog.create();
   dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
   dialog.open();
 }
Exemplo n.º 26
0
  @Override
  public void addPages() {

    super.addPages();

    fMainPage = new NewQVTProjectCreationPage("main", fProjectData); // $NON-NLS-1$
    fMainPage.setTitle(Messages.NewTransformationProject_Title);
    fMainPage.setDescription(Messages.NewTransformationProject_Description);
    addPage(fMainPage);

    fContentPage = new NewQVTProjectContentPage("page2", fMainPage, fProjectData); // $NON-NLS-1$
    fWizardSelectionPage = new QVTWizardListSelectionPage(getDestinationProvider());
    addPage(fContentPage);
    addPage(fWizardSelectionPage);
  }
Exemplo n.º 27
0
  @Override
  public void setContainer(final IWizardContainer wizardContainer) {
    if (wizardContainer instanceof IPageChangeProvider) {
      final IPageChangeProvider pcp = (IPageChangeProvider) wizardContainer;
      pcp.addPageChangedListener(
          new IPageChangedListener() {

            public void pageChanged(final PageChangedEvent event) {
              if (event.getSelectedPage() == importIncludeAndSourceDirsPage) {
                setupDirectoriesPage();
              }
            }
          });
    }
    super.setContainer(wizardContainer);
  }
Exemplo n.º 28
0
  /** @see Wizard#addPages() */
  @Override
  public void addPages() {
    super.addPages();

    // add configuration pages
    for (AbstractConfigurationPage<? extends P, ? extends IOWizard<P>> page :
        new HashSet<>(configPages.values())) {
      addPage(page);
    }

    if (getContainer() instanceof WizardDialog) {
      ((WizardDialog) getContainer()).addPageChangingListener(this);
    } else {
      throw new RuntimeException("Only WizardDialog as container supported");
    }
  }
  /**
   * Subclasses can override this method and call internally {@link #addPage(IWizardPage)} for each
   * page they want to add. If this method is not overridden the extension-point with the id {@link
   * WizardDelegateRegistry#EXTENSION_POINT_ID} is processed and if a {@link IWizardDelegateFactory}
   * is registered for a subclass it will automatically be used. In this case {@link
   * #performFinish()} should also not be overridden.
   */
  @Override
  public void addPages() {
    super.addPages(); // empty super method.
    IWizardPage entryPage = getWizardEntryPage();
    if (entryPage != null) addPage(entryPage);

    // check if a wizardActionHandler is registered for this wizard class
    initWizardActionHandler();

    // if a wizardActionHandler is registered add the pages of the corresponding page provider
    if (wizardActionHandler != null) {
      List<? extends IWizardPage> pages = wizardActionHandler.getPageProvider().getPages();
      for (IWizardPage page : pages) {
        addPage(page);
      }
    }
  }
  /*
   * (non-Javadoc)
   * @see org.eclipse.jface.wizard.Wizard
   * #addPage(org.eclipse.jface.wizard.IWizardPage)
   */
  @Override
  public void addPage(IWizardPage page) {
    super.addPage(page);
    page.setWizard(this);

    String title =
        this.petalsMode == PetalsMode.provides
            ? "Petals Service Provider"
            : "Petals Service Consumer";
    title += " (" + getComponentVersionDescription().getComponentAlias() + ")";
    page.setTitle(title);

    if (page.getDescription() == null) {
      if (this.petalsMode == PetalsMode.consumes)
        page.setDescription(getComponentVersionDescription().getConsumeDescription());
      else if (this.petalsMode == PetalsMode.provides)
        page.setDescription(getComponentVersionDescription().getProvideDescription());
    }
  }