* make absolutely sure state is reset before building the new popup

This commit is contained in:
Reinhard Pointner 2012-10-28 06:36:07 +00:00
parent b6fd00cae6
commit c6daa17f60
1 changed files with 4 additions and 1 deletions

View File

@ -556,6 +556,9 @@ class FormatDialog extends JDialog {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent evt) {
// make sure to reset state
popupMenuWillBecomeInvisible(evt);
JPopupMenu popup = (JPopupMenu) evt.getSource();
for (final String expression : mode.persistentFormatHistory()) {
JMenuItem item = popup.add(new AbstractAction(expression) {
@ -580,7 +583,7 @@ class FormatDialog extends JDialog {
@Override
public void popupMenuCanceled(PopupMenuEvent evt) {
// ignore
popupMenuWillBecomeInvisible(evt);
}
});
return popup;