Java Code Examples for org.eclipse.ui.IWorkbenchPartSite#getWorkbenchWindow()
The following examples show how to use
org.eclipse.ui.IWorkbenchPartSite#getWorkbenchWindow() .
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: JavaReconciler.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
@Override public void uninstall() { IWorkbenchPartSite site= fTextEditor.getSite(); IWorkbenchWindow window= site.getWorkbenchWindow(); window.getPartService().removePartListener(fPartListener); fPartListener= null; Shell shell= window.getShell(); if (shell != null && !shell.isDisposed()) shell.removeShellListener(fActivationListener); fActivationListener= null; JavaCore.removeElementChangedListener(fJavaElementChangedListener); fJavaElementChangedListener= null; IWorkspace workspace= JavaPlugin.getWorkspace(); workspace.removeResourceChangeListener(fResourceChangeListener); fResourceChangeListener= null; JavaPlugin.getDefault().getCombinedPreferenceStore().removePropertyChangeListener(fPropertyChangeListener); fPropertyChangeListener= null; super.uninstall(); }
Example 2
Source File: FindBugsAction.java From spotbugs with GNU Lesser General Public License v2.1 | 5 votes |
protected static IWorkbenchWindow getWindow(IWorkbenchPart part) { IWorkbenchWindow window; IWorkbenchPartSite currentSite = part != null ? part.getSite() : null; if (currentSite != null) { window = currentSite.getWorkbenchWindow(); } else { window = FindbugsPlugin.getActiveWorkbenchWindow(); } return window; }
Example 3
Source File: JavaReconciler.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@Override public void install(ITextViewer textViewer) { super.install(textViewer); fPartListener= new PartListener(); IWorkbenchPartSite site= fTextEditor.getSite(); IWorkbenchWindow window= site.getWorkbenchWindow(); window.getPartService().addPartListener(fPartListener); fActivationListener= new ActivationListener(textViewer.getTextWidget()); Shell shell= window.getShell(); shell.addShellListener(fActivationListener); fJavaElementChangedListener= new ElementChangedListener(); JavaCore.addElementChangedListener(fJavaElementChangedListener); fResourceChangeListener= new ResourceChangeListener(); IWorkspace workspace= JavaPlugin.getWorkspace(); workspace.addResourceChangeListener(fResourceChangeListener); fPropertyChangeListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (SpellingService.PREFERENCE_SPELLING_ENABLED.equals(event.getProperty()) || SpellingService.PREFERENCE_SPELLING_ENGINE.equals(event.getProperty())) forceReconciling(); } }; JavaPlugin.getDefault().getCombinedPreferenceStore().addPropertyChangeListener(fPropertyChangeListener); fReconciledElement= EditorUtility.getEditorInputJavaElement(fTextEditor, false); }
Example 4
Source File: WorkbenchUtils.java From goclipse with Eclipse Public License 1.0 | 4 votes |
public static IWorkbenchPart getActivePart(IWorkbenchPartSite site) { IWorkbenchWindow window = site.getWorkbenchWindow(); IPartService service = window.getPartService(); return service.getActivePart(); }