Java Code Examples for org.eclipse.ui.contexts.IContextService#deactivateContext()

The following examples show how to use org.eclipse.ui.contexts.IContextService#deactivateContext() . 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: PyContextActivator.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
private void handleStateChange() {
    boolean isActive = false;
    for (IPyContextObserver obs : this.observers.getListeners()) {
        if (obs.isPyContextActive()) {
            isActive = true;
            break;
        }
    }

    IContextService contextService = (IContextService) PlatformUI.getWorkbench().getService(IContextService.class);
    //May be null on shutdown on Eclipse 4. 
    if (contextService != null) {
        if (isActive) {
            if (activateContext == null) {
                activateContext = contextService.activateContext("com.python.pydev.contexts.window");
            }
        } else {
            if (activateContext != null) {
                contextService.deactivateContext(activateContext);
            }
            activateContext = null;
        }
    }
}
 
Example 2
Source File: XFindPanel.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
private void deactivateContext() {
    if (contextActivation != null) {
        IContextService contextService = getService(IContextService.class);
        if (contextService != null) {
            contextService.deactivateContext(contextActivation);
        }
        contextActivation = null;
    }
}
 
Example 3
Source File: UpdateManager.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Cancel overriding of standard 'Check for Updates' handler. 
 */
public static void deactivateXdsUpdateContext() {
	if (activateContext != null) {
		IContextService contextService = (IContextService) PlatformUI.getWorkbench().getService(IContextService.class);
		contextService.deactivateContext(activateContext);
		activateContext = null;
	}
}
 
Example 4
Source File: GraphicalEditorWithFlyoutPalette.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private void deActivateDesignerEditPart( )
{
	if ( !UIUtil.isReportEditorActivated( ) )
	{
		IContextService contextService = (IContextService) PlatformUI.getWorkbench( )
				.getService( IContextService.class );
		if ( contextActivation != null )
		{
			contextService.deactivateContext( contextActivation );
			contextActivation = null;
		}
	}
}
 
Example 5
Source File: EmacsPlusConsoleParticipant.java    From e4macs with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * @see org.eclipse.ui.console.IConsolePageParticipant#deactivated()
 */
public void deactivated() {
       if (fContextActivation != null){
       	IContextService contextService = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
       	contextService.deactivateContext(fContextActivation);
       	fContextActivation = null;
       	((EmacsPlusConsole)console).offLine();
       }
}