}
});
JButton addSeparator = new LineButton();
addSeparator.setToolTipText(mLocalizer.msg("separator", "Add Separator"));
addSeparator.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int pos = mList.getList().getSelectedIndex();
if (pos < 0) {
pos = mList.getList().getModel().getSize();
}
mList.addElement(pos, new SeparatorMenuItem());
mList.getList().setSelectedIndex(pos);
mList.getList().ensureIndexIsVisible(pos);
}
});
mList.addButton(addSeparator);
final JButton garbage = new JButton(TVBrowserIcons.delete(TVBrowserIcons.SIZE_LARGE));
garbage.setToolTipText(mLocalizer.msg("garbage", "Remove Separator"));
garbage.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
Object[] items = mList.getList().getSelectedValues();
for (Object item : items) {
mList.removeElement(item);
}