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


Java BindingManager.setBindings方法代码示例

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


在下文中一共展示了BindingManager.setBindings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadModelBackend

import org.eclipse.jface.bindings.BindingManager; //导入方法依赖的package包/类
private static BindingManager loadModelBackend(IServiceLocator locator) {
	IBindingService bindingService = (IBindingService) locator.getService(IBindingService.class);
	BindingManager bindingManager = new BindingManager(new ContextManager(), new CommandManager());
	final Scheme[] definedSchemes = bindingService.getDefinedSchemes();
	try {
		Scheme modelActiveScheme = null;
		for (int i = 0; i < definedSchemes.length; i++) {
			final Scheme scheme = definedSchemes[i];
			final Scheme copy = bindingManager.getScheme(scheme.getId());
			copy.define(scheme.getName(), scheme.getDescription(), scheme.getParentId());
			if (definedSchemes[i] == bindingService.getActiveScheme()) {
				modelActiveScheme = copy;
			}
		}
		bindingManager.setActiveScheme(modelActiveScheme);
	} catch (final NotDefinedException e) {
		StatusManager.getManager()
				.handle(new Status(IStatus.WARNING, WorkbenchPlugin.PI_WORKBENCH,
						"Keys page found an undefined scheme", e)); //$NON-NLS-1$
	}
	bindingManager.setLocale(bindingService.getLocale());
	bindingManager.setPlatform(bindingService.getPlatform());
	bindingManager.setBindings(bindingService.getBindings());
	return bindingManager;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:26,代码来源:KeyController2.java

示例2: filterDupliteBind

import org.eclipse.jface.bindings.BindingManager; //导入方法依赖的package包/类
@SuppressWarnings("restriction")
public void filterDupliteBind(){
	IWorkbench workbench = PlatformUI.getWorkbench();
	IBindingService bindingService = (IBindingService) workbench.getService(IBindingService.class);
	BindingService service =(BindingService)bindingService;
	BindingManager bindingManager = service.getBindingManager();
	//service.getBindingManager().
	Binding[] bindings = bindingManager.getBindings();
     List<Binding> bindTemp = new ArrayList<Binding>();
     List<String> ids = new ArrayList<String>();
     for(Binding bind : bindings){
		if(null ==bind){
			continue;
		}
		ParameterizedCommand command = bind.getParameterizedCommand();
		if(null == command){
			continue;
		}
		String id = command.getId();
		if(!ids.contains(id)){
			ids.add(id);
			bindTemp.add(bind);
		}
	}
   
     bindingManager.setBindings(bindTemp.toArray(new Binding[ids.size()]));
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:28,代码来源:KeyController2.java

示例3: loadModelBackend

import org.eclipse.jface.bindings.BindingManager; //导入方法依赖的package包/类
private BindingManager loadModelBackend() {
	final BindingManager outManager = new BindingManager(
	        new ContextManager(), new CommandManager());
	final Scheme[] definedSchemes = bindingManagerApp.getDefinedSchemes();
	try {
		Scheme modelActiveScheme = null;
		for (int i = 0; i < definedSchemes.length; i++) {
			final Scheme scheme = definedSchemes[i];
			final Scheme copy = outManager.getScheme(scheme.getId());
			copy.define(scheme.getName(), scheme.getDescription(),
			        scheme.getParentId());
			if (definedSchemes[i].getId()
			        .equals(bindingManagerApp.getActiveScheme().getId())) {
				modelActiveScheme = copy;
			}
		}
		outManager.setActiveScheme(modelActiveScheme);
	}
	catch (final NotDefinedException exc) {
		log.error(exc, exc.getMessage());
	}
	outManager.setLocale(bindingManagerApp.getLocale());
	outManager.setPlatform(bindingManagerApp.getPlatform());
	// fill bindings from bindingService to bindingManager instance
	outManager.setBindings(getBindingsFromSrc());
	return outManager;
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:28,代码来源:KeyController.java


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