con.initialize();
PhtoolsIconServer server = new PhtoolsIconServer();
int searchtype = FindNameDialog.BUFFER_SEARCH;
final FindNameDialog dialog = new FindNameDialog(con,server,searchtype);
dialog.stringToQuery(getConfigValue("query"));
dialog.setMaxSelections(-1); //Allow arbitrary number of selections.
dialog.setMinSelections(0);//We don't need to select any.
dialog.setVisible(true);
dialog.addOkListener(new ActionListener()
{
public void actionPerformed(ActionEvent ev)
{
String[] names = dialog.getSelectedNames();
if ((names != null) && (names.length>0))
{
dialog.clearAllQueries();
String query = names[0];
for (int j=1;j<names.length;j++)
{
//Use the or operator...
query = (query+" | "+names[j]);
}
dialog.setBufferNicknameQueryText(query);
reposEd.setConfigValue("query",dialog.queryToString());
}
else
{
reposEd.setConfigValue("query",dialog.queryToString());
}
dialog.dispose();
}
});
dialog.addCancelListener(new ActionListener()
{
public void actionPerformed(ActionEvent ev)
{
dialog.dispose();
}
});
}
});
}