src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java
Print this page
*** 494,507 ****
}
// This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that
// arrow up or down does not automatically select the
@SuppressWarnings("serial") // anonymous class
! private static final Action triggerSelectionAction = new AbstractAction() {
public void actionPerformed(final ActionEvent e) {
triggerSelectionEvent((JComboBox)e.getSource(), e);
}
};
@SuppressWarnings("serial") // anonymous class
private static final Action toggleSelectionAction = new AbstractAction() {
public void actionPerformed(final ActionEvent e) {
--- 494,512 ----
}
// This is somewhat messy. The difference here from BasicComboBoxUI.EnterAction is that
// arrow up or down does not automatically select the
@SuppressWarnings("serial") // anonymous class
! private final Action triggerSelectionAction = new AbstractAction() {
public void actionPerformed(final ActionEvent e) {
triggerSelectionEvent((JComboBox)e.getSource(), e);
}
+
+ @Override
+ public boolean isEnabled() {
+ return comboBox.isPopupVisible() && super.isEnabled();
+ }
};
@SuppressWarnings("serial") // anonymous class
private static final Action toggleSelectionAction = new AbstractAction() {
public void actionPerformed(final ActionEvent e) {