Package org.eclipse.ui.internal.keys

Examples of org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter


      // process the actual key stroke.
      display.asyncExec(new Runnable(){
        public void run(){
          BindingService bindingService = (BindingService)
            PlatformUI.getWorkbench().getAdapter(IBindingService.class);
          WorkbenchKeyboard keyboard = bindingService.getKeyboard();
          for(String sequence : sequences){
            try{
              if (sequence.equals("refocus")){
                logger.debug("refocus gvim");
                IWorkbenchPage page = PlatformUI.getWorkbench()
                  .getActiveWorkbenchWindow().getActivePage();
                IEditorPart editor = page.getActiveEditor();
                if (editor != null){
                  editor.setFocus();
                }
                continue;
              }

              KeyStroke keyStroke = KeyStroke.getInstance(sequence);

              Event event = new Event();
              event.widget = display.getActiveShell();

              ArrayList<KeyStroke> keyStrokes = new ArrayList<KeyStroke>();
              keyStrokes.add(keyStroke);
              keyboard.press(keyStrokes, event);
              logger.debug("key strokes processed: " + sequence);
            }catch(Throwable t){
              logger.error("Error feeding keys.", t);
            }
          }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.