I18N.setTextAndMnemonic("main.main.rostermenu.Remove",menuItem,true);
menuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
JID to = currentJIDStatus.getJID();
if (JOptionPane.showConfirmDialog(main, MessageFormat.format(I18N.gettext("main.popup.Really_remove_{0}_from_all_groups_?"),
new Object[] { to.toString() }),I18N.gettext("main.main.rostermenu.Remove"),
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
{
IQXRoster roster = new IQXRoster(new RosterItem(to, null, "remove", null, null));
backend.send(new InfoQuery("set", roster));
}
}
});
popupMenu.add(menuItem);
}
if(Preferences.getBoolean("jeti","rostermenuRename",true))
{
menuItem = new JMenuItem();
I18N.setTextAndMnemonic("main.main.rostermenu.Rename",menuItem,true);
menuItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String nick = JOptionPane.showInputDialog(main, MessageFormat.format(I18N.gettext("main.popup.Rename_{0}_to"),new Object[] {currentJIDStatus.getNick() }));
if (nick == null) return;
IQXRoster roster = new IQXRoster(new RosterItem(currentJIDStatus.getJID(), nick, null, null, currentJIDStatus.getGroupsCopy()));
backend.send(new InfoQuery("set", roster));
}
});
popupMenu.add(menuItem);
}
if(Preferences.getBoolean("jeti","rostermenuGroup",true))
{
subMenu = new JMenu();
I18N.setTextAndMnemonic("main.main.rostermenu.Group",subMenu);
menuItem = new JMenuItem();
I18N.setTextAndMnemonic("main.main.rostermenu.Change_Group",
menuItem,true);
menuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
{
new GroupDialog(currentGroup, currentJIDStatus, backend).setVisible(true);
}
});
subMenu.add(menuItem);
menuItem = new JMenuItem();
I18N.setTextAndMnemonic("main.main.rostermenu.Add_to_Group",
menuItem, true);
menuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
{
new GroupDialog(currentJIDStatus, backend).setVisible(true);
}
});
subMenu.add(menuItem);
menuItem = new JMenuItem();
I18N.setTextAndMnemonic("main.main.rostermenu.Remove_from_group",
menuItem,true);
menuItem.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(ActionEvent e)
{
JID to = currentJIDStatus.getJID();
if (currentJIDStatus.groupCount() == 1)
{
if (JOptionPane.showConfirmDialog(main
, MessageFormat.format(
I18N.gettext("main.popup.{0}_is_in_the_last_group,_remove_completely?")
,new Object[]{to.toString() })
, I18N.gettext("main.main.rostermenu.Remove")
, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
{
IQXRoster roster = new IQXRoster(new RosterItem(to, null, "remove", null, null));
backend.send(new InfoQuery("set", roster));