Examples of KeyHandler


Examples of baubles.common.event.KeyHandler

  @Override
  public void registerHandlers() {}
 
  @Override
  public void registerKeyBindings() {
    keyHandler = new KeyHandler();
    FMLCommonHandler.instance().bus().register(keyHandler);
    MinecraftForge.EVENT_BUS.register(new GuiEvents());
  }
View Full Code Here

Examples of org.crsh.keyboard.KeyHandler

    this.command = command;
  }

  @Override
  public void handle(KeyType type, int[] sequence) {
    KeyHandler keyHandler = process.getKeyHandler();
    if (keyHandler != null) {
      CRaSHConnector.log.fine("Processing key event " + type + " " + Arrays.toString(sequence));
      try {
        keyHandler.handle(type, sequence);
      }
      catch (Exception e) {
        CRaSHConnector.log.log(Level.SEVERE, "Processing key handler " + keyHandler + " threw an exception", e);
      }
    }
View Full Code Here

Examples of org.crsh.keyboard.KeyHandler

              if (s != null) {
                reader.line.add(s);
              }
            }
          } else {
            KeyHandler keyHandler = processHandler.process.getKeyHandler();
            if (keyHandler != null) {
              KeyType type = key.map();
              try {
                keyHandler.handle(type, key.sequence);
              }
              catch (Throwable t) {
                // Perhaps handle better this and treat error / exception differently
                log.log(Level.SEVERE, "Key handler " + keyHandler + " failure", t);
              }
View Full Code Here

Examples of org.crsh.keyboard.KeyHandler

    process.cancel();
    return this;
  }

  public BaseProcessContext on(KeyType type, int[] sequence) {
    KeyHandler handler = process.getKeyHandler();
    if (handler != null) {
      handler.handle(type, sequence);
    }
    return this;
  }
View Full Code Here

Examples of org.crsh.keyboard.KeyHandler

  }

  @Override
  public KeyHandler getKeyHandler() {
    for (CommandInvoker<?, ?> invoker : invokers) {
      KeyHandler handler = invoker.getKeyHandler();
      if (handler != null) {
        return handler;
      }
    }
    return null;
View Full Code Here

Examples of org.crsh.keyboard.KeyHandler

  public void testHandleKeyInProcess() {
    final ArrayBlockingQueue<Integer> keys = new ArrayBlockingQueue<Integer>(1);
    shell.addProcess(new SyncProcess() {
      @Override
      protected KeyHandler createKeyHandler() {
        return new KeyHandler() {
          @Override
          public void handle(KeyType type, int[] sequence) {
            for (int c : sequence) {
              keys.add(c);
            }
View Full Code Here

Examples of org.crsh.keyboard.KeyHandler

  public void testHandleKeyExceptionInProcess() {
    shell.addProcess(new SyncProcess() {
      @Override
      protected KeyHandler createKeyHandler() {
        return new KeyHandler() {
          @Override
          public void handle(KeyType type, int[] sequence) {
            throw new RuntimeException();
          }
        };
View Full Code Here

Examples of org.eclipse.gef.KeyHandler

        }
    }

    protected KeyHandler getCommonKeyHandler() {
        if (sharedKeyHandler == null) {
            sharedKeyHandler = new KeyHandler();
            sharedKeyHandler
                    .put(KeyStroke.getPressed(SWT.DEL, 127, 0),
                            getActionRegistry().getAction(
                                    ActionFactory.DELETE.getId()));
            sharedKeyHandler.put(KeyStroke.getPressed(SWT.F2, 0),
View Full Code Here

Examples of org.eclipse.gef.KeyHandler

                EditPart editPart = element.getTypeDefinition().createGraphicalEditPart(element);
                return editPart;
            }
        });

        KeyHandler keyHandler = new GraphicalViewerKeyHandler(getGraphicalViewer());
        keyHandler.setParent(getCommonKeyHandler());
        getGraphicalViewer().setKeyHandler(keyHandler);
        getGraphicalViewer().setContextMenu(createContextMenu());
        getSite().setSelectionProvider(getGraphicalViewer());
    }
View Full Code Here

Examples of org.eclipse.gef.KeyHandler

        getSite().setSelectionProvider(getGraphicalViewer());
    }

    protected KeyHandler getCommonKeyHandler() {
        if (commonKeyHandler == null) {
            commonKeyHandler = new KeyHandler();
            commonKeyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(ActionFactory.DELETE.getId()));
            commonKeyHandler.put(KeyStroke.getPressed(SWT.F2, 0), getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT));
        }
        return commonKeyHandler;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.