@Override protected boolean processKeyBinding(final KeyStroke ks, final KeyEvent e, final int condition, final boolean pressed) { return super.processKeyBinding(ks, e, condition, pressed) || e.getKeyChar() == KeyEvent.VK_SPACE || e.getKeyChar() == KeyEvent.VK_ALT; } }
@Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { return super.processKeyBinding(ks, e, condition, pressed) || MenuKeyProcessor.INSTANCE.processKeyBinding(ks, e, condition, pressed); }
@Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { if (e.getKeyCode() == KeyEvent.VK_F1 || e.getKeyCode() == KeyEvent.VK_HELP) { JComponent rootPane = SwingUtilities.getRootPane(this); if (rootPane != null) { rootPane.putClientProperty(ResizablePopup.HELP_COOKIE, Boolean.TRUE); } } return super.processKeyBinding(ks, e, condition, pressed); }
/** * */ @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { if (!e.isConsumed()) { return super.processKeyBinding(ks, e, condition, pressed); } else { return true; } }
/** * This method is called by Swing when the TreeTableCellPanel is installed * as a TableCellEditor. It gives the component a chance to process the * KeyEvent. For example, a JTextField will honour the keystroke and * add the letter to its Document. * * The TreeTableCellPanel's main job is to pass the KeyEvent on to the * underlying {@link #nodeComponent} so that it may have a chance to react. * This only need occur once for the KeyEvent that caused the cell edit, * after which time the focus will be within the {@link #nodeComponent} and * subsequent keystrokes should be ignored. */ @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { // let the nodeComponent have a crack at processing the KeyEvent // (we'd love to call nodeComponent.processKeyBinding(ks, e, condition, pressed) but it's protected and thus out of scope) if (!nodeComponent.hasFocus()) SwingUtilities.invokeLater(new RequestFocusAndDispatchKeyEventRunnable(e, nodeComponent)); // now let the JComboBox react (important for arrow keys to work as expected) return super.processKeyBinding(ks, e, condition, pressed); }
/** * This method is called by Swing when the TreeTableCellPanel is installed * as a TableCellEditor. It gives the component a chance to process the * KeyEvent. For example, a JTextField will honour the keystroke and * add the letter to its Document. * * The TreeTableCellPanel's main job is to pass the KeyEvent on to the * underlying {@link #nodeComponent} so that it may have a chance to react. * This only need occur once for the KeyEvent that caused the cell edit, * after which time the focus will be within the {@link #nodeComponent} and * subsequent keystrokes should be ignored. */ @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { // let the nodeComponent have a crack at processing the KeyEvent // (we'd love to call nodeComponent.processKeyBinding(ks, e, condition, pressed) but it's protected and thus out of scope) if (!nodeComponent.hasFocus()) SwingUtilities.invokeLater(new RequestFocusAndDispatchKeyEventRunnable(e, nodeComponent)); // now let the JComboBox react (important for arrow keys to work as expected) return super.processKeyBinding(ks, e, condition, pressed); }
/** * This method is called by Swing when the TreeTableCellPanel is installed * as a TableCellEditor. It gives the component a chance to process the * KeyEvent. For example, a JTextField will honour the keystroke and * add the letter to its Document. * * The TreeTableCellPanel's main job is to pass the KeyEvent on to the * underlying {@link #nodeComponent} so that it may have a chance to react. * This only need occur once for the KeyEvent that caused the cell edit, * after which time the focus will be within the {@link #nodeComponent} and * subsequent keystrokes should be ignored. */ @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { // let the nodeComponent have a crack at processing the KeyEvent // (we'd love to call nodeComponent.processKeyBinding(ks, e, condition, pressed) but it's protected and thus out of scope) if (!nodeComponent.hasFocus()) SwingUtilities.invokeLater(new RequestFocusAndDispatchKeyEventRunnable(e, nodeComponent)); // now let the JComboBox react (important for arrow keys to work as expected) return super.processKeyBinding(ks, e, condition, pressed); }
/** * {@inheritDoc} */ @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { if (super.processKeyBinding(ks, e, condition, pressed)) { return true; } Object binding = textField.getInputMap(condition).get(ks); if (binding != null && textField.getActionMap().get(binding) != null) { textField.dispatchEvent(e); return true; } return false; }
/** * {@inheritDoc} */ @Override protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) { if (super.processKeyBinding(ks, e, condition, pressed)) { return true; } Object binding = textField.getInputMap(condition).get(ks); if (binding != null && textField.getActionMap().get(binding) != null) { textField.dispatchEvent(e); return true; } return false; }