Examples of IWizardDescriptor


Examples of org.eclipse.ui.wizards.IWizardDescriptor

  /* (non-Javadoc)
   * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
   */
  public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (element instanceof IWizardDescriptor) {
      IWizardDescriptor desc = (IWizardDescriptor)element;
      String [] tags = desc.getTags();
      for (int i = 0; i < tags.length; i++) {
        for (int j = 0; j < myTags.length; j++) {
          if (tags[i].equals(myTags[j])) {
            return true;
          }
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

  private void addParameterValues(Map values, IWizardCategory wizardCategory) {

    final IWizardDescriptor[] wizardDescriptors = wizardCategory
        .getWizards();
    for (int i = 0; i < wizardDescriptors.length; i++) {
      final IWizardDescriptor wizardDescriptor = wizardDescriptors[i];

      // Note: using description instead of label for the name
      // to reduce possibilities of key collision in the map
      // final String name = wizardDescriptor.getDescription();
     
      // by request
      String name = wizardDescriptor.getLabel();
      final String id = wizardDescriptor.getId();
      final String value = (String) values.get(name);
      if (value!=null && !value.equals(id)) {
        name = name + " (" + id + ")"; //$NON-NLS-1$//$NON-NLS-2$
      }
      values.put(name, id);
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

  }

  protected static IWorkbenchWizard createWizard(final String id) throws CoreException {
        final IWorkbench wb = PlatformUI.getWorkbench();
        final IWizardRegistry reg = wb.getNewWizardRegistry();
        final IWizardDescriptor desc = reg.findWizard(id);
        IWorkbenchWizard wizard = desc.createWizard();
        if (wizard != null) {
            return wizard;
        }
        throw new RuntimeException("Wizard not found. id:" + id); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

  private boolean isDestination;
  private String name;

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWizardDescriptor descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(SapConnectionConfigurationExportWizard.ID);
    if (descriptor != null) {

      try {
        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
        if (isDestination) {
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

public class ExportWizardHandler extends AbstractHandler implements IHandler {

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWizardDescriptor descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(SapConnectionConfigurationExportWizard.ID);
    if (descriptor != null) {

      try {
        IWorkbenchWizard wizard = descriptor.createWizard();
        IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
        ISelection selection = HandlerUtil.getCurrentSelection(event);
        if (!(selection instanceof IStructuredSelection)) {
          selection = StructuredSelection.EMPTY;
        }
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

    openWizard(site.getShell(), site.getWorkbenchWindow().getWorkbench(), null, "ccw.project.new.wizard");
  }

  public void openWizard(Shell shell, IWorkbench workbench, IStructuredSelection selection, 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();
        ((IWorkbenchWizard) wizard).init(workbench, selection);
        WizardDialog wd = new WizardDialog(shell, wizard);
        wd.setTitle(wizard.getWindowTitle());
        wd.open();
      }
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

   *         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

    if (category == null || projectsOnly) {
      return true;
    }
    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

        inputArray = sortWizard(inputArray);
        IWizardCategory[] categories = phpCategory.getCategories();
        for (int i = 0; i < categories.length; i++) {
          inputArray.add(categories[i]);
        }
        IWizardDescriptor folder = wizardCategories
            .findWizard("org.eclipse.ui.wizards.new.folder"); //$NON-NLS-1$
        if (folder != null) {
          inputArray.add(folder);
        }
      }
View Full Code Here

Examples of org.eclipse.ui.wizards.IWizardDescriptor

  private ArrayList<IWizardDescriptor> sortWizard(List wizards) {
    ArrayList<IWizardDescriptor> result = new ArrayList<IWizardDescriptor>();
    for (String id : PROJECT_WIZARD_ID) {
      for (int i = 0; i < wizards.size(); i++) {
        if (wizards.get(i) instanceof IWizardDescriptor) {
          IWizardDescriptor iWizardDescriptor = (IWizardDescriptor) wizards
              .get(i);
          if (id.equals(iWizardDescriptor.getId())) {
            result.add(iWizardDescriptor);
          }
        }
      }
    }
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.