mSettingsPn.add(UiUtilities.createHelpTextArea(mLocalizer.msg("help", "Help Text")), cc.xyw(2,3,7));
mSettingsPn.add(testButton, cc.xyw(2, 5, 7));
mSettingsPn.add(new JLabel(mLocalizer.msg("whichBrowser", "which browser")), cc.xyw(2,7,7));
JRadioButton useDefault = new JRadioButton(mLocalizer.msg("defaultWebbrowser", "Default Webbrowser"));
useDefault.setSelected(Settings.propUserDefinedWebbrowser.getString() == null);
useDefault.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
updateInputFields();
}
});
mSettingsPn.add(useDefault, cc.xyw(2, 9, 4));
mUseWebbrowser = new JRadioButton(mLocalizer.msg("userDefinedWebbrowser","user defined webbrowser"));
mUseWebbrowser.setSelected(Settings.propUserDefinedWebbrowser.getString() != null);
mUseWebbrowser.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
updateInputFields();
}
});
ButtonGroup group = new ButtonGroup();
group.add(useDefault);
group.add(mUseWebbrowser);
mSettingsPn.add(mUseWebbrowser, cc.xyw(2, 11, 7));
mSettingsPn.add(new JLabel(mLocalizer.msg("browserExecutable", "Executable") + ":"), cc.xy(3, 13));
mFileTextField = new JTextField(30);
mFileTextField.setText(Settings.propUserDefinedWebbrowser.getString());
mSettingsPn.add(mFileTextField, cc.xy(5, 13));
mChooseButton = new JButton(Localizer.getLocalization(Localizer.I18N_SELECT));
mChooseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if (mFileChooser==null) {
mFileChooser=new JFileChooser();
if (OperatingSystem.isMacOs()) {
mFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
} else {
mFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
}
}
int retVal = mFileChooser.showOpenDialog(mSettingsPn.getParent());
if (retVal == JFileChooser.APPROVE_OPTION) {
File f=mFileChooser.getSelectedFile();
if (f!=null) {
mFileTextField.setText(f.getAbsolutePath());
}
}
}
});
mSettingsPn.add(mChooseButton, cc.xy(7, 13));
mSettingsPn.add(new JLabel(mLocalizer.msg("browserParameter", "Parameter") + ":"), cc.xy(3,15));
mParams = new JTextField();
mParams.setText(Settings.propUserDefinedWebbrowserParams.getString());
mSettingsPn.add(mParams, cc.xy(5,15));
mSettingsPn.add(new JLabel(mLocalizer.msg("browserParameterHelp", "{0} will be replaced by the url.")), cc.xyw(5,17,4));
updateInputFields();
return mSettingsPn;
}