public void actionPerformed(ActionEvent ev) {

        if (ev.getSource() instanceof TextField) {
            saveTable();

            return;
        }

        String   s = ev.getActionCommand();
        MenuItem i = new MenuItem();

        if (s == null) {
            if (ev.getSource() instanceof MenuItem) {
                i = (MenuItem) ev.getSource();
                s = i.getLabel();
            }
        }

        if (s == null) {}

        if (s.equals("Start Transfer") || s.equals("ReStart Transfer")) {
            bStart.setLabel("ReStart Transfer");
            bStart.invalidate();

            CurrentTransfer = 0;
            CurrentAlter    = 0;

            transfer();
        } else if (s.equals("Continue Transfer")) {
            transfer();
        } else if (s.equals("Start Dump") || s.equals("Start Restore")) {
            CurrentTransfer = 0;
            CurrentAlter    = 0;

            transfer();
        } else if (s.equals("Quit")) {
            exit();
        } else if (s.indexOf("Select Schema") >= 0) {
            String[] selection = lTable.getSelectedItems();

            if ((selection == null) || (selection.length == 0)) {
                return;
            }

            if (iSelectionStep == Transfer.SELECT_SOURCE_SCHEMA) {
                sSourceSchemas = selection;
            } else {
                sDestSchema = selection[0];
            }

            if (iTransferMode == TRFM_DUMP) {
                iSelectionStep = Transfer.SELECT_SOURCE_TABLES;
            } else {
                iSelectionStep++;
            }

            ProcessNextStep();
        } else if (s.indexOf("Select Catalog") >= 0) {
            String selection = lTable.getSelectedItem();

            if ((selection == null) || (selection.equals(""))) {
                return;
            }

            if (iSelectionStep == Transfer.SELECT_SOURCE_CATALOG) {
                sSourceCatalog = selection;
                sSourceSchemas = null;
            } else {
                sDestCatalog = selection;
                sDestSchema  = null;

                try {
                    targetDb.setCatalog(sDestCatalog);
                } catch (Exception ex) {
                    trace("Catalog " + sDestCatalog
                          + " could not be selected in the target database");

                    sDestCatalog = null;
                }
            }

            iSelectionStep++;

            ProcessNextStep();
        } else if (s.equals("Insert 10 rows only")) {
            iMaxRows = 10;
        } else if (s.equals("Insert 1000 rows only")) {
            iMaxRows = 1000;
        } else if (s.equals("Insert all rows")) {
            iMaxRows = 0;
        } else if (s.equals("Load Settings...")) {
            FileDialog f = new FileDialog(fMain, "Load Settings",
                                          FileDialog.LOAD);

            f.show();

            String file = f.getDirectory() + f.getFile();

            if (file != null) {
                LoadPrefs(file);
                displayTable(tCurrent);
            }
        } else if (s.equals("Save Settings...")) {
            FileDialog f = new FileDialog(fMain, "Save Settings",
                                          FileDialog.SAVE);

            f.show();

            String file = f.getDirectory() + f.getFile();

            if (file != null) {
                SavePrefs(file);
            }
        } else if (s.equals("Exit")) {
            windowClosing(null);
        }
    }
public void actionPerformed ( ActionEvent ev ) { if ( ev . getSource ( ) instanceof TextField ) { saveTable ( ) ; return ; } String s = ev . getActionCommand ( ) ; MenuItem i = new MenuItem ( ) ; if ( s == null ) { if ( ev . getSource ( ) instanceof MenuItem ) { i = ( MenuItem ) ev . getSource ( ) ; s = i . getLabel ( ) ; } } if ( s == null ) { } if ( s . equals ( "Start Transfer" ) || s . equals ( "ReStart Transfer" ) ) { bStart . setLabel ( "ReStart Transfer" ) ; bStart . invalidate ( ) ; CurrentTransfer = 0 ; CurrentAlter = 0 ; transfer ( ) ; } else if ( s . equals ( "Continue Transfer" ) ) { transfer ( ) ; } else if ( s . equals ( "Start Dump" ) || s . equals ( "Start Restore" ) ) { CurrentTransfer = 0 ; CurrentAlter = 0 ; transfer ( ) ; } else if ( s . equals ( "Quit" ) ) { exit ( ) ; } else if ( s . indexOf ( "Select Schema" ) >= 0 ) { String [ ] selection = lTable . getSelectedItems ( ) ; if ( ( selection == null ) || ( selection . length == 0 ) ) { return ; } if ( iSelectionStep == Transfer . SELECT_SOURCE_SCHEMA ) { sSourceSchemas = selection ; } else { sDestSchema = selection [ 0 ] ; } if ( iTransferMode == TRFM_DUMP ) { iSelectionStep = Transfer . SELECT_SOURCE_TABLES ; } else { iSelectionStep ++ ; } ProcessNextStep ( ) ; } else if ( s . indexOf ( "Select Catalog" ) >= 0 ) { String selection = lTable . getSelectedItem ( ) ; if ( ( selection == null ) || ( selection . equals ( "" ) ) ) { return ; } if ( iSelectionStep == Transfer . SELECT_SOURCE_CATALOG ) { sSourceCatalog = selection ; sSourceSchemas = null ; } else { sDestCatalog = selection ; sDestSchema = null ; try { targetDb . setCatalog ( sDestCatalog ) ; } catch ( Exception ex ) { trace ( "Catalog " + sDestCatalog + " could not be selected in the target database" ) ; sDestCatalog = null ; } } iSelectionStep ++ ; ProcessNextStep ( ) ; } else if ( s . equals ( "Insert 10 rows only" ) ) { iMaxRows = 10 ; } else if ( s . equals ( "Insert 1000 rows only" ) ) { iMaxRows = 1000 ; } else if ( s . equals ( "Insert all rows" ) ) { iMaxRows = 0 ; } else if ( s . equals ( "Load Settings..." ) ) { FileDialog f = new FileDialog ( fMain , "Load Settings" , FileDialog . LOAD ) ; f . show ( ) ; String file = f . getDirectory ( ) + f . getFile ( ) ; if ( file != null ) { LoadPrefs ( file ) ; displayTable ( tCurrent ) ; } } else if ( s . equals ( "Save Settings..." ) ) { FileDialog f = new FileDialog ( fMain , "Save Settings" , FileDialog . SAVE ) ; f . show ( ) ; String file = f . getDirectory ( ) + f . getFile ( ) ; if ( file != null ) { SavePrefs ( file ) ; } } else if ( s . equals ( "Exit" ) ) { windowClosing ( null ) ; } }
Method declaration


@param ev