Examples of IWorkingSetManager


Examples of org.eclipse.ui.IWorkingSetManager

    assertEquals("Wrong project in working set", projectName, project
        .getName());
  }

  private void removeWorkingSet(String name) {
    IWorkingSetManager workingSetManager = PlatformUI.getWorkbench()
        .getWorkingSetManager();
    IWorkingSet workingSet = workingSetManager.getWorkingSet(name);
    if (workingSet != null)
      workingSetManager.removeWorkingSet(workingSet);
  }
View Full Code Here

Examples of org.eclipse.ui.IWorkingSetManager

      final Set<ProjectRecord> projectsToCreate, final boolean open,
      final IWorkingSet[] selectedWorkingSets, IProgressMonitor monitor)
      throws InvocationTargetException, InterruptedException {
    IWorkspaceRunnable wsr = new IWorkspaceRunnable() {
      public void run(IProgressMonitor actMonitor) throws CoreException {
        IWorkingSetManager workingSetManager = PlatformUI
            .getWorkbench().getWorkingSetManager();
        try {
          actMonitor.beginTask("", projectsToCreate.size() * 2 + 1); //$NON-NLS-1$
          if (actMonitor.isCanceled())
            throw new OperationCanceledException();
          Map<IProject, File> projectsToConnect = new HashMap<IProject, File>();
          for (ProjectRecord projectRecord : projectsToCreate) {
            if (actMonitor.isCanceled())
              throw new OperationCanceledException();
            actMonitor.subTask(projectRecord.getProjectLabel());
            IProject project = createExistingProject(projectRecord,
                open, new SubProgressMonitor(actMonitor, 1));
            if (project == null)
              continue;

            RepositoryFinder finder = new RepositoryFinder(project);
            finder.setFindInChildren(false);
            Collection<RepositoryMapping> mappings = finder
                .find(new SubProgressMonitor(actMonitor, 1));
            if (!mappings.isEmpty()) {
              RepositoryMapping mapping = mappings.iterator()
                  .next();
              projectsToConnect.put(project, mapping
                  .getGitDirAbsolutePath().toFile());
            }

            if (selectedWorkingSets != null
                && selectedWorkingSets.length > 0)
              workingSetManager.addToWorkingSets(project,
                  selectedWorkingSets);
          }

          if (!projectsToConnect.isEmpty()) {
            ConnectProviderOperation connect = new ConnectProviderOperation(
View Full Code Here

Examples of org.eclipse.ui.IWorkingSetManager

      fTableViewer.setCheckedElements(selections.toArray());
    }
  }

  private void createWorkingSet() {
    IWorkingSetManager manager = PlatformUI.getWorkbench()
        .getWorkingSetManager();
    IWorkingSetNewWizard wizard = manager
        .createWorkingSetNewWizard(new String[] { "org.eclipse.php.ui.workingset.PHPWorkingSetPage" }); //$NON-NLS-1$
    // the wizard can't be null since we have at least the Script working
    // set.
    WizardDialog dialog = new WizardDialog(getShell(), wizard);
    dialog.create();
    if (dialog.open() == Window.OK) {
      IWorkingSet workingSet = wizard.getSelection();
      Filter filter = new Filter();
      if (filter.select(null, null, workingSet)) {
        fAllWorkingSets.add(workingSet);
        fTableViewer.add(workingSet);
        fTableViewer.setSelection(new StructuredSelection(workingSet),
            true);
        fTableViewer.setChecked(workingSet, true);
        manager.addWorkingSet(workingSet);
        fAddedWorkingSets.add(workingSet);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.ui.IWorkingSetManager

      }
    }
  }

  private void editSelectedWorkingSet() {
    IWorkingSetManager manager = PlatformUI.getWorkbench()
        .getWorkingSetManager();
    IWorkingSet editWorkingSet = (IWorkingSet) ((IStructuredSelection) fTableViewer
        .getSelection()).getFirstElement();
    IWorkingSetEditWizard wizard = manager
        .createWorkingSetEditWizard(editWorkingSet);
    WizardDialog dialog = new WizardDialog(getShell(), wizard);
    IWorkingSet originalWorkingSet = (IWorkingSet) fEditedWorkingSets
        .get(editWorkingSet);
    boolean firstEdit = originalWorkingSet == null;
View Full Code Here

Examples of org.eclipse.ui.IWorkingSetManager

   * Removes the selected working sets from the workbench.
   */
  private void removeSelectedWorkingSets() {
    ISelection selection = fTableViewer.getSelection();
    if (selection instanceof IStructuredSelection) {
      IWorkingSetManager manager = PlatformUI.getWorkbench()
          .getWorkingSetManager();
      Iterator iter = ((IStructuredSelection) selection).iterator();
      while (iter.hasNext()) {
        IWorkingSet workingSet = (IWorkingSet) iter.next();
        if (fAddedWorkingSets.contains(workingSet)) {
          fAddedWorkingSets.remove(workingSet);
        } else {
          IWorkingSet[] recentWorkingSets = manager
              .getRecentWorkingSets();
          for (int i = 0; i < recentWorkingSets.length; i++) {
            if (workingSet.equals(recentWorkingSets[i])) {
              fRemovedMRUWorkingSets.add(workingSet);
              break;
            }
          }
          fRemovedWorkingSets.add(workingSet);
        }
        fAllWorkingSets.remove(workingSet);
        manager.removeWorkingSet(workingSet);
      }
      fTableViewer.remove(((IStructuredSelection) selection).toArray());
    }
  }
View Full Code Here

Examples of org.eclipse.ui.IWorkingSetManager

  /**
   * Removes newly created working sets from the working set manager.
   */
  private void restoreAddedWorkingSets() {
    IWorkingSetManager manager = PlatformUI.getWorkbench()
        .getWorkingSetManager();
    Iterator iterator = fAddedWorkingSets.iterator();

    while (iterator.hasNext()) {
      manager.removeWorkingSet(((IWorkingSet) iterator.next()));
    }
  }
View Full Code Here

Examples of org.eclipse.ui.IWorkingSetManager

  /**
   * Adds back removed working sets to the working set manager.
   */
  private void restoreRemovedWorkingSets() {
    IWorkingSetManager manager = PlatformUI.getWorkbench()
        .getWorkingSetManager();
    Iterator iterator = fRemovedWorkingSets.iterator();

    while (iterator.hasNext()) {
      manager.addWorkingSet(((IWorkingSet) iterator.next()));
    }
    iterator = fRemovedMRUWorkingSets.iterator();
    while (iterator.hasNext()) {
      manager.addRecentWorkingSet(((IWorkingSet) iterator.next()));
    }
  }
View Full Code Here

Examples of org.eclipse.ui.IWorkingSetManager

    public static SearchPatternData create(IDialogSettings settings) {
      String textPattern = settings.get("textPattern"); //$NON-NLS-1$
      String[] wsIds = settings.getArray("workingSets"); //$NON-NLS-1$
      IWorkingSet[] workingSets = null;
      if (wsIds != null && wsIds.length > 0) {
        IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
        workingSets = new IWorkingSet[wsIds.length];
        for (int i = 0; workingSets != null && i < wsIds.length; i++) {
          workingSets[i] = workingSetManager.getWorkingSet(wsIds[i]);
          if (workingSets[i] == null) {
            workingSets = null;
          }
        }
      }
View Full Code Here

Examples of org.eclipse.ui.IWorkingSetManager

   * @return WorkingSets
   */
  public static List<String> getWorkingSets() {
    ArrayList<String> workingSets = new ArrayList<String>();
   
    IWorkingSetManager wsManager = getDefault().getWorkbench().getWorkingSetManager();
    if( wsManager == null )
      return workingSets;
   
    for(IWorkingSet ws: wsManager.getWorkingSets()) {
      workingSets.add(ws.getName());
    }
   
    Collections.sort(workingSets, String.CASE_INSENSITIVE_ORDER);
   
View Full Code Here

Examples of org.eclipse.ui.IWorkingSetManager

   */
  public static String[] getWorkingSetProjects(String workingSet) {
   
    String emptyResults[] = new String[0];
   
    IWorkingSetManager wsManager = getDefault().getWorkbench().getWorkingSetManager();
    if( wsManager == null )
      return emptyResults;
   
    IWorkingSet ws = wsManager.getWorkingSet(workingSet);
    if( ws == null )
      return emptyResults;
   
    ArrayList<String> projects = new ArrayList<String>();
    IAdaptable elements[] = ws.getElements();
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.