本文整理汇总了Java中org.eclipse.ui.contexts.IContextService类的典型用法代码示例。如果您正苦于以下问题:Java IContextService类的具体用法?Java IContextService怎么用?Java IContextService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IContextService类属于org.eclipse.ui.contexts包,在下文中一共展示了IContextService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPartControl
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Code Folding
ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
// Occurrence initiation, need ITextResource and ISourceViewer.
highlighting = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileHighlighting(getResource(), viewer, colorManager, this);
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
projectionSupport.install();
// turn projection mode on
viewer.doOperation(ProjectionViewer.TOGGLE);
codeFoldingManager = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileCodeFoldingManager(viewer, this);
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext("de.darwinspl.preferences.resource.dwprofile.EditorScope");
}
示例2: createPartControl
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Code Folding
ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
// Occurrence initiation, need ITextResource and ISourceViewer.
highlighting = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionHighlighting(getResource(), viewer, colorManager, this);
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
projectionSupport.install();
// turn projection mode on
viewer.doOperation(ProjectionViewer.TOGGLE);
codeFoldingManager = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionCodeFoldingManager(viewer, this);
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext("eu.hyvar.feature.expression.resource.hyexpression.EditorScope");
}
示例3: createPartControl
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Code Folding
ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
// Occurrence initiation, need ITextResource and ISourceViewer.
highlighting = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaHighlighting(getResource(), viewer, colorManager, this);
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
projectionSupport.install();
// turn projection mode on
viewer.doOperation(ProjectionViewer.TOGGLE);
codeFoldingManager = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaCodeFoldingManager(viewer, this);
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext("eu.hyvar.context.contextValidity.resource.hyvalidityformula.EditorScope");
}
示例4: createPartControl
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Code Folding
ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
// Occurrence initiation, need ITextResource and ISourceViewer.
highlighting = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueHighlighting(getResource(), viewer, colorManager, this);
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
projectionSupport.install();
// turn projection mode on
viewer.doOperation(ProjectionViewer.TOGGLE);
codeFoldingManager = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueCodeFoldingManager(viewer, this);
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext("eu.hyvar.dataValues.resource.hydatavalue.EditorScope");
}
示例5: createPartControl
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Code Folding
ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
// Occurrence initiation, need ITextResource and ISourceViewer.
highlighting = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingHighlighting(getResource(), viewer, colorManager, this);
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
projectionSupport.install();
// turn projection mode on
viewer.doOperation(ProjectionViewer.TOGGLE);
codeFoldingManager = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingCodeFoldingManager(viewer, this);
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext("eu.hyvar.feature.mapping.resource.hymapping.EditorScope");
}
示例6: createPartControl
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Code Folding
ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
// Occurrence initiation, need ITextResource and ISourceViewer.
highlighting = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsHighlighting(getResource(), viewer, colorManager, this);
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
projectionSupport.install();
// turn projection mode on
viewer.doOperation(ProjectionViewer.TOGGLE);
codeFoldingManager = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsCodeFoldingManager(viewer, this);
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext("eu.hyvar.feature.constraint.resource.hyconstraints.EditorScope");
}
示例7: createPartControl
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
public void createPartControl(Composite parent) {
super.createPartControl(parent);
// Code Folding
ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
// Occurrence initiation, need ITextResource and ISourceViewer.
highlighting = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestHighlighting(getResource(), viewer, colorManager, this);
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
projectionSupport.install();
// turn projection mode on
viewer.doOperation(ProjectionViewer.TOGGLE);
codeFoldingManager = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestCodeFoldingManager(viewer, this);
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext("eu.hyvar.mspl.manifest.resource.hymanifest.EditorScope");
}
示例8: handleStateChange
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
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;
}
}
}
示例9: createControls
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
@Override
protected void createControls(Composite composite) {
super.createControls(composite);
ICompareContainer container = getCompareConfiguration().getContainer();
IWorkbenchPart workbenchPart= container.getWorkbenchPart();
if (workbenchPart != null) {
IContextService service= workbenchPart.getSite().getService(IContextService.class);
if (service != null) {
service.activateContext(EditorSettings_Actual.EDITOR_CONTEXT_ID);
}
}
// TODO: activate Lang editor commands
// IHandlerService handlerSvc = container.getServiceLocator().getService(IHandlerService.class);
// handlerSvc.activateHandler(EditorCommandIds.OpenDef_ID, new OpenDefinitionHandler2());
}
示例10: activateContext
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
/**
* 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);
}
示例11: initN4Context
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
private void initN4Context() {
if (isWorkbenchRunning()) {
final IWorkbench workbench = getWorkbench();
workbench.getDisplay().asyncExec(() -> {
final IContextService service = workbench.getService(IContextService.class);
service.activateContext(N4_CONTEXT_ID);
});
}
}
示例12: createPartControl
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent) {
parentComposite = parent;
super.createPartControl(parent);
setLineBackground();
getSite().getService(IContextService.class).activateContext(CONTEXT.EDITOR);
}
示例13: createPartControl
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
@Override
public void createPartControl(Composite parent) {
contextService = (IContextService) PlatformUI.getWorkbench().getService(IContextService.class);
createWidgets(parent);
debugEventListener = new DebugListener();
DebugPlugin.getDefault().addDebugEventListener(debugEventListener);
breakpointListener = new PandionJBreakpointListener();
JDIDebugModel.addJavaBreakpointListener(breakpointListener);
// populateToolBar();
addErrorReporting();
}
示例14: init
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
setSite(site);
setInput(input);
setTitleImage(input.getImageDescriptor().createImage());
setPartName(input.getName());
// initialize the context bindings for this editor. Useful for shortcuts
IContextService service = (IContextService) site.getService(IContextService.class);
service.activateContext(CONTEXT_ID);
// get the input
avroSchema = getAvroSchema();
// load the configurations
IEditorConfiguration editorConfiguration = loadEditorConfiguration();
SchemaViewerConfiguration schemaViewerConfiguration = loadSchemaViewerConfiguration();
AttributesConfiguration attributesConfiguration = loadAttributesConfiguration();
// create and configure the main component
editor = new AvroSchemaEditor(input.getName(), getContextId(), this);
editor.setEditorConfiguration(editorConfiguration);
editor.setSchemaViewerConfiguration(schemaViewerConfiguration);
editor.setAttributesConfiguration(attributesConfiguration);
editor.setInput(avroSchema);
editor.addDirtyListener(this);
}
示例15: createControls
import org.eclipse.ui.contexts.IContextService; //导入依赖的package包/类
@Override
protected void createControls(Composite composite) {
super.createControls(composite);
IWorkbenchPart workbenchPart = getCompareConfiguration().getContainer().getWorkbenchPart();
if (workbenchPart != null) {
IContextService service = workbenchPart.getSite().getService(IContextService.class);
if (service != null) {
service.activateContext("ts.eclipse.ide.jsdt.ui.typeScriptEditorScope"); //$NON-NLS-1$
}
}
}