Exemplo n.º 1
0
  /**
   * Show popup menu in response to a key event.
   * 
   * @param e Event.
   */
  @Override
  protected void showPopup(KeyEvent e) {

    // Retrieve information
    if (!(e.getComponent() instanceof MWPane)) {
      return;
    }
    MWPane textPane = (MWPane) e.getComponent();
    try {
      Rectangle rect = textPane.modelToView(textPane.getCaretPosition());
      showPopup(textPane, textPane.getSelectionStart(), rect.x, rect.y);
    } catch (BadLocationException e1) {
      //
    }
  }