本文整理汇总了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);
}
}
}
示例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();
}
}
示例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);
}
示例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();
}