use of org.eclipse.ui.keys.IBindingService in project translationstudio8 by heartsome.
the class KeyAssistHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
final IWorkbench workbench = PlatformUI.getWorkbench();
IBindingService bindingService = (IBindingService) workbench.getService(IBindingService.class);
BindingService service = (BindingService) bindingService;
ArrayList<Binding> lstBinding = new ArrayList<Binding>(Arrays.asList(bindingService.getBindings()));
List<String> lstRemove = Constants.lstRemove;
Iterator<Binding> it = lstBinding.iterator();
while (it.hasNext()) {
Binding binding = it.next();
ParameterizedCommand pCommand = binding.getParameterizedCommand();
if (pCommand == null || lstRemove.contains(pCommand.getCommand().getId())) {
it.remove();
}
}
service.getKeyboard().openKeyAssistShell(lstBinding);
return null;
}
use of org.eclipse.ui.keys.IBindingService in project translationstudio8 by heartsome.
the class ShieldStartup method earlyStartup.
public void earlyStartup() {
IWorkbench workbench = PlatformUI.getWorkbench();
// 在工作台初始化后,移除平台默认的 scheme
IBindingService bindingService = (IBindingService) workbench.getService(IBindingService.class);
Scheme[] schemes = bindingService.getDefinedSchemes();
for (int i = 0; i < schemes.length; i++) {
String id = schemes[i].getId();
if (id.equals(platformDefaultScheme) || id.equals(platformEmacsScheme)) {
schemes[i].undefine();
}
}
}
use of org.eclipse.ui.keys.IBindingService in project translationstudio8 by heartsome.
the class TmMatchEditDialog method close.
@Override
public boolean close() {
IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
bindingService.setKeyFilterEnabled(true);
srcSegmentViewer.reset();
tgtSegmentViewer.reset();
return super.close();
}
use of org.eclipse.ui.keys.IBindingService in project KaiZen-OpenAPI-Editor by RepreZen.
the class JsonContentAssistProcessor method initTextMessages.
protected String[] initTextMessages() {
IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
String bindingKey = bindingService.getBestActiveBindingFormattedFor(EDIT_CONTENT_ASSIST);
ContextType contextType = referenceProposalProvider.getContextTypes().get(getCurrentPath() != null ? getCurrentPath().toString() : "");
String context = contextType != null ? contextType.label() : "";
return new String[] { //
String.format(Messages.content_assist_proposal_project, bindingKey, context), String.format(Messages.content_assist_proposal_workspace, bindingKey, context), String.format(Messages.content_assist_proposal_local, bindingKey, context) };
}
use of org.eclipse.ui.keys.IBindingService in project eclipse.platform.text by eclipse.
the class IncrementalFindTarget method focusLost.
@Override
public void focusLost(FocusEvent e) {
IBindingService bindingService = PlatformUI.getWorkbench().getAdapter(IBindingService.class);
if (bindingService != null && !bindingService.isKeyFilterEnabled()) {
/*
* Workaround for bug 492587: Autosave breaks Incremental Find:
* We don't want to leave when the Workbench Window temporarily disables controls to
* run an IRunnableWithProgress. There's no direct API to know that this happens, but
* we can rely on the implementation detail that WorkbenchWindow#run(..) disables the
* key filter (and is the only one who does this, except for the Keys preference page).
*/
return;
}
leave();
}
Aggregations