gbConstraints.fill = GridBagConstraints.HORIZONTAL;
gbConstraints.gridy = 1; gbConstraints.gridx = 0;
gbLayout.setConstraints(relationLab, gbConstraints);
alignedP.add(relationLab);
m_relationNameForFilename = new JCheckBox();
m_relationNameForFilename.setSelected(m_dsSaver.getRelationNameForFilename());
m_relationNameForFilename.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (m_relationNameForFilename.isSelected()) {
m_prefixText.setLabel("Prefix for file name");
m_fileChooser.setApproveButtonText("Select directory and prefix");
} else {
m_prefixText.setLabel("File name");
m_fileChooser.setApproveButtonText("Select directory and filename");
}
}
});
gbConstraints = new GridBagConstraints();
gbConstraints.anchor = GridBagConstraints.EAST;
gbConstraints.fill = GridBagConstraints.HORIZONTAL;
gbConstraints.gridy = 1; gbConstraints.gridx = 1;
gbConstraints.weightx = 5;
gbLayout.setConstraints(m_relationNameForFilename, gbConstraints);
alignedP.add(m_relationNameForFilename);
} catch(Exception ex){
}
//innerPanel.add(m_SaverEditor, BorderLayout.SOUTH);
JPanel about = m_SaverEditor.getAboutPanel();
if (about != null) {
innerPanel.add(about, BorderLayout.NORTH);
}
add(innerPanel, BorderLayout.NORTH);
// add(m_fileChooser, BorderLayout.CENTER);
JLabel directoryLab = new JLabel("Directory", SwingConstants.RIGHT);
directoryLab.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
gbConstraints = new GridBagConstraints();
gbConstraints.anchor = GridBagConstraints.EAST;
gbConstraints.fill = GridBagConstraints.HORIZONTAL;
gbConstraints.gridy = 2; gbConstraints.gridx = 0;
gbLayout.setConstraints(directoryLab, gbConstraints);
alignedP.add(directoryLab);
m_directoryText = new EnvironmentField();
// m_directoryText.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
m_directoryText.setEnvironment(m_env);
/* width = m_directoryText.getPreferredSize().width;
height = m_directoryText.getPreferredSize().height;
m_directoryText.setMinimumSize(new Dimension(width * 2, height));
m_directoryText.setPreferredSize(new Dimension(width * 2, height)); */
try {
m_directoryText.setText(m_dsSaver.getSaverTemplate().retrieveDir());
} catch (IOException ex) {
// ignore
}
JButton browseBut = new JButton("Browse...");
browseBut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
//final JFrame jf = new JFrame("Choose directory");
final JDialog jf = new JDialog((JDialog)SaverCustomizer.this.getTopLevelAncestor(),
"Choose directory", true);
jf.setLayout(new BorderLayout());
jf.getContentPane().add(m_fileChooser, BorderLayout.CENTER);
m_fileChooserFrame = jf;
jf.pack();
jf.setVisible(true);
} catch (Exception ex) {
ex.printStackTrace();
}
}
});
JPanel efHolder = new JPanel();
efHolder.setLayout(new BorderLayout());
JPanel bP = new JPanel(); bP.setLayout(new BorderLayout());
bP.setBorder(BorderFactory.createEmptyBorder(5,0,5,5));
bP.add(browseBut, BorderLayout.CENTER);
efHolder.add(m_directoryText, BorderLayout.CENTER);
efHolder.add(bP, BorderLayout.EAST);
//efHolder.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
gbConstraints = new GridBagConstraints();
gbConstraints.anchor = GridBagConstraints.EAST;
gbConstraints.fill = GridBagConstraints.HORIZONTAL;
gbConstraints.gridy = 2; gbConstraints.gridx = 1;
gbLayout.setConstraints(efHolder, gbConstraints);
alignedP.add(efHolder);
JLabel relativeLab = new JLabel("Use relative file paths", SwingConstants.RIGHT);
relativeLab.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
gbConstraints = new GridBagConstraints();
gbConstraints.anchor = GridBagConstraints.EAST;
gbConstraints.fill = GridBagConstraints.HORIZONTAL;
gbConstraints.gridy = 3; gbConstraints.gridx = 0;
gbLayout.setConstraints(relativeLab, gbConstraints);
alignedP.add(relativeLab);
m_relativeFilePath = new JCheckBox();
m_relativeFilePath.
setSelected(((FileSourcedConverter)m_dsSaver.getSaverTemplate()).getUseRelativePath());
m_relativeFilePath.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {