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


Java IContextService类代码示例

本文整理汇总了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");
}
 
开发者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: 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);
		});
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:10,代码来源:N4JSApplicationWorkbenchWindowAdvisor.java

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

示例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();
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:16,代码来源:PandionJView.java

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


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