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


Java IBindingService.setKeyFilterEnabled方法代码示例

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


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

示例1: handleEvent

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
public static void handleEvent(Event e)
{
	IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);

	Listener keyDownFilter = ((BindingService) bindingService).getKeyboard().getKeyDownFilter();
	boolean enabled = bindingService.isKeyFilterEnabled();
	Control focusControl = e.display.getFocusControl();
	try
	{
		bindingService.setKeyFilterEnabled(true);
		keyDownFilter.handleEvent(e);
	}
	finally
	{
		if (focusControl == e.display.getFocusControl()) // $codepro.audit.disable useEquals
		{
			bindingService.setKeyFilterEnabled(enabled);
		}
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:21,代码来源:KeyBindingHelper.java

示例2: setFindBarContextActive

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
private void setFindBarContextActive(boolean activate)
{
	fActivated = activate;
	IWorkbenchPartSite site = textEditor.getSite();
	IHandlerService handlerService = (IHandlerService) site.getService(IHandlerService.class);
	IBindingService service = (IBindingService) site.getService(IBindingService.class);

	if (activate)
	{

		// These will be the only active commands (note that they may have multiple keybindings
		// defined in plugin.xml)
		for (Map.Entry<String, AbstractHandler> entry : fCommandToHandler.entrySet())
		{
			AbstractHandler handler = entry.getValue();
			if (handler != null)
			{
				fHandlerActivations.add(handlerService.activateHandler(entry.getKey(), handler));
			}
		}

		// Yes, no longer execute anything from the binding service (we'll do our own handling so that the commands
		// we need still get executed).
		service.setKeyFilterEnabled(false);

		service.addBindingManagerListener(fClearCommandToBindingOnChangesListener);
	}
	else
	{
		fCommandToBinding = null;
		service.setKeyFilterEnabled(true);

		service.removeBindingManagerListener(fClearCommandToBindingOnChangesListener);
		handlerService.deactivateHandlers(fHandlerActivations);
		fHandlerActivations.clear();
	}
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:38,代码来源:FindBarActions.java

示例3: TmMatchEditDialog

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
/**
 * Create the dialog.
 * @param parentShell
 */
public TmMatchEditDialog(Shell parentShell, FuzzySearchResult fuzzyResult) {
	super(parentShell);
	this.fuzzyResult = fuzzyResult;
	setShellStyle(getShellStyle() | SWT.RESIZE);
	IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
	bindingService.setKeyFilterEnabled(false);
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:12,代码来源:TmMatchEditDialog.java

示例4: close

import org.eclipse.ui.keys.IBindingService; //导入方法依赖的package包/类
@Override
public boolean close() {
	IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
	bindingService.setKeyFilterEnabled(true);
	srcSegmentViewer.reset();
	tgtSegmentViewer.reset();
	return super.close();
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:9,代码来源:TmMatchEditDialog.java


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