@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; } });
do { action = action == null ? aMap.get(DefaultEditorKit.deletePrevCharAction) : null; aMap.remove(DefaultEditorKit.deletePrevCharAction); aMap = aMap.getParent(); } while (aMap != null);
public void remove(Object key) { if (delegate != null) { delegate.remove (key); } }
/** * Resets the contained editors actionMap to original and * nulls all fields. <p> * NOTE: after calling this method the action must not be * used! Create a new one for the same or another editor. * */ public void uninstall() { editor.getActionMap().remove(TEXT_CANCEL_KEY); cancelAction = null; editor = null; }
/** * Resets the contained editors actionMap to original and * nulls all fields. <p> * NOTE: after calling this method the action must not be * used! Create a new one for the same or another editor. * */ public void uninstall() { editor.getActionMap().remove(TEXT_CANCEL_KEY); cancelAction = null; editor = null; }
/** * Resets the contained editors actionMap to original and * nulls all fields. <p> * NOTE: after calling this method the action must not be * used! Create a new one for the same or another editor. * */ public void uninstall() { editor.getActionMap().remove(TEXT_CANCEL_KEY); cancelAction = null; editor = null; }
/** * Resets the contained editors actionMap to original and * nulls all fields. <p> * NOTE: after calling this method the action must not be * used! Create a new one for the same or another editor. * */ public void uninstall() { editor.getActionMap().remove(TEXT_CANCEL_KEY); cancelAction = null; editor = null; }
/** * Removes the action for this button. Since a new button will be created * everytime they are updated, the action will not be readded for this * button, so the shortcut will have no action to perform. It's easier to * remove from the action map based on the button than from the input map. * * @param button */ private void clearShortcut(JButton button) { owner.getRootPane().getActionMap().remove(button); }
private void removeWindowsF10() { InputMap imap = menuBar.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); Object action = imap.get(KeyStroke.getKeyStroke("F10")); if (log.isInfoEnabled()) log.info("Removing the F10 key from the menuBar's InputMap; it did " + (action == null ? "not" : "") + " exist"); ActionMap amap = menuBar.getActionMap(); amap.getParent().remove(action); }
private void unregisterKeybinding(String actionName, KeyStroke stroke) { getInputMap().remove(stroke); getActionMap().remove(actionName); }
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(); }
@Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { if (decorated != null) { decorated.getActionMap().remove(TextFieldsCommitAction.COMMIT_ACTION_NAME); decorated.getActionMap().put(TextFieldsCommitAction.COMMIT_ACTION_NAME, new TextFieldsCommitAction(decorated)); } EventQueue.invokeLater(() -> { decorated.requestFocus(); }); return super.getTableCellEditorComponent(table, value, isSelected, row, column); }
@Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { JFormattedTextField ftf = decorated.getEditorComponent(); ftf.getActionMap().remove(TextFieldsCommitAction.COMMIT_ACTION_NAME); ftf.getActionMap().put(TextFieldsCommitAction.COMMIT_ACTION_NAME, new TextFieldsCommitAction(ftf)); EventQueue.invokeLater(() -> { decorated.requestFocus(); }); return super.getTableCellEditorComponent(table, value, isSelected, row, column); }
@Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { if (decorated.getEditor() instanceof NumberEditor) { JFormattedTextField ftf = ((NumberEditor) decorated.getEditor()).getTextField(); ftf.getActionMap().remove(TextFieldsCommitAction.COMMIT_ACTION_NAME); ftf.getActionMap().put(TextFieldsCommitAction.COMMIT_ACTION_NAME, new TextFieldsCommitAction(ftf)); } EventQueue.invokeLater(() -> { decorated.requestFocus(); }); return super.getTableCellEditorComponent(table, value, isSelected, row, column); //To change body of generated methods, choose Tools | Templates. }
/** * 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()); } }
public void cleanup() { super.releaseResources(); clear(); removeMouseListener( this ); removeMouseMotionListener( this ); removeContextMenuListener( this ); getActionMap().remove( "copy" ); }
public EditorTopComponent(DataObjectContext context, Lookup lookup, JComponent view) { this.view = view; setLayout(new BorderLayout()); setFocusable(true); add(view, BorderLayout.CENTER); // ic = new InstanceContent(); if (view instanceof TopComponent) this.lookup = new ProxyLookup (((TopComponent) view).getLookup (), lookup, /*new AbstractLookup(ic),*/ Lookups.singleton(getActionMap())); else this.lookup = new ProxyLookup (lookup, /*new AbstractLookup(ic),*/ Lookups.singleton(getActionMap())); getActionMap ().remove ("cloneWindow"); // NOI18N }
public void shutdownController() { Controller.getCurrentModeController().getMapController().removeNodeSelectionListener(noteManager); Controller.getCurrentController().getMapViewManager().removeMapSelectionListener(noteManager); if (noteViewerComponent == null) { return; } noteViewerComponent.getActionMap().remove("jumpToMapAction"); if (shouldUseSplitPane()) { hideNotesPanel(); noteViewerComponent = null; } }