public void actionPerformed(ActionEvent e) {
JFileChooser jfc = new JFileChooser();
jfc.setDialogTitle("Abrir...");
jfc.setDialogType(JFileChooser.OPEN_DIALOG);
FileNameExtensionFilter fileNameExtensionFilter = new FileNameExtensionFilter(
"Arquivos BDF", ApplicationController.EXTENSAO);
jfc.addChoosableFileFilter(fileNameExtensionFilter);
if (jfc.showDialog(null, "Abrir") == JFileChooser.APPROVE_OPTION) {
if (!controller.isNomeArquivoValido(jfc.getSelectedFile()
.getName())) {
JOptionPane.showMessageDialog(ViewFrame2.this,
"Arquivo inv�lido!", "Erro",
JOptionPane.ERROR_MESSAGE);
} else {
try {
controller.abrir(jfc.getSelectedFile().getAbsolutePath(), jfc.getSelectedFile().getName());
jTextAreaEditor.setText(controller.getCodigo());
jTextAreaConsole.setText("");
modificou(Status.UNMODIFIED);
} catch (Exception e1) {
JOptionPane.showMessageDialog(ViewFrame2.this, e1
.getMessage(), "Erro",
JOptionPane.ERROR_MESSAGE);
e1.printStackTrace();
}
}
}
}
});
jButtonSalvar.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (controller.isNovo()) {
final JFileChooser jfc = new JFileChooser();
jfc.setDialogTitle("Salvar...");
jfc.setDialogType(JFileChooser.SAVE_DIALOG);
FileNameExtensionFilter fileNameExtensionFilter = new FileNameExtensionFilter(
"Arquivos BDF", ApplicationController.EXTENSAO);
jfc.addChoosableFileFilter(fileNameExtensionFilter);
if (jfc.showDialog(ViewFrame2.this, "Salvar") == JFileChooser.APPROVE_OPTION) {
if (jfc.getFileFilter() == fileNameExtensionFilter) {