Ignore:
Timestamp:
02/09/10 18:26:36 (21 months ago)
Author:
Stephen Rankin
Message:

Added save results feature and single file checking (NXDL). Update of Javadocs. ref#236.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/applications/NXvalidate/src/org/nexusformat/nxvalidate/NXLoadFilesDialog.java

    r1507 r1520  
    2828 
    2929import java.io.File; 
     30import java.util.ResourceBundle; 
    3031 
    3132/** 
     
    3839    private File nxdl = null; 
    3940    private boolean OKButtonUsed = false; 
    40  
     41    private CheckNexusFileType check = null; 
     42    private ResourceBundle bundle = null; 
    4143    /** Creates new form NXLoadFilesDialog */ 
    4244    public NXLoadFilesDialog(java.awt.Frame parent, boolean modal) { 
    4345        super(parent, modal); 
    4446        initComponents(); 
     47        check = new CheckNexusFileType(); 
     48        bundle = ResourceBundle.getBundle( 
     49                "org/nexusformat/nxvalidate/resources/nxvalidate"); 
    4550    } 
    4651 
     
    5560 
    5661        jFileChooser1 = new javax.swing.JFileChooser(); 
     62        messageOptionPane = new javax.swing.JOptionPane(); 
    5763        jPanel1 = new javax.swing.JPanel(); 
    5864        nxsLabel = new javax.swing.JLabel(); 
     
    172178            if (returnVal == jFileChooser1.APPROVE_OPTION) { 
    173179                nxs = jFileChooser1.getSelectedFile(); 
    174                 nxsTextField.setText(nxs.getAbsolutePath()); 
    175                 nxsTextField.setToolTipText(nxs.getAbsolutePath()); 
     180 
     181                if(check.checkNexusFile(nxs)){ 
     182                    nxsTextField.setText(nxs.getAbsolutePath()); 
     183                    nxsTextField.setToolTipText(nxs.getAbsolutePath()); 
     184                } else{ 
     185                    nxs = null; 
     186                    messageOptionPane.showMessageDialog(this, 
     187                        bundle.getString("notNXDLFileMessage")); 
     188                } 
     189 
     190                 
    176191            } else { 
    177192                nxs = null; 
     
    189204            if (returnVal == jFileChooser1.APPROVE_OPTION) { 
    190205                nxdl = jFileChooser1.getSelectedFile(); 
    191                 nxdcTextField.setText(nxdl.getAbsolutePath()); 
    192                 nxdcTextField.setToolTipText(nxdl.getAbsolutePath()); 
     206 
     207                if(check.checkNXDLFile(nxdl)){ 
     208                    nxdcTextField.setText(nxdl.getAbsolutePath()); 
     209                    nxdcTextField.setToolTipText(nxdl.getAbsolutePath()); 
     210                } else{ 
     211                    nxdl = null; 
     212                    messageOptionPane.showMessageDialog(this, 
     213                        bundle.getString("notNXDLFileMessage")); 
     214                } 
     215                 
     216                 
    193217            } else { 
    194218                nxdl = null; 
     
    247271    private javax.swing.JFileChooser jFileChooser1; 
    248272    private javax.swing.JPanel jPanel1; 
     273    private javax.swing.JOptionPane messageOptionPane; 
    249274    private javax.swing.JTextField nxdcTextField; 
    250275    private javax.swing.JLabel nxdlLabel; 
Note: See TracChangeset for help on using the changeset viewer.