use of org.eclipse.ui.contexts.IContextService in project n4js by eclipse.
the class N4IDEXpectView method activateContext.
/**
* Activate a context that this view uses. It will be tied to this view activation events and will be removed when
* the view is disposed.
*/
private void activateContext() {
IContextService contextService = getSite().getService(IContextService.class);
// this will get cleaned up automatically when the site
// is disposed
contextService.activateContext(VIEW_CONTEXT_ID);
}
use of org.eclipse.ui.contexts.IContextService in project tdq-studio-se by Talend.
the class PatternTestView method activateContext.
/**
* Activate a context that this view uses. It will be tied to this view activation events and will be removed when
* the view is disposed.
*/
private void activateContext() {
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext(VIEW_CONTEXT_ID);
TestRegularAction testRegularAction = new TestRegularAction();
IHandlerService service = (IHandlerService) getViewSite().getService(IHandlerService.class);
service.activateHandler(testRegularAction.getActionDefinitionId(), new ActionHandler(testRegularAction));
}
use of org.eclipse.ui.contexts.IContextService in project titan.EclipsePlug-ins by eclipse.
the class ASN1Editor method createSourceViewer.
@Override
protected ISourceViewer createSourceViewer(final Composite parent, final IVerticalRuler ruler, final int styles) {
ISourceViewer viewer = new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
getSourceViewerDecorationSupport(viewer);
Activator.getDefault().getPreferenceStore().addPropertyChangeListener(foldingListener);
// Context setting is placed here because getEditorSite() must
// be called after the editor is initialized.
IContextService contextService = (IContextService) getEditorSite().getService(IContextService.class);
// As the service is retrieved from the editor instance it will
// be active only within the editor.
contextService.activateContext(EDITOR_SCOPE);
return viewer;
}
use of org.eclipse.ui.contexts.IContextService in project titan.EclipsePlug-ins by eclipse.
the class ConfigTextEditor method createSourceViewer.
@Override
protected ISourceViewer createSourceViewer(final Composite parent, final IVerticalRuler ruler, final int styles) {
ISourceViewer viewer = new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles);
getSourceViewerDecorationSupport(viewer);
Activator.getDefault().getPreferenceStore().addPropertyChangeListener(foldingListener);
// Context setting is placed here because getEditorSite() must
// be called after the editor is
// initialized.
IContextService contextService = (IContextService) getEditorSite().getService(IContextService.class);
// As the service is retrieved from the editor instance it will
// be active only within the editor.
contextService.activateContext(EDITOR_SCOPE);
return viewer;
}
use of org.eclipse.ui.contexts.IContextService in project titan.EclipsePlug-ins by eclipse.
the class GraphEditor method init.
/**
* We just store the input and site to catch events
*
* @param input
* : the input to set
* @param site
* : the site to set
*/
@Override
public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
final IContextService contextService = (IContextService) site.getService(IContextService.class);
contextService.activateContext(GRAPH_CONTEXT_ID);
handlerService = (IHandlerService) site.getService(IHandlerService.class);
setSite(site);
setInput(input);
}
Aggregations