public void actionPerformed(ActionEvent e) { JRootPane jrp = getRootPane(); if (jrp != null) { JButton b = getRootPane().getDefaultButton(); if (b != null && b.isEnabled()) { b.doClick(); } } }
public void actionPerformed(ActionEvent e) { JRootPane jrp = getRootPane(); if (jrp != null) { JButton b = getRootPane().getDefaultButton(); if ((b != null) && b.isEnabled()) { b.doClick(); } } }
public void actionPerformed(ActionEvent e) { JRootPane jrp = getRootPane(); if (jrp != null) { JButton b = getRootPane().getDefaultButton(); if (b != null && b.isEnabled()) { b.doClick(); } } }
public void actionPerformed(ActionEvent e) { if (isEditing() || (editorComp != null)) { removeEditor(); return; } else { Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); InputMap imp = getRootPane().getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap am = getRootPane().getActionMap(); KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); Object key = imp.get(escape); if (key == null) { //Default for NbDialog key = "Cancel"; } if (key != null) { Action a = am.get(key); if (a != null) { String commandKey = (String) a.getValue(Action.ACTION_COMMAND_KEY); if (commandKey == null) { commandKey = key.toString(); } a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, commandKey)); //NOI18N } } } }
public void actionPerformed(ActionEvent e) { if (isEditing() || editorComp != null) { removeEditor(); return; } else { Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); InputMap imp = getRootPane().getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap am = getRootPane().getActionMap(); KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); Object key = imp.get(escape); if (key == null) { //Default for NbDialog key = "Cancel"; } if (key != null) { Action a = am.get(key); if (a != null) { String commandKey = (String)a.getValue(Action.ACTION_COMMAND_KEY); if (commandKey == null) { commandKey = key.toString(); } a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, commandKey)); //NOI18N } } } }
public void actionPerformed(ActionEvent e) { if (isEditing() || editorComp != null) { removeEditor(); return; } else { Component c = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); InputMap imp = getRootPane().getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); ActionMap am = getRootPane().getActionMap(); KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); Object key = imp.get(escape); if (key == null) { //Default for NbDialog key = "Cancel"; } if (key != null) { Action a = am.get(key); if (a != null) { String commandKey = (String)a.getValue(Action.ACTION_COMMAND_KEY); if (commandKey == null) { commandKey = key.toString(); } a.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, commandKey)); //NOI18N } } } }
JRootPane rp = getRootPane(); JButton jb = rp.getDefaultButton(); if (jb != null) {
JRootPane rp = getRootPane(); JButton jb = rp.getDefaultButton();
JRootPane rp = getRootPane(); JButton jb = rp.getDefaultButton(); if (jb != null) {