Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkingSetManager


  public List<String> handleWorkingSets(XMLMemento xmlMemento, Shell shell) {
    List<String> workingSetNames = new ArrayList<String>();
    // try working sets
    IMemento[] sets = xmlMemento.getChildren("workingSets"); //$NON-NLS-1$
    IWorkingSetManager wsManager = TeamUIPlugin.getPlugin().getWorkbench()
        .getWorkingSetManager();
   
    WorkingSetStatus status = new WorkingSetStatus();

    for (int i = 0; i < sets.length; i++) {
      IWorkingSet newWs = wsManager.createWorkingSet(sets[i]);
      if (newWs != null) {
        workingSetNames.add(newWs.getName());
        IWorkingSet oldWs = wsManager.getWorkingSet(newWs.getName());
        if (oldWs == null) {
          wsManager.addWorkingSet(newWs);
        } else if (status.isReplaceAll()) {
          getWorkingSetHelper().replaceWorkingSet(wsManager, newWs,
              oldWs);
        } else if (status.isMergeAll()) {
          getWorkingSetHelper().mergeWorkingSets(newWs, oldWs);
View Full Code Here


  protected String getJobName() {
    return TeamUIMessages.ImportProjectSetMainPage_jobName;
  }
 
  private void createWorkingSet(IWorkingSet[] workingSets, IProject[] projects) {
    IWorkingSetManager manager = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager();
    String workingSetName;
    for (int i = 0; i < workingSets.length; i++) {
      workingSetName = workingSets[i].getName();
      IWorkingSet oldSet = manager.getWorkingSet(workingSetName);
      if (oldSet == null) {
        IWorkingSet newSet = manager.createWorkingSet(workingSetName, projects);
        manager.addWorkingSet(newSet);
      } else {
        //don't overwrite the old elements
        IAdaptable[] tempElements = oldSet.getElements();
        IAdaptable[] adaptedProjects = oldSet.adaptElements(projects);
        IAdaptable[] finalElementList = new IAdaptable[tempElements.length + adaptedProjects.length];
View Full Code Here

public class Main {

  public static void main(String[] args) {
    org.eclipse.ui.IWorkingSet ws = null;
    IWorkingSetManager manager = WorkbenchPlugin.getDefault()
        .getWorkingSetManager();
    WorkingSetRegistry registry = WorkbenchPlugin.getDefault()
        .getWorkingSetRegistry();
    WorkingSetDescriptor descriptor = null;
    registry.addWorkingSetDescriptor(descriptor);
   
    ImportProjectSetMainPage ip;
   
    PsfUrlStore.getInstance();
   
    ProjectSetImporter importer;
   
      IWorkingSetManager wsManager = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager();
     
      WorkbenchPlugin.getDefault()
    .getImportWizardRegistry().getRootCategory();

  }
View Full Code Here

//      }
//    }
  }

  public static IWorkingSet getWorkingSet(Object element) {
    IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
    for(IWorkingSet workingSet : workingSetManager.getWorkingSets()) {
      for(IAdaptable adaptable : workingSet.getElements()) {
        if(adaptable.getAdapter(IResource.class) == element) {
          return workingSet;
        }
      }
View Full Code Here

    return null;
  }

  public static List<IWorkingSet> getAssignedWorkingSets(Object element) {
    List<IWorkingSet> list = new ArrayList<IWorkingSet>();
    IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
    for(IWorkingSet workingSet : workingSetManager.getWorkingSets()) {
      for(IAdaptable adaptable : workingSet.getElements()) {
        if(adaptable.getAdapter(IResource.class) == element) {
          list.add(workingSet);
        }
      }
View Full Code Here

    newWorkingSetButton.setData("name", "configureButton"); //$NON-NLS-1$ //$NON-NLS-2$
    newWorkingSetButton.setText(WizardMessages.WorkingSetGroup_btnMore);
    newWorkingSetButton.setEnabled(false);
    newWorkingSetButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(final SelectionEvent e) {
        IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
        IWorkingSetSelectionDialog dialog = workingSetManager.createWorkingSetSelectionDialog(shell, true,
            WORKING_SET_IDS.toArray(new String[0]));
        if(dialog.open() == Window.OK) {
          IWorkingSet[] workingSets = dialog.getSelection();
          selectWorkingSets(Arrays.asList(workingSets));
        }
View Full Code Here

  }

  Set<IWorkingSet> getWorkingSets() {
    Set<IWorkingSet> workingSets = new HashSet<IWorkingSet>();

    IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
    for(IWorkingSet workingSet : workingSetManager.getWorkingSets()) {
      if(!workingSet.isEmpty()) {
        IAdaptable[] elements = workingSet.getElements();
        IResource resource = (IResource) elements[0].getAdapter(IResource.class);
        if(resource != null) {
          workingSets.add(workingSet);
View Full Code Here

        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

        }
        project.create(desc, null);
        project.open(null);

        // Add project to current WorkingSet
        IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
        IWorkingSet[] workingSets = workingSetManager.getWorkingSets();
        if (workingSets != null && workingSets.length > 0) {
          workingSetManager
              .addToWorkingSets(
                  project,
              workingSets);
        }
        DisplayUtil.asyncExec(new Runnable(){
View Full Code Here

    removeWorkingSet(workingSetName);
  }

  private void assertProjectInWorkingSet(String workingSetName,
      String projectName) {
    IWorkingSetManager workingSetManager = PlatformUI.getWorkbench()
        .getWorkingSetManager();
    IWorkingSet workingSet = workingSetManager
        .getWorkingSet(workingSetName);
    IAdaptable[] elements = workingSet.getElements();
    assertEquals("Wrong number of projects in working set", 1,
        elements.length);
    IProject project = (IProject) elements[0].getAdapter(IProject.class);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkingSetManager

Copyright © 2018 www.massapicom. 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.