Update the session list menu.
164 JMenu menu = getMenu(2);
165 while (menu.getMenuComponentCount() > 8)
168 int cnt = list.size();
173 Registry conf = Registry.getCurrent();
174 Font fnt = (Font) conf.get(
"component",
"font");
175 Color fg = (Color) conf.get(
"component",
"fgcolor");
176 Integer delay = (Integer) conf.get(
"component",
"click-delay");
177 ImageIcon onIcon = conf.loadIcon(
"on16.png");
178 ImageIcon offIcon = conf.loadIcon(
"voidrect16.png");
180 for (
int i = 0; i < cnt; i++) {
181 JFrame sess = (JFrame) list.get(i);
183 JMenuItem item =
new JMenuItem(sess.getTitle() +
" ");
185 item.setForeground(fg);
187 item.setMultiClickThreshhold(delay);
190 int accel = VK_0 + i;
191 KeyStroke ks = KeyStroke.getKeyStroke(accel, InputEvent.ALT_DOWN_MASK);
192 item.setAccelerator(ks);
195 item.setIcon((i == sel) ? onIcon : offIcon);
196 item.setActionCommand(
"Select session " + i);
197 item.addActionListener(
handler);