当前位置: 首页>>代码示例>>Java>>正文


Java IContextService.activateContext方法代码示例

本文整理汇总了Java中org.eclipse.ui.contexts.IContextService.activateContext方法的典型用法代码示例。如果您正苦于以下问题:Java IContextService.activateContext方法的具体用法?Java IContextService.activateContext怎么用?Java IContextService.activateContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.contexts.IContextService的用法示例。


在下文中一共展示了IContextService.activateContext方法的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");
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:19,代码来源:DwprofileEditor.java

示例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");
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:19,代码来源:HyexpressionEditor.java

示例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");
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:19,代码来源:HyvalidityformulaEditor.java

示例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");
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:19,代码来源:HydatavalueEditor.java

示例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");
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:19,代码来源:HymappingEditor.java

示例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");
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:19,代码来源:HyconstraintsEditor.java

示例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");
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:19,代码来源:HymanifestEditor.java

示例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;
        }
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:25,代码来源:PyContextActivator.java

示例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());
	}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:17,代码来源:LangTextMergeViewer.java

示例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);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:N4IDEXpectView.java

示例11: 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);
       
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:31,代码来源:AvroSchemaEditorPart.java

示例12: 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$
		}
	}
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:12,代码来源:TypeScriptMergeViewer.java

示例13: focusGained

import org.eclipse.ui.contexts.IContextService; //导入方法依赖的package包/类
public void focusGained(FocusEvent e) {
	ConfigurationManager.getInstance(getProject()).clearProjectClassLoader();
	
	IContextService contextService = (IContextService)PlatformUI.getWorkbench()
			.getService(IContextService.class);
	contextService.activateContext("com.hudson.velocityweb.velocityContext");
}
 
开发者ID:ninneko,项目名称:velocity-edit,代码行数:8,代码来源:VelocityEditor.java

示例14: setSite

import org.eclipse.ui.contexts.IContextService; //导入方法依赖的package包/类
@Override
protected void setSite(IWorkbenchPartSite newSite) {
	newSite.setSelectionProvider(new EnsembleSelectionProvider(this.toString()));
    super.setSite(newSite);
	IContextService contextService = (IContextService)newSite.getService(IContextService.class);
	contextService.activateContext("timeline");
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:8,代码来源:TimelineEditorPart.java

示例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 = (IContextService)workbenchPart.getSite().getService(IContextService.class);
		if (service != null) {
			service.activateContext("org.eclipse.jdt.ui.javaEditorScope"); //$NON-NLS-1$
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:JavaMergeViewer.java


注:本文中的org.eclipse.ui.contexts.IContextService.activateContext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。