private void performWorkingSetReordering() { WorkingSetModel model= fPackageExplorer.getWorkingSetModel(); List activeWorkingSets= new ArrayList(Arrays.asList(model.getActiveWorkingSets())); int index= activeWorkingSets.indexOf(fWorkingSet); if (index != -1) { if (fLocation == LOCATION_AFTER) index++; List result= new ArrayList(activeWorkingSets.size()); List selected= new ArrayList(Arrays.asList(fElementsToAdds)); for (int i= 0; i < activeWorkingSets.size(); i++) { if (i == index) { result.addAll(selected); } Object element= activeWorkingSets.get(i); if (!selected.contains(element)) { result.add(element); } } if (index == activeWorkingSets.size()) result.addAll(selected); model.setActiveWorkingSets((IWorkingSet[])result.toArray(new IWorkingSet[result.size()])); } }
private void performWorkingSetReordering() { WorkingSetModel model= fPackageExplorer.getWorkingSetModel(); List<IWorkingSet> allWorkingSets= new ArrayList<>(Arrays.asList(model.getAllWorkingSets())); int index= allWorkingSets.indexOf(fWorkingSet);
private void performWorkingSetReordering() { WorkingSetModel model= fPackageExplorer.getWorkingSetModel(); List<IWorkingSet> allWorkingSets= new ArrayList<>(Arrays.asList(model.getAllWorkingSets())); int index= allWorkingSets.indexOf(fWorkingSet);
/** * Hides all the working sets in the list from the Package Explorer. * * @param selection the selection of working sets * @since 3.8 */ private void hideWorkingSets(List<IWorkingSet> selection) { IWorkbenchPage page= JavaPlugin.getActivePage(); if (page != null) { IWorkbenchPart activePart= page.getActivePart(); if (activePart instanceof PackageExplorerPart) { PackageExplorerPart packagePart= (PackageExplorerPart) activePart; WorkingSetModel model= packagePart.getWorkingSetModel(); List<IWorkingSet> activeWorkingSets= new ArrayList<>(Arrays.asList(model.getActiveWorkingSets())); activeWorkingSets.removeAll(selection); model.setActiveWorkingSets(activeWorkingSets.toArray(new IWorkingSet[activeWorkingSets.size()])); } } }
/** * Hides all the working sets in the list from the Package Explorer. * * @param selection the selection of working sets * @since 3.8 */ private void hideWorkingSets(List<IWorkingSet> selection) { IWorkbenchPage page= JavaPlugin.getActivePage(); if (page != null) { IWorkbenchPart activePart= page.getActivePart(); if (activePart instanceof PackageExplorerPart) { PackageExplorerPart packagePart= (PackageExplorerPart) activePart; WorkingSetModel model= packagePart.getWorkingSetModel(); List<IWorkingSet> activeWorkingSets= new ArrayList<>(Arrays.asList(model.getActiveWorkingSets())); activeWorkingSets.removeAll(selection); model.setActiveWorkingSets(activeWorkingSets.toArray(new IWorkingSet[activeWorkingSets.size()])); } } }
/** * Adds the given working set to the set of currently active working sets. * * @param workingSet working set to be activated * @since 3.5 */ private void activateWorkingSet(IWorkingSet workingSet) { if (fWorkingSetModel != null) { fWorkingSetModel.addActiveWorkingSet(workingSet); } else { PackageExplorerPart activePart= getActivePackageExplorer(); if (activePart != null) { activePart.getWorkingSetModel().addActiveWorkingSet(workingSet); } } }
/** * Returns an array of currently active WorkingSets. * * @return array of active working sets or <code>null</code> if none * @since 3.5 */ private IWorkingSet[] getActiveWorkingSets() { if (fWorkingSetModel != null) { return fWorkingSetModel.getActiveWorkingSets(); } else { WorkingSetModel model= null; PackageExplorerPart activePart= getActivePackageExplorer(); if (activePart != null) model= activePart.getWorkingSetModel(); return model == null ? null : model.getActiveWorkingSets(); } }
/** * Adds the given working set to the set of currently active working sets. * * @param workingSet working set to be activated * @since 3.5 */ private void activateWorkingSet(IWorkingSet workingSet) { if (fWorkingSetModel != null) { fWorkingSetModel.addActiveWorkingSet(workingSet); } else { PackageExplorerPart activePart= getActivePackageExplorer(); if (activePart != null) { activePart.getWorkingSetModel().addActiveWorkingSet(workingSet); } } }
/** * Returns an array of currently active WorkingSets. * * @return array of active working sets or <code>null</code> if none * @since 3.5 */ private IWorkingSet[] getActiveWorkingSets() { if (fWorkingSetModel != null) { return fWorkingSetModel.getActiveWorkingSets(); } else { WorkingSetModel model= null; PackageExplorerPart activePart= getActivePackageExplorer(); if (activePart != null) model= activePart.getWorkingSetModel(); return model == null ? null : model.getActiveWorkingSets(); } }
Object newInput= null; if (fPart.getRootMode() == PackageExplorerPart.PROJECTS_AS_ROOTS) { oldInput= fPart.getWorkingSetModel(); newInput= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); } else { oldInput= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); newInput= fPart.getWorkingSetModel();
Object newInput= null; if (fPart.getRootMode() == PackageExplorerPart.PROJECTS_AS_ROOTS) { oldInput= fPart.getWorkingSetModel(); newInput= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); } else { oldInput= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); newInput= fPart.getWorkingSetModel();
Object newInput= null; if (fPart.showProjects()) { oldInput= fPart.getWorkingSetModel(); newInput= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); } else if (fPart.showWorkingSets()) { oldInput= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); newInput= fPart.getWorkingSetModel();
setExpandEnabled(false); if ((getCurrentLocation() == LOCATION_BEFORE || getCurrentLocation() == LOCATION_AFTER) && !fPackageExplorer.getWorkingSetModel().isSortingEnabled()) { setFeedbackEnabled(true); return DND.DROP_MOVE;
setExpandEnabled(false); if ((getCurrentLocation() == LOCATION_BEFORE || getCurrentLocation() == LOCATION_AFTER) && !fPackageExplorer.getWorkingSetModel().isSortingEnabled()) { setFeedbackEnabled(true); return DND.DROP_MOVE;