diff --git a/README.md b/README.md index 2caad02..d2df6cb 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,29 @@ It populates "Select Import File:" dropdown with my list of files that match my ** regex field parsing changed in v21 to hopefully give more flexibility. you need to use "named capture groups", as in: -"?(?.*?)"?(?:[,]|\Z)(?.*) - -```java value = what string you want to pull out for the field value. rest = is left over line to parse next. +```java +"?(?.*?)"?(?:[,]|\Z)(?(.*|\Z)) will handle basic csv parsing + +"(?.*?)"(?:[,]|\Z)(?(.*|\Z)) I had to do this to get amount within "123,456.78" + +"?(?.*?)"?(?:[,]|\Z) final list for "ignore rest" + +(?:CHECK[ ](?\d*)|(.{0,0}))(?.*) This actually adds an extra column. + +it will parse +04/10/2018,CHECK 0001234,,"($530.46)","$123" +04/04/2018,Insurance,PREM,"($467.30)","$5" + +into +04/10/2018,1234, , ,"($530.46)","$123" +04/04/2018, ,Insurance,PREM,"($467.30)","$5" + + +How it parses a whole line: + if you have this line: 01/14/2018,check 3000,My Store,$123.40,whatever diff --git a/src/com/moneydance/modules/features/mdcsvimporter/CustomReaderDialog.java b/src/com/moneydance/modules/features/mdcsvimporter/CustomReaderDialog.java index 40c6bce..43e5c0e 100755 --- a/src/com/moneydance/modules/features/mdcsvimporter/CustomReaderDialog.java +++ b/src/com/moneydance/modules/features/mdcsvimporter/CustomReaderDialog.java @@ -199,152 +199,185 @@ public TransactionReader getTransactionReader( String readerNameToGet ) public boolean getReaderConfig( String readerNameToGet ) { - message.setText( "" ); - if ( ! ReaderConfigsHM.containsKey( readerNameToGet ) ) - { - message.setText( "There is no reader by that name '" + readerNameToGet + "'" ); - return false; - } - - CustomReaderData customReaderData = ReaderConfigsHM.get( readerNameToGet ); - readerName.setText( readerNameToGet ); - regexsList = customReaderData.getRegexsList(); - dataTypesList = customReaderData.getDataTypesList(); - emptyFlagsList = customReaderData.getEmptyFlagsList(); - //dateFormatList = customReaderData.getDateFormatList(); - setFieldSeparatorChar( customReaderData.getFieldSeparatorChar() ); - setFileEncodingSelectedItem( customReaderData.getFileEncoding() ); - setHeaderLines( customReaderData.getHeaderLines() ); - setFooterLines( customReaderData.getFooterLines() ); - - setAmountCurrencyChar( customReaderData.getAmountCurrencyChar() ); - setAmountDecimalSignChar( customReaderData.getAmountDecimalSignChar() ); - setAmountGroupingSeparatorChar( customReaderData.getAmountGroupingSeparatorChar() ); - setAmountFormat( customReaderData.getAmountFormat() ); - setImportReverseOrderFlg( customReaderData.getImportReverseOrderFlg() ); - setUseRegexFlag( customReaderData.getUseRegexFlag() ); - setFilenameMatcher( customReaderData.getFilenameMatcher() ); + try { + message.setText( "" ); + if ( ! ReaderConfigsHM.containsKey( readerNameToGet ) ) + { + message.setText( "There is no reader by that name '" + readerNameToGet + "'" ); + return false; + } - DefaultListModel listModel = (DefaultListModel) customReadersList.getModel(); - customReadersList.setSelectedValue( readerNameToGet, true ); + CustomReaderData customReaderData = ReaderConfigsHM.get( readerNameToGet ); + readerName.setText( readerNameToGet ); + regexsList = customReaderData.getRegexsList(); + dataTypesList = customReaderData.getDataTypesList(); + emptyFlagsList = customReaderData.getEmptyFlagsList(); + //dateFormatList = customReaderData.getDateFormatList(); + setFieldSeparatorChar( customReaderData.getFieldSeparatorChar() ); + setFileEncodingSelectedItem( customReaderData.getFileEncoding() ); + setHeaderLines( customReaderData.getHeaderLines() ); + setFooterLines( customReaderData.getFooterLines() ); + + setAmountCurrencyChar( customReaderData.getAmountCurrencyChar() ); + setAmountDecimalSignChar( customReaderData.getAmountDecimalSignChar() ); + setAmountGroupingSeparatorChar( customReaderData.getAmountGroupingSeparatorChar() ); + setAmountFormat( customReaderData.getAmountFormat() ); + setImportReverseOrderFlg( customReaderData.getImportReverseOrderFlg() ); + setUseRegexFlag( customReaderData.getUseRegexFlag() ); + setFilenameMatcher( customReaderData.getFilenameMatcher() ); + + DefaultListModel listModel = (DefaultListModel) customReadersList.getModel(); + customReadersList.setSelectedValue( readerNameToGet, true ); + + System.err.println( "get UseRegexFlag customReaderData.getUseRegexFlag()=" + customReaderData.getUseRegexFlag() + "= and gui getUseRegexFlag() =" + getUseRegexFlag() ); + System.err.println( "get regexsList arraylist =" + regexsList + "=" ); + System.err.println( "get dataTypesList arraylist =" + dataTypesList + "=" ); + System.err.println( "get emptyFlagsList arraylist =" + emptyFlagsList + "=" ); + + int i = 0; + /* + // System.out.println( "get datatype===================================" ); + // System.out.println( "get datatype===================================" ); + for ( String dataType : dataTypesList ) + { + // System.out.println( "get datatype " + i + " =" + dataType + "=" ); + i++; + } + */ + + System.err.println( "get regex ===================================" ); + regex0.setText( regexsList.get( 0 ) ); + regex1.setText( regexsList.get( 1 ) ); + regex2.setText( regexsList.get( 2 ) ); + regex3.setText( regexsList.get( 3 ) ); + regex4.setText( regexsList.get( 4 ) ); + regex5.setText( regexsList.get( 5 ) ); + regex6.setText( regexsList.get( 6 ) ); + regex7.setText( regexsList.get( 7 ) ); + regex8.setText( regexsList.get( 8 ) ); + regex9.setText( regexsList.get( 9 ) ); + + System.err.println( "get datatype ===================================" ); + dataType0.setSelectedItem( dataTypesList.get( 0 ) ); + dataType1.setSelectedItem( dataTypesList.get( 1 ) ); + dataType2.setSelectedItem( dataTypesList.get( 2 ) ); + dataType3.setSelectedItem( dataTypesList.get( 3 ) ); + dataType4.setSelectedItem( dataTypesList.get( 4 ) ); + dataType5.setSelectedItem( dataTypesList.get( 5 ) ); + dataType6.setSelectedItem( dataTypesList.get( 6 ) ); + dataType7.setSelectedItem( dataTypesList.get( 7 ) ); + dataType8.setSelectedItem( dataTypesList.get( 8 ) ); + dataType9.setSelectedItem( dataTypesList.get( 9 ) ); + + i = 0; + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 0 ) + "=" ); + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 1 ) + "=" ); + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 2 ) + "=" ); + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 3 ) + "=" ); + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 4 ) + "=" ); + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 5 ) + "=" ); + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 6 ) + "=" ); + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 7 ) + "=" ); + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 8 ) + "=" ); + System.err.println( "get datatype " + (i++) + " =" + dataTypesList.get( 9 ) + "=" ); + + if ( getUseRegexFlag() ) + { + isNullable0.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + isNullable1.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + isNullable2.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + isNullable3.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + isNullable4.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + isNullable5.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + isNullable6.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + isNullable7.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + isNullable8.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + isNullable9.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); + } + else + { + isNullable0.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + isNullable1.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + isNullable2.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + isNullable3.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + isNullable4.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + isNullable5.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + isNullable6.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + isNullable7.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + isNullable8.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + isNullable9.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + } - System.err.println( "get regexsList arraylist =" + regexsList + "=" ); - System.err.println( "get dataTypesList arraylist =" + dataTypesList + "=" ); - System.err.println( "get emptyFlagsList arraylist =" + emptyFlagsList + "=" ); + i = 0; + System.err.println( "get emptyFlagsList ===================================" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 0 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 1 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 2 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 3 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 4 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 5 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 6 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 7 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 8 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 9 ) + "=" ); + + + isNullable0.setSelectedItem( emptyFlagsList.get( 0 ) ); + isNullable1.setSelectedItem( emptyFlagsList.get( 1 ) ); + isNullable2.setSelectedItem( emptyFlagsList.get( 2 ) ); + isNullable3.setSelectedItem( emptyFlagsList.get( 3 ) ); + isNullable4.setSelectedItem( emptyFlagsList.get( 4 ) ); + isNullable5.setSelectedItem( emptyFlagsList.get( 5 ) ); + isNullable6.setSelectedItem( emptyFlagsList.get( 6 ) ); + isNullable7.setSelectedItem( emptyFlagsList.get( 7 ) ); + isNullable8.setSelectedItem( emptyFlagsList.get( 8 ) ); + isNullable9.setSelectedItem( emptyFlagsList.get( 9 ) ); + + i = 0; + System.err.println( "get isNullable ===================================" ); + System.err.println( "isNullable0.getSelectedItem() =" + isNullable0.getSelectedItem() + "=" ); + System.err.println( "isNullable1.getSelectedItem() =" + isNullable1.getSelectedItem() + "=" ); + System.err.println( "isNullable2.getSelectedItem() =" + isNullable2.getSelectedItem() + "=" ); + System.err.println( "isNullable3.getSelectedItem() =" + isNullable3.getSelectedItem() + "=" ); + System.err.println( "isNullable4.getSelectedItem() =" + isNullable4.getSelectedItem() + "=" ); + System.err.println( "isNullable5.getSelectedItem() =" + isNullable5.getSelectedItem() + "=" ); + System.err.println( "isNullable6.getSelectedItem() =" + isNullable6.getSelectedItem() + "=" ); + System.err.println( "isNullable7.getSelectedItem() =" + isNullable7.getSelectedItem() + "=" ); + System.err.println( "isNullable8.getSelectedItem() =" + isNullable8.getSelectedItem() + "=" ); + System.err.println( "isNullable8.getSelectedItem() =" + isNullable9.getSelectedItem() + "=" ); + + /* + DefaultComboBoxModel dateFormatModel = new DefaultComboBoxModel(); + for ( String format : dateFormatList ) + { + System.out.println( "add date format =" + format + "=" ); + dateFormatModel.addElement( format ); + } - /* - int i = 0; -// System.out.println( "get datatype===================================" ); -// System.out.println( "get datatype===================================" ); - for ( String dataType : dataTypesList ) - { -// System.out.println( "get datatype " + i + " =" + dataType + "=" ); - i++; - } - */ - -// System.out.println( "get regex ===================================" ); - regex0.setText( regexsList.get( 0 ) ); - regex1.setText( regexsList.get( 1 ) ); - regex2.setText( regexsList.get( 2 ) ); - regex3.setText( regexsList.get( 3 ) ); - regex4.setText( regexsList.get( 4 ) ); - regex5.setText( regexsList.get( 5 ) ); - regex6.setText( regexsList.get( 6 ) ); - regex7.setText( regexsList.get( 7 ) ); - regex8.setText( regexsList.get( 8 ) ); - regex9.setText( regexsList.get( 9 ) ); - -// System.out.println( "get datatype ===================================" ); - dataType0.setSelectedItem( dataTypesList.get( 0 ) ); - dataType1.setSelectedItem( dataTypesList.get( 1 ) ); - dataType2.setSelectedItem( dataTypesList.get( 2 ) ); - dataType3.setSelectedItem( dataTypesList.get( 3 ) ); - dataType4.setSelectedItem( dataTypesList.get( 4 ) ); - dataType5.setSelectedItem( dataTypesList.get( 5 ) ); - dataType6.setSelectedItem( dataTypesList.get( 6 ) ); - dataType7.setSelectedItem( dataTypesList.get( 7 ) ); - dataType8.setSelectedItem( dataTypesList.get( 8 ) ); - dataType9.setSelectedItem( dataTypesList.get( 9 ) ); + dateFormatCB.setModel( dateFormatModel ); + if ( this.parent != null ) + { + this.parent.comboDateFormatSetModel( dateFormatModel ); + } - /* - System.out.println( "get datatype===================================" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 0 ) + "=" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 1 ) + "=" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 2 ) + "=" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 3 ) + "=" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 4 ) + "=" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 5 ) + "=" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 6 ) + "=" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 7 ) + "=" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 8 ) + "=" ); - System.out.println( "get datatype " + i + " =" + dataTypesList.get( 9 ) + "=" ); - */ - - if ( getUseRegexFlag() ) - { - isNullable0.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - isNullable1.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - isNullable2.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - isNullable3.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - isNullable4.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - isNullable5.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - isNullable6.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - isNullable7.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - isNullable8.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - isNullable9.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyRegexFlag ) ); - } - else - { - isNullable0.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); - isNullable1.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); - isNullable2.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); - isNullable3.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); - isNullable4.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); - isNullable5.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); - isNullable6.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); - isNullable7.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); - isNullable8.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); - isNullable9.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); + TransactionReader customReader = ReaderHM.get( readerName.getText() ); + String [] tmpArray = new String[0]; + customReader.setSupportedDateFormats( dateFormatList.toArray( tmpArray ) ); + */ + + CustomReader customReader = (CustomReader) ReaderHM.get( readerName.getText() ); + setDateFormatString( customReaderData.getDateFormatString() ); + + customReader.createSupportedDateFormats( getDateFormatString() ); + this.parent.createSupportedDateFormats( getDateFormatString() ); + + System.err.println( "getNumberOfCustomReaderFieldsUsed() =" + getNumberOfCustomReaderFieldsUsed() ); } - - isNullable0.setSelectedItem( emptyFlagsList.get( 0 ) ); - isNullable1.setSelectedItem( emptyFlagsList.get( 1 ) ); - isNullable2.setSelectedItem( emptyFlagsList.get( 2 ) ); - isNullable3.setSelectedItem( emptyFlagsList.get( 3 ) ); - isNullable4.setSelectedItem( emptyFlagsList.get( 4 ) ); - isNullable5.setSelectedItem( emptyFlagsList.get( 5 ) ); - isNullable6.setSelectedItem( emptyFlagsList.get( 6 ) ); - isNullable7.setSelectedItem( emptyFlagsList.get( 7 ) ); - isNullable8.setSelectedItem( emptyFlagsList.get( 8 ) ); - isNullable9.setSelectedItem( emptyFlagsList.get( 9 ) ); - - /* - DefaultComboBoxModel dateFormatModel = new DefaultComboBoxModel(); - for ( String format : dateFormatList ) + catch( Exception exc ) { - System.out.println( "add date format =" + format + "=" ); - dateFormatModel.addElement( format ); + exc.printStackTrace(); + return false; } - - dateFormatCB.setModel( dateFormatModel ); - if ( this.parent != null ) - { - this.parent.comboDateFormatSetModel( dateFormatModel ); - } - - TransactionReader customReader = ReaderHM.get( readerName.getText() ); - String [] tmpArray = new String[0]; - customReader.setSupportedDateFormats( dateFormatList.toArray( tmpArray ) ); - */ - - CustomReader customReader = (CustomReader) ReaderHM.get( readerName.getText() ); - setDateFormatString( customReaderData.getDateFormatString() ); - - customReader.createSupportedDateFormats( getDateFormatString() ); - this.parent.createSupportedDateFormats( getDateFormatString() ); - - System.err.println( "getNumberOfCustomReaderFieldsUsed() =" + getNumberOfCustomReaderFieldsUsed() ); return true; } @@ -1925,12 +1958,12 @@ private void useRegexFlagActionPerformed(java.awt.event.ActionEvent evt) {//GEN- // regex4.setText( "([^,]*([,]|\\Z)).*" ); // regex5.setText( "([^,]*([,]|\\Z)).*" ); - regex0.setText( "\"?(?.*?)\"?(?:[,]|\\Z)(?.*)" ); + regex0.setText( "\"?(?.*?)\"?(?:[,]|\\Z)(?(.*|\\Z))" ); regex1.setText( "(?:CHECK[ ](?\\d*)|(.{0,0}))(?.*)" ); - regex2.setText( "\"?(?.*?)\"?(?:[,]|\\Z)(?.*)" ); - regex3.setText( "\"?(?.*?)\"?(?:[,]|\\Z)(?.*)" ); - regex4.setText( "\"?(?.*?)\"?(?:[,]|\\Z)(?.*)" ); - regex5.setText( "\"?(?.*?)\"?(?:[,]|\\Z)(?.*)" ); + regex2.setText( "\"?(?.*?)\"?(?:[,]|\\Z)(?(.*|\\Z))" ); + regex3.setText( "\"(?.*?)\"(?:[,]|\\Z)(?(.*|\\Z))" ); + regex4.setText( "\"?(?.*?)\"?(?:[,]|\\Z)(?(.*|\\Z))" ); + regex5.setText( "\"?(?.*?)\"?(?:[,]|\\Z)" ); } regex0.setVisible( true ); regex1.setVisible( true ); @@ -1985,6 +2018,31 @@ private void useRegexFlagActionPerformed(java.awt.event.ActionEvent evt) {//GEN- isNullable8.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); isNullable9.setModel(new javax.swing.DefaultComboBoxModel( allowEmptyFlag ) ); } + + int i = 0; + System.err.println( "get emptyFlagsList ===================================" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 0 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 1 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 2 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 3 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 4 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 5 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 6 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 7 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 8 ) + "=" ); + System.err.println( "get emptyFlagsList " + (i++) + " =" + emptyFlagsList.get( 9 ) + "=" ); + + + isNullable0.setSelectedItem( emptyFlagsList.get( 0 ) ); + isNullable1.setSelectedItem( emptyFlagsList.get( 1 ) ); + isNullable2.setSelectedItem( emptyFlagsList.get( 2 ) ); + isNullable3.setSelectedItem( emptyFlagsList.get( 3 ) ); + isNullable4.setSelectedItem( emptyFlagsList.get( 4 ) ); + isNullable5.setSelectedItem( emptyFlagsList.get( 5 ) ); + isNullable6.setSelectedItem( emptyFlagsList.get( 6 ) ); + isNullable7.setSelectedItem( emptyFlagsList.get( 7 ) ); + isNullable8.setSelectedItem( emptyFlagsList.get( 8 ) ); + isNullable9.setSelectedItem( emptyFlagsList.get( 9 ) ); }//GEN-LAST:event_useRegexFlagActionPerformed private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing diff --git a/src/com/moneydance/modules/features/mdcsvimporter/ImportDialog.java b/src/com/moneydance/modules/features/mdcsvimporter/ImportDialog.java index fba36e4..0366894 100644 --- a/src/com/moneydance/modules/features/mdcsvimporter/ImportDialog.java +++ b/src/com/moneydance/modules/features/mdcsvimporter/ImportDialog.java @@ -378,13 +378,13 @@ private void fillAccountCombo_( Account parentAccount ) { Account account = parentAccount.getSubAccount( i ); if ( account.isRegisterAccount() ) - { + { comboAccount.addItem( account ); - } - else - { - fillAccountCombo_( account ); - } + } +// else +// { + fillAccountCombo_( account ); // always look for subaccounts too +// } } } @@ -546,7 +546,8 @@ protected void deleteCsvFile() */ @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents - private void initComponents() { + private void initComponents() + { java.awt.GridBagConstraints gridBagConstraints; jLabel3 = new javax.swing.JLabel(); @@ -585,11 +586,14 @@ private void initComponents() { setMinimumSize(new java.awt.Dimension(750, 470)); setName("importDialog"); // NOI18N setPreferredSize(new java.awt.Dimension(800, 470)); - addWindowListener(new java.awt.event.WindowAdapter() { - public void windowClosing(java.awt.event.WindowEvent evt) { + addWindowListener(new java.awt.event.WindowAdapter() + { + public void windowClosing(java.awt.event.WindowEvent evt) + { formWindowClosing(evt); } - public void windowOpened(java.awt.event.WindowEvent evt) { + public void windowOpened(java.awt.event.WindowEvent evt) + { formWindowOpened(evt); } }); @@ -608,8 +612,10 @@ public void windowOpened(java.awt.event.WindowEvent evt) { btnBrowse.setMaximumSize(new java.awt.Dimension(50, 23)); btnBrowse.setMinimumSize(new java.awt.Dimension(50, 23)); btnBrowse.setPreferredSize(new java.awt.Dimension(50, 23)); - btnBrowse.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBrowse.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnBrowseActionPerformed(evt); } }); @@ -633,8 +639,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { getContentPane().add(checkDeleteFile, gridBagConstraints); btnClose.setText("Close"); - btnClose.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnClose.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnCloseActionPerformed(evt); } }); @@ -647,8 +655,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnProcess.setText("Process"); btnProcess.setEnabled(false); - btnProcess.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + btnProcess.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { btnProcessActionPerformed(evt); } }); @@ -711,13 +721,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { comboFileFormat.setMaximumSize(new java.awt.Dimension(180, 29)); comboFileFormat.setMinimumSize(new java.awt.Dimension(180, 29)); comboFileFormat.setPreferredSize(new java.awt.Dimension(180, 29)); - comboFileFormat.addItemListener(new java.awt.event.ItemListener() { - public void itemStateChanged(java.awt.event.ItemEvent evt) { + comboFileFormat.addItemListener(new java.awt.event.ItemListener() + { + public void itemStateChanged(java.awt.event.ItemEvent evt) + { fileFormatChanged(evt); } }); - comboFileFormat.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + comboFileFormat.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { comboFileFormatActionPerformed(evt); } }); @@ -760,8 +774,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { comboDateFormat.setMaximumSize(new java.awt.Dimension(180, 29)); comboDateFormat.setMinimumSize(new java.awt.Dimension(180, 29)); comboDateFormat.setPreferredSize(new java.awt.Dimension(180, 29)); - comboDateFormat.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + comboDateFormat.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { comboDateFormatActionPerformed(evt); } }); @@ -775,8 +791,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { getContentPane().add(comboDateFormat, gridBagConstraints); jButton1.setText("Maintain Custom File Readers"); - jButton1.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { jButton1ActionPerformed(evt); } }); @@ -809,8 +827,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { getContentPane().add(comboFileFormatLabel, gridBagConstraints); jButton2.setText("Suggestions"); - jButton2.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { jButton2ActionPerformed(evt); } }); @@ -840,8 +860,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { getContentPane().add(propertiesFile, gridBagConstraints); PreviewImportBtn.setText("Preview Import"); - PreviewImportBtn.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + PreviewImportBtn.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { PreviewImportBtnActionPerformed(evt); } }); @@ -851,8 +873,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { getContentPane().add(PreviewImportBtn, gridBagConstraints); jButton3.setText("Find Reader(s) that Work on Import File"); - jButton3.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { jButton3ActionPerformed(evt); } }); @@ -867,8 +891,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { textFilename.setModel(new javax.swing.DefaultComboBoxModel(new String[] { " " })); textFilename.setMinimumSize(new java.awt.Dimension(180, 29)); textFilename.setPreferredSize(new java.awt.Dimension(180, 29)); - textFilename.addItemListener(new java.awt.event.ItemListener() { - public void itemStateChanged(java.awt.event.ItemEvent evt) { + textFilename.addItemListener(new java.awt.event.ItemListener() + { + public void itemStateChanged(java.awt.event.ItemEvent evt) + { textFilenameItemStateChanged(evt); } }); @@ -882,8 +908,10 @@ public void itemStateChanged(java.awt.event.ItemEvent evt) { getContentPane().add(textFilename, gridBagConstraints); jButton4.setText("Find Import File(s) for this Reader"); - jButton4.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton4.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { jButton4ActionPerformed(evt); } }); @@ -895,8 +923,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { getContentPane().add(jButton4, gridBagConstraints); jButton5.setText("List All Readers"); - jButton5.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton5.addActionListener(new java.awt.event.ActionListener() + { + public void actionPerformed(java.awt.event.ActionEvent evt) + { jButton5ActionPerformed(evt); } }); diff --git a/src/com/moneydance/modules/features/mdcsvimporter/Main.java b/src/com/moneydance/modules/features/mdcsvimporter/Main.java index f3dda5e..55f1989 100644 --- a/src/com/moneydance/modules/features/mdcsvimporter/Main.java +++ b/src/com/moneydance/modules/features/mdcsvimporter/Main.java @@ -33,7 +33,7 @@ public class Main extends FeatureModule { - private static final int VERSION = 21; + private static final int VERSION = 22; protected static final String VERSION_STRING = " " + VERSION + " for MD2015"; private static final String NAME = "CSV Importer"; private static final String VENDOR = "Stan Towianski, Milutin Jovanović";