* make absolutely sure state is reset before building the new popup
This commit is contained in:
parent
b6fd00cae6
commit
c6daa17f60
|
@ -556,6 +556,9 @@ class FormatDialog extends JDialog {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void popupMenuWillBecomeVisible(PopupMenuEvent evt) {
|
public void popupMenuWillBecomeVisible(PopupMenuEvent evt) {
|
||||||
|
// make sure to reset state
|
||||||
|
popupMenuWillBecomeInvisible(evt);
|
||||||
|
|
||||||
JPopupMenu popup = (JPopupMenu) evt.getSource();
|
JPopupMenu popup = (JPopupMenu) evt.getSource();
|
||||||
for (final String expression : mode.persistentFormatHistory()) {
|
for (final String expression : mode.persistentFormatHistory()) {
|
||||||
JMenuItem item = popup.add(new AbstractAction(expression) {
|
JMenuItem item = popup.add(new AbstractAction(expression) {
|
||||||
|
@ -580,7 +583,7 @@ class FormatDialog extends JDialog {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void popupMenuCanceled(PopupMenuEvent evt) {
|
public void popupMenuCanceled(PopupMenuEvent evt) {
|
||||||
// ignore
|
popupMenuWillBecomeInvisible(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return popup;
|
return popup;
|
||||||
|
|
Loading…
Reference in New Issue