*/
protected void showConfigureDialog(final SearchTextField textField) {
final SearchForm form = new SearchForm(false, false, true);
form.setSearchFormSettings(mSearchFormSettings);
final JDialog configure = new JDialog(MainFrame.getInstance(), mLocalizer.msg("settingsTitle","Search-Settings"), false);
configure.setUndecorated(true);
JPanel panel = (JPanel)configure.getContentPane();
panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),Borders.DLU4_BORDER));
panel.setLayout(new FormLayout("fill:pref:grow, 3dlu, pref", "pref, fill:3dlu:grow, pref"));
form.setParentDialog(configure);
CellConstraints cc = new CellConstraints();
panel.add(form, cc.xyw(1, 1, 3));
JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
configure.setVisible(false);
mSearchFormSettings = form.getSearchFormSettings();
saveSearchFormSettings();
textField.requestFocusInWindow();
textField.selectAll();
}
});
panel.add(ok, cc.xy(3,3));
UiUtilities.registerForClosing(new WindowClosingIf() {
public void close() {
configure.removeWindowListener(configure.getWindowListeners()[0]);
configure.setVisible(false);
textField.requestFocusInWindow();
textField.selectAll();
}
public JRootPane getRootPane() {
return configure.getRootPane();
}
});
configure.pack();
configure.addWindowListener(new WindowAdapter() {
public void windowDeactivated(WindowEvent e) {
if(!form.isSearchFieldsSelectionDialogVisible()) {
((JDialog)e.getSource()).setVisible(false);
mSearchFormSettings = form.getSearchFormSettings();
saveSearchFormSettings();
}
}
});
Point p = mSearchButton.getLocationOnScreen();
if(MainFrame.getInstance().getToolbar().getToolbarLocation().compareTo(BorderLayout.NORTH) == 0) {
configure.setLocation(p.x - configure.getWidth() + mSearchButton.getWidth(),p.y + mSearchButton.getHeight());
} else {
configure.setLocation(p.x ,p.y - configure.getHeight());
}
configure.setVisible(true);
}