@Override public Object invoke(Object o, Method method, Object[] args) throws Throwable { if (method.getName().equals("windowEnteredFullScreen")) { putValue(NAME, LocalisationHelper.getString("main_frame_menuitem_leave_fullscreen")); putValue(SHORT_DESCRIPTION, LocalisationHelper.getString("main_frame_menuitem_hint_leave_fullscreen")); gcViewer.getDesktopPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "leaveFullScreen"); gcViewer.getDesktopPane().getActionMap().put("leaveFullScreen", OSXFullScreen.this); } if (method.getName().equals("windowExitedFullScreen")) { putValue(NAME, LocalisationHelper.getString("main_frame_menuitem_enter_fullscreen")); putValue(SHORT_DESCRIPTION, LocalisationHelper.getString("main_frame_menuitem_hint_enter_fullscreen")); gcViewer.getDesktopPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).remove(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0)); gcViewer.getDesktopPane().getActionMap().remove("leaveFullScreen"); } return null; } });
keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK, false); do { iMap.remove(keyStroke); iMap = iMap.getParent(); } while (iMap != null);
/** * Removes the "Ctrl+H <=> Backspace" behavior that Java shows, for some * odd reason... */ private void fixCtrlH() { InputMap inputMap = getInputMap(); KeyStroke char010 = KeyStroke.getKeyStroke("typed \010"); InputMap parent = inputMap; while (parent != null) { parent.remove(char010); parent = parent.getParent(); } if (inputMap != null) { // Just for Sonar KeyStroke backspace = KeyStroke.getKeyStroke("BACK_SPACE"); inputMap.put(backspace, DefaultEditorKit.deletePrevCharAction); } }
/** * Adds key bindings to this popup. */ private void installKeyBindings() { InputMap im = getRootPane().getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap am = getRootPane().getActionMap(); KeyStroke escapeKS = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); im.put(escapeKS, "onEscape"); am.put("onEscape", new EscapeAction()); list.getInputMap().remove(escapeKS); }
/** * DarculaLaf:L354-L358 registers ENTER to invoke 'toggle' action. This seems * to cause problems as reported in #14 because enter key can not invoke * default button in dialogs. */ private void removeEnterFromTreeInputMap() { // Make ENTER work in JTrees InputMap treeInputMap = (InputMap) UIManager.get("Tree.focusInputMap"); if (treeInputMap != null) { // it's really possible. For example, GTK+ doesn't have such map treeInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)); } }
InputMap map = (InputMap) value; for (int vk = KeyEvent.VK_F2; vk <= KeyEvent.VK_F12; ++vk) { map.remove(KeyStroke.getKeyStroke(vk, 0));
KeyStroke keyToRemove = KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0); InputMap imap = table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); while (imap != null) { imap.remove(keyToRemove); imap = imap.getParent(); }
private KeyStroke removeEntry(InputMap inputMap, String keyToBeRemoved) { KeyStroke removedEntry = null; for (KeyStroke ks : inputMap.keys()) { String key = (String) inputMap.get(ks); if (key.equals(keyToBeRemoved)) { inputMap.remove(ks); removedEntry = ks; break; } } return removedEntry; }
private void updateHelpStroke( KeyStroke newStroke ) { InputMap imap = f.getRootPane().getInputMap( JComponent.WHEN_IN_FOCUSED_WINDOW ); if( helpStroke != null ) imap.remove( helpStroke ); helpStroke = newStroke; if( helpStroke != null ) imap.put( helpStroke, HELP_PROPERTY ); }
private static void removeKeyBinding(InputMap im, KeyStroke ks) { // Remove the key binding from the second "tier" input map // User bindings are stored in the first tier, where as UI // bindings (installed by the LAF) are stored in the second tier; if (im.getParent() != null) { im.getParent().remove(ks); } }
private static void removeKeyBinding(InputMap im, KeyStroke ks) { // Remove the key binding from the second "tier" input map // User bindings are stored in the first tier, where as UI // bindings (installed by the LAF) are stored in the second tier; if (im.getParent() != null) { im.getParent().remove(ks); } }
/** * Remove dependices when no longer in use. */ public void close() { getDocument().removeDocumentListener(this); getDocument().removeUndoableEditListener(undoManager); removeMouseListener(this); getInputMap().remove(undoKeyStroke); getInputMap().remove(ctrlbackspaceKeyStroke); getInputMap().remove(escapeKeyStroke); getInputMap().remove(KeyStroke.getKeyStroke("Ctrl W")); }
private static void removeKeyBinding(InputMap im, KeyStroke ks) { // Remove the key binding from the second "tier" input map // User bindings are stored in the first tier, where as UI // bindings (installed by the LAF) are stored in the second tier; if (im.getParent() != null) { im.getParent().remove(ks); } }
private static void removeKeyBinding(InputMap im, KeyStroke ks) { // Remove the key binding from the second "tier" input map // User bindings are stored in the first tier, where as UI // bindings (installed by the LAF) are stored in the second tier; if (im.getParent() != null) { im.getParent().remove(ks); } }
/** * Adds key bindings to this popup. */ private void installKeyBindings() { InputMap im = getRootPane().getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap am = getRootPane().getActionMap(); KeyStroke escapeKS = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); im.put(escapeKS, "onEscape"); am.put("onEscape", new EscapeAction()); list.getInputMap().remove(escapeKS); }
private void unregisterListeners() { KeyStroke refreshKey = KeyStroke.getKeyStroke(KeyEvent.VK_R, KeyEvent.CTRL_DOWN_MASK, true); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).remove(refreshKey); getActionMap().remove("refresh"); // NOI18N resetKeyboardActions(); }
private void unregisterKeybinding(String actionName, KeyStroke stroke) { getInputMap().remove(stroke); getActionMap().remove(actionName); }
/** * Unregister accelerator of MuAction from JComponent. */ private static void unregisterActionAccelerator(MuAction action, KeyStroke accelerator, JComponent comp, int condition) { if(accelerator != null) { InputMap inputMap = comp.getInputMap(condition); ActionMap actionMap = comp.getActionMap(); inputMap.remove(accelerator); actionMap.remove(action.getDescriptor().getId()); } }