Exemplo n.º 1
0
 public void activate() {
   // arranco la primera opcion
   if (m_actionfirst != null) {
     m_actionfirst.actionPerformed(null);
     m_actionfirst = null;
   }
 }
Exemplo n.º 2
0
 private boolean proceedKeyEvent(KeyEvent event, KeyStroke stroke) {
   if (myInputMap.get(stroke) != null) {
     final Action action = myActionMap.get(myInputMap.get(stroke));
     if (action != null && action.isEnabled()) {
       action.actionPerformed(
           new ActionEvent(
               getContent(), event.getID(), "", event.getWhen(), event.getModifiers()));
       return true;
     }
   }
   return false;
 }
Exemplo n.º 3
0
  public void redoAction() {
    try {
      if (undoMgr.canRedo()) {
        redoAction.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "Redo"));

        setRedoItem();
      } else {
        java.awt.Toolkit.getDefaultToolkit().beep();
      }
    } catch (CannotUndoException ex) {
      ex.printStackTrace();
    }
  }
  @SuppressWarnings("HardCodedStringLiteral")
  private void processListSelection(final KeyEvent e) {
    if (togglePopup(e)) return;

    if (!isPopupShowing()) return;

    final InputMap map = myPathTextField.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    if (map != null) {
      final Object object = map.get(KeyStroke.getKeyStrokeForEvent(e));
      if (object instanceof Action) {
        final Action action = (Action) object;
        if (action.isEnabled()) {
          action.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "action"));
          e.consume();
          return;
        }
      }
    }

    final Object action = getAction(e, myList);

    if ("selectNextRow".equals(action)) {
      if (ensureSelectionExists()) {
        ListScrollingUtil.moveDown(myList, e.getModifiersEx());
      }
    } else if ("selectPreviousRow".equals(action)) {
      ListScrollingUtil.moveUp(myList, e.getModifiersEx());
    } else if ("scrollDown".equals(action)) {
      ListScrollingUtil.movePageDown(myList);
    } else if ("scrollUp".equals(action)) {
      ListScrollingUtil.movePageUp(myList);
    } else if (getSelectedFileFromCompletionPopup() != null
        && (e.getKeyCode() == KeyEvent.VK_ENTER || e.getKeyCode() == KeyEvent.VK_TAB)
        && e.getModifiers() == 0) {
      hideCurrentPopup();
      e.consume();
      processChosenFromCompletion(e.getKeyCode() == KeyEvent.VK_TAB);
    }
  }
Exemplo n.º 5
0
 public void selectLine() {
   Action selectLine = getAction(DefaultEditorKit.selectLineAction);
   if (selectLine != null) {
     selectLine.actionPerformed(null);
   }
 }
Exemplo n.º 6
0
 public void actionPerformed(ActionEvent event) {
   saveHistoryAction.actionPerformed(event);
 }
Exemplo n.º 7
0
 public void actionPerformed(ActionEvent event) {
   stopRAction.actionPerformed(event);
 }
Exemplo n.º 8
0
 public void actionPerformed(ActionEvent e) {
   String keyword = EditorUtil.getSelectedkeyword(logArea);
   if (keyword != null) {
     openfunctionAction.actionPerformed(new ActionEvent(this, 0, keyword));
   }
 }
Exemplo n.º 9
0
 public void actionPerformed(ActionEvent event) {
   String keyword = EditorUtil.getSelectedkeyword(logArea);
   if (keyword != null) {
     requesthelpAction.actionPerformed(new ActionEvent(this, 0, keyword));
   }
 }