Examples of IWizardDescriptor


Examples of org.eclipse.ui.wizards.IWizardDescriptor

      return openEditor(workbench, file, org.eclipse.ui.editors.text.EditorsUI.DEFAULT_TEXT_EDITOR_ID)
    }
  }

  public static IWorkbenchWizard openWizardOnCurrentEditorInput(IWorkbench workbench, String id) throws CoreException {
    IWizardDescriptor wizardDesc = workbench.getExportWizardRegistry().findWizard(id);
    if (wizardDesc == null) {
      wizardDesc = workbench.getNewWizardRegistry().findWizard(id);
    }
    if (wizardDesc != null) {
      IWorkbenchWizard wizard = wizardDesc.createWizard();
      IEditorPart editorPart = workbench.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
      if (editorPart != null && editorPart.getEditorInput() instanceof FileEditorInput) {
        FileEditorInput input = (FileEditorInput) editorPart.getEditorInput();
        wizard.init(workbench, new SingleStructuredSelection(input.getFile().getParent()));
        WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

  public static IWorkbenchWizard openWizard(IWorkbench workbench, String id) throws CoreException {
    return openWizard(workbench, id, null);
  }
 
  public static IWorkbenchWizard openWizard(IWorkbench workbench, String id, IStructuredSelection selection) throws CoreException {
    IWizardDescriptor wizardDesc = workbench.getExportWizardRegistry().findWizard(id);
    if (wizardDesc == null) {
      wizardDesc = workbench.getNewWizardRegistry().findWizard(id);
    }
    if (wizardDesc != null) {
      IWorkbenchWizard wizard = wizardDesc.createWizard();
      wizard.init(workbench, selection);
      WizardDialog dialog = new WizardDialog(workbench.getActiveWorkbenchWindow().getShell(), wizard);
      dialog.open();
      return wizard;
    } else {
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

   *
   * @param id
   */
  public void openWizard(String id) {
    // First see if this is a "new wizard".
    IWizardDescriptor descriptor = PlatformUI.getWorkbench()
        .getNewWizardRegistry().findWizard(id);
    // If not check if it is an "import wizard".
    if (descriptor == null) {
      descriptor = PlatformUI.getWorkbench().getImportWizardRegistry()
          .findWizard(id);
    }
    // Or maybe an export wizard
    if (descriptor == null) {
      descriptor = PlatformUI.getWorkbench().getExportWizardRegistry()
          .findWizard(id);
    }
    try {
      // Then if we have a wizard, open it.
      if (descriptor != null) {
        IWizard wizard = descriptor.createWizard();
        WizardDialog wd = new WizardDialog(PlatformUI.getWorkbench()
            .getDisplay().getActiveShell(), wizard);
        wd.setTitle(wizard.getWindowTitle());
        wd.open();
      }
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

    private IAction getAction(String id) {
        // Keep a cache, rather than creating a new action each time,
        // so that image caching in ActionContributionItem works.
        IAction action = (IAction) actions.get(id);
        if (action == null) {
            IWizardDescriptor wizardDesc = WorkbenchPlugin.getDefault()
          .getNewWizardRegistry().findWizard(id);
            if (wizardDesc != null) {
                action = new NewWizardShortcutAction(workbenchWindow,
            wizardDesc);
        actions.put(id, action);
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

      IAction wizardAction = createWizardChooserDialogAction(activeWindow);
      wizardAction.run();
    } else {

      IWizardRegistry wizardRegistry = getWizardRegistry();
      IWizardDescriptor wizardDescriptor = wizardRegistry
          .findWizard(wizardId);
      if (wizardDescriptor == null) {
        throw new ExecutionException("unknown wizard: " + wizardId); //$NON-NLS-1$
      }

      try {
        IWorkbenchWizard wizard = wizardDescriptor.createWizard();
        wizard.init(PlatformUI.getWorkbench(),
            StructuredSelection.EMPTY);
       
        if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) {
          wizard.performFinish();
          return null;
        }
       
        Shell parent = activeWindow.getShell();
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

  }

  @Override
  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (element instanceof IWizardDescriptor) {
      IWizardDescriptor desc = (IWizardDescriptor)element;
     
      if(this.prjs){
        String [] tags = desc.getTags();
        for (int i = 0; i < tags.length; i++)
          if (tags[i].equals(WorkbenchWizardElement.TAG_PROJECT))
            return true;
      }
      else if(this.res){
        String id = desc.getId();
        for (int i = 0; i < KNOWN_RESOURCE_WIZARD.length; i++)
          if(id.equals(KNOWN_RESOURCE_WIZARD[i]))
            return true;
      }
     
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

    if (wizardId == null) {
      executeHandler(event);
    } else {

      IWizardRegistry wizardRegistry = getWizardRegistry();
      IWizardDescriptor wizardDescriptor = wizardRegistry
          .findWizard(wizardId);
      if (wizardDescriptor == null) {
        throw new ExecutionException("unknown wizard: " + wizardId); //$NON-NLS-1$
      }

      try {
        IWorkbenchWizard wizard = wizardDescriptor.createWizard();
        wizard.init(PlatformUI.getWorkbench(), getSelectionToUse(event));
       
        if (wizardDescriptor.canFinishEarly() && !wizardDescriptor.hasPages()) {
          wizard.performFinish();
          return null;
        }
       
        Shell parent = activeWindow.getShell();
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

     * @return whether all wizards in the category are considered primary
     */
    private boolean allPrimary(IWizardCategory category) {
        IWizardDescriptor [] wizards = category.getWizards();
        for (int i = 0; i < wizards.length; i++) {
          IWizardDescriptor wizard = wizards[i];
            if (!isPrimary(wizard)) {
        return false;
      }
        }

View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

     * @return whether all of the wizards in the category are enabled via activity filtering
     */
    private boolean allActivityEnabled(IWizardCategory category) {
        IWizardDescriptor [] wizards = category.getWizards();
        for (int i = 0; i < wizards.length; i++) {
            IWizardDescriptor wizard = wizards[i];
            if (WorkbenchActivityHelper.filterItem(wizard)) {
        return false;
      }
        }

View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

     * @return whether all wizards in the category are considered primary
     */
    private boolean allPrimary(IWizardCategory category) {
        IWizardDescriptor [] wizards = category.getWizards();
        for (int i = 0; i < wizards.length; i++) {
          IWizardDescriptor wizard = wizards[i];
            if (!isPrimary(wizard)) {
        return false;
      }
        }

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.