setIconImage(nu.fw.jeti.images.StatusIcons.getImageIcon("jeti").getImage());
if(xData.getTitle() !=null) setTitle(xData.getTitle());
else setTitle(I18N.gettext("search.User_Search"));
if(xData.getType().equals("form"))
{
setContentPane(new XDataPanel(xData,this));
}
else if (xData.hasItems() || xData.hasItems())
{
final XDataPanel xDataPanel = new XDataPanel(xData,this);
JPanel panel = new JPanel();
JButton button = new JButton();
I18N.setTextAndMnemonic("search.Add_to_Roster",button);
button.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
JID jid=null;
String nick=null;
for(Iterator i = xDataPanel.getCurrentField();i.hasNext();)
{
XDataField data = (XDataField)i.next();
if("jid".equals(data.getVar()))
{
jid = JID.jidFromString(data.getValue());
}
else if("nick".equals(data.getVar()))nick = data.getValue();
}
if(jid!=null)new AddContact(jid,nick,null,backend).setVisible(true);
}
});
panel.add(button);
button = new JButton();
I18N.setTextAndMnemonic("search.Chat",button);
button.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
for(Iterator i = xDataPanel.getCurrentField();i.hasNext();)
{
XDataField data = (XDataField)i.next();
if("jid".equals(data.getVar()))
{
JID jid = JID.jidFromString(data.getValue());