mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
show popup on focus gain
This commit is contained in:
@@ -24,13 +24,15 @@ import javax.swing.*;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class ComboBoxVisibilityPanel extends VisibilityPanelBase /*implements ShortcutProvider*/ {
|
||||
public class ComboBoxVisibilityPanel extends VisibilityPanelBase {
|
||||
private final JLabel myLabel;
|
||||
private final JComboBox myComboBox;
|
||||
private final Map<String, String> myNamesMap = new HashMap<String, String>();
|
||||
@@ -50,6 +52,13 @@ public class ComboBoxVisibilityPanel extends VisibilityPanelBase /*implements Sh
|
||||
myEventDispatcher.getMulticaster().stateChanged(new ChangeEvent(ComboBoxVisibilityPanel.this));
|
||||
}
|
||||
});
|
||||
|
||||
myComboBox.addFocusListener(new FocusAdapter() {
|
||||
@Override
|
||||
public void focusGained(FocusEvent e) {
|
||||
myComboBox.showPopup();
|
||||
}
|
||||
});
|
||||
DialogUtil.registerMnemonic(myLabel, myComboBox);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user