columnNames.add( field.getLabel() );
fieldLabel.setToolTipText(field.getDescription());
}
protected void click(){
SearchIQ iq = new SearchIQ();
iq.setType(IQ.Type.SET);
iq.setFrom(account.xmpp.getConnection().getUser());
//iq.setTo(searchservice);
//iq.setTo( "users.netlab.cz" );
if (searchIQ != null)
iq.setTo(searchIQ.getFrom());
Form reply = form.createAnswerForm();
Iterator i = reply.getFields();
while (i.hasNext()) {
FormField field = (FormField) i.next();
if (field.getType().equals(FormField.TYPE_HIDDEN))
continue;
Object obj = (Control) dialogArea.getData(field.getVariable());
if (obj instanceof Text) {
reply.setAnswer(field.getVariable(), ((Text) obj)
.getText());
} else if (obj instanceof Button) {
reply.setAnswer(field.getVariable(), ((Button) obj)
.getSelection());
}
}
replyValue = reply;
if (searchIQ != null)
iq.addExtension(reply.getDataFormToSend());
if (searchIQ == null) {
// close();
return;
}
//System.out.println("SEND DATA " + iq.getChildElementXML());
// result = (SearchIQ)account.xmpp.sendIQPacketAndWaitForReply( iq);
new GOIMPacketListener(account.xmpp.getConnection(),
new PacketIDFilter(iq.getPacketID()), new TaskObserver()) {
public void processPacket(final Packet packet) {
final SearchIQ result = (SearchIQ) packet;
showResults( result );
}
}.registerListener();
account.xmpp.getConnection().sendPacket(iq);
}