import jalview.viewmodel.OverviewDimensionsShowHidden;
import java.awt.BorderLayout;
+import java.awt.CheckboxMenuItem;
import java.awt.Dimension;
-import java.awt.MenuItem;
import java.awt.Panel;
import java.awt.PopupMenu;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.InputEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
private void showPopupMenu(MouseEvent e)
{
PopupMenu popup = new PopupMenu();
- ActionListener menuListener = new ActionListener()
+ ItemListener menuListener = new ItemListener()
{
@Override
- public void actionPerformed(ActionEvent event)
+ public void itemStateChanged(ItemEvent e)
{
- // switch on/off the hidden columns view
toggleHiddenColumns();
}
};
- MenuItem item = new MenuItem(
+ CheckboxMenuItem item = new CheckboxMenuItem(
MessageManager.getString("label.togglehidden"));
+ item.setState(showHidden);
popup.add(item);
- item.addActionListener(menuListener);
+ item.addItemListener(menuListener);
this.add(popup);
popup.show(this, e.getX(), e.getY());
}