public void addViewMode(final ViewMode viewMode) { viewBarComponent.addMode(viewMode); char ch = Character.toLowerCase(viewMode.getName().charAt(0)); getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(ch), viewMode); getActionMap().put(viewMode, new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { setViewMode(viewMode); } }); }
if (acceleratorKeyStroke != null) { String key = "Accelerator" + System.currentTimeMillis(); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(acceleratorKeyStroke, key); getActionMap().put(key, action); action.putValue(AbstractAction.SHORT_DESCRIPTION,
if (acceleratorKeyStroke != null) { String key = "Accelerator" + System.currentTimeMillis(); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(acceleratorKeyStroke, key); getActionMap().put(key, action); action.putValue(AbstractAction.SHORT_DESCRIPTION,
if (acceleratorKeyStroke != null) { String key = "Accelerator" + System.currentTimeMillis(); getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(acceleratorKeyStroke, key); getActionMap().put(key, action); action.putValue(AbstractAction.SHORT_DESCRIPTION,