热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.eclipse.e4.core.contexts.IEclipseContext.set()方法的使用及代码示例

本文整理了Java中org.eclipse.e4.core.contexts.IEclipseContext.set()方法的一些代码示例,展示了IEcli

本文整理了Java中org.eclipse.e4.core.contexts.IEclipseContext.set()方法的一些代码示例,展示了IEclipseContext.set()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IEclipseContext.set()方法的具体详情如下:
包路径:org.eclipse.e4.core.contexts.IEclipseContext
类名称:IEclipseContext
方法名:set

IEclipseContext.set介绍

[英]Sets a value to be associated with a given class in this context.
[中]设置要在此上下文中与给定类关联的值。

代码示例

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.core.commands

@Override
public void activateHandler(String commandId, Object handler) {
String handlerId = H_ID + commandId;
context.set(handlerId, handler);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

@PostConstruct
public void init(IEclipseContext context) {
this.cOntext= context;
this.context.set(SHARED_ELEMENTS_STORE, new HashMap>());
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.core.contexts

/**
* Creates and returns a new empty context.
* @return A new empty context.
*/
static public IEclipseContext create(String name) {
IEclipseContext result = create();
result.set(EclipseContext.DEBUG_STRING, name);
return result;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

private CommandService initializeCommandService(IEclipseContext appContext) {
CommandService service = new CommandService(commandManager, appContext);
appContext.set(ICommandService.class, service);
appContext.set(IUpdateService.class, service);
service.readRegistry();
return service;
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.workbench.renderers.base

private static void populateModelInterfaces(MApplicationElement element, IEclipseContext context, Class[] interfaces) {
for (Class intf : interfaces) {
context.set(intf.getName(), element);
populateModelInterfaces(element, context, intf.getInterfaces());
}
}
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.ui.services

private void deferDeactivateContext(String id) {
@SuppressWarnings("unchecked")
LinkedList locals = (LinkedList) eclipseContext.getLocal(DEFERED_DEACTIVATES);
if (locals == null) {
locals = new LinkedList<>();
eclipseContext.set(DEFERED_DEACTIVATES, locals);
}
locals.add(id);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.workbench.base

private static void populateModelInterfaces(MContext contextModel, IEclipseContext context, Class[] interfaces) {
for (Class intf : interfaces) {
context.set(intf.getName(), contextModel);
populateModelInterfaces(contextModel, context, intf.getInterfaces());
}
}
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

@Override
public PerspectiveBuilder createPerspectiveBuilder(PerspectiveReader perspReader) {
IEclipseContext childCOntext= context.createChild();
childContext.set(PerspectiveReader.class, perspReader);
return ContextInjectionFactory.make(PerspectiveBuilder.class, childContext);
}

代码示例来源:origin: org.eclipse.e4.ui/bindings

@PostConstruct
public void init(IEclipseContext context) {
ContextManager cOntextManager= context.get(ContextManager.class);
ContextSet.setComparator(new ContextSet.CComp(contextManager));
context.set(BindingTableManager.class,
ContextInjectionFactory.make(BindingTableManager.class, context));
context.set(EBindingService.class.getName(), new BindingServiceCreationFunction());
}
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.keybindings.e4

@SuppressWarnings("static-method")
@PostConstruct
void init(IEclipseContext context) {
ContextManager cOntextManager= context.get(ContextManager.class);
ContextSet.setComparator(new ContextSet.CComp(contextManager));
context.set(BindingTableManager.class, ContextInjectionFactory.make(BindingTableManager.class, context));
context.set(EBindingService.class.getName(), new BindingServiceCreationFunction());
}
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

public void widgetSelected(SelectionEvent e) {
lclContext.set(MItem.class.getName(), item);
ContextInjectionFactory.invoke(contrib.getObject(),
Execute.class, lclContext);
lclContext.remove(MItem.class.getName());
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.ui.services

@Override
public Object compute(IEclipseContext context, String contextKey) {
EventBroker broker = context.getLocal(EventBroker.class);
if (broker == null) {
broker = ContextInjectionFactory.make(EventBroker.class, context);
context.set(EventBroker.class, broker);
}
return broker;
}
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.core.commands

@Override
public Object compute(IEclipseContext context, String contextKey) {
if (service == null) {
IEclipseContext root = getRootContext(context);
manager = new CommandManager();
root.set(CommandManager.class.getName(), manager);
service = ContextInjectionFactory.make(CommandServiceImpl.class, root);
}
return service;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

private void handleContextSet(Event event) {
Object element = event.getProperty(UIEvents.EventTags.ELEMENT);
MPart part = getModel();
if (element == part) {
IEclipseContext cOntext= part.getContext();
if (context != null) {
context.set(getClass().getName(), this);
unsubscribe();
}
}
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

public void updateShowInSources(MPart part) {
IWorkbenchPart workbenchPart = getWorkbenchPart(part);
ShowInContext cOntext= getContext(workbenchPart);
if (context != null) {
window.getContext().set(ISources.SHOW_IN_INPUT, context.getInput());
window.getContext().set(ISources.SHOW_IN_SELECTION, context.getSelection());
}
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

public void showPopup(final Event event, final Menu menu,
final MPopupMenu menuModel) {
// System.err.println("showPopup: " + menuModel + "\n\t" + menu);
// we need some context foolery here
final IEclipseContext popupCOntext= menuModel.getContext();
final IEclipseContext parentCOntext= popupContext.getParent();
final IEclipseContext originalChild = parentContext.getActiveChild();
popupContext.activate();
popupContext.set(TMP_ORIGINAL_CONTEXT, originalChild);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.e4.ui.workbench

@Override
public void changeApplicationLocale(Locale locale) {
// the TranslationService.LOCALE context parameter is specified as String
// so we put the String representation of the given Locale to the context
this.application.getContext().set(TranslationService.LOCALE, locale);
// update model
updateLocalization(this.application.getChildren());
// fire event
broker.post(LOCALE_CHANGE, locale);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.workbench.fx

@Override
public void stop() {
if (this.app != null) {
this.app.getContext().set("__efx_engine_shutdown", Boolean.TRUE); //$NON-NLS-1$
for (MWindow w : this.app.getChildren()) {
ElementRenderer r = getRenderer(w);
if (r != null) {
removeGui(w);
}
}
}
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt

private void showPopup(final Menu menu, final MPopupMenu menuModel,
MenuManager menuManager) {
// System.err.println("showPopup: " + menuModel + "\n\t" + menu);
// we need some context foolery here
final IEclipseContext popupCOntext= menuModel.getContext();
final IEclipseContext parentCOntext= popupContext.getParent();
final IEclipseContext originalChild = parentContext.getActiveChild();
popupContext.activate();
popupContext.set(MenuManagerRendererFilter.TMP_ORIGINAL_CONTEXT,
originalChild);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.code.editor.e4

void handlePartDirty(Event event) {
Object element = event.getData();
// TODO remove once we run on Neon See https://bugs.eclipse.org/bugs/show_bug.cgi?id=480934
if( element == null ) {
element = event.getProperties().get(EventTags.ELEMENT);
}
if( element instanceof MContext ) {
((MContext) element).getContext().set(Constants.EDITOR_DIRTY_FLAG_KEY, event.getProperties().get(EventTags.NEW_VALUE));
broker.publish(TOPIC_REQUEST_ENABLEMENT_UPDATE_STRING, UIEvents.ALL_ELEMENT_ID,true);
}
}

推荐阅读
  • 开发笔记:加密&json&StringIO模块&BytesIO模块
    篇首语:本文由编程笔记#小编为大家整理,主要介绍了加密&json&StringIO模块&BytesIO模块相关的知识,希望对你有一定的参考价值。一、加密加密 ... [详细]
  • 如何使用Java获取服务器硬件信息和磁盘负载率
    本文介绍了使用Java编程语言获取服务器硬件信息和磁盘负载率的方法。首先在远程服务器上搭建一个支持服务端语言的HTTP服务,并获取服务器的磁盘信息,并将结果输出。然后在本地使用JS编写一个AJAX脚本,远程请求服务端的程序,得到结果并展示给用户。其中还介绍了如何提取硬盘序列号的方法。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • Java实战之电影在线观看系统的实现
    本文介绍了Java实战之电影在线观看系统的实现过程。首先对项目进行了简述,然后展示了系统的效果图。接着介绍了系统的核心代码,包括后台用户管理控制器、电影管理控制器和前台电影控制器。最后对项目的环境配置和使用的技术进行了说明,包括JSP、Spring、SpringMVC、MyBatis、html、css、JavaScript、JQuery、Ajax、layui和maven等。 ... [详细]
  • Java序列化对象传给PHP的方法及原理解析
    本文介绍了Java序列化对象传给PHP的方法及原理,包括Java对象传递的方式、序列化的方式、PHP中的序列化用法介绍、Java是否能反序列化PHP的数据、Java序列化的原理以及解决Java序列化中的问题。同时还解释了序列化的概念和作用,以及代码执行序列化所需要的权限。最后指出,序列化会将对象实例的所有字段都进行序列化,使得数据能够被表示为实例的序列化数据,但只有能够解释该格式的代码才能够确定数据的内容。 ... [详细]
  • 本文介绍了Java工具类库Hutool,该工具包封装了对文件、流、加密解密、转码、正则、线程、XML等JDK方法的封装,并提供了各种Util工具类。同时,还介绍了Hutool的组件,包括动态代理、布隆过滤、缓存、定时任务等功能。该工具包可以简化Java代码,提高开发效率。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • 本文讨论了一个关于cuowu类的问题,作者在使用cuowu类时遇到了错误提示和使用AdjustmentListener的问题。文章提供了16个解决方案,并给出了两个可能导致错误的原因。 ... [详细]
  • Oracle seg,V$TEMPSEG_USAGE与Oracle排序的关系及使用方法
    本文介绍了Oracle seg,V$TEMPSEG_USAGE与Oracle排序之间的关系,V$TEMPSEG_USAGE是V_$SORT_USAGE的同义词,通过查询dba_objects和dba_synonyms视图可以了解到它们的详细信息。同时,还探讨了V$TEMPSEG_USAGE的使用方法。 ... [详细]
  • 预备知识可参考我整理的博客Windows编程之线程:https:www.cnblogs.comZhuSenlinp16662075.htmlWindows编程之线程同步:https ... [详细]
  • 本文介绍了在wepy中运用小顺序页面受权的计划,包含了用户点击作废后的从新受权计划。 ... [详细]
  • Java程序设计第4周学习总结及注释应用的开发笔记
    本文由编程笔记#小编为大家整理,主要介绍了201521123087《Java程序设计》第4周学习总结相关的知识,包括注释的应用和使用类的注释与方法的注释进行注释的方法,并在Eclipse中查看。摘要内容大约为150字,提供了一定的参考价值。 ... [详细]
  • 本文记录了在vue cli 3.x中移除console的一些采坑经验,通过使用uglifyjs-webpack-plugin插件,在vue.config.js中进行相关配置,包括设置minimizer、UglifyJsPlugin和compress等参数,最终成功移除了console。同时,还包括了一些可能出现的报错情况和解决方法。 ... [详细]
  • 本文讨论了在VMWARE5.1的虚拟服务器Windows Server 2008R2上安装oracle 10g客户端时出现的问题,并提供了解决方法。错误日志显示了异常访问违例,通过分析日志中的问题帧,找到了解决问题的线索。文章详细介绍了解决方法,帮助读者顺利安装oracle 10g客户端。 ... [详细]
author-avatar
谭禅心_136
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有