org.eclipse.ui.IWorkingSetManager Java Examples
The following examples show how to use
org.eclipse.ui.IWorkingSetManager.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WorkingSetMenuContributionItem.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
@Override public void fill(Menu menu, int index) { MenuItem mi= new MenuItem(menu, SWT.RADIO, index); String name= fWorkingSet.getLabel(); mi.setText("&" + fId + " " + name); //$NON-NLS-1$ //$NON-NLS-2$ if (fImage == null) { ImageDescriptor imageDescriptor= fWorkingSet.getImageDescriptor(); if (imageDescriptor != null) fImage= imageDescriptor.createImage(); } mi.setImage(fImage); mi.setSelection(fWorkingSet.equals(fActionGroup.getWorkingSet())); mi.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); fActionGroup.setWorkingSet(fWorkingSet, true); manager.addRecentWorkingSet(fWorkingSet); } }); }
Example #2
Source File: SelectWorkingSetAction.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
@Override public void run() { Shell shell= getShell(); IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSetSelectionDialog dialog= manager.createWorkingSetSelectionDialog(shell, false); IWorkingSet workingSet= fActionGroup.getWorkingSet(); if (workingSet != null) dialog.setSelection(new IWorkingSet[]{workingSet}); if (dialog.open() == Window.OK) { IWorkingSet[] result= dialog.getSelection(); if (result != null && result.length > 0) { fActionGroup.setWorkingSet(result[0], true); manager.addRecentWorkingSet(result[0]); } else fActionGroup.setWorkingSet(null, true); } }
Example #3
Source File: WorkingSetFilterActionGroup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
public WorkingSetFilterActionGroup(IWorkbenchPartSite site, IPropertyChangeListener changeListener) { Assert.isNotNull(site); Assert.isNotNull(changeListener); fChangeListener= changeListener; fWorkbenchPage= site.getPage(); fAllowWindowWorkingSetByDefault= true; fClearWorkingSetAction= new ClearWorkingSetAction(this); fSelectWorkingSetAction= new SelectWorkingSetAction(this, site); fEditWorkingSetAction= new EditWorkingSetAction(this, site); fWorkingSetListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { doPropertyChange(event); } }; fWorkingSetFilter= new WorkingSetFilter(); IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); manager.addPropertyChangeListener(fWorkingSetListener); if (useWindowWorkingSetByDefault()) { setWorkingSet(site.getPage().getAggregateWorkingSet(), false); } }
Example #4
Source File: BugContentProvider.java From spotbugs with GNU Lesser General Public License v2.1 | 6 votes |
protected void initWorkingSet(String workingSetName) { IWorkingSet workingSet = null; if (workingSetName != null && workingSetName.length() > 0) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); workingSet = workingSetManager.getWorkingSet(workingSetName); } /* * else if (PlatformUI.getPreferenceStore().getBoolean( * IWorkbenchPreferenceConstants.USE_WINDOW_WORKING_SET_BY_DEFAULT)) { * // use the window set by default if the global preference is set * workingSet = * PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage * ().getAggregateWorkingSet(); } */ if (workingSet != null) { setCurrentWorkingSet(workingSet); } }
Example #5
Source File: WorkingSetActionProvider.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
/** * Restores the working set filter from the persistence store. */ protected void initWorkingSetFilter(String workingSetName) { IWorkingSet workingSet = null; if (workingSetName != null && workingSetName.length() > 0) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); workingSet = workingSetManager.getWorkingSet(workingSetName); } else if (PlatformUI.getPreferenceStore().getBoolean( IWorkbenchPreferenceConstants.USE_WINDOW_WORKING_SET_BY_DEFAULT)) { // use the window set by default if the global preference is set workingSet = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getAggregateWorkingSet(); } if (workingSet != null) { setWorkingSet(workingSet); } }
Example #6
Source File: WorkingSetConfigurationDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
/** * 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()); } }
Example #7
Source File: WorkingSetFilterActionGroup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
public WorkingSetFilterActionGroup(Shell shell, IWorkbenchPage page, IPropertyChangeListener changeListener) { Assert.isNotNull(shell); Assert.isNotNull(changeListener); fWorkbenchPage= page; fAllowWindowWorkingSetByDefault= false; fChangeListener= changeListener; fClearWorkingSetAction= new ClearWorkingSetAction(this); fSelectWorkingSetAction= new SelectWorkingSetAction(this, shell); fEditWorkingSetAction= new EditWorkingSetAction(this, shell); fWorkingSetListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { doPropertyChange(event); } }; fWorkingSetFilter= new WorkingSetFilter(); IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); manager.addPropertyChangeListener(fWorkingSetListener); setWorkingSet(null, false); }
Example #8
Source File: GlobalRefreshResourceSelectionPage.java From APICloud-Studio with GNU General Public License v3.0 | 6 votes |
private void selectWorkingSetAction() { IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSetSelectionDialog dialog = manager.createWorkingSetSelectionDialog(getShell(), true); dialog.open(); IWorkingSet[] sets = dialog.getSelection(); if(sets != null) { workingSets = sets; } else { // dialog cancelled return; } updateWorkingSetScope(); updateWorkingSetLabel(); participantScope.setSelection(false); selectedResourcesScope.setSelection(false); workingSetScope.setSelection(true); }
Example #9
Source File: WorkingSetConfigurationDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private void createWorkingSet() { IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSetNewWizard wizard= manager.createWorkingSetNewWizard(new String[] {IWorkingSetIDs.JAVA}); // the wizard can't be null since we have at least the Java working set. WizardDialog dialog= new WizardDialog(getShell(), wizard); dialog.create(); if (dialog.open() == Window.OK) { IWorkingSet workingSet= wizard.getSelection(); if (WorkingSetModel.isSupportedAsTopLevelElement(workingSet)) { fAllWorkingSets.add(workingSet); fTableViewer.add(workingSet); fTableViewer.setSelection(new StructuredSelection(workingSet), true); fTableViewer.setChecked(workingSet, true); manager.addWorkingSet(workingSet); fAddedWorkingSets.add(workingSet); } } }
Example #10
Source File: WorkingSetActionProvider.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
/** * Restores the working set filter from the persistence store. */ protected void initWorkingSetFilter(String workingSetName) { IWorkingSet workingSet = null; if (workingSetName != null && workingSetName.length() > 0) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); workingSet = workingSetManager.getWorkingSet(workingSetName); } else if (PlatformUI.getPreferenceStore().getBoolean( IWorkbenchPreferenceConstants.USE_WINDOW_WORKING_SET_BY_DEFAULT)) { // use the window set by default if the global preference is set workingSet = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getAggregateWorkingSet(); } if (workingSet != null) { setWorkingSet(workingSet); } }
Example #11
Source File: EditWorkingSetAction.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
@Override public void run() { Shell shell= getShell(); IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSet workingSet= fActionGroup.getWorkingSet(); if (workingSet == null || workingSet.isAggregateWorkingSet()) { setEnabled(false); return; } IWorkingSetEditWizard wizard= manager.createWorkingSetEditWizard(workingSet); if (wizard == null) { String title= WorkingSetMessages.EditWorkingSetAction_error_nowizard_title; String message= WorkingSetMessages.EditWorkingSetAction_error_nowizard_message; MessageDialog.openError(shell, title, message); return; } WizardDialog dialog= new WizardDialog(shell, wizard); dialog.create(); if (dialog.open() == Window.OK) fActionGroup.setWorkingSet(wizard.getSelection(), true); }
Example #12
Source File: WorkingSetActionProvider.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
public void propertyChange(PropertyChangeEvent event) { String property = event.getProperty(); Object newValue = event.getNewValue(); Object oldValue = event.getOldValue(); String newLabel = null; if (IWorkingSetManager.CHANGE_WORKING_SET_REMOVE.equals(property) && oldValue == workingSet) { newLabel = ""; //$NON-NLS-1$ setWorkingSet(null); } else if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property) && newValue == workingSet) { newLabel = workingSet.getLabel(); } else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property) && newValue == workingSet) { if (workingSet.isAggregateWorkingSet() && workingSet.isEmpty()) { // act as if the working set has been made null if (!emptyWorkingSet) { emptyWorkingSet = true; setWorkingSetFilter(null); newLabel = null; } } else { // we've gone from empty to non-empty on our set. // Restore it. if (emptyWorkingSet) { emptyWorkingSet = false; setWorkingSetFilter(workingSet); newLabel = workingSet.getLabel(); } } } if (viewer != null) { if (newLabel != null) viewer.getCommonNavigator().setWorkingSetLabel(newLabel); viewer.getFrameList().reset(); viewer.refresh(); } }
Example #13
Source File: WorkingSetFilterActionGroup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * Sets this filter's working set. * * @param workingSet the working set * @param refreshViewer Indicates if the viewer should be refreshed. */ public void setWorkingSet(IWorkingSet workingSet, boolean refreshViewer) { // Update action fClearWorkingSetAction.setEnabled(workingSet != null); fEditWorkingSetAction.setEnabled(workingSet != null && !workingSet.isAggregateWorkingSet()); fWorkingSet= workingSet; fWorkingSetFilter.setWorkingSet(workingSet); if (refreshViewer) { fChangeListener.propertyChange(new PropertyChangeEvent(this, IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE, null, workingSet)); } }
Example #14
Source File: WorkingSetFilterActionGroup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void doPropertyChange(PropertyChangeEvent event) { String property= event.getProperty(); if (IWorkingSetManager.CHANGE_WORKING_SET_LABEL_CHANGE.equals(property)) { fChangeListener.propertyChange(event); } else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) { IWorkingSet newWorkingSet= (IWorkingSet) event.getNewValue(); if (newWorkingSet.equals(fWorkingSet)) { if (fWorkingSetFilter != null) { fWorkingSetFilter.notifyWorkingSetContentChange(); // first refresh the filter } fChangeListener.propertyChange(event); } } }
Example #15
Source File: OthersWorkingSetUpdater.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
public void propertyChange(PropertyChangeEvent event) { if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(event.getProperty())) { IWorkingSet changedWorkingSet= (IWorkingSet) event.getNewValue(); if (changedWorkingSet != fWorkingSet && fWorkingSetModel.isActiveWorkingSet(changedWorkingSet)) { updateElements(); } } }
Example #16
Source File: WorkingSetConfigurationDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * Removes newly created working sets from the working set manager. */ private void restoreAddedWorkingSets() { IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); Iterator<IWorkingSet> iterator= fAddedWorkingSets.iterator(); while (iterator.hasNext()) { manager.removeWorkingSet(iterator.next()); } }
Example #17
Source File: WorkingSetActionProvider.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
/** * Set current active working set. * * @param workingSet * working set to be activated, may be <code>null</code> */ protected void setWorkingSet(IWorkingSet workingSet) { this.workingSet = workingSet; emptyWorkingSet = workingSet != null && workingSet.isAggregateWorkingSet() && workingSet.isEmpty(); ignoreFilterChangeEvents = true; try { workingSetActionGroup.setWorkingSet(workingSet); } finally { ignoreFilterChangeEvents = false; } if (viewer != null) { setWorkingSetFilter(workingSet); if (workingSet == null || emptyWorkingSet || !extensionStateModel.getBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS)) { if (viewer.getInput() != originalViewerInput) { viewer.setInput(originalViewerInput); } else { viewer.refresh(); } } else { if (!workingSet.isAggregateWorkingSet()) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); viewer.setInput(workingSetManager.createAggregateWorkingSet( "", "", new IWorkingSet[] { workingSet })); //$NON-NLS-1$ //$NON-NLS-2$ } else { viewer.setInput(workingSet); } } } }
Example #18
Source File: NewHybridProjectWizard.java From thym with Eclipse Public License 1.0 | 5 votes |
private void addToWorkingSets(IProject project) { IWorkingSet[] selectedWorkingSets = ((WizardNewHybridProjectCreationPage) pageOne).getSelectedWorkingSets(); if(selectedWorkingSets == null || selectedWorkingSets.length == 0) return; // no Working set is selected IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); workingSetManager.addToWorkingSets(project, selectedWorkingSets); }
Example #19
Source File: WorkingSetActionProvider.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
public void propertyChange(PropertyChangeEvent event) { String property = event.getProperty(); Object newValue = event.getNewValue(); Object oldValue = event.getOldValue(); String newLabel = null; if (IWorkingSetManager.CHANGE_WORKING_SET_REMOVE.equals(property) && oldValue == workingSet) { newLabel = ""; //$NON-NLS-1$ setWorkingSet(null); } else if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property) && newValue == workingSet) { newLabel = workingSet.getLabel(); } else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property) && newValue == workingSet) { if (workingSet.isAggregateWorkingSet() && workingSet.isEmpty()) { // act as if the working set has been made null if (!emptyWorkingSet) { emptyWorkingSet = true; setWorkingSetFilter(null); newLabel = null; } } else { // we've gone from empty to non-empty on our set. // Restore it. if (emptyWorkingSet) { emptyWorkingSet = false; setWorkingSetFilter(workingSet); newLabel = workingSet.getLabel(); } } } if (viewer != null) { if (newLabel != null) viewer.getCommonNavigator().setWorkingSetLabel(newLabel); viewer.getFrameList().reset(); viewer.refresh(); } }
Example #20
Source File: WorkingSetActionProvider.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
/** * Set current active working set. * * @param workingSet * working set to be activated, may be <code>null</code> */ protected void setWorkingSet(IWorkingSet workingSet) { this.workingSet = workingSet; emptyWorkingSet = workingSet != null && workingSet.isAggregateWorkingSet() && workingSet.isEmpty(); ignoreFilterChangeEvents = true; try { workingSetActionGroup.setWorkingSet(workingSet); } finally { ignoreFilterChangeEvents = false; } if (viewer != null) { setWorkingSetFilter(workingSet); if (workingSet == null || emptyWorkingSet || !extensionStateModel.getBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS)) { if (viewer.getInput() != originalViewerInput) { viewer.setInput(originalViewerInput); } else { viewer.refresh(); } } else { if (!workingSet.isAggregateWorkingSet()) { IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); viewer.setInput(workingSetManager.createAggregateWorkingSet( "", "", new IWorkingSet[] { workingSet })); //$NON-NLS-1$ //$NON-NLS-2$ } else { viewer.setInput(workingSet); } } } }
Example #21
Source File: TagsSetHandler.java From e4macs with Eclipse Public License 1.0 | 5 votes |
/** * Get the correct working set, if working sets are present in environment * The Eclipse UI's default 'Other Projects' entry is not represented in the manager * so, if a file from there is selected a Workspace search will result. * * @param editor * @return current IWorkingSet or null */ private IWorkingSet getWorkingSet(ITextEditor editor) { IWorkingSet result = null; IWorkbenchPage page = getWorkbenchPage(); if (page != null) { IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSet[] workingSets = manager.getRecentWorkingSets(); if (workingSets != null && workingSets.length > 0) { // return most recent working set result = workingSets[0]; } else { // For some lame reason, recent working sets is often not set in the manager // so paw through them manually workingSets = manager.getAllWorkingSets(); if (workingSets != null && workingSets.length > 0) { IProject proj = this.getCurrentProject(editor); for(IWorkingSet set : workingSets) { for (IAdaptable ele : set.getElements()) { Object adapt = ele.getAdapter(IProject.class); if (adapt != null && adapt.equals(proj)){ return set; } } } } } } return result; }
Example #22
Source File: GoSearchPage.java From goclipse with Eclipse Public License 1.0 | 5 votes |
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; } } } String[] fileNamePatterns = settings.getArray("fileNamePatterns"); //$NON-NLS-1$ if (fileNamePatterns == null) { fileNamePatterns = new String[0]; } try { int scope = settings.getInt("scope"); //$NON-NLS-1$ boolean isRegExSearch = settings.getBoolean("isRegExSearch"); //$NON-NLS-1$ boolean ignoreCase = settings.getBoolean("ignoreCase"); //$NON-NLS-1$ return new SearchPatternData(textPattern, !ignoreCase, isRegExSearch, fileNamePatterns, scope, workingSets); } catch (NumberFormatException e) { return null; } }
Example #23
Source File: WorkingSetAwareContentProvider.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void workingSetModelChanged(PropertyChangeEvent event) { String property= event.getProperty(); Object newValue= event.getNewValue(); List<Object> toRefresh= new ArrayList<Object>(1); if (WorkingSetModel.CHANGE_WORKING_SET_MODEL_CONTENT.equals(property)) { toRefresh.add(fWorkingSetModel); } else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) { toRefresh.add(newValue); } else if (IWorkingSetManager.CHANGE_WORKING_SET_LABEL_CHANGE.equals(property)) { toRefresh.add(newValue); } ArrayList<Runnable> runnables= new ArrayList<Runnable>(); postRefresh(toRefresh, true, runnables); executeRunnables(runnables); }
Example #24
Source File: ManualAssociationAwareWorkingSetManager.java From n4js with Eclipse Public License 1.0 | 5 votes |
/** * Deletes all Eclipse based working sets that belong to the 'Resources' working set type. */ private void deleteEclipseResourcesWorkingSets() { // Discard the Eclipse based working set manager state by deleting all 'Resources' working sets. final Iterator<IWorkingSet> itr = getAllEclipseResourceWorkingSetsIterator(); final IWorkingSetManager manager = getWorkbench().getWorkingSetManager(); while (itr.hasNext()) { final IWorkingSet next = itr.next(); manager.removeWorkingSet(next); } }
Example #25
Source File: GlobalRefreshResourceSelectionPage.java From APICloud-Studio with GNU General Public License v3.0 | 5 votes |
private void initializeScopingHint() { String working_sets = settings.get(STORE_WORKING_SETS); if (working_sets == null) { participantScope.setSelection(true); updateParticipantScope(); } else { StringTokenizer st = new StringTokenizer(working_sets, " ,"); //$NON-NLS-1$ ArrayList ws = new ArrayList(); while (st.hasMoreTokens()) { String workingSetName = st.nextToken(); if (workingSetName != null && workingSetName.equals("") == false) { //$NON-NLS-1$ IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); IWorkingSet workingSet = workingSetManager.getWorkingSet(workingSetName); if (workingSet != null) { ws.add(workingSet); } } } if(! ws.isEmpty()) { this.workingSets = (IWorkingSet[]) ws.toArray(new IWorkingSet[ws.size()]); updateWorkingSetScope(); updateWorkingSetLabel(); participantScope.setSelection(false); selectedResourcesScope.setSelection(false); workingSetScope.setSelection(true); } } }
Example #26
Source File: PackageExplorerActionGroup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void doWorkingSetChanged(PropertyChangeEvent event) { if (ViewActionGroup.MODE_CHANGED.equals(event.getProperty())) { fPart.rootModeChanged(((Integer)event.getNewValue()).intValue()); Object oldInput= null; 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(); } if (oldInput != null && newInput != null) { Frame frame; for (int i= 0; (frame= fFrameList.getFrame(i)) != null; i++) { if (frame instanceof TreeFrame) { TreeFrame treeFrame= (TreeFrame)frame; if (oldInput.equals(treeFrame.getInput())) treeFrame.setInput(newInput); } } } } else { IWorkingSet workingSet= (IWorkingSet) event.getNewValue(); String workingSetLabel= null; if (workingSet != null) workingSetLabel= BasicElementLabels.getWorkingSetLabel(workingSet); fPart.setWorkingSetLabel(workingSetLabel); fPart.updateTitle(); String property= event.getProperty(); if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) { TreeViewer viewer= fPart.getTreeViewer(); viewer.getControl().setRedraw(false); viewer.refresh(); viewer.getControl().setRedraw(true); } } }
Example #27
Source File: WorkingSetConfigurationDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * Adds back removed working sets to the working set manager. */ private void restoreRemovedWorkingSets() { IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); Iterator<IWorkingSet> iterator= fRemovedWorkingSets.iterator(); while (iterator.hasNext()) { manager.addWorkingSet(iterator.next()); } iterator= fRemovedMRUWorkingSets.iterator(); while (iterator.hasNext()) { manager.addRecentWorkingSet(iterator.next()); } }
Example #28
Source File: TypeHierarchyViewPart.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
protected void doPropertyChange(PropertyChangeEvent event) { String property= event.getProperty(); if (fMethodsViewer != null) { if (MembersOrderPreferenceCache.isMemberOrderProperty(event.getProperty())) { fMethodsViewer.refresh(); } } if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) { updateHierarchyViewer(true); updateToolTipAndDescription(); } }
Example #29
Source File: JavaBrowsingPart.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
private void doWorkingSetChanged(PropertyChangeEvent event) { String property= event.getProperty(); if (IWorkingSetManager.CHANGE_WORKING_SET_LABEL_CHANGE.equals(property)) updateTitle(); else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property)) { updateTitle(); fViewer.getControl().setRedraw(false); fViewer.refresh(); fViewer.getControl().setRedraw(true); } }
Example #30
Source File: ConfigureWorkingSetAssignementAction.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * {@inheritDoc} */ @Override protected void cancelPressed() { IWorkingSetManager manager= PlatformUI.getWorkbench().getWorkingSetManager(); for (int i= 0; i < fCreatedWorkingSets.size(); i++) { manager.removeWorkingSet(fCreatedWorkingSets.get(i)); } super.cancelPressed(); }