Java Code Examples for org.eclipse.ui.IWorkbenchPage#removePartListener()

The following examples show how to use org.eclipse.ui.IWorkbenchPage#removePartListener() . 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: AbstractTimeGraphView.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public void dispose() {
    super.dispose();
    synchronized (fBuildJobMap) {
        fBuildJobMap.values().forEach(Job::cancel);
    }
    if (fZoomThread != null) {
        fZoomThread.cancel();
    }
    deactivateContextService();
    ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
    IWorkbenchPage page = getSite().getPage();
    if (fPartListener != null) {
        page.removePartListener(fPartListener);
    }
    if (fPartListener2 != null) {
        page.removePartListener(fPartListener2);
    }
}
 
Example 2
Source File: PackageExplorerPart.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
public void setLinkingEnabled(boolean enabled) {
	fLinkingEnabled= enabled;
	saveDialogSettings();

	IWorkbenchPage page= getSite().getPage();
	if (enabled) {
		page.addPartListener(fLinkWithEditorListener);

		IEditorPart editor = page.getActiveEditor();
		if (editor != null)
			editorActivated(editor);
	} else {
		page.removePartListener(fLinkWithEditorListener);
	}
	fOpenAndLinkWithEditorHelper.setLinkWithEditor(enabled);
}
 
Example 3
Source File: JSDTEditorTracker.java    From typescript.java with MIT License 5 votes vote down vote up
@Override
public void pageClosed(IWorkbenchPage page) {
	IEditorReference[] rs = page.getEditorReferences();
	for (IEditorReference r : rs) {
		IEditorPart part = r.getEditor(false);
		if (part != null) {
			editorClosed(part);
		}
	}
	page.removePartListener(this);
}
 
Example 4
Source File: FilenameDifferentiator.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public void dispose()
{
	IWorkbench workbench = null;
	try
	{
		workbench = PlatformUI.getWorkbench();
	}
	catch (Exception e)
	{
		// ignore
	}

	if (workbench != null)
	{
		IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
		if (window != null)
		{
			IWorkbenchPage page = window.getActivePage();
			if (page != null)
			{
				page.removePartListener(this);
			}
		}
	}
	if (baseNames != null)
	{
		baseNames.clear();
		baseNames = null;
	}
}
 
Example 5
Source File: CompletionMinibuffer.java    From e4macs with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * @see com.mulgasoft.emacsplus.minibuffer.HistoryMinibuffer#removeOtherListeners(IWorkbenchPage, ISourceViewer, StyledText)
 */
@Override
protected void removeOtherListeners(IWorkbenchPage page, ISourceViewer viewer, StyledText widget) {
	if (page != null) {
		page.removePartListener(this);
	}
	super.removeOtherListeners(page, viewer, widget);
}
 
Example 6
Source File: TecoRegister.java    From e4macs with Eclipse Public License 1.0 5 votes vote down vote up
public void removeListener(IPartListener2 listener) {
	IWorkbenchPage page = EmacsPlusUtils.getWorkbenchPage(); 
	if (page != null && location != null) {
		page.removePartListener(listener);
	}
	location.clearListener();
	location = null;
}
 
Example 7
Source File: OpenDocumentTracker.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void pageClosed(IWorkbenchPage page) {
	page.removePartListener(partListener);
}
 
Example 8
Source File: AllInOneWorkbenchListener.java    From typescript.java with MIT License 4 votes vote down vote up
private void unhookListeners(IWorkbenchPage page) {
	page.removePartListener(this);
}
 
Example 9
Source File: OccurrencesSearchResultPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void uninstall(IWorkbenchPage page) {
	page.removePartListener(this);
	uninstallOnActiveEditor();
}
 
Example 10
Source File: EditorTracker.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public void pageClosed(IWorkbenchPage page) {
	page.removePartListener(this);
}